Lines Matching refs:iph1
139 isakmp_cfg_r(iph1, msg) in isakmp_cfg_r() argument
140 struct ph1handle *iph1; in isakmp_cfg_r()
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) in isakmp_cfg_attr_r() argument
275 struct ph1handle *iph1; in isakmp_cfg_attr_r()
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) in isakmp_cfg_reply() argument
317 struct ph1handle *iph1; in isakmp_cfg_reply()
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) in isakmp_cfg_request() argument
490 struct ph1handle *iph1; in isakmp_cfg_request()
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) in isakmp_cfg_set() argument
658 struct ph1handle *iph1; in isakmp_cfg_set()
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) in isakmp_cfg_net() argument
778 struct ph1handle *iph1; in isakmp_cfg_net()
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) in isakmp_cfg_copy() argument
942 struct ph1handle *iph1; in isakmp_cfg_copy()
962 isakmp_cfg_short(iph1, attr, value) in isakmp_cfg_short() argument
963 struct ph1handle *iph1; in isakmp_cfg_short()
986 isakmp_cfg_varlen(iph1, attr, string, len) in isakmp_cfg_varlen() argument
987 struct ph1handle *iph1; in isakmp_cfg_varlen()
1012 isakmp_cfg_string(iph1, attr, string) in isakmp_cfg_string() argument
1013 struct ph1handle *iph1; in isakmp_cfg_string()
1018 return isakmp_cfg_varlen(iph1, attr, string, len);
1022 isakmp_cfg_addr4(iph1, attr, addr) in isakmp_cfg_addr4() argument
1023 struct ph1handle *iph1; in isakmp_cfg_addr4()
1047 isakmp_cfg_addr4_list(iph1, attr, addr, nbr) in isakmp_cfg_addr4_list() argument
1048 struct ph1handle *iph1; in isakmp_cfg_addr4_list()
1092 isakmp_cfg_newiv(iph1, msgid) in isakmp_cfg_newiv() argument
1093 struct ph1handle *iph1; in isakmp_cfg_newiv()
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) in isakmp_cfg_send() argument
1116 struct ph1handle *iph1; in isakmp_cfg_send()
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) in isakmp_cfg_rmstate() argument
1295 struct ph1handle *iph1; in isakmp_cfg_rmstate()
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) in isakmp_cfg_getport() argument
1344 struct ph1handle *iph1; in isakmp_cfg_getport()
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) in isakmp_cfg_putport() argument
1381 struct ph1handle *iph1; in isakmp_cfg_putport()
1403 iph1->mode_cfg->flags &= ISAKMP_CFG_PORT_ALLOCATED;
1426 isakmp_cfg_accounting(iph1, inout) in isakmp_cfg_accounting() argument
1427 struct ph1handle *iph1; in isakmp_cfg_accounting()
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) in isakmp_cfg_accounting_radius() argument
1494 struct ph1handle *iph1; in isakmp_cfg_accounting_radius()
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) in isakmp_cfg_getconfig() argument
1712 struct ph1handle *iph1; in isakmp_cfg_getconfig()
1758 error = isakmp_cfg_send(iph1, buffer,
1870 isakmp_cfg_setenv(iph1, envp, envc) in isakmp_cfg_setenv() argument
1871 struct ph1handle *iph1; in isakmp_cfg_setenv()
1891 if ((iph1->mode_cfg->flags & ISAKMP_CFG_GOT_ADDR4) ||
1893 (iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_EXTERN) ||
1896 (iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_EXTERN) ||
1898 (iph1->mode_cfg->flags & ISAKMP_CFG_ADDR4_LOCAL)) {
1899 inet_ntop(AF_INET, &iph1->mode_cfg->addr4,
1909 if (iph1->mode_cfg->xauth.authdata.generic.usr != NULL) {
1911 iph1->mode_cfg->xauth.authdata.generic.usr) != 0) {
1919 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_MASK4)
1920 inet_ntop(AF_INET, &iph1->mode_cfg->mask4,
1941 tmp = ntohl(iph1->mode_cfg->mask4.s_addr);
1952 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_DNS4) {
1954 inet_ntop(AF_INET, &iph1->mode_cfg->dns4[0],
1958 isakmp_cfg_iplist_to_str(addrlist, iph1->mode_cfg->dns4_index,
1959 (void *)iph1->mode_cfg->dns4, 0);
1976 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_WINS4) {
1981 inet_ntop(AF_INET, &iph1->mode_cfg->wins4[0],
1985 isakmp_cfg_iplist_to_str(addrlist, iph1->mode_cfg->wins4_index,
1986 (void *)iph1->mode_cfg->wins4, 0);
2005 if(iph1->mode_cfg->flags & ISAKMP_CFG_GOT_DEFAULT_DOMAIN)
2007 iph1->mode_cfg->default_domain,
2019 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_SPLIT_INCLUDE) {
2021 splitnet_list_2str(iph1->mode_cfg->split_include, NETMASK);
2023 splitnet_list_2str(iph1->mode_cfg->split_include, CIDR);
2045 if (iph1->mode_cfg->flags & ISAKMP_CFG_GOT_SPLIT_LOCAL) {
2047 splitnet_list_2str(iph1->mode_cfg->split_local, NETMASK);
2049 splitnet_list_2str(iph1->mode_cfg->split_local, CIDR);