Lines Matching refs:iph2
543 struct ph2handle *iph2; local
546 LIST_FOREACH(iph2, &ph2tree, chain) {
547 if (iph2->proposal == NULL && iph2->approval == NULL)
549 if (iph2->approval != NULL) {
550 for (pr = iph2->approval->head; pr != NULL;
555 return iph2;
557 } else if (iph2->proposal != NULL) {
558 for (pr = iph2->proposal->head; pr != NULL;
563 return iph2;
577 struct ph2handle *iph2 = NULL; in newph2() local
580 iph2 = racoon_calloc(1, sizeof(*iph2)); in newph2()
581 if (iph2 == NULL) in newph2()
584 iph2->status = PHASE1ST_SPAWN; in newph2()
586 return iph2; in newph2()
595 initph2(iph2) in initph2() argument
596 struct ph2handle *iph2; in initph2()
598 sched_scrub_param(iph2);
599 iph2->sce = NULL;
600 iph2->scr = NULL;
602 VPTRINIT(iph2->sendbuf);
603 VPTRINIT(iph2->msg1);
606 if (iph2->proposal) {
608 for (pr = iph2->proposal->head; pr != NULL; pr = pr->next)
613 if (iph2->approval) {
614 flushsaprop(iph2->approval);
615 iph2->approval = NULL;
619 if (iph2->spidx_gen) {
620 delsp_bothdir((struct policyindex *)iph2->spidx_gen);
621 racoon_free(iph2->spidx_gen);
622 iph2->spidx_gen = NULL;
625 if (iph2->pfsgrp) {
626 oakley_dhgrp_free(iph2->pfsgrp);
627 iph2->pfsgrp = NULL;
630 VPTRINIT(iph2->dhpriv);
631 VPTRINIT(iph2->dhpub);
632 VPTRINIT(iph2->dhpub_p);
633 VPTRINIT(iph2->dhgxy);
634 VPTRINIT(iph2->id);
635 VPTRINIT(iph2->id_p);
636 VPTRINIT(iph2->nonce);
637 VPTRINIT(iph2->nonce_p);
638 VPTRINIT(iph2->sa);
639 VPTRINIT(iph2->sa_ret);
641 if (iph2->ivm) {
642 oakley_delivm(iph2->ivm);
643 iph2->ivm = NULL;
651 delph2(iph2) in delph2() argument
652 struct ph2handle *iph2; in delph2()
654 initph2(iph2);
656 if (iph2->src) {
657 racoon_free(iph2->src);
658 iph2->src = NULL;
660 if (iph2->dst) {
661 racoon_free(iph2->dst);
662 iph2->dst = NULL;
664 if (iph2->src_id) {
665 racoon_free(iph2->src_id);
666 iph2->src_id = NULL;
668 if (iph2->dst_id) {
669 racoon_free(iph2->dst_id);
670 iph2->dst_id = NULL;
673 if (iph2->proposal) {
674 flushsaprop(iph2->proposal);
675 iph2->proposal = NULL;
678 racoon_free(iph2);
685 insph2(iph2) in insph2() argument
686 struct ph2handle *iph2; in insph2()
688 LIST_INSERT_HEAD(&ph2tree, iph2, chain);
694 remph2(iph2) in remph2() argument
695 struct ph2handle *iph2; in remph2()
697 LIST_REMOVE(iph2, chain);
744 struct ph2handle *iph2, *next; local
747 for (iph2 = LIST_FIRST(&ph2tree); iph2 != NULL; iph2 = next) {
748 next = LIST_NEXT(iph2, chain);
749 if (iph2->proposal == NULL && iph2->approval == NULL)
751 if (iph2->approval != NULL) {
752 for (pr = iph2->approval->head; pr != NULL;
757 } else if (iph2->proposal != NULL) {
758 for (pr = iph2->proposal->head; pr != NULL;
766 unbindph12(iph2);
767 remph2(iph2);
768 delph2(iph2);
774 bindph12(iph1, iph2) in bindph12() argument
776 struct ph2handle *iph2;
778 iph2->ph1 = iph1;
779 LIST_INSERT_HEAD(&iph1->ph2tree, iph2, ph1bind);
783 unbindph12(iph2) in unbindph12() argument
784 struct ph2handle *iph2; in unbindph12()
786 if (iph2->ph1 != NULL) {
787 iph2->ph1 = NULL;
788 LIST_REMOVE(iph2, ph1bind);
1076 static int revalidate_ph2(struct ph2handle *iph2){ in revalidate_ph2() argument
1086 if (iph2->sainfo != NULL) { in revalidate_ph2()
1087 iph2->sainfo = getsainfo(iph2->sainfo->idsrc, in revalidate_ph2()
1088 iph2->sainfo->iddst, iph2->sainfo->id_i, in revalidate_ph2()
1089 iph2->sainfo->remoteid); in revalidate_ph2()
1091 approval = iph2->approval; in revalidate_ph2()
1092 sainfo = iph2->sainfo; in revalidate_ph2()
1128 if (iph2->ph1 != NULL) in revalidate_ph2()
1129 iph1=iph2->ph1; in revalidate_ph2()
1131 iph1=getph1byaddr(iph2->src, iph2->dst, 0); in revalidate_ph2()
1184 sainfo->pfs_group != iph2->approval->pfs_group) { in revalidate_ph2()
1267 remove_ph2(struct ph2handle *iph2) in remove_ph2() argument
1271 if(iph2 == NULL) in remove_ph2()
1277 if (iph2->status == PHASE2ST_ESTABLISHED) in remove_ph2()
1278 isakmp_info_send_d2(iph2); in remove_ph2()
1280 if(iph2->approval != NULL && iph2->approval->head != NULL){ in remove_ph2()
1281 spis[0]=iph2->approval->head->spi; in remove_ph2()
1282 spis[1]=iph2->approval->head->spi_p; in remove_ph2()
1289 purge_ipsec_spi(iph2->dst, iph2->approval->head->proto_id, in remove_ph2()
1292 unbindph12(iph2); in remove_ph2()
1293 remph2(iph2); in remove_ph2()
1294 delph2(iph2); in remove_ph2()
1299 struct ph2handle *iph2, *iph2_next; in remove_ph1() local
1308 for (iph2 = LIST_FIRST(&iph1->ph2tree); iph2; iph2 = iph2_next) { in remove_ph1()
1309 iph2_next = LIST_NEXT(iph2, chain); in remove_ph1()
1310 remove_ph2(iph2); in remove_ph1()