Lines Matching refs:iph2

458 	struct ph2handle *iph2;
622 isakmp_info_send_d2(iph2)
623 struct ph2handle *iph2;
633 if (iph2->status != PHASE2ST_ESTABLISHED)
640 iph1 = getph1byaddr(iph2->src, iph2->dst, 0);
648 for (pr = iph2->approval->head; pr != NULL; pr = pr->next) {
835 isakmp_info_send_n2(iph2, type, data)
836 struct ph2handle *iph2;
840 struct ph1handle *iph1 = iph2->ph1;
847 if (!iph2->approval)
850 pr = iph2->approval->head;
874 iph2->flags |= ISAKMP_FLAG_E; /* XXX Should we do FLAG_A ? */
875 error = isakmp_info_send_common(iph1, payload, ISAKMP_NPTYPE_N, iph2->flags);
892 struct ph2handle *iph2 = NULL;
901 iph2 = newph2();
902 if (iph2 == NULL)
905 iph2->dst = dupsaddr(iph1->remote);
906 if (iph2->dst == NULL) {
907 delph2(iph2);
910 iph2->src = dupsaddr(iph1->local);
911 if (iph2->src == NULL) {
912 delph2(iph2);
916 if (set_port(iph2->dst, 0) == NULL ||
917 set_port(iph2->src, 0) == NULL) {
920 delph2(iph2);
924 iph2->ph1 = iph1;
925 iph2->side = INITIATOR;
926 iph2->status = PHASE2ST_START;
927 iph2->msgid = isakmp_newmsgid2(iph1);
931 iph2->ivm = oakley_newiv2(iph1, iph2->msgid);
932 if (iph2->ivm == NULL) {
933 delph2(iph2);
938 hash = oakley_compute_hash1(iph2->ph1, iph2->msgid, payload);
940 delph2(iph2);
955 iph2->flags = (hash == NULL ? 0 : ISAKMP_FLAG_E);
957 iph2->flags = (hash == NULL ? 0 : ISAKMP_FLAG_A);
959 insph2(iph2);
960 bindph12(iph1, iph2);
965 iph2->sendbuf = vmalloc(tlen);
966 if (iph2->sendbuf == NULL) {
973 isakmp = (struct isakmp *)iph2->sendbuf->v;
979 isakmp->flags = iph2->flags;
980 memcpy(&isakmp->msgid, &iph2->msgid, sizeof(isakmp->msgid));
999 isakmp_printpacket(iph2->sendbuf, iph1->local, iph1->remote, 1);
1006 tmp = oakley_do_encrypt(iph2->ph1, iph2->sendbuf, iph2->ivm->ive,
1007 iph2->ivm->iv);
1008 VPTRINIT(iph2->sendbuf);
1011 iph2->sendbuf = tmp;
1015 if (isakmp_send(iph2->ph1, iph2->sendbuf) < 0) {
1016 VPTRINIT(iph2->sendbuf);
1030 VPTRINIT(iph2->sendbuf);
1039 unbindph12(iph2);
1040 remph2(iph2);
1041 delph2(iph2);
1138 struct ph2handle *iph2;
1255 iph2 = getph2bysaidx(src, dst, proto, spi[i]);
1256 if(iph2 != NULL){
1257 delete_spd(iph2, created);
1258 unbindph12(iph2);
1259 remph2(iph2);
1260 delph2(iph2);
1293 struct ph2handle *iph2;
1466 iph2 = getph2bysaidx(src, dst, proto_id, sa->sadb_sa_spi);
1467 if (iph2) {
1468 delete_spd(iph2, 0);
1469 unbindph12(iph2);
1470 remph2(iph2);
1471 delph2(iph2);
1576 * => ru->data <= iph2->dpd_seq &&
1577 * ru->data >= iph2->dpd_seq - iph2->dpd_fails ? */