Lines Matching full:cx
168 if (rad_request_authenticator(r->cx.rad, R, sizeof R) != AUTH_LEN) { in demangle()
178 S = rad_server_secret(r->cx.rad); /* We need the RADIUS secret */ in demangle()
265 r->cx.fd = -1; /* Stop select()ing */ in radius_Process()
266 stype = r->cx.auth ? "auth" : "acct"; in radius_Process()
272 if (!r->cx.auth) { in radius_Process()
273 rad_close(r->cx.rad); in radius_Process()
281 if (!r->cx.auth) { in radius_Process()
282 rad_close(r->cx.rad); in radius_Process()
291 if (r->cx.auth) in radius_Process()
292 auth_Failure(r->cx.auth); in radius_Process()
293 rad_close(r->cx.rad); in radius_Process()
305 if (r->cx.auth) in radius_Process()
306 auth_Failure(r->cx.auth); /* unexpected !!! */ in radius_Process()
309 rad_close(r->cx.rad); in radius_Process()
314 "radius(%s): %s\n", stype, rad_strerror(r->cx.rad)); in radius_Process()
315 if (r->cx.auth) in radius_Process()
316 auth_Failure(r->cx.auth); in radius_Process()
317 rad_close(r->cx.rad); in radius_Process()
322 got, rad_strerror(r->cx.rad)); in radius_Process()
323 if (r->cx.auth) in radius_Process()
324 auth_Failure(r->cx.auth); in radius_Process()
325 rad_close(r->cx.rad); in radius_Process()
333 while ((res = rad_get_attr(r->cx.rad, &data, &len)) > 0) { in radius_Process()
344 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad)); in radius_Process()
345 auth_Failure(r->cx.auth); in radius_Process()
346 rad_close(r->cx.rad); in radius_Process()
393 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad)); in radius_Process()
394 auth_Failure(r->cx.auth); in radius_Process()
395 rad_close(r->cx.rad); in radius_Process()
401 bundle = r->cx.auth->physical->dl->bundle; in radius_Process()
445 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad)); in radius_Process()
446 auth_Failure(r->cx.auth); in radius_Process()
447 rad_close(r->cx.rad); in radius_Process()
460 auth_Failure(r->cx.auth); in radius_Process()
461 rad_close(r->cx.rad); in radius_Process()
478 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad)); in radius_Process()
479 auth_Failure(r->cx.auth); in radius_Process()
480 rad_close(r->cx.rad); in radius_Process()
486 bundle = r->cx.auth->physical->dl->bundle; in radius_Process()
524 rad_strerror(r->cx.rad)); in radius_Process()
525 auth_Failure(r->cx.auth); in radius_Process()
526 rad_close(r->cx.rad); in radius_Process()
552 rad_strerror(r->cx.rad)); in radius_Process()
553 auth_Failure(r->cx.auth); in radius_Process()
554 rad_close(r->cx.rad); in radius_Process()
580 rad_strerror(r->cx.rad)); in radius_Process()
581 auth_Failure(r->cx.auth); in radius_Process()
582 rad_close(r->cx.rad); in radius_Process()
640 rad_strerror(r->cx.rad)); in radius_Process()
641 auth_Failure(r->cx.auth); in radius_Process()
643 auth_Failure(r->cx.auth); in radius_Process()
646 auth_Success(r->cx.auth); in radius_Process()
648 rad_close(r->cx.rad); in radius_Process()
660 timer_Stop(&r->cx.timer); in radius_Continue()
661 if ((got = rad_continue_send_request(r->cx.rad, sel, &r->cx.fd, &tv)) == 0) { in radius_Continue()
664 r->cx.timer.load = tv.tv_usec / TICKUNIT + tv.tv_sec * SECTICKS; in radius_Continue()
665 timer_Start(&r->cx.timer); in radius_Continue()
700 while (r->cx.fd != -1) { in radius_Flush()
702 FD_SET(r->cx.fd, &s); in radius_Flush()
705 select(r->cx.fd + 1, &s, NULL, NULL, &tv); in radius_Flush()
719 if (r && rad->cx.fd != -1) { in radius_UpdateSet()
720 FD_SET(rad->cx.fd, r); in radius_UpdateSet()
721 if (*n < rad->cx.fd + 1) in radius_UpdateSet()
722 *n = rad->cx.fd + 1; in radius_UpdateSet()
723 log_Printf(LogTIMER, "Radius: fdset(r) %d\n", rad->cx.fd); in radius_UpdateSet()
738 return r && r->cx.fd != -1 && FD_ISSET(r->cx.fd, fdset); in radius_IsSet()
764 r->cx.fd = -1; in radius_Init()
765 r->cx.rad = NULL; in radius_Init()
766 memset(&r->cx.timer, '\0', sizeof r->cx.timer); in radius_Init()
767 r->cx.auth = NULL; in radius_Init()
799 timer_Stop(&r->cx.timer); in radius_Destroy()
822 if (r->cx.fd != -1) { in radius_Destroy()
823 r->cx.fd = -1; in radius_Destroy()
824 rad_close(r->cx.rad); in radius_Destroy()
857 if (rad_put_int(rad->cx.rad, RAD_NAS_PORT_TYPE, type) != 0) { in radius_put_physical_details()
858 log_Printf(LogERROR, "rad_put: rad_put_int: %s\n", rad_strerror(rad->cx.rad)); in radius_put_physical_details()
859 rad_close(rad->cx.rad); in radius_put_physical_details()
880 if (rad_put_int(rad->cx.rad, RAD_NAS_PORT, slot) != 0) { in radius_put_physical_details()
881 log_Printf(LogERROR, "rad_put: rad_put_int: %s\n", rad_strerror(rad->cx.rad)); in radius_put_physical_details()
882 rad_close(rad->cx.rad); in radius_put_physical_details()
913 if (r->cx.fd != -1) in radius_Authenticate()
922 if ((r->cx.rad = rad_auth_open()) == NULL) { in radius_Authenticate()
927 if (rad_config(r->cx.rad, r->cfg.file) != 0) { in radius_Authenticate()
928 log_Printf(LogERROR, "rad_config: %s\n", rad_strerror(r->cx.rad)); in radius_Authenticate()
929 rad_close(r->cx.rad); in radius_Authenticate()
933 if (rad_create_request(r->cx.rad, RAD_ACCESS_REQUEST) != 0) { in radius_Authenticate()
934 log_Printf(LogERROR, "rad_create_request: %s\n", rad_strerror(r->cx.rad)); in radius_Authenticate()
935 rad_close(r->cx.rad); in radius_Authenticate()
939 if (rad_put_string(r->cx.rad, RAD_USER_NAME, name) != 0 || in radius_Authenticate()
940 rad_put_int(r->cx.rad, RAD_SERVICE_TYPE, RAD_FRAMED) != 0 || in radius_Authenticate()
941 rad_put_int(r->cx.rad, RAD_FRAMED_PROTOCOL, RAD_PPP) != 0) { in radius_Authenticate()
942 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad)); in radius_Authenticate()
943 rad_close(r->cx.rad); in radius_Authenticate()
950 if (rad_put_attr(r->cx.rad, RAD_USER_PASSWORD, key, klen) != 0) { in radius_Authenticate()
952 rad_strerror(r->cx.rad)); in radius_Authenticate()
953 rad_close(r->cx.rad); in radius_Authenticate()
962 if (rad_put_attr(r->cx.rad, RAD_CHAP_PASSWORD, key, klen) != 0 || in radius_Authenticate()
963 rad_put_attr(r->cx.rad, RAD_CHAP_CHALLENGE, nchallenge, nclen) != 0) { in radius_Authenticate()
965 rad_strerror(r->cx.rad)); in radius_Authenticate()
966 rad_close(r->cx.rad); in radius_Authenticate()
976 rad_close(r->cx.rad); in radius_Authenticate()
980 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT, in radius_Authenticate()
986 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT, in radius_Authenticate()
995 rad_close(r->cx.rad); in radius_Authenticate()
1000 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT, in radius_Authenticate()
1008 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT, in radius_Authenticate()
1017 rad_close(r->cx.rad); in radius_Authenticate()
1028 if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) { in radius_Authenticate()
1030 rad_strerror(r->cx.rad)); in radius_Authenticate()
1031 rad_close(r->cx.rad); in radius_Authenticate()
1036 rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) { in radius_Authenticate()
1038 rad_strerror(r->cx.rad)); in radius_Authenticate()
1039 rad_close(r->cx.rad); in radius_Authenticate()
1045 rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) { in radius_Authenticate()
1046 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad)); in radius_Authenticate()
1047 rad_close(r->cx.rad); in radius_Authenticate()
1055 r->cx.auth = authp; in radius_Authenticate()
1056 if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv))) in radius_Authenticate()
1062 r->cx.timer.load = tv.tv_usec / TICKUNIT + tv.tv_sec * SECTICKS; in radius_Authenticate()
1063 r->cx.timer.func = radius_Timeout; in radius_Authenticate()
1064 r->cx.timer.name = "radius auth"; in radius_Authenticate()
1065 r->cx.timer.arg = r; in radius_Authenticate()
1066 timer_Start(&r->cx.timer); in radius_Authenticate()
1109 if (r->cx.fd != -1) in radius_Account()
1116 timer_Stop(&r->cx.timer); in radius_Account()
1118 if ((r->cx.rad = rad_acct_open()) == NULL) { in radius_Account()
1123 if (rad_config(r->cx.rad, r->cfg.file) != 0) { in radius_Account()
1124 log_Printf(LogERROR, "rad_config: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1125 rad_close(r->cx.rad); in radius_Account()
1129 if (rad_create_request(r->cx.rad, RAD_ACCOUNTING_REQUEST) != 0) { in radius_Account()
1130 log_Printf(LogERROR, "rad_create_request: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1131 rad_close(r->cx.rad); in radius_Account()
1155 if (rad_put_string(r->cx.rad, RAD_USER_NAME, ac->user_name) != 0 || in radius_Account()
1156 rad_put_int(r->cx.rad, RAD_SERVICE_TYPE, RAD_FRAMED) != 0 || in radius_Account()
1157 rad_put_int(r->cx.rad, RAD_FRAMED_PROTOCOL, RAD_PPP) != 0) { in radius_Account()
1158 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1159 rad_close(r->cx.rad); in radius_Account()
1164 if (rad_put_addr(r->cx.rad, RAD_FRAMED_IP_ADDRESS, in radius_Account()
1166 rad_put_addr(r->cx.rad, RAD_FRAMED_IP_NETMASK, in radius_Account()
1168 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1169 rad_close(r->cx.rad); in radius_Account()
1175 if (rad_put_attr(r->cx.rad, RAD_FRAMED_INTERFACE_ID, ac->peer.ipv6.ifid, in radius_Account()
1177 log_Printf(LogERROR, "rad_put_attr: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1178 rad_close(r->cx.rad); in radius_Account()
1186 if (rad_put_attr(r->cx.rad, RAD_FRAMED_IPV6_PREFIX, r->ipv6prefix, in radius_Account()
1188 log_Printf(LogERROR, "rad_put_attr: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1189 rad_close(r->cx.rad); in radius_Account()
1201 rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) { in radius_Account()
1202 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1203 rad_close(r->cx.rad); in radius_Account()
1213 if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) { in radius_Account()
1215 rad_strerror(r->cx.rad)); in radius_Account()
1216 rad_close(r->cx.rad); in radius_Account()
1221 rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) { in radius_Account()
1223 rad_strerror(r->cx.rad)); in radius_Account()
1224 rad_close(r->cx.rad); in radius_Account()
1231 if (rad_put_int(r->cx.rad, RAD_ACCT_STATUS_TYPE, acct_type) != 0 || in radius_Account()
1232 rad_put_string(r->cx.rad, RAD_ACCT_SESSION_ID, ac->session_id) != 0 || in radius_Account()
1233 rad_put_string(r->cx.rad, RAD_ACCT_MULTI_SESSION_ID, in radius_Account()
1235 rad_put_int(r->cx.rad, RAD_ACCT_DELAY_TIME, 0) != 0) { in radius_Account()
1237 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1238 rad_close(r->cx.rad); in radius_Account()
1244 if (rad_put_int(r->cx.rad, RAD_ACCT_INPUT_OCTETS, stats->OctetsIn % UINT32_MAX) != 0 || in radius_Account()
1245 rad_put_int(r->cx.rad, RAD_ACCT_INPUT_GIGAWORDS, stats->OctetsIn / UINT32_MAX) != 0 || in radius_Account()
1246 rad_put_int(r->cx.rad, RAD_ACCT_INPUT_PACKETS, stats->PacketsIn) != 0 || in radius_Account()
1247 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_OCTETS, stats->OctetsOut % UINT32_MAX) != 0 || in radius_Account()
1248 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_GIGAWORDS, stats->OctetsOut / UINT32_MAX) != 0 || in radius_Account()
1249 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_PACKETS, stats->PacketsOut) in radius_Account()
1251 rad_put_int(r->cx.rad, RAD_ACCT_SESSION_TIME, throughput_uptime(stats)) in radius_Account()
1253 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad)); in radius_Account()
1254 rad_close(r->cx.rad); in radius_Account()
1283 r->cx.auth = NULL; /* Not valid for accounting requests */ in radius_Account()
1284 if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv))) in radius_Account()
1288 r->cx.timer.load = tv.tv_usec / TICKUNIT + tv.tv_sec * SECTICKS; in radius_Account()
1289 r->cx.timer.func = radius_Timeout; in radius_Account()
1290 r->cx.timer.name = "radius acct"; in radius_Account()
1291 r->cx.timer.arg = r; in radius_Account()
1292 timer_Start(&r->cx.timer); in radius_Account()