• Home
  • Raw
  • Download

Lines Matching refs:iph2

665 		struct ph2handle *iph2;  local
699 iph2 = getph2bymsgid(iph1, msgid);
700 if (iph2 == NULL) {
716 iph2->flags |= ISAKMP_FLAG_C;
719 if (quick_main(iph2, msg) < 0) {
722 unbindph12(iph2);
723 remph2(iph2);
724 delph2(iph2);
949 quick_main(iph2, msg) in quick_main() argument
950 struct ph2handle *iph2; in quick_main()
960 if (iph2->status == PHASE2ST_ESTABLISHED
961 || iph2->status == PHASE2ST_GETSPISENT)
970 [iph2->side]
971 [iph2->status] == NULL) {
972 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
977 [iph2->side]
978 [iph2->status])(iph2, msg);
980 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
984 isakmp_info_send_n1(iph2->ph1, error, NULL);
989 if (iph2->status == PHASE2ST_ADDSA)
993 if (iph2->sendbuf == NULL) {
998 VPTRINIT(iph2->sendbuf);
1001 SCHED_KILL(iph2->scr);
1006 [iph2->side]
1007 [iph2->status])(iph2, msg) != 0) {
1008 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
1017 s_isakmp_state(ISAKMP_ETYPE_QUICK, iph2->side, iph2->status),
1253 isakmp_ph2begin_i(iph1, iph2) in isakmp_ph2begin_i() argument
1255 struct ph2handle *iph2;
1270 a = racoon_strdup(saddr2str(iph2->src));
1275 a, saddr2str(iph2->dst));
1280 gettimeofday(&iph2->start, NULL);
1283 bindph12(iph1, iph2);
1284 iph2->status = PHASE2ST_STATUS2;
1287 [iph2->side]
1288 [iph2->status])(iph2, NULL) < 0) {
1289 unbindph12(iph2);
1291 remph2(iph2);
1304 struct ph2handle *iph2 = 0; local
1317 iph2 = newph2();
1318 if (iph2 == NULL) {
1324 iph2->ph1 = iph1;
1325 iph2->side = RESPONDER;
1326 iph2->status = PHASE2ST_START;
1327 iph2->flags = isakmp->flags;
1328 iph2->msgid = isakmp->msgid;
1329 iph2->seq = pk_getseq();
1330 iph2->ivm = oakley_newiv2(iph1, iph2->msgid);
1331 if (iph2->ivm == NULL) {
1332 delph2(iph2);
1335 iph2->dst = dupsaddr(iph1->remote); /* XXX should be considered */
1336 if (iph2->dst == NULL) {
1337 delph2(iph2);
1340 iph2->src = dupsaddr(iph1->local); /* XXX should be considered */
1341 if (iph2->src == NULL) {
1342 delph2(iph2);
1346 if (set_port(iph2->dst, 0) == NULL ||
1347 set_port(iph2->src, 0) == NULL) {
1349 "invalid family: %d\n", iph2->dst->sa_family);
1350 delph2(iph2);
1356 insph2(iph2);
1357 bindph12(iph1, iph2);
1363 a = racoon_strdup(saddr2str(iph2->src));
1368 a, saddr2str(iph2->dst));
1377 [iph2->side]
1378 [iph2->status])(iph2, msg);
1383 isakmp_info_send_n1(iph2->ph1, error, NULL);
1388 unbindph12(iph2);
1389 remph2(iph2);
1390 delph2(iph2);
1397 [iph2->side]
1398 [iph2->status])(iph2, msg) < 0) {
1399 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
1408 s_isakmp_state(ISAKMP_ETYPE_QUICK, iph2->side, iph2->status),
1932 struct ph2handle *iph2; local
1934 iph2=(struct ph2handle *)p;
1936 if(isakmp_ph2resend(iph2) < 0){
1937 unbindph12(iph2);
1938 remph2(iph2);
1939 delph2(iph2);
1944 isakmp_ph2resend(iph2) in isakmp_ph2resend() argument
1945 struct ph2handle *iph2; in isakmp_ph2resend()
1949 if (iph2->ph1->status == PHASE1ST_EXPIRED){
1952 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1956 if (iph2->retry_counter <= 0) {
1959 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1960 EVT_PUSH(iph2->src, iph2->dst, EVTT_PEER_NO_RESPONSE, NULL);
1961 unbindph12(iph2);
1965 if (isakmp_send(iph2->ph1, iph2->sendbuf) < 0){
1968 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1969 EVT_PUSH(iph2->src, iph2->dst, EVTT_PEER_NO_RESPONSE, NULL);
1976 isakmp_pindex(&iph2->ph1->index, iph2->msgid));
1978 iph2->retry_counter--;
1980 iph2->scr = sched_new(iph2->ph1->rmconf->retry_interval,
1981 isakmp_ph2resend_stub, iph2);
2086 isakmp_ph2expire(iph2) in isakmp_ph2expire() argument
2087 struct ph2handle *iph2; in isakmp_ph2expire()
2091 SCHED_KILL(iph2->sce);
2093 src = racoon_strdup(saddrwop2str(iph2->src));
2094 dst = racoon_strdup(saddrwop2str(iph2->dst));
2103 iph2->status = PHASE2ST_EXPIRED;
2105 iph2->sce = sched_new(1, isakmp_ph2delete_stub, iph2);
2120 isakmp_ph2delete(iph2) in isakmp_ph2delete() argument
2121 struct ph2handle *iph2; in isakmp_ph2delete()
2125 SCHED_KILL(iph2->sce);
2127 src = racoon_strdup(saddrwop2str(iph2->src));
2128 dst = racoon_strdup(saddrwop2str(iph2->dst));
2137 unbindph12(iph2);
2138 remph2(iph2);
2139 delph2(iph2);
2152 isakmp_post_acquire(iph2) in isakmp_post_acquire() argument
2153 struct ph2handle *iph2; in isakmp_post_acquire()
2161 rmconf = getrmconf(iph2->dst);
2165 saddrwop2str(iph2->dst));
2174 saddrwop2str(iph2->dst));
2184 if (!extract_port(iph2->src) && !extract_port(iph2->dst)) {
2185 if ((iph1 = getph1byaddrwop(iph2->src, iph2->dst)) != NULL) {
2186 set_port(iph2->src, extract_port(iph1->local));
2187 set_port(iph2->dst, extract_port(iph1->remote));
2190 iph1 = getph1byaddr(iph2->src, iph2->dst, 0);
2193 iph1 = getph1byaddr(iph2->src, iph2->dst, 0);
2200 iph2->retry_checkph1 = lcconf->retry_checkph1;
2201 sc = sched_new(1, isakmp_chkph1there_stub, iph2);
2205 saddrwop2str(iph2->dst));
2208 if (isakmp_ph1begin_i(rmconf, iph2->dst, iph2->src) < 0) {
2219 iph2->retry_checkph1 = lcconf->retry_checkph1;
2220 sched_new(1, isakmp_chkph1there_stub, iph2);
2221 plog(LLV_INFO, LOCATION, iph2->dst,
2235 if (isakmp_ph2begin_i(iph1, iph2))
2245 isakmp_post_getspi(iph2) in isakmp_post_getspi() argument
2246 struct ph2handle *iph2; in isakmp_post_getspi()
2253 if (iph2->ph1->status == PHASE1ST_EXPIRED) {
2254 plog(LLV_ERROR, LOCATION, iph2->ph1->remote,
2264 [iph2->side]
2265 [iph2->status])(iph2, NULL) != 0)
2271 s_isakmp_state(ISAKMP_ETYPE_QUICK, iph2->side, iph2->status),
2287 isakmp_chkph1there(iph2) in isakmp_chkph1there() argument
2288 struct ph2handle *iph2; in isakmp_chkph1there()
2292 iph2->retry_checkph1--;
2293 if (iph2->retry_checkph1 < 0) {
2294 plog(LLV_ERROR, LOCATION, iph2->dst,
2297 sadbsecas2str(iph2->dst, iph2->src,
2298 iph2->satype, 0, 0));
2303 pk_sendeacquire(iph2);
2305 unbindph12(iph2);
2306 remph2(iph2);
2307 delph2(iph2);
2318 if (!extract_port(iph2->src) && !extract_port(iph2->dst)) {
2320 if( (iph1 = getph1byaddrwop(iph2->src, iph2->dst)) != NULL){
2325 iph1 = getph1byaddr(iph2->src, iph2->dst, 0);
2330 iph1 = getph1byaddr(iph2->src, iph2->dst, 0);
2343 plog(LLV_DEBUG2, LOCATION, NULL, "src: %s\n", saddr2str(iph2->src));
2344 plog(LLV_DEBUG2, LOCATION, NULL, "dst: %s\n", saddr2str(iph2->dst));
2345 set_port(iph2->src, extract_port(iph1->local));
2346 set_port(iph2->dst, extract_port(iph1->remote));
2348 plog(LLV_DEBUG2, LOCATION, NULL, "src: %s\n", saddr2str(iph2->src));
2349 plog(LLV_DEBUG2, LOCATION, NULL, "dst: %s\n", saddr2str(iph2->dst));
2352 (void)isakmp_ph2begin_i(iph1, iph2);
2359 sched_new(1, isakmp_chkph1there_stub, iph2);
2646 set_isakmp_header2(vbuf, iph2, nptype) in set_isakmp_header2() argument
2648 struct ph2handle *iph2;
2651 return set_isakmp_header (vbuf, iph2->ph1, nptype, ISAKMP_ETYPE_QUICK, iph2->flags, iph2->msgid);
2919 nostate2(iph2, msg) in nostate2() argument
2920 struct ph2handle *iph2; in nostate2()
2923 plog(LLV_ERROR, LOCATION, iph2->ph1->remote, "wrong state %u.\n",
2924 iph2->status);
3203 struct ph2handle *iph2; local
3275 iph2 = getph2bysaidx(src, dst, proto_id, sa->sadb_sa_spi);
3280 if (iph2 == NULL) {
3291 if (iph2->ph1 != NULL && iph2->ph1 != iph1){
3297 if (iph2->status == PHASE2ST_ESTABLISHED ||
3298 iph2->status == PHASE2ST_EXPIRED) {
3317 if (iph2 != NULL) {
3318 delete_spd(iph2, 0);
3319 unbindph12(iph2);
3320 remph2(iph2);
3321 delph2(iph2);
3345 delete_spd(iph2, created) in delete_spd() argument
3346 struct ph2handle *iph2; in delete_spd()
3357 if (iph2 == NULL)
3362 if (! iph2->generated_spidx )
3365 src = iph2->src;
3366 dst = iph2->dst;
3372 iph2->spidx_gen = (caddr_t )&spidx;
3375 iph2->src = dst;
3376 iph2->dst = src;
3390 if (iph2->id != NULL
3391 && (_XIDT(iph2->id) == IPSECDOI_ID_IPV4_ADDR
3392 || _XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR
3393 || _XIDT(iph2->id) == IPSECDOI_ID_IPV4_ADDR_SUBNET
3394 || _XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR_SUBNET)) {
3396 error = ipsecdoi_id2sockaddr(iph2->id,
3409 if (_XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR) {
3412 iph2->src)) != 0)
3417 if (_XIDT(iph2->id) == IPSECDOI_ID_IPV4_ADDR
3418 || _XIDT(iph2->id) == IPSECDOI_ID_IPV6_ADDR)
3419 idi2type = _XIDT(iph2->id);
3434 memcpy(&spidx.dst, iph2->src, sysdep_sa_len(iph2->src));
3453 if (iph2->id_p != NULL
3454 && (_XIDT(iph2->id_p) == IPSECDOI_ID_IPV4_ADDR
3455 || _XIDT(iph2->id_p) == IPSECDOI_ID_IPV6_ADDR
3456 || _XIDT(iph2->id_p) == IPSECDOI_ID_IPV4_ADDR_SUBNET
3457 || _XIDT(iph2->id_p) == IPSECDOI_ID_IPV6_ADDR_SUBNET)) {
3459 error = ipsecdoi_id2sockaddr(iph2->id_p,
3470 if (_XIDT(iph2->id_p) == IPSECDOI_ID_IPV6_ADDR) {
3473 iph2->dst);
3480 if (_XIDT(iph2->id_p) == idi2type
3482 iph2->src_id =
3484 if (iph2->src_id == NULL) {
3489 iph2->dst_id =
3491 if (iph2->dst_id == NULL) {
3506 memcpy(&spidx.src, iph2->dst, sysdep_sa_len(iph2->dst));
3566 if (pk_sendspddelete(iph2) < 0) {
3576 if (tunnel_mode_prop(iph2->approval)) {
3578 if (pk_sendspddelete(iph2) < 0) {
3589 iph2->src = src;
3590 iph2->dst = dst;
3599 if (pk_sendspddelete(iph2) < 0) {
3607 iph2->spidx_gen=NULL;