Home | History | Annotate | Download | only in src

Lines Matching refs:rad

168   if (rad_request_authenticator(r->cx.rad, R, sizeof R) != AUTH_LEN) {
178 S = rad_server_secret(r->cx.rad); /* We need the RADIUS secret */
273 rad_close(r->cx.rad);
282 rad_close(r->cx.rad);
293 rad_close(r->cx.rad);
309 rad_close(r->cx.rad);
314 "radius(%s): %s\n", stype, rad_strerror(r->cx.rad));
317 rad_close(r->cx.rad);
322 got, rad_strerror(r->cx.rad));
325 rad_close(r->cx.rad);
333 while ((res = rad_get_attr(r->cx.rad, &data, &len)) > 0) {
344 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
346 rad_close(r->cx.rad);
393 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
395 rad_close(r->cx.rad);
445 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
447 rad_close(r->cx.rad);
461 rad_close(r->cx.rad);
478 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
480 rad_close(r->cx.rad);
524 rad_strerror(r->cx.rad));
526 rad_close(r->cx.rad);
552 rad));
554 rad_close(r->cx.rad);
580 rad_strerror(r->cx.rad));
582 rad_close(r->cx.rad);
640 rad_strerror(r->cx.rad));
648 rad_close(r->cx.rad);
661 if ((got = rad_continue_send_request(r->cx.rad, sel, &r->cx.fd, &tv)) == 0) {
717 struct radius *rad = descriptor2radius(d);
719 if (r && rad->cx.fd != -1) {
720 FD_SET(rad->cx.fd, r);
721 if (*n < rad->cx.fd + 1)
722 *n = rad->cx.fd + 1;
723 log_Printf(LogTIMER, "Radius: fdset(r) %d\n", rad->cx.fd);
765 r->cx.rad = NULL;
824 rad_close(r->cx.rad);
829 radius_put_physical_details(struct radius *rad, struct physical *p)
857 if (rad_put_int(rad->cx.rad, RAD_NAS_PORT_TYPE, type) != 0) {
858 log_Printf(LogERROR, "rad_put: rad_put_int: %s\n", rad_strerror(rad->cx.rad));
859 rad_close(rad->cx.rad);
863 switch (rad->port_id_type) {
880 if (rad_put_int(rad->cx.rad, RAD_NAS_PORT, slot) != 0) {
881 log_Printf(LogERROR, "rad_put: rad_put_int: %s\n", rad_strerror(rad->cx.rad));
882 rad_close(rad->cx.rad);
922 if ((r->cx.rad = rad_auth_open()) == NULL) {
927 if (rad_config(r->cx.rad, r->cfg.file) != 0) {
928 log_Printf(LogERROR, "rad_config: %s\n", rad_strerror(r->cx.rad));
929 rad_close(r->cx.rad);
933 if (rad_create_request(r->cx.rad, RAD_ACCESS_REQUEST) != 0) {
934 log_Printf(LogERROR, "rad_create_request: %s\n", rad_strerror(r->cx.rad));
935 rad_close(r->cx.rad);
939 if (rad_put_string(r->cx.rad, RAD_USER_NAME, name) != 0 ||
940 rad_put_int(r->cx.rad, RAD_SERVICE_TYPE, RAD_FRAMED) != 0 ||
941 rad_put_int(r->cx.rad, RAD_FRAMED_PROTOCOL, RAD_PPP) != 0) {
942 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
943 rad_close(r->cx.rad);
950 if (rad_put_attr(r->cx.rad, RAD_USER_PASSWORD, key, klen) != 0) {
952 rad_strerror(r->cx.rad));
953 rad_close(r->cx.rad);
962 if (rad_put_attr(r->cx.rad, RAD_CHAP_PASSWORD, key, klen) != 0 ||
963 rad_put_attr(r->cx.rad, RAD_CHAP_CHALLENGE, nchallenge, nclen) != 0) {
965 rad_strerror(r->cx.rad));
966 rad_close(r->cx.rad);
976 rad_close(r->cx.rad);
980 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
986 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
995 rad_close(r->cx.rad);
1000 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
1008 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
1017 rad_close(r->cx.rad);
1028 if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) {
1030 rad_strerror(r->cx.rad));
1031 rad_close(r->cx.rad);
1036 rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) {
1038 rad_strerror(r->cx.rad));
1039 rad_close(r->cx.rad);
1045 rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) {
1046 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1047 rad_close(r->cx.rad);
1056 if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv)))
1118 if ((r->cx.rad = rad_acct_open()) == NULL) {
1123 if (rad_config(r->cx.rad, r->cfg.file) != 0) {
1124 log_Printf(LogERROR, "rad_config: %s\n", rad_strerror(r->cx.rad));
1125 rad_close(r->cx.rad);
1129 if (rad_create_request(r->cx.rad, RAD_ACCOUNTING_REQUEST) != 0) {
1130 log_Printf(LogERROR, "rad_create_request: %s\n", rad_strerror(r->cx.rad));
1131 rad_close(r->cx.rad);
1155 if (rad_put_string(r->cx.rad, RAD_USER_NAME, ac->user_name) != 0 ||
1156 rad_put_int(r->cx.rad, RAD_SERVICE_TYPE, RAD_FRAMED) != 0 ||
1157 rad_put_int(r->cx.rad, RAD_FRAMED_PROTOCOL, RAD_PPP) != 0) {
1158 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1159 rad_close(r->cx.rad);
1164 if (rad_put_addr(r->cx.rad, RAD_FRAMED_IP_ADDRESS,
1166 rad_put_addr(r->cx.rad, RAD_FRAMED_IP_NETMASK,
1168 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1169 rad_close(r->cx.rad);
1175 if (rad_put_attr(r->cx.rad, RAD_FRAMED_INTERFACE_ID, ac->peer.ipv6.ifid,
1177 log_Printf(LogERROR, "rad_put_attr: %s\n", rad_strerror(r->cx.rad));
1178 rad_close(r->cx.rad);
1186 if (rad_put_attr(r->cx.rad, RAD_FRAMED_IPV6_PREFIX, r->ipv6prefix,
1188 log_Printf(LogERROR, "rad_put_attr: %s\n", rad_strerror(r->cx.rad));
1189 rad_close(r->cx.rad);
1201 rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) {
1202 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1203 rad_close(r->cx.rad);
1213 if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) {
1215 rad_strerror(r->cx.rad));
1216 rad_close(r->cx.rad);
1221 rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) {
1223 rad_strerror(r->cx.rad));
1224 rad_close(r->cx.rad);
1231 if (rad_put_int(r->cx.rad, RAD_ACCT_STATUS_TYPE, acct_type) != 0 ||
1232 rad_put_string(r->cx.rad, RAD_ACCT_SESSION_ID, ac->session_id) != 0 ||
1233 rad_put_string(r->cx.rad, RAD_ACCT_MULTI_SESSION_ID,
1235 rad_put_int(r->cx.rad, RAD_ACCT_DELAY_TIME, 0) != 0) {
1237 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1238 rad_close(r->cx.rad);
1244 if (rad_put_int(r->cx.rad, RAD_ACCT_INPUT_OCTETS, stats->OctetsIn % UINT32_MAX) != 0 ||
1245 rad_put_int(r->cx.rad, RAD_ACCT_INPUT_GIGAWORDS, stats->OctetsIn / UINT32_MAX) != 0 ||
1246 rad_put_int(r->cx.rad, RAD_ACCT_INPUT_PACKETS, stats->PacketsIn) != 0 ||
1247 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_OCTETS, stats->OctetsOut % UINT32_MAX) != 0 ||
1248 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_GIGAWORDS, stats->OctetsOut / UINT32_MAX) != 0 ||
1249 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_PACKETS, stats->PacketsOut)
1251 rad_put_int(r->cx.rad, RAD_ACCT_SESSION_TIME, throughput_uptime(stats))
1253 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1254 rad_close(r->cx.rad);
1284 if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv)))