Home | History | Annotate | Download | only in racoon

Lines Matching defs:iph2

543 	struct ph2handle *iph2;
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;
579 /* create new iph2 */
580 iph2 = racoon_calloc(1, sizeof(*iph2));
581 if (iph2 == NULL)
584 iph2->status = PHASE1ST_SPAWN;
586 return iph2;
595 initph2(iph2)
596 struct ph2handle *iph2;
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)
652 struct ph2handle *iph2;
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)
686 struct ph2handle *iph2;
688 LIST_INSERT_HEAD(&ph2tree, iph2, chain);
694 remph2(iph2)
695 struct ph2handle *iph2;
697 LIST_REMOVE(iph2, chain);
744 struct ph2handle *iph2, *next;
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)
776 struct ph2handle *iph2;
778 iph2->ph1 = iph1;
779 LIST_INSERT_HEAD(&iph1->ph2tree, iph2, ph1bind);
783 unbindph12(iph2)
784 struct ph2handle *iph2;
786 if (iph2->ph1 != NULL) {
787 iph2->ph1 = NULL;
788 LIST_REMOVE(iph2, ph1bind);
819 /* create new iph2 */
1076 static int revalidate_ph2(struct ph2handle *iph2){
1086 if (iph2->sainfo != NULL) {
1087 iph2->sainfo = getsainfo(iph2->sainfo->idsrc,
1088 iph2->sainfo->iddst, iph2->sainfo->id_i,
1089 iph2->sainfo->remoteid);
1091 approval = iph2->approval;
1092 sainfo = iph2->sainfo;
1114 * We have to keep iph2->proposal valid at least for initiator,
1128 if (iph2->ph1 != NULL)
1129 iph1=iph2->ph1;
1131 iph1=getph1byaddr(iph2->src, iph2->dst, 0);
1184 sainfo->pfs_group != iph2->approval->pfs_group) {
1267 remove_ph2(struct ph2handle *iph2)
1271 if(iph2 == NULL)
1277 if (iph2->status == PHASE2ST_ESTABLISHED)
1278 isakmp_info_send_d2(iph2);
1280 if(iph2->approval != NULL && iph2->approval->head != NULL){
1281 spis[0]=iph2->approval->head->spi;
1282 spis[1]=iph2->approval->head->spi_p;
1289 purge_ipsec_spi(iph2->dst, iph2->approval->head->proto_id,
1292 unbindph12(iph2);
1293 remph2(iph2);
1294 delph2(iph2);
1299 struct ph2handle *iph2, *iph2_next;
1308 for (iph2 = LIST_FIRST(&iph1->ph2tree); iph2; iph2 = iph2_next) {
1309 iph2_next = LIST_NEXT(iph2, chain);
1310 remove_ph2(iph2);