Lines Matching refs:iph2
616 isakmp_info_send_d2(iph2) in isakmp_info_send_d2() argument
617 struct ph2handle *iph2; in isakmp_info_send_d2()
627 if (iph2->status != PHASE2ST_ESTABLISHED)
634 iph1 = getph1byaddr(iph2->src, iph2->dst, 0);
642 for (pr = iph2->approval->head; pr != NULL; pr = pr->next) {
820 isakmp_info_send_n2(iph2, type, data) in isakmp_info_send_n2() argument
821 struct ph2handle *iph2; in isakmp_info_send_n2()
825 struct ph1handle *iph1 = iph2->ph1;
832 if (!iph2->approval)
835 pr = iph2->approval->head;
859 iph2->flags |= ISAKMP_FLAG_E; /* XXX Should we do FLAG_A ? */
860 error = isakmp_info_send_common(iph1, payload, ISAKMP_NPTYPE_N, iph2->flags);
877 struct ph2handle *iph2 = NULL; local
886 iph2 = newph2();
887 if (iph2 == NULL)
890 iph2->dst = dupsaddr(iph1->remote);
891 if (iph2->dst == NULL) {
892 delph2(iph2);
895 iph2->src = dupsaddr(iph1->local);
896 if (iph2->src == NULL) {
897 delph2(iph2);
900 iph2->side = INITIATOR;
901 iph2->status = PHASE2ST_START;
902 iph2->msgid = isakmp_newmsgid2(iph1);
906 iph2->ivm = oakley_newiv2(iph1, iph2->msgid);
907 if (iph2->ivm == NULL) {
908 delph2(iph2);
913 hash = oakley_compute_hash1(iph1, iph2->msgid, payload);
915 delph2(iph2);
930 iph2->flags = (hash == NULL ? 0 : ISAKMP_FLAG_E);
932 iph2->flags = (hash == NULL ? 0 : ISAKMP_FLAG_A);
934 insph2(iph2);
935 bindph12(iph1, iph2);
940 iph2->sendbuf = vmalloc(tlen);
941 if (iph2->sendbuf == NULL) {
948 isakmp = (struct isakmp *)iph2->sendbuf->v;
954 isakmp->flags = iph2->flags;
955 memcpy(&isakmp->msgid, &iph2->msgid, sizeof(isakmp->msgid));
974 isakmp_printpacket(iph2->sendbuf, iph1->local, iph1->remote, 1);
981 tmp = oakley_do_encrypt(iph2->ph1, iph2->sendbuf, iph2->ivm->ive,
982 iph2->ivm->iv);
983 VPTRINIT(iph2->sendbuf);
986 iph2->sendbuf = tmp;
990 if (isakmp_send(iph2->ph1, iph2->sendbuf) < 0) {
991 VPTRINIT(iph2->sendbuf);
1005 VPTRINIT(iph2->sendbuf);
1014 remph2(iph2);
1015 delph2(iph2);
1085 struct ph2handle *iph2; local
1174 iph2 = getph2bysaidx(src, dst, proto, spi[i]);
1175 if(iph2 != NULL){
1176 delete_spd(iph2, created);
1177 remph2(iph2);
1178 delph2(iph2);
1216 struct ph2handle *iph2; local
1364 iph2 = getph2bysaidx(src, dst, proto_id, sa->sadb_sa_spi);
1365 if (iph2 && iph2 != protectedph2) {
1366 delete_spd(iph2, 0);
1367 remph2(iph2);
1368 delph2(iph2);