Lines Matching refs:rad

170   if (rad_request_authenticator(r->cx.rad, R, sizeof R) != AUTH_LEN) {
180 S = rad_server_secret(r->cx.rad); /* We need the RADIUS secret */
275 rad_close(r->cx.rad);
284 rad_close(r->cx.rad);
295 rad_close(r->cx.rad);
311 rad_close(r->cx.rad);
316 "radius(%s): %s\n", stype, rad_strerror(r->cx.rad));
319 rad_close(r->cx.rad);
324 got, rad_strerror(r->cx.rad));
327 rad_close(r->cx.rad);
335 while ((res = rad_get_attr(r->cx.rad, &data, &len)) > 0) {
346 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
348 rad_close(r->cx.rad);
395 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
397 rad_close(r->cx.rad);
447 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
449 rad_close(r->cx.rad);
463 rad_close(r->cx.rad);
480 log_Printf(LogERROR, "rad_cvt_string: %s\n", rad_strerror(r->cx.rad));
482 rad_close(r->cx.rad);
526 rad_strerror(r->cx.rad));
528 rad_close(r->cx.rad);
554 rad_strerror(r->cx.rad));
556 rad_close(r->cx.rad);
582 rad_strerror(r->cx.rad));
584 rad_close(r->cx.rad);
642 rad_strerror(r->cx.rad));
650 rad_close(r->cx.rad);
663 if ((got = rad_continue_send_request(r->cx.rad, sel, &r->cx.fd, &tv)) == 0) {
719 struct radius *rad = descriptor2radius(d);
721 if (r && rad->cx.fd != -1) {
722 FD_SET(rad->cx.fd, r);
723 if (*n < rad->cx.fd + 1)
724 *n = rad->cx.fd + 1;
725 log_Printf(LogTIMER, "Radius: fdset(r) %d\n", rad->cx.fd);
767 r->cx.rad = NULL;
826 rad_close(r->cx.rad);
831 radius_put_physical_details(struct radius *rad, struct physical *p)
859 if (rad_put_int(rad->cx.rad, RAD_NAS_PORT_TYPE, type) != 0) {
860 log_Printf(LogERROR, "rad_put: rad_put_int: %s\n", rad_strerror(rad->cx.rad));
861 rad_close(rad->cx.rad);
865 switch (rad->port_id_type) {
882 if (rad_put_int(rad->cx.rad, RAD_NAS_PORT, slot) != 0) {
883 log_Printf(LogERROR, "rad_put: rad_put_int: %s\n", rad_strerror(rad->cx.rad));
884 rad_close(rad->cx.rad);
924 if ((r->cx.rad = rad_auth_open()) == NULL) {
929 if (rad_config(r->cx.rad, r->cfg.file) != 0) {
930 log_Printf(LogERROR, "rad_config: %s\n", rad_strerror(r->cx.rad));
931 rad_close(r->cx.rad);
935 if (rad_create_request(r->cx.rad, RAD_ACCESS_REQUEST) != 0) {
936 log_Printf(LogERROR, "rad_create_request: %s\n", rad_strerror(r->cx.rad));
937 rad_close(r->cx.rad);
941 if (rad_put_string(r->cx.rad, RAD_USER_NAME, name) != 0 ||
942 rad_put_int(r->cx.rad, RAD_SERVICE_TYPE, RAD_FRAMED) != 0 ||
943 rad_put_int(r->cx.rad, RAD_FRAMED_PROTOCOL, RAD_PPP) != 0) {
944 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
945 rad_close(r->cx.rad);
952 if (rad_put_attr(r->cx.rad, RAD_USER_PASSWORD, key, klen) != 0) {
954 rad_strerror(r->cx.rad));
955 rad_close(r->cx.rad);
964 if (rad_put_attr(r->cx.rad, RAD_CHAP_PASSWORD, key, klen) != 0 ||
965 rad_put_attr(r->cx.rad, RAD_CHAP_CHALLENGE, nchallenge, nclen) != 0) {
967 rad_strerror(r->cx.rad));
968 rad_close(r->cx.rad);
978 rad_close(r->cx.rad);
982 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
988 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
997 rad_close(r->cx.rad);
1002 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
1010 rad_put_vendor_attr(r->cx.rad, RAD_VENDOR_MICROSOFT,
1019 rad_close(r->cx.rad);
1030 if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) {
1032 rad_strerror(r->cx.rad));
1033 rad_close(r->cx.rad);
1038 rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) {
1040 rad_strerror(r->cx.rad));
1041 rad_close(r->cx.rad);
1047 rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) {
1048 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1049 rad_close(r->cx.rad);
1058 if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv)))
1120 if ((r->cx.rad = rad_acct_open()) == NULL) {
1125 if (rad_config(r->cx.rad, r->cfg.file) != 0) {
1126 log_Printf(LogERROR, "rad_config: %s\n", rad_strerror(r->cx.rad));
1127 rad_close(r->cx.rad);
1131 if (rad_create_request(r->cx.rad, RAD_ACCOUNTING_REQUEST) != 0) {
1132 log_Printf(LogERROR, "rad_create_request: %s\n", rad_strerror(r->cx.rad));
1133 rad_close(r->cx.rad);
1157 if (rad_put_string(r->cx.rad, RAD_USER_NAME, ac->user_name) != 0 ||
1158 rad_put_int(r->cx.rad, RAD_SERVICE_TYPE, RAD_FRAMED) != 0 ||
1159 rad_put_int(r->cx.rad, RAD_FRAMED_PROTOCOL, RAD_PPP) != 0) {
1160 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1161 rad_close(r->cx.rad);
1166 if (rad_put_addr(r->cx.rad, RAD_FRAMED_IP_ADDRESS,
1168 rad_put_addr(r->cx.rad, RAD_FRAMED_IP_NETMASK,
1170 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1171 rad_close(r->cx.rad);
1177 if (rad_put_attr(r->cx.rad, RAD_FRAMED_INTERFACE_ID, ac->peer.ipv6.ifid,
1179 log_Printf(LogERROR, "rad_put_attr: %s\n", rad_strerror(r->cx.rad));
1180 rad_close(r->cx.rad);
1188 if (rad_put_attr(r->cx.rad, RAD_FRAMED_IPV6_PREFIX, r->ipv6prefix,
1190 log_Printf(LogERROR, "rad_put_attr: %s\n", rad_strerror(r->cx.rad));
1191 rad_close(r->cx.rad);
1203 rad_put_string(r->cx.rad, RAD_CALLING_STATION_ID, mac_addr) != 0) {
1204 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1205 rad_close(r->cx.rad);
1215 if (rad_put_addr(r->cx.rad, RAD_NAS_IP_ADDRESS, hostaddr) != 0) {
1217 rad_strerror(r->cx.rad));
1218 rad_close(r->cx.rad);
1223 rad_put_string(r->cx.rad, RAD_NAS_IDENTIFIER, hostname) != 0) {
1225 rad_strerror(r->cx.rad));
1226 rad_close(r->cx.rad);
1233 if (rad_put_int(r->cx.rad, RAD_ACCT_STATUS_TYPE, acct_type) != 0 ||
1234 rad_put_string(r->cx.rad, RAD_ACCT_SESSION_ID, ac->session_id) != 0 ||
1235 rad_put_string(r->cx.rad, RAD_ACCT_MULTI_SESSION_ID,
1237 rad_put_int(r->cx.rad, RAD_ACCT_DELAY_TIME, 0) != 0) {
1239 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1240 rad_close(r->cx.rad);
1246 if (rad_put_int(r->cx.rad, RAD_ACCT_INPUT_OCTETS, stats->OctetsIn % UINT32_MAX) != 0 ||
1247 rad_put_int(r->cx.rad, RAD_ACCT_INPUT_GIGAWORDS, stats->OctetsIn / UINT32_MAX) != 0 ||
1248 rad_put_int(r->cx.rad, RAD_ACCT_INPUT_PACKETS, stats->PacketsIn) != 0 ||
1249 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_OCTETS, stats->OctetsOut % UINT32_MAX) != 0 ||
1250 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_GIGAWORDS, stats->OctetsOut / UINT32_MAX) != 0 ||
1251 rad_put_int(r->cx.rad, RAD_ACCT_OUTPUT_PACKETS, stats->PacketsOut)
1253 rad_put_int(r->cx.rad, RAD_ACCT_SESSION_TIME, throughput_uptime(stats))
1255 log_Printf(LogERROR, "rad_put: %s\n", rad_strerror(r->cx.rad));
1256 rad_close(r->cx.rad);
1286 if ((got = rad_init_send_request(r->cx.rad, &r->cx.fd, &tv)))