Home | History | Annotate | Download | only in racoon

Lines Matching refs:iph1

139 isakmp_cfg_r(iph1, msg)
140 struct ph1handle *iph1;
170 if (iph1->mode_cfg->ivm == NULL ||
171 iph1->mode_cfg->last_msgid != packet->msgid )
172 iph1->mode_cfg->ivm =
173 isakmp_cfg_newiv(iph1, packet->msgid);
174 ivm = iph1->mode_cfg->ivm;
176 dmsg = oakley_do_decrypt(iph1, msg, ivm->iv, ivm->ive);
228 if ((check = oakley_compute_hash1(iph1,
251 isakmp_cfg_attr_r(iph1, packet->msgid, attrpl);
274 isakmp_cfg_attr_r(iph1, msgid, attrpl)
275 struct ph1handle *iph1;
286 oakley_delivm(iph1->mode_cfg->ivm);
287 iph1->mode_cfg->ivm = NULL;
292 return isakmp_cfg_reply(iph1, attrpl);
296 iph1->msgid = msgid;
297 return isakmp_cfg_request(iph1, attrpl);
301 iph1->msgid = msgid;
302 return isakmp_cfg_set(iph1, attrpl);
316 isakmp_cfg_reply(iph1, attrpl)
317 struct ph1handle *iph1;
345 if ((error = xauth_attr_reply(iph1,
388 if ((error = xauth_attr_reply(iph1,
393 isakmp_cfg_getaddr4(attr, &iph1->mode_cfg->addr4);
394 iph1->mode_cfg->flags |= ISAKMP_CFG_GOT_ADDR4;
397 isakmp_cfg_getaddr4(attr, &iph1->mode_cfg->mask4);
398 iph1->mode_cfg->flags |= ISAKMP_CFG_GOT_MASK4;
402 &iph1->mode_cfg->dns4[iph1->mode_cfg->dns4_index],
403 &iph1->mode_cfg->dns4_index, MAXNS);
404 iph1->mode_cfg->flags |= ISAKMP_CFG_GOT_DNS4;
408 &iph1->mode_cfg->wins4[iph1->mode_cfg->wins4_index],
409 &iph1->mode_cfg->wins4_index, MAXNS);
410 iph1->mode_cfg->flags |= ISAKMP_CFG_GOT_WINS4;
414 iph1->mode_cfg->default_domain);
415 iph1->mode_cfg->flags |= ISAKMP_CFG_GOT_DEFAULT_DOMAIN;
427 isakmp_unity_reply(iph1, attr);
449 if ((iph1->status == PHASE1ST_ESTABLISHED) &&
450 iph1->rmconf->mode_cfg) {
451 switch (AUTHMETHOD(iph1)) {
460 script_hook(iph1, SCRIPT_PHASE1_UP);
478 EVT_PUSH(iph1->local, iph1->remote,
489 isakmp_cfg_request(iph1, attrpl)
490 struct ph1handle *iph1;
527 reply_attr = isakmp_xauth_req(iph1, attr);
568 reply_attr = isakmp_cfg_net(iph1, attr);
581 reply_attr = isakmp_xauth_req(iph1, attr);
585 reply_attr = isakmp_cfg_string(iph1,
600 reply_attr = isakmp_unity_req(iph1, attr);
630 error = isakmp_cfg_send(iph1, payload,
633 if (iph1->status == PHASE1ST_ESTABLISHED) {
634 switch (AUTHMETHOD(iph1)) {
643 script_hook(iph1, SCRIPT_PHASE1_UP);
657 isakmp_cfg_set(iph1, attrpl)
658 struct ph1handle *iph1;
694 reply_attr = isakmp_xauth_set(iph1, attr);
732 error = isakmp_cfg_send(iph1, payload,
735 if (iph1->mode_cfg->flags & ISAKMP_CFG_DELETE_PH1) {
736 if (iph1->status == PHASE1ST_ESTABLISHED)
737 isakmp_info_send_d1(iph1);
738 remph1(iph1);
739 delph1(iph1);
740 iph1 = NULL;
748 if ((iph1 != NULL) && (iph1->rmconf->mode_cfg) && (error == 0))
749 error = isakmp_cfg_getconfig(iph1);
777 isakmp_cfg_net(iph1, attr)
778 struct ph1handle *iph1;
790 if (xauth_check(iph1) != 0) {
809 if (iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_EXTERN)
819 if ((iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_EXTERN)
820 && (iph1->mode_cfg->addr4.s_addr != htonl(-2)))
833 if (isakmp_cfg_getport(iph1) == -1) {
839 iph1->mode_cfg->addr4.s_addr =
841 + iph1->mode_cfg->port);
842 iph1->mode_cfg->flags |= ISAKMP_CFG_ADDR4_LOCAL;
850 if (isakmp_cfg_accounting(iph1, ISAKMP_CFG_LOGIN) != 0)
853 return isakmp_cfg_addr4(iph1,
854 attr, &iph1->mode_cfg->addr4.s_addr);
861 if (iph1->mode_cfg->flags & ISAKMP_CFG_MASK4_EXTERN)
871 if (iph1->mode_cfg->flags & ISAKMP_CFG_MASK4_EXTERN)
880 iph1->mode_cfg->mask4.s_addr
882 iph1->mode_cfg->flags |= ISAKMP_CFG_MASK4_LOCAL;
889 return isakmp_cfg_addr4(iph1, attr,
890 &iph1->mode_cfg->mask4.s_addr);
894 return isakmp_cfg_addr4_list(iph1,
900 return isakmp_cfg_addr4_list(iph1,
906 return isakmp_cfg_addr4(iph1,
919 isakmp_cfg_void(iph1, attr)
920 struct ph1handle *iph1;
941 isakmp_cfg_copy(iph1, attr)
942 struct ph1handle *iph1;
962 isakmp_cfg_short(iph1, attr, value)
963 struct ph1handle *iph1;
986 isakmp_cfg_varlen(iph1, attr, string, len)
987 struct ph1handle *iph1;
1012 isakmp_cfg_string(iph1, attr, string)
1013 struct ph1handle *iph1;
1018 return isakmp_cfg_varlen(iph1, attr, string, len);
1022 isakmp_cfg_addr4(iph1, attr, addr)
1023 struct ph1handle *iph1;
1047 isakmp_cfg_addr4_list(iph1, attr, addr, nbr)
1048 struct ph1handle *iph1;
1092 isakmp_cfg_newiv(iph1, msgid)
1093 struct ph1handle *iph1;
1096 struct isakmp_cfg_state *ics = iph1->mode_cfg;
1107 ics->ivm = oakley_newiv2(iph1, msgid);
1115 isakmp_cfg_send(iph1, payload, np, flags, new_exchange)
1116 struct ph1handle *iph1;
1129 struct isakmp_cfg_state *ics = iph1->mode_cfg;
1132 if ((iph1->status != PHASE1ST_ESTABLISHED) ||
1133 (iph1->local == NULL) ||
1134 (iph1->remote == NULL)) {
1145 iph2->dst = dupsaddr(iph1->remote);
1150 iph2->src = dupsaddr(iph1->local);
1160 "invalid family: %d\n", iph1->remote->sa_family);
1165 iph2->ph1 = iph1;
1170 iph2->msgid = isakmp_newmsgid2(iph1);
1172 iph2->msgid = iph1->msgid;
1175 if (iph1->skeyid_a != NULL) {
1177 if (isakmp_cfg_newiv(iph1, iph2->msgid) == NULL) {
1206 bindph12(iph1, iph2);
1220 memcpy(&isakmp->i_ck, &iph1->index.i_ck, sizeof(cookie_t));
1221 memcpy(&isakmp->r_ck, &iph1->index.r_ck, sizeof(cookie_t));
1223 isakmp->v = iph1->version;
1245 isakmp_printpacket(iph2->sendbuf, iph1->local, iph1->remote, 1);
1294 isakmp_cfg_rmstate(iph1)
1295 struct ph1handle *iph1;
1297 struct isakmp_cfg_state *state = iph1->mode_cfg;
1299 if (isakmp_cfg_accounting(iph1, ISAKMP_CFG_LOGOUT) != 0)
1303 isakmp_cfg_putport(iph1, state->port);
1306 if(iph1->mode_cfg->ivm) {
1307 oakley_delivm(iph1->mode_cfg->ivm);
1308 iph1->mode_cfg->ivm = NULL;
1312 if(iph1->mode_cfg->split_include != NULL)
1313 splitnet_list_free(iph1->mode_cfg->split_include,
1314 &iph1->mode_cfg->include_count);
1315 if(iph1->mode_cfg->split_local != NULL)
1316 splitnet_list_free(iph1->mode_cfg->split_local,
1317 &iph1->mode_cfg->local_count);
1322 iph1->mode_cfg = NULL;
1343 isakmp_cfg_getport(iph1)
1344 struct ph1handle *iph1;
1349 if (iph1->mode_cfg->flags & ISAKMP_CFG_PORT_ALLOCATED)
1350 return iph1->mode_cfg->port;
1373 iph1->mode_cfg->flags |= ISAKMP_CFG_PORT_ALLOCATED;
1374 iph1->mode_cfg->port = i;
1380 isakmp_cfg_putport(iph1, index)
1381 struct ph1handle *iph1;
1403 iph1->mode_cfg->flags &= ISAKMP_CFG_PORT_ALLOCATED;
1426 isakmp_cfg_accounting(iph1, inout)
1427 struct ph1handle *iph1;
1432 return privsep_accounting_pam(iph1->mode_cfg->port,
1437 return isakmp_cfg_accounting_radius(iph1, inout);
1440 return privsep_accounting_system(iph1->mode_cfg->port,
1441 iph1->remote, iph1->mode_cfg->login, inout);
1493 isakmp_cfg_accounting_radius(iph1, inout)
1494 struct ph1handle *iph1;
1524 iph1->mode_cfg->login) != 0) {
1544 RAD_FRAMED_IP_ADDRESS, iph1->mode_cfg->addr4) != 0) {
1552 RAD_LOGIN_IP_HOST, iph1->mode_cfg->addr4) != 0) {
1567 iph1->mode_cfg->port) != 0)
1711 isakmp_cfg_getconfig(iph1)
1712 struct ph1handle *iph1;
1758 error = isakmp_cfg_send(iph1, buffer,
1866 isakmp_cfg_setenv(iph1, envp, envc)
1867 struct ph1handle *iph1;
1887 if ((iph1->mode_cfg->flags & ISAKMP_CFG_GOT_ADDR4) ||
1889 (iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_EXTERN) ||
1892 (iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_EXTERN) ||
1894 (iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_LOCAL)) {
1895 inet_ntop(AF_INET, &iph1->mode_cfg->addr4,
1905 if (iph1->mode_cfg->xauth.authdata.generic.usr != NULL) {
1907 iph1->mode_cfg->xauth.authdata.generic.usr) != 0) {
1915 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_MASK4)
1916 inet_ntop(AF_INET, &iph1->mode_cfg->mask4,
1937 tmp = ntohl(iph1->mode_cfg->mask4.s_addr);
1948 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_DNS4) {
1950 inet_ntop(AF_INET, &iph1->mode_cfg->dns4[0],
1954 isakmp_cfg_iplist_to_str(addrlist, iph1->mode_cfg->dns4_index,
1955 (void *)iph1->mode_cfg->dns4, 0);
1972 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_WINS4) {
1977 inet_ntop(AF_INET, &iph1->mode_cfg->wins4[0],
1981 isakmp_cfg_iplist_to_str(addrlist, iph1->mode_cfg->wins4_index,
1982 (void *)iph1->mode_cfg->wins4, 0);
2001 if(iph1->mode_cfg->flags & ISAKMP_CFG_GOT_DEFAULT_DOMAIN)
2003 iph1->mode_cfg->default_domain,
2015 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_SPLIT_INCLUDE) {
2017 splitnet_list_2str(iph1->mode_cfg->split_include, NETMASK);
2019 splitnet_list_2str(iph1->mode_cfg->split_include, CIDR);
2041 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_SPLIT_LOCAL) {
2043 splitnet_list_2str(iph1->mode_cfg->split_local, NETMASK);
2045 splitnet_list_2str(iph1->mode_cfg->split_local, CIDR);