Lines Matching refs:iph2

656 		struct ph2handle *iph2;  local
691 iph2 = getph2bymsgid(iph1, msgid);
692 if (iph2 == NULL) {
708 iph2->flags |= ISAKMP_FLAG_C;
711 if (quick_main(iph2, msg) < 0) {
714 remph2(iph2);
715 delph2(iph2);
963 quick_main(iph2, msg) in quick_main() argument
964 struct ph2handle *iph2; in quick_main()
974 if (iph2->status == PHASE2ST_ESTABLISHED
975 || iph2->status == PHASE2ST_GETSPISENT)
984 [iph2->side]
985 [iph2->status] == NULL) {
986 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
991 [iph2->side]
992 [iph2->status])(iph2, msg);
994 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
996 iph2->side, iph2->status);
999 isakmp_info_send_n1(iph2->ph1, error, NULL);
1004 if (iph2->status == PHASE2ST_ADDSA)
1008 if (iph2->sendbuf == NULL) {
1013 VPTRINIT(iph2->sendbuf);
1016 sched_cancel(&iph2->scr);
1021 [iph2->side]
1022 [iph2->status])(iph2, msg) != 0) {
1023 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
1025 iph2->side, iph2->status);
1033 s_isakmp_state(ISAKMP_ETYPE_QUICK, iph2->side, iph2->status),
1266 isakmp_ph2begin_i(iph1, iph2) in isakmp_ph2begin_i() argument
1268 struct ph2handle *iph2;
1279 if (extract_port(iph2->src) == 0)
1280 set_port(iph2->src, extract_port(iph1->local));
1281 if (extract_port(iph2->dst) == 0)
1282 set_port(iph2->dst, extract_port(iph1->remote));
1289 a = racoon_strdup(saddr2str(iph2->src));
1294 a, saddr2str(iph2->dst));
1299 gettimeofday(&iph2->start, NULL);
1301 if (iph2->status != PHASE2ST_EXPIRED) /* Phase 1 is already bound (ongoing rekeying) */
1302 bindph12(iph1, iph2);
1303 iph2->status = PHASE2ST_STATUS2;
1306 [iph2->side]
1307 [iph2->status])(iph2, NULL) < 0) {
1309 remph2(iph2);
1322 struct ph2handle *iph2 = 0; local
1335 iph2 = newph2();
1336 if (iph2 == NULL) {
1342 iph2->side = RESPONDER;
1343 iph2->status = PHASE2ST_START;
1344 iph2->flags = isakmp->flags;
1345 iph2->msgid = isakmp->msgid;
1346 iph2->seq = pk_getseq();
1347 iph2->ivm = oakley_newiv2(iph1, iph2->msgid);
1348 if (iph2->ivm == NULL) {
1349 delph2(iph2);
1352 iph2->dst = dupsaddr(iph1->remote); /* XXX should be considered */
1353 if (iph2->dst == NULL) {
1354 delph2(iph2);
1357 iph2->src = dupsaddr(iph1->local); /* XXX should be considered */
1358 if (iph2->src == NULL) {
1359 delph2(iph2);
1364 insph2(iph2);
1365 bindph12(iph1, iph2);
1371 a = racoon_strdup(saddr2str(iph2->src));
1376 a, saddr2str(iph2->dst));
1385 [iph2->side]
1386 [iph2->status])(iph2, msg);
1390 iph2->side, iph2->status);
1392 isakmp_info_send_n1(iph2->ph1, error, NULL);
1397 remph2(iph2);
1398 delph2(iph2);
1405 [iph2->side]
1406 [iph2->status])(iph2, msg) < 0) {
1407 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
1409 iph2->side, iph2->status);
1417 s_isakmp_state(ISAKMP_ETYPE_QUICK, iph2->side, iph2->status),
1889 struct ph2handle *iph2 = container_of(p, struct ph2handle, scr); in isakmp_ph2resend_stub() local
1891 if (isakmp_ph2resend(iph2) < 0) { in isakmp_ph2resend_stub()
1892 remph2(iph2); in isakmp_ph2resend_stub()
1893 delph2(iph2); in isakmp_ph2resend_stub()
1898 isakmp_ph2resend(iph2) in isakmp_ph2resend() argument
1899 struct ph2handle *iph2; in isakmp_ph2resend()
1903 if (iph2->ph1->status >= PHASE1ST_EXPIRED) {
1906 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1910 if (iph2->retry_counter <= 0) {
1913 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1914 evt_phase2(iph2, EVT_PHASE2_NO_RESPONSE, NULL);
1915 unbindph12(iph2);
1919 if (isakmp_send(iph2->ph1, iph2->sendbuf) < 0){
1922 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1923 evt_phase2(iph2, EVT_PHASE2_NO_RESPONSE, NULL);
1929 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1931 iph2->retry_counter--;
1933 sched_schedule(&iph2->scr, lcconf->retry_interval,
1940 isakmp_ph2send(iph2) in isakmp_ph2send() argument
1941 struct ph2handle *iph2; in isakmp_ph2send()
1943 iph2->retry_counter = lcconf->retry_counter;
1944 return isakmp_ph2resend(iph2);
2099 isakmp_ph2expire(iph2) in isakmp_ph2expire() argument
2100 struct ph2handle *iph2; in isakmp_ph2expire()
2104 src = racoon_strdup(saddrwop2str(iph2->src));
2105 dst = racoon_strdup(saddrwop2str(iph2->dst));
2114 iph2->status = PHASE2ST_EXPIRED;
2115 sched_schedule(&iph2->sce, 1, isakmp_ph2delete_stub);
2128 isakmp_ph2delete(iph2) in isakmp_ph2delete() argument
2129 struct ph2handle *iph2; in isakmp_ph2delete()
2133 src = racoon_strdup(saddrwop2str(iph2->src));
2134 dst = racoon_strdup(saddrwop2str(iph2->dst));
2143 remph2(iph2);
2144 delph2(iph2);
2157 isakmp_post_acquire(iph2, iph1hint, nopassive) in isakmp_post_acquire() argument
2158 struct ph2handle *iph2; in isakmp_post_acquire()
2177 rmconf = getrmconf(iph2->dst, nopassive ? GETRMCONF_F_NO_PASSIVE : 0);
2181 saddrwop2str(iph2->dst));
2193 saddrwop2str(iph2->dst));
2202 iph1 = getph1(iph1hint, iph2->src, iph2->dst, 0);
2206 iph2->retry_checkph1 = lcconf->retry_checkph1;
2207 sched_schedule(&iph2->sce, 1, isakmp_chkph1there_stub);
2211 saddrwop2str(iph2->dst));
2214 if (isakmp_ph1begin_i(rmconf, iph2->dst, iph2->src) == NULL) {
2215 sched_cancel(&iph2->sce);
2225 iph2->retry_checkph1 = lcconf->retry_checkph1;
2226 sched_schedule(&iph2->sce, 1, isakmp_chkph1there_stub);
2227 plog(LLV_INFO, LOCATION, iph2->dst,
2241 if (isakmp_ph2begin_i(iph1, iph2))
2248 isakmp_get_sainfo(iph2, sp_out, sp_in) in isakmp_get_sainfo() argument
2249 struct ph2handle *iph2; in isakmp_get_sainfo()
2280 conf = getrmconf(iph2->dst, 0);
2286 iph2->sainfo = getsainfo(idsrc, iddst, NULL, NULL, remoteid);
2289 if (iph2->sainfo == NULL) {
2297 "selected sainfo: %s\n", sainfo2str(iph2->sainfo));
2300 if (set_proposal_from_policy(iph2, sp_out, sp_in) < 0) {
2314 isakmp_post_getspi(iph2) in isakmp_post_getspi() argument
2315 struct ph2handle *iph2; in isakmp_post_getspi()
2322 if (iph2->ph1->status >= PHASE1ST_EXPIRED) {
2323 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
2333 [iph2->side]
2334 [iph2->status])(iph2, NULL) != 0)
2340 s_isakmp_state(ISAKMP_ETYPE_QUICK, iph2->side, iph2->status),
2356 isakmp_chkph1there(iph2) in isakmp_chkph1there() argument
2357 struct ph2handle *iph2; in isakmp_chkph1there()
2361 iph2->retry_checkph1--;
2362 if (iph2->retry_checkph1 < 0) {
2363 plog(LLV_ERROR, LOCATION, iph2->dst,
2366 sadbsecas2str(iph2->src, iph2->dst,
2367 iph2->satype, 0, 0));
2372 pk_sendeacquire(iph2);
2374 remph2(iph2);
2375 delph2(iph2);
2381 iph1 = getph1byaddr(iph2->src, iph2->dst, 0);
2393 plog(LLV_DEBUG2, LOCATION, NULL, "src: %s\n", saddr2str(iph2->src));
2394 plog(LLV_DEBUG2, LOCATION, NULL, "dst: %s\n", saddr2str(iph2->dst));
2395 set_port(iph2->src, extract_port(iph1->local));
2396 set_port(iph2->dst, extract_port(iph1->remote));
2398 plog(LLV_DEBUG2, LOCATION, NULL, "src: %s\n", saddr2str(iph2->src));
2399 plog(LLV_DEBUG2, LOCATION, NULL, "dst: %s\n", saddr2str(iph2->dst));
2402 (void)isakmp_ph2begin_i(iph1, iph2);
2409 sched_schedule(&iph2->sce, 1, isakmp_chkph1there_stub);
2691 set_isakmp_header2(vbuf, iph2, nptype) in set_isakmp_header2() argument
2693 struct ph2handle *iph2;
2696 return set_isakmp_header (vbuf, iph2->ph1, nptype, ISAKMP_ETYPE_QUICK, iph2->flags, iph2->msgid);
2970 nostate2(iph2, msg) in nostate2() argument
2971 struct ph2handle *iph2; in nostate2()
2974 plog(LLV_ERROR, LOCATION, iph2->ph1->remote, "wrong state %u.\n",
2975 iph2->status);
3258 struct ph2handle *iph2; local
3333 iph2 = getph2bysaidx(src, dst, proto_id, sa->sadb_sa_spi);
3338 if (iph2 == NULL) {
3349 if (iph2->ph1 != NULL && iph2->ph1 != iph1){
3355 if (iph2->status == PHASE2ST_ESTABLISHED ||
3356 iph2->status == PHASE2ST_EXPIRED) {
3375 if (iph2 != NULL) {
3376 delete_spd(iph2, 0);
3377 remph2(iph2);
3378 delph2(iph2);
3400 delete_spd(iph2, created) in delete_spd() argument
3401 struct ph2handle *iph2; in delete_spd()
3412 if (iph2 == NULL)
3417 if (! iph2->generated_spidx )
3420 src = iph2->src;
3421 dst = iph2->dst;
3427 iph2->spidx_gen = (caddr_t )&spidx;
3430 iph2->src = dst;
3431 iph2->dst = src;
3445 if (iph2->id != NULL
3446 && (_XIDT(iph2->id) == IPSECDOI_ID_IPV4_ADDR
3447 || _XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR
3448 || _XIDT(iph2->id) == IPSECDOI_ID_IPV4_ADDR_SUBNET
3449 || _XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR_SUBNET)) {
3451 error = ipsecdoi_id2sockaddr(iph2->id,
3464 if (_XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR) {
3467 iph2->src)) != 0)
3472 if (_XIDT(iph2->id) == IPSECDOI_ID_IPV4_ADDR
3473 || _XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR)
3474 idi2type = _XIDT(iph2->id);
3489 memcpy(&spidx.dst, iph2->src, sysdep_sa_len(iph2->src));
3508 if (iph2->id_p != NULL
3509 && (_XIDT(iph2->id_p) == IPSECDOI_ID_IPV4_ADDR
3510 || _XIDT(iph2->id_p) == IPSECDOI_ID_IPV6_ADDR
3511 || _XIDT(iph2->id_p) == IPSECDOI_ID_IPV4_ADDR_SUBNET
3512 || _XIDT(iph2->id_p) == IPSECDOI_ID_IPV6_ADDR_SUBNET)) {
3514 error = ipsecdoi_id2sockaddr(iph2->id_p,
3525 if (_XIDT(iph2->id_p) == IPSECDOI_ID_IPV6_ADDR) {
3528 iph2->dst);
3535 if (_XIDT(iph2->id_p) == idi2type
3537 iph2->sa_src =
3539 if (iph2->sa_src == NULL) {
3544 iph2->sa_dst =
3546 if (iph2->sa_dst == NULL) {
3561 memcpy(&spidx.src, iph2->dst, sysdep_sa_len(iph2->dst));
3621 if (pk_sendspddelete(iph2) < 0) {
3631 if (tunnel_mode_prop(iph2->approval)) {
3633 if (pk_sendspddelete(iph2) < 0) {
3644 iph2->src = src;
3645 iph2->dst = dst;
3654 if (pk_sendspddelete(iph2) < 0) {
3662 iph2->spidx_gen=NULL;