Lines Matching defs:iph1
221 struct ph1handle *iph1;
227 LIST_FOREACH(iph1, &ph1tree, chain)
238 LIST_FOREACH(iph1, &ph1tree, chain) {
239 memcpy(&pd->index, &iph1->index, sizeof(iph1->index));
240 pd->status = iph1->status;
241 pd->side = iph1->side;
242 memcpy(&pd->remote, iph1->remote, sysdep_sa_len(iph1->remote));
243 memcpy(&pd->local, iph1->local, sysdep_sa_len(iph1->local));
244 pd->version = iph1->version;
245 pd->etype = iph1->etype;
246 pd->created = iph1->created;
247 pd->ph2cnt = iph1->ph2cnt;
260 struct ph1handle *iph1;
262 /* create new iph1 */
263 iph1 = racoon_calloc(1, sizeof(*iph1));
264 if (iph1 == NULL)
267 iph1->status = PHASE1ST_SPAWN;
270 iph1->dpd_support = 0;
271 iph1->dpd_lastack = 0;
272 iph1->dpd_seq = 0;
273 iph1->dpd_fails = 0;
274 iph1->dpd_r_u = NULL;
277 return iph1;
284 delph1(iph1)
285 struct ph1handle *iph1;
287 if (iph1 == NULL)
291 script_hook(iph1, SCRIPT_PHASE1_DOWN);
293 EVT_PUSH(iph1->local, iph1->remote, EVTT_PHASE1_DOWN, NULL);
296 if (iph1->natt_flags & NAT_KA_QUEUED)
297 natt_keepalive_remove (iph1->local, iph1->remote);
299 if (iph1->natt_options) {
300 racoon_free(iph1->natt_options);
301 iph1->natt_options = NULL;
306 if (iph1->mode_cfg)
307 isakmp_cfg_rmstate(iph1);
311 SCHED_KILL(iph1->dpd_r_u);
314 if (iph1->remote) {
315 racoon_free(iph1->remote);
316 iph1->remote = NULL;
318 if (iph1->local) {
319 racoon_free(iph1->local);
320 iph1->local = NULL;
322 if (iph1->approval) {
323 delisakmpsa(iph1->approval);
324 iph1->approval = NULL;
327 VPTRINIT(iph1->authstr);
329 sched_scrub_param(iph1);
330 iph1->sce = NULL;
331 iph1->scr = NULL;
333 VPTRINIT(iph1->sendbuf);
335 VPTRINIT(iph1->dhpriv);
336 VPTRINIT(iph1->dhpub);
337 VPTRINIT(iph1->dhpub_p);
338 VPTRINIT(iph1->dhgxy);
339 VPTRINIT(iph1->nonce);
340 VPTRINIT(iph1->nonce_p);
341 VPTRINIT(iph1->skeyid);
342 VPTRINIT(iph1->skeyid_d);
343 VPTRINIT(iph1->skeyid_a);
344 VPTRINIT(iph1->skeyid_e);
345 VPTRINIT(iph1->key);
346 VPTRINIT(iph1->hash);
347 VPTRINIT(iph1->sig);
348 VPTRINIT(iph1->sig_p);
349 oakley_delcert(iph1->cert);
350 iph1->cert = NULL;
351 oakley_delcert(iph1->cert_p);
352 iph1->cert_p = NULL;
353 oakley_delcert(iph1->crl_p);
354 iph1->crl_p = NULL;
355 oakley_delcert(iph1->cr_p);
356 iph1->cr_p = NULL;
357 VPTRINIT(iph1->id);
358 VPTRINIT(iph1->id_p);
360 if(iph1->approval != NULL)
361 delisakmpsa(iph1->approval);
363 if (iph1->ivm) {
364 oakley_delivm(iph1->ivm);
365 iph1->ivm = NULL;
368 VPTRINIT(iph1->sa);
369 VPTRINIT(iph1->sa_ret);
372 VPTRINIT(iph1->gi_i);
373 VPTRINIT(iph1->gi_r);
375 gssapi_free_state(iph1);
378 racoon_free(iph1);
385 insph1(iph1)
386 struct ph1handle *iph1;
389 if (iph1->remote == NULL) {
394 LIST_INSERT_HEAD(&ph1tree, iph1, chain);
400 remph1(iph1)
401 struct ph1handle *iph1;
403 LIST_REMOVE(iph1, chain);
475 getph2bymsgid(iph1, msgid)
476 struct ph1handle *iph1;
482 if (p->msgid == msgid && p->ph1 == iph1)
774 bindph12(iph1, iph2)
775 struct ph1handle *iph1;
778 iph2->ph1 = iph1;
779 LIST_INSERT_HEAD(&iph1->ph2tree, iph2, ph1bind);
1081 struct ph1handle *iph1;
1129 iph1=iph2->ph1;
1131 iph1=getph1byaddr(iph2->src, iph2->dst, 0);
1133 if(iph1 != NULL && iph1->rmconf != NULL) {
1134 check_level = iph1->rmconf->pcheck_level;
1136 if(iph1 != NULL)
1298 static void remove_ph1(struct ph1handle *iph1){
1301 if(iph1 == NULL)
1307 if (iph1->status == PHASE1ST_ESTABLISHED){
1308 for (iph2 = LIST_FIRST(&iph1->ph2tree); iph2; iph2 = iph2_next) {
1312 isakmp_info_send_d1(iph1);
1314 iph1->status = PHASE1ST_EXPIRED;
1315 iph1->sce = sched_new(1, isakmp_ph1delete_stub, iph1);
1356 static int revalidate_ph1(struct ph1handle *iph1){
1360 if(iph1 == NULL ||
1361 iph1->approval == NULL ||
1362 iph1->rmconf == NULL)
1365 approval=iph1->approval;
1367 for (e = iph1->rmconf->etypes; e != NULL; e = e->next){
1368 if (iph1->etype == e->type)
1378 if (iph1->etype == ISAKMP_ETYPE_AGG &&
1379 approval->dh_group != iph1->rmconf->dh_group){
1385 for (p=iph1->rmconf->proposal; p != NULL; p=p->next){
1401 switch (iph1->rmconf->pcheck_level) {
1471 if (iph1->etype != ISAKMP_ETYPE_AGG &&