Lines Matching refs:iph2
811 pfkey_timeover(iph2) in pfkey_timeover() argument
812 struct ph2handle *iph2; in pfkey_timeover()
816 saddrwop2str(iph2->dst));
817 SCHED_KILL(iph2->sce);
820 if (iph2->side == INITIATOR)
821 pk_sendeacquire(iph2);
823 unbindph12(iph2);
824 remph2(iph2);
825 delph2(iph2);
838 pk_sendgetspi(iph2) in pk_sendgetspi() argument
839 struct ph2handle *iph2; in pk_sendgetspi()
848 if (iph2->side == INITIATOR) {
849 pp = iph2->proposal;
850 proxy = iph2->ph1->rmconf->support_proxy;
852 pp = iph2->approval;
853 if (iph2->sainfo && iph2->sainfo->id_i)
858 if (proxy && iph2->src_id && iph2->dst_id &&
860 src = iph2->src_id;
861 dst = iph2->dst_id;
863 src = iph2->src;
864 dst = iph2->dst;
910 pr->reqid_in, iph2->seq) < 0) {
933 struct ph2handle *iph2; local
961 iph2 = getph2byseq(msg->sadb_msg_seq);
962 if (iph2 == NULL) {
970 if (iph2->status != PHASE2ST_GETSPISENT) {
973 iph2->status, PHASE2ST_GETSPISENT);
981 pp = iph2->side == INITIATOR ? iph2->proposal : iph2->approval;
989 sadbsecas2str(iph2->dst, iph2->src,
1001 saddrwop2str(iph2->dst));
1007 iph2->status = PHASE2ST_GETSPIDONE;
1008 if (isakmp_post_getspi(iph2) < 0) {
1011 unbindph12(iph2);
1012 remph2(iph2);
1013 delph2(iph2);
1014 iph2 = NULL;
1026 pk_sendupdate(iph2) in pk_sendupdate() argument
1027 struct ph2handle *iph2; in pk_sendupdate()
1034 if (iph2->approval == NULL) {
1039 if (iph2->side == INITIATOR)
1040 proxy = iph2->ph1->rmconf->support_proxy;
1041 else if (iph2->sainfo && iph2->sainfo->id_i)
1047 sa_args.l_addtime = iph2->approval->lifetime;
1048 sa_args.seq = iph2->seq;
1052 if (proxy && iph2->src_id && iph2->dst_id &&
1053 ipsecdoi_transportmode(iph2->approval)) {
1054 sa_args.dst = iph2->src_id;
1055 sa_args.src = iph2->dst_id;
1057 sa_args.dst = iph2->src;
1058 sa_args.src = iph2->dst;
1061 for (pr = iph2->approval->head; pr != NULL; pr = pr->next) {
1095 sa_args.l_bytes = iph2->approval->lifebyte * 1024,
1101 if (*iph2->approval->sctx.ctx_str) {
1102 sa_args.ctxdoi = iph2->approval->sctx.ctx_doi;
1103 sa_args.ctxalg = iph2->approval->sctx.ctx_alg;
1104 sa_args.ctxstrlen = iph2->approval->sctx.ctx_strlen;
1105 sa_args.ctxstr = iph2->approval->sctx.ctx_str;
1111 sa_args.l_natt_type = iph2->ph1->natt_options->encaps_type;
1112 sa_args.l_natt_sport = extract_port (iph2->ph1->remote);
1113 sa_args.l_natt_dport = extract_port (iph2->ph1->local);
1116 sa_args.l_natt_frag = iph2->ph1->rmconf->esp_frag;
1151 sa_args.l_bytes = iph2->approval->lifebyte * 1024;
1176 struct ph2handle *iph2; local
1213 iph2 = getph2byseq(msg->sadb_msg_seq);
1214 if (iph2 == NULL) {
1222 if (iph2->status != PHASE2ST_ADDSA) {
1225 iph2->status, PHASE2ST_ADDSA);
1230 for (pr = iph2->approval->head; pr != NULL; pr = pr->next) {
1249 sadbsecas2str(iph2->dst, iph2->src,
1256 sadbsecas2str(iph2->dst, iph2->src,
1269 SCHED_KILL(iph2->sce);
1272 iph2->status = PHASE2ST_ESTABLISHED;
1275 gettimeofday(&iph2->end, NULL);
1277 "phase2", "quick", timedelta(&iph2->start, &iph2->end));
1281 iph2->ph1->ph2cnt++;
1284 SCHED_KILL(iph2->scr);
1291 set_port(iph2->src, extract_port(iph2->ph1->local));
1292 set_port(iph2->dst, extract_port(iph2->ph1->remote));
1299 unbindph12(iph2);
1301 iph2->sce = sched_new(iph2->approval->lifetime,
1302 isakmp_ph2expire_stub, iph2);
1312 pk_sendadd(iph2) in pk_sendadd() argument
1313 struct ph2handle *iph2; in pk_sendadd()
1320 if (iph2->approval == NULL) {
1326 if (iph2->side == INITIATOR)
1327 proxy = iph2->ph1->rmconf->support_proxy;
1328 else if (iph2->sainfo && iph2->sainfo->id_i)
1334 sa_args.l_addtime = iph2->approval->lifetime;
1335 sa_args.seq = iph2->seq;
1339 if (proxy && iph2->src_id && iph2->dst_id &&
1340 ipsecdoi_transportmode(iph2->approval)) {
1341 sa_args.src = iph2->src_id;
1342 sa_args.dst = iph2->dst_id;
1344 sa_args.src = iph2->src;
1345 sa_args.dst = iph2->dst;
1348 for (pr = iph2->approval->head; pr != NULL; pr = pr->next) {
1383 sa_args.l_bytes = iph2->approval->lifebyte * 1024,
1389 if (*iph2->approval->sctx.ctx_str) {
1390 sa_args.ctxdoi = iph2->approval->sctx.ctx_doi;
1391 sa_args.ctxalg = iph2->approval->sctx.ctx_alg;
1392 sa_args.ctxstrlen = iph2->approval->sctx.ctx_strlen;
1393 sa_args.ctxstr = iph2->approval->sctx.ctx_str;
1403 sa_args.l_natt_sport = extract_port(iph2->ph1->local);
1404 sa_args.l_natt_dport = extract_port(iph2->ph1->remote);
1407 sa_args.l_natt_frag = iph2->ph1->rmconf->esp_frag;
1466 struct ph2handle *iph2; local
1501 iph2 = getph2byseq(msg->sadb_msg_seq);
1502 if (iph2 == NULL) {
1517 sadbsecas2str(iph2->src, iph2->dst,
1531 struct ph2handle *iph2; local
1566 iph2 = getph2bysaidx(src, dst, proto_id, sa->sadb_sa_spi);
1567 if (iph2 == NULL) {
1580 if (iph2->status != PHASE2ST_ESTABLISHED) {
1596 SCHED_KILL(iph2->sce);
1598 iph2->status = PHASE2ST_EXPIRED;
1602 if (iph2->side == INITIATOR) {
1604 initph2(iph2);
1607 iph2->status = PHASE2ST_STATUS2;
1610 if (isakmp_post_acquire(iph2) < 0) {
1611 plog(LLV_ERROR, LOCATION, iph2->dst,
1614 unbindph12(iph2);
1615 remph2(iph2);
1616 delph2(iph2);
1627 unbindph12(iph2);
1628 remph2(iph2);
1629 delph2(iph2);
1642 struct ph2handle *iph2[MAXNESTEDSA]; local
1749 iph2[0] = getph2byid(src, dst, xpl->sadb_x_policy_id);
1750 if (iph2[0] != NULL) {
1751 if (iph2[0]->status < PHASE2ST_ESTABLISHED) {
1756 if (iph2[0]->status == PHASE2ST_EXPIRED)
1757 iph2[0] = NULL;
1805 memset(iph2, 0, MAXNESTEDSA);
1810 iph2[n] = newph2();
1811 if (iph2[n] == NULL) {
1816 iph2[n]->side = INITIATOR;
1817 iph2[n]->spid = xpl->sadb_x_policy_id;
1818 iph2[n]->satype = msg->sadb_msg_satype;
1819 iph2[n]->seq = msg->sadb_msg_seq;
1820 iph2[n]->status = PHASE2ST_STATUS2;
1823 iph2[n]->dst = dupsaddr(PFKEY_ADDR_SADDR(mhp[SADB_EXT_ADDRESS_DST]));
1824 if (iph2[n]->dst == NULL) {
1825 delph2(iph2[n]);
1828 iph2[n]->src = dupsaddr(PFKEY_ADDR_SADDR(mhp[SADB_EXT_ADDRESS_SRC]));
1829 if (iph2[n]->src == NULL) {
1830 delph2(iph2[n]);
1847 delph2(iph2[n]);
1857 delph2(iph2[n]);
1862 conf = getrmconf(iph2[n]->dst);
1870 iph2[n]->sainfo = getsainfo(idsrc, iddst, NULL, remoteid);
1873 if (iph2[n]->sainfo == NULL) {
1876 delph2(iph2[n]);
1882 "selected sainfo: %s\n", sainfo2str(iph2[n]->sainfo));
1885 if (set_proposal_from_policy(iph2[n], sp_out, sp_in) < 0) {
1888 delph2(iph2[n]);
1893 set_secctx_in_proposal(iph2[n], spidx);
1897 insph2(iph2[n]);
1901 if (isakmp_post_acquire(iph2[n]) < 0) {
1911 unbindph12(iph2[n]);
1912 remph2(iph2[n]);
1913 delph2(iph2[n]);
1914 iph2[n] = NULL;
1927 struct ph2handle *iph2 = NULL; local
1964 iph2 = getph2bysaidx(src, dst, proto_id, sa->sadb_sa_spi);
1965 if (iph2 == NULL) {
1976 sadbsecas2str(iph2->src, iph2->dst,
1980 if (iph2->status == PHASE2ST_ESTABLISHED)
1981 isakmp_info_send_d2(iph2);
1983 unbindph12(iph2);
1984 remph2(iph2);
1985 delph2(iph2);
2011 getsadbpolicy(policy0, policylen0, type, iph2) in getsadbpolicy() argument
2014 struct ph2handle *iph2;
2016 struct policyindex *spidx = (struct policyindex *)iph2->spidx_gen;
2035 for (pr = iph2->approval->head; pr; pr = pr->next) {
2038 xisrlen += (sysdep_sa_len(iph2->src)
2039 + sysdep_sa_len(iph2->dst));
2098 for (pr = iph2->approval->head; pr; pr = pr->next) rlist_len++;
2106 for (pr = iph2->approval->head; pr; pr = pr->next) pr_rlist[rlist_len--] = pr;
2130 if(iph2->proposal->head->reqid_in > 0){
2132 xisr->sadb_x_ipsecrequest_reqid = iph2->proposal->head->reqid_in;
2144 src_len = sysdep_sa_len(iph2->src);
2145 dst_len = sysdep_sa_len(iph2->dst);
2148 memcpy(p, iph2->src, src_len);
2151 memcpy(p, iph2->dst, dst_len);
2176 pk_sendspdupdate2(iph2) in pk_sendspdupdate2() argument
2177 struct ph2handle *iph2; in pk_sendspdupdate2()
2179 struct policyindex *spidx = (struct policyindex *)iph2->spidx_gen;
2184 ltime = iph2->approval->lifetime;
2187 if (getsadbpolicy(&policy, &policylen, SADB_X_SPDUPDATE, iph2)) {
2298 pk_sendspdadd2(iph2) in pk_sendspdadd2() argument
2299 struct ph2handle *iph2; in pk_sendspdadd2()
2301 struct policyindex *spidx = (struct policyindex *)iph2->spidx_gen;
2306 ltime = iph2->approval->lifetime;
2309 if (getsadbpolicy(&policy, &policylen, SADB_X_SPDADD, iph2)) {
2420 pk_sendspddelete(iph2) in pk_sendspddelete() argument
2421 struct ph2handle *iph2; in pk_sendspddelete()
2423 struct policyindex *spidx = (struct policyindex *)iph2->spidx_gen;
2427 if (getsadbpolicy(&policy, &policylen, SADB_X_SPDDELETE, iph2)) {
2727 pk_sendeacquire(iph2) in pk_sendeacquire() argument
2728 struct ph2handle *iph2; in pk_sendeacquire()
2745 newmsg->sadb_msg_satype = iph2->satype;
2748 newmsg->sadb_msg_seq = iph2->seq;
2761 int pk_sendeacquire(struct ph2handle *iph2) in pk_sendeacquire() argument