Home | History | Annotate | Download | only in racoon

Lines Matching refs:iph1

114 	int (* enum_func)(struct ph1handle *iph1, void *arg);
239 resolveph1rmconf(iph1)
240 struct ph1handle *iph1;
245 if (iph1->side == INITIATOR)
248 rmconf = getrmconf_by_ph1(iph1);
254 if (iph1->rmconf != NULL) {
255 if (rmconf != iph1->rmconf) {
261 iph1->rmconf = rmconf;
290 * the iph1 is new, migrate all phase2s that belong to a dying or dead ph1
292 void migrate_dying_ph12(iph1)
293 struct ph1handle *iph1;
298 if (p == iph1)
303 if (cmpsaddr(iph1->local, p->local) == CMPSADDR_MATCH
304 && cmpsaddr(iph1->remote, p->remote) == CMPSADDR_MATCH)
305 migrate_ph12(p, iph1);
316 struct ph1handle *iph1;
322 LIST_FOREACH(iph1, &ph1tree, chain)
333 LIST_FOREACH(iph1, &ph1tree, chain) {
334 memcpy(&pd->index, &iph1->index, sizeof(iph1->index));
335 pd->status = iph1->status;
336 pd->side = iph1->side;
337 memcpy(&pd->remote, iph1->remote, sysdep_sa_len(iph1->remote));
338 memcpy(&pd->local, iph1->local, sysdep_sa_len(iph1->local));
339 pd->version = iph1->version;
340 pd->etype = iph1->etype;
341 pd->created = iph1->created;
342 pd->ph2cnt = iph1->ph2cnt;
355 struct ph1handle *iph1;
357 /* create new iph1 */
358 iph1 = racoon_calloc(1, sizeof(*iph1));
359 if (iph1 == NULL)
362 iph1->status = PHASE1ST_SPAWN;
365 iph1->dpd_support = 0;
366 iph1->dpd_seq = 0;
367 iph1->dpd_fails = 0;
369 evt_list_init(&iph1->evt_listeners);
371 return iph1;
378 delph1(iph1)
379 struct ph1handle *iph1;
381 if (iph1 == NULL)
385 script_hook(iph1, SCRIPT_PHASE1_DOWN);
386 evt_list_cleanup(&iph1->evt_listeners);
389 if (iph1->natt_flags & NAT_KA_QUEUED)
390 natt_keepalive_remove (iph1->local, iph1->remote);
392 if (iph1->natt_options) {
393 racoon_free(iph1->natt_options);
394 iph1->natt_options = NULL;
399 if (iph1->mode_cfg)
400 isakmp_cfg_rmstate(iph1);
404 sched_cancel(&iph1->dpd_r_u);
406 sched_cancel(&iph1->sce);
407 sched_cancel(&iph1->scr);
409 if (iph1->remote) {
410 racoon_free(iph1->remote);
411 iph1->remote = NULL;
413 if (iph1->local) {
414 racoon_free(iph1->local);
415 iph1->local = NULL;
417 if (iph1->approval) {
418 delisakmpsa(iph1->approval);
419 iph1->approval = NULL;
422 VPTRINIT(iph1->authstr);
423 VPTRINIT(iph1->sendbuf);
424 VPTRINIT(iph1->dhpriv);
425 VPTRINIT(iph1->dhpub);
426 VPTRINIT(iph1->dhpub_p);
427 VPTRINIT(iph1->dhgxy);
428 VPTRINIT(iph1->nonce);
429 VPTRINIT(iph1->nonce_p);
430 VPTRINIT(iph1->skeyid);
431 VPTRINIT(iph1->skeyid_d);
432 VPTRINIT(iph1->skeyid_a);
433 VPTRINIT(iph1->skeyid_e);
434 VPTRINIT(iph1->key);
435 VPTRINIT(iph1->hash);
436 VPTRINIT(iph1->sig);
437 VPTRINIT(iph1->sig_p);
438 VPTRINIT(iph1->cert);
439 VPTRINIT(iph1->cert_p);
440 VPTRINIT(iph1->crl_p);
441 VPTRINIT(iph1->cr_p);
442 VPTRINIT(iph1->id);
443 VPTRINIT(iph1->id_p);
445 if(iph1->approval != NULL)
446 delisakmpsa(iph1->approval);
448 if (iph1->ivm) {
449 oakley_delivm(iph1->ivm);
450 iph1->ivm = NULL;
453 VPTRINIT(iph1->sa);
454 VPTRINIT(iph1->sa_ret);
457 VPTRINIT(iph1->gi_i);
458 VPTRINIT(iph1->gi_r);
460 gssapi_free_state(iph1);
463 racoon_free(iph1);
470 insph1(iph1)
471 struct ph1handle *iph1;
474 if (iph1->remote == NULL) {
479 LIST_INSERT_HEAD(&ph1tree, iph1, chain);
485 remph1(iph1)
486 struct ph1handle *iph1;
488 LIST_REMOVE(iph1, chain);
518 ph1_rekey_enabled(iph1)
519 struct ph1handle *iph1;
521 if (iph1->rmconf == NULL)
523 if (iph1->rmconf->rekey == REKEY_FORCE)
526 if (iph1->rmconf->rekey == REKEY_ON && iph1->dpd_support &&
527 iph1->rmconf->dpd_interval)
586 getph2bymsgid(iph1, msgid)
587 struct ph1handle *iph1;
592 LIST_FOREACH(p, &iph1->ph2tree, ph1bind) {
593 if (p->msgid == msgid && p->ph1 == iph1)
917 bindph12(iph1, iph2)
918 struct ph1handle *iph1;
923 iph2->ph1 = iph1;
924 iph1->ph2cnt++;
925 LIST_INSERT_HEAD(&iph1->ph2tree, iph2, ph1bind);
1243 struct ph1handle *iph1;
1291 iph1=iph2->ph1;
1293 iph1=getph1byaddr(iph2->src, iph2->dst, 0);
1295 if(iph1 != NULL && iph1->rmconf != NULL) {
1296 check_level = iph1->rmconf->pcheck_level;
1298 if(iph1 != NULL)
1459 static void remove_ph1(struct ph1handle *iph1){
1462 if(iph1 == NULL)
1468 if (iph1->status == PHASE1ST_ESTABLISHED ||
1469 iph1->status == PHASE1ST_DYING) {
1470 for (iph2 = LIST_FIRST(&iph1->ph2tree); iph2; iph2 = iph2_next) {
1474 isakmp_info_send_d1(iph1);
1476 iph1->status = PHASE1ST_EXPIRED;
1478 * condition where we'll try to access iph1->rmconf after it has
1481 isakmp_ph1delete(iph1);