Changeset 974:2091bf698fb1 in freeDiameter for extensions/app_radgw
- Timestamp:
- Mar 15, 2013, 2:14:35 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/app_radgw
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/radius.c
r972 r974 320 320 auth = &(msg->radius.hdr->authenticator[0]); 321 321 322 fd_log_debug("------ RADIUS msg dump ------- \n");323 fd_log_debug(" id : 0x%02hhx, code : %hhd (%s), length : %d \n", msg->radius.hdr->identifier, msg->radius.hdr->code, rgw_msg_code_str(msg->radius.hdr->code), ntohs(msg->radius.hdr->length));324 fd_log_debug(" auth: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx \n",322 fd_log_debug("------ RADIUS msg dump -------"); 323 fd_log_debug(" id : 0x%02hhx, code : %hhd (%s), length : %d", msg->radius.hdr->identifier, msg->radius.hdr->code, rgw_msg_code_str(msg->radius.hdr->code), ntohs(msg->radius.hdr->length)); 324 fd_log_debug(" auth: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx", 325 325 auth[0], auth[1], auth[2], auth[3], auth[4], auth[5], auth[6], auth[7]); 326 fd_log_debug(" %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx \n",326 fd_log_debug(" %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx", 327 327 auth[8], auth[9], auth[10], auth[11], auth[12], auth[13], auth[14], auth[15]); 328 328 for (i = 0; i < msg->radius.attr_used; i++) { … … 332 332 } 333 333 if (has_meta && msg->ps_nb) { 334 fd_log_debug("---- hidden attributes: \n");334 fd_log_debug("---- hidden attributes:"); 335 335 for (i = msg->ps_first; i < msg->ps_first + msg->ps_nb; i++) { 336 336 struct radius_attr_hdr *attr = (struct radius_attr_hdr *)(msg->radius.buf + msg->radius.attr_pos[i]); … … 339 339 } 340 340 } 341 fd_log_debug("----------------------------- \n");341 fd_log_debug("-----------------------------"); 342 342 } 343 343 … … 527 527 msg_len = ntohs(hdr->length); 528 528 if (msg_len < sizeof(*hdr) || msg_len > len) { 529 TRACE_DEBUG(INFO, "Invalid RADIUS message length \n");529 TRACE_DEBUG(INFO, "Invalid RADIUS message length"); 530 530 return EINVAL; 531 531 } 532 532 533 533 if (msg_len < len) { 534 TRACE_DEBUG(INFO, "Ignored %lu extra bytes after RADIUS message \n",534 TRACE_DEBUG(INFO, "Ignored %lu extra bytes after RADIUS message", 535 535 (unsigned long) len - msg_len); 536 536 } -
extensions/app_radgw/rgw_clients.c
r965 r974 983 983 984 984 if (!FD_IS_LIST_EMPTY(&cli_ip)) 985 fd_log_debug(" RADIUS IP clients list: \n");985 fd_log_debug(" RADIUS IP clients list:"); 986 986 dump_cli_list(&cli_ip); 987 987 988 988 if (!FD_IS_LIST_EMPTY(&cli_ip6)) 989 fd_log_debug(" RADIUS IPv6 clients list: \n");989 fd_log_debug(" RADIUS IPv6 clients list:"); 990 990 dump_cli_list(&cli_ip6); 991 991 -
extensions/app_radgw/rgw_conf.l
r741 r974 89 89 yylval->string = strdup(yytext+1); 90 90 if (yylval->string == NULL) { 91 fd_log_debug("Unable to allocate memory: %s \n", strerror(errno));91 fd_log_debug("Unable to allocate memory: %s", strerror(errno)); 92 92 return LEX_ERROR; /* trig an error in yacc parser */ 93 93 } … … 111 111 if (ret != 1) { 112 112 /* No matching: an error occurred */ 113 fd_log_debug("Unable to convert the value '%s' to a valid number: %s \n", yytext, strerror(errno));113 fd_log_debug("Unable to convert the value '%s' to a valid number: %s", yytext, strerror(errno)); 114 114 return LEX_ERROR; /* trig an error in yacc parser */ 115 115 /* Maybe we could REJECT instead of failing here? */ … … 133 133 work = strdup(yytext); 134 134 if ( work == NULL ) { 135 fd_log_debug("Unable to allocate memory: %s \n", strerror(errno));135 fd_log_debug("Unable to allocate memory: %s", strerror(errno)); 136 136 return LEX_ERROR; /* trig an error in yacc parser */ 137 137 } … … 141 141 port++; 142 142 if (sscanf(port, "%hu]", &p) != 1) { 143 fd_log_debug("'%s' is not a valid port: %s \n", port, strerror(errno));143 fd_log_debug("'%s' is not a valid port: %s", port, strerror(errno)); 144 144 free(work); 145 145 return LEX_ERROR; /* trig an error in yacc parser */ … … 153 153 sin6 = malloc(sizeof(struct sockaddr_in6)); 154 154 if (sin6 == NULL) { 155 fd_log_debug("Unable to allocate memory: %s \n", strerror(errno));155 fd_log_debug("Unable to allocate memory: %s", strerror(errno)); 156 156 free(work); 157 157 return LEX_ERROR; /* trig an error in yacc parser */ … … 161 161 sin6->sin6_family = AF_INET6; 162 162 if (inet_pton(AF_INET6, work, &sin6->sin6_addr) != 1) { 163 fd_log_debug("'%s' is not a valid IPv6 address: %s \n", work, strerror(errno));163 fd_log_debug("'%s' is not a valid IPv6 address: %s", work, strerror(errno)); 164 164 free(work); 165 165 free(sin6); … … 173 173 sin = malloc(sizeof(struct sockaddr_in)); 174 174 if (sin == NULL) { 175 fd_log_debug("Unable to allocate memory: %s \n", strerror(errno));175 fd_log_debug("Unable to allocate memory: %s", strerror(errno)); 176 176 free(work); 177 177 return LEX_ERROR; /* trig an error in yacc parser */ … … 181 181 sin->sin_family = AF_INET; 182 182 if (inet_pton(AF_INET, work, &sin->sin_addr) != 1) { 183 fd_log_debug("'%s' is not a valid IP address: %s \n", work, strerror(errno));183 fd_log_debug("'%s' is not a valid IP address: %s", work, strerror(errno)); 184 184 free(work); 185 185 free(sin); … … 213 213 if (ret != 1) { 214 214 /* No matching: an error occurred */ 215 fd_log_debug("Unable to convert the value '%s' to a valid number: %s \n", yytext, strerror(errno));215 fd_log_debug("Unable to convert the value '%s' to a valid number: %s", yytext, strerror(errno)); 216 216 return LEX_ERROR; /* trig an error in yacc parser */ 217 217 /* Maybe we could REJECT instead of failing here? */ … … 227 227 sin = malloc(sizeof(struct sockaddr_in)); 228 228 if (sin == NULL) { 229 fd_log_debug("Unable to allocate memory: %s \n", strerror(errno));229 fd_log_debug("Unable to allocate memory: %s", strerror(errno)); 230 230 return LEX_ERROR; /* trig an error in yacc parser */ 231 231 } … … 234 234 sin->sin_family = AF_INET; 235 235 if (inet_pton(AF_INET, yytext, &sin->sin_addr) != 1) { 236 fd_log_debug("'%s' is not a valid IP address: %s \n", yytext, strerror(errno));236 fd_log_debug("'%s' is not a valid IP address: %s", yytext, strerror(errno)); 237 237 free(sin); 238 238 return LEX_ERROR; /* trig an error in yacc parser */ … … 247 247 sin6 = malloc(sizeof(struct sockaddr_in6)); 248 248 if (sin6 == NULL) { 249 fd_log_debug("Unable to allocate memory: %s \n", strerror(errno));249 fd_log_debug("Unable to allocate memory: %s", strerror(errno)); 250 250 return LEX_ERROR; /* trig an error in yacc parser */ 251 251 } … … 254 254 sin6->sin6_family = AF_INET6; 255 255 if (inet_pton(AF_INET6, yytext, &sin6->sin6_addr) != 1) { 256 fd_log_debug("'%s' is not a valid IPv6 address: %s \n", yytext, strerror(errno));256 fd_log_debug("'%s' is not a valid IPv6 address: %s", yytext, strerror(errno)); 257 257 free(sin6); 258 258 return LEX_ERROR; /* trig an error in yacc parser */ … … 271 271 /* Unrecognized character */ 272 272 <*>. { 273 fd_log_debug("Unrecognized text on line %d col %d: '%s'. \n", yylloc->first_line, yylloc->first_column, yytext);273 fd_log_debug("Unrecognized text on line %d col %d: '%s'.", yylloc->first_line, yylloc->first_column, yytext); 274 274 return LEX_ERROR; 275 275 } -
extensions/app_radgw/rgw_conf.y
r741 r974 69 69 if (rgw_confin == NULL) { 70 70 ret = errno; 71 fd_log_debug("Unable to open extension configuration file %s for reading: %s \n", conffile, strerror(ret));71 fd_log_debug("Unable to open extension configuration file %s for reading: %s", conffile, strerror(ret)); 72 72 return ret; 73 73 } … … 91 91 { 92 92 if (ploc->first_line != ploc->last_line) 93 fd_log_debug("%s:%d.%d-%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s);93 fd_log_debug("%s:%d.%d-%d.%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s); 94 94 else if (ploc->first_column != ploc->last_column) 95 fd_log_debug("%s:%d.%d-%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s);95 fd_log_debug("%s:%d.%d-%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s); 96 96 else 97 fd_log_debug("%s:%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, s);97 fd_log_debug("%s:%d.%d : %s", conffile, ploc->first_line, ploc->first_column, s); 98 98 } 99 99 … … 111 111 rez = realloc(buf, buf_rsz); 112 112 if (rez == NULL) { 113 fd_log_debug("Error on memory allocation: %s \n", strerror(errno));113 fd_log_debug("Error on memory allocation: %s", strerror(errno)); 114 114 return 0; 115 115 } … … 198 198 if (fd == NULL) { 199 199 int ret = errno; 200 TRACE_DEBUG(INFO, "Unable to open file %s for reading: %s \n", fname, strerror(ret));200 TRACE_DEBUG(INFO, "Unable to open file %s for reading: %s", fname, strerror(ret)); 201 201 yyerror (&yylloc, conffile, "Error adding plugin"); 202 202 YYERROR; -
extensions/app_radgw/rgw_plugins.c
r741 r974 188 188 if (new->dlo == NULL) { 189 189 /* An error occured */ 190 fd_log_debug("Loading of plugin '%s' failed: \n %s\n", plgfile, dlerror());190 fd_log_debug("Loading of plugin '%s' failed: %s", plgfile, dlerror()); 191 191 goto error; 192 192 } … … 196 196 if (new->descriptor == NULL) { 197 197 /* An error occured */ 198 fd_log_debug("Unable to resolve 'rgwp_descriptor' in plugin '%s': \n %s\n", plgfile, dlerror());198 fd_log_debug("Unable to resolve 'rgwp_descriptor' in plugin '%s': %s", plgfile, dlerror()); 199 199 goto error; 200 200 } … … 206 206 CHECK_FCT_DO( (*(new->descriptor->rgwp_conf_parse))(conffile, &new->cs), 207 207 { 208 fd_log_debug("An error occurred while parsing configuration file '%s' in plugin '%s', aborting... \n", conffile, plgfile);208 fd_log_debug("An error occurred while parsing configuration file '%s' in plugin '%s', aborting...", conffile, plgfile); 209 209 goto error; 210 210 } ); … … 266 266 267 267 if ( ! FD_IS_LIST_EMPTY( &plg_list ) ) 268 fd_log_debug("[app_radgw] --- List of registered plugins: \n");268 fd_log_debug("[app_radgw] --- List of registered plugins:"); 269 269 for (ptr = plg_list.next; ptr != &plg_list; ptr = ptr->next) { 270 270 char buf[1024]; 271 271 plg = (struct plg_descr *)ptr; 272 272 273 fd_log_debug(" %-25s ( %p ) - types: %s%s, codes: ",274 275 276 277 273 snprintf(buf, sizeof(buf), " %-25s ( %p ) - types: %s%s, codes: ", 274 plg->descriptor->rgwp_name, 275 plg->cs, 276 plg->type & RGW_PLG_TYPE_AUTH ? "Au" : " ", 277 plg->type & RGW_PLG_TYPE_ACCT ? "Ac" : " "); 278 278 279 279 if (plg->cc) { … … 281 281 282 282 for (i = 0; i < plg->cc_len; i++) { 283 fd_log_debug("%02hhx ", plg->cc[i]);283 snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%02hhx ", plg->cc[i]); 284 284 } 285 fd_log_debug(" \n");285 fd_log_debug("%s", buf); 286 286 } else { 287 fd_log_debug(" *\n");287 fd_log_debug("%s*", buf); 288 288 } 289 289 } … … 297 297 CHECK_POSIX_DO( pthread_rwlock_rdlock(&plg_lock), ); 298 298 if ( !FD_IS_LIST_EMPTY( &plg_accel_auth ) || !FD_IS_LIST_EMPTY( &plg_accel_acct )) 299 fd_log_debug(" --- Accelerators: \n");299 fd_log_debug(" --- Accelerators:"); 300 300 301 301 for (ptraccel = plg_accel_auth.next; ptraccel != &plg_accel_auth; ptraccel = ptraccel->next) { 302 302 struct plg_accel * accel = (struct plg_accel *)ptraccel; 303 fd_log_debug(" auth, code %02hhu: \n", accel->ccode);303 fd_log_debug(" auth, code %02hhu:", accel->ccode); 304 304 305 305 for (ptr = accel->plugins.next; ptr != &accel->plugins; ptr = ptr->next) { 306 306 struct plg_accel_item * item = (struct plg_accel_item *)ptr; 307 fd_log_debug(" %-15s (%p) \n", item->plg->descriptor->rgwp_name, item->plg->cs);307 fd_log_debug(" %-15s (%p)", item->plg->descriptor->rgwp_name, item->plg->cs); 308 308 } 309 309 } 310 310 for (ptraccel = plg_accel_acct.next; ptraccel != &plg_accel_acct; ptraccel = ptraccel->next) { 311 311 struct plg_accel * accel = (struct plg_accel *)ptraccel; 312 fd_log_debug(" acct, code %02hhu: \n", accel->ccode);312 fd_log_debug(" acct, code %02hhu:", accel->ccode); 313 313 314 314 for (ptr = accel->plugins.next; ptr != &accel->plugins; ptr = ptr->next) { 315 315 struct plg_accel_item * item = (struct plg_accel_item *)ptr; 316 fd_log_debug(" %-15s (%p) \n", item->plg->descriptor->rgwp_name, item->plg->cs);316 fd_log_debug(" %-15s (%p)", item->plg->descriptor->rgwp_name, item->plg->cs); 317 317 } 318 318 } … … 380 380 if (ret > 0) { 381 381 /* Critical error, log and exit */ 382 TRACE_DEBUG(NONE, "An error occurred while handling a RADIUS message from '%s': %s \n", rgw_clients_id(cli), strerror(ret));382 TRACE_DEBUG(NONE, "An error occurred while handling a RADIUS message from '%s': %s", rgw_clients_id(cli), strerror(ret)); 383 383 return ret; 384 384 } … … 436 436 if (ret > 0) { 437 437 /* Critical error, log and exit */ 438 fd_log_debug("[app_radgw] An error occurred while handling a DIAMETER answer to a converted RADIUS request, turn on DEBUG for details: %s \n", strerror(ret));438 fd_log_debug("[app_radgw] An error occurred while handling a DIAMETER answer to a converted RADIUS request, turn on DEBUG for details: %s", strerror(ret)); 439 439 return ret; 440 440 } -
extensions/app_radgw/rgw_servers.c
r965 r974 52 52 return; 53 53 54 fd_log_debug(" auth server: \n");55 fd_log_debug(" disabled..... : %s \n", rgw_servers.auth_serv.disabled ? "TRUE":"false");56 fd_log_debug(" IP disabled.. : %s \n", rgw_servers.auth_serv.ip_disabled ? "TRUE":"false");57 fd_log_debug(" IPv6 disabled : %s \n", rgw_servers.auth_serv.ip6_disabled ? "TRUE":"false");58 fd_log_debug(" port......... : %hu \n", ntohs(rgw_servers.auth_serv.port));54 fd_log_debug(" auth server:"); 55 fd_log_debug(" disabled..... : %s", rgw_servers.auth_serv.disabled ? "TRUE":"false"); 56 fd_log_debug(" IP disabled.. : %s", rgw_servers.auth_serv.ip_disabled ? "TRUE":"false"); 57 fd_log_debug(" IPv6 disabled : %s", rgw_servers.auth_serv.ip6_disabled ? "TRUE":"false"); 58 fd_log_debug(" port......... : %hu", ntohs(rgw_servers.auth_serv.port)); 59 59 inet_ntop(AF_INET, &rgw_servers.auth_serv.ip_endpoint,ipstr,sizeof(ipstr)); 60 fd_log_debug(" IP bind...... : %s \n", ipstr);60 fd_log_debug(" IP bind...... : %s", ipstr); 61 61 inet_ntop(AF_INET6, &rgw_servers.auth_serv.ip6_endpoint,ipstr,sizeof(ipstr)); 62 fd_log_debug(" IPv6 bind.... : %s \n", ipstr);63 64 fd_log_debug(" acct server: \n");65 fd_log_debug(" disabled..... : %s \n", rgw_servers.acct_serv.disabled ? "TRUE":"false");66 fd_log_debug(" IP disabled.. : %s \n", rgw_servers.acct_serv.ip_disabled ? "TRUE":"false");67 fd_log_debug(" IPv6 disabled : %s \n", rgw_servers.acct_serv.ip6_disabled ? "TRUE":"false");68 fd_log_debug(" port......... : %hu \n", ntohs(rgw_servers.acct_serv.port));62 fd_log_debug(" IPv6 bind.... : %s", ipstr); 63 64 fd_log_debug(" acct server:"); 65 fd_log_debug(" disabled..... : %s", rgw_servers.acct_serv.disabled ? "TRUE":"false"); 66 fd_log_debug(" IP disabled.. : %s", rgw_servers.acct_serv.ip_disabled ? "TRUE":"false"); 67 fd_log_debug(" IPv6 disabled : %s", rgw_servers.acct_serv.ip6_disabled ? "TRUE":"false"); 68 fd_log_debug(" port......... : %hu", ntohs(rgw_servers.acct_serv.port)); 69 69 inet_ntop(AF_INET, &rgw_servers.acct_serv.ip_endpoint,ipstr,sizeof(ipstr)); 70 fd_log_debug(" IP bind...... : %s \n", ipstr);70 fd_log_debug(" IP bind...... : %s", ipstr); 71 71 inet_ntop(AF_INET6, &rgw_servers.acct_serv.ip6_endpoint,ipstr,sizeof(ipstr)); 72 fd_log_debug(" IPv6 bind.... : %s \n", ipstr);72 fd_log_debug(" IPv6 bind.... : %s", ipstr); 73 73 74 74 } -
extensions/app_radgw/rgw_worker.c
r767 r974 163 163 /* Check the created Diameter message -- it will be invalid if no callback has handled the RADIUS message */ 164 164 if ((diam_msg == NULL) || ( fd_msg_parse_rules(diam_msg, fd_g_config->cnf_dict, NULL) ) ) { 165 fd_log_debug("[radgw] No or invalid Diameter message was generated after processing the RADIUS command %hhd (%s). \n"165 fd_log_debug("[radgw] No or invalid Diameter message was generated after processing the RADIUS command %hhd (%s)." 166 166 " It may indicate a gateway configuration problem, or implementation issue in a plugin.\n", 167 167 msg->radius.hdr->code, rgw_msg_code_str(msg->radius.hdr->code)); … … 174 174 struct radius_attr_hdr *attr = (struct radius_attr_hdr *)(msg->radius.buf + msg->radius.attr_pos[a]); 175 175 pb++; 176 fd_log_debug("[radgw] No plugin available to handle attribute %hhd (%s) in command %hhd (%s)! Translation aborted. \n",176 fd_log_debug("[radgw] No plugin available to handle attribute %hhd (%s) in command %hhd (%s)! Translation aborted.", 177 177 attr->type, rgw_msg_attrtype_str(attr->type), 178 178 msg->radius.hdr->code, rgw_msg_code_str(msg->radius.hdr->code)); … … 193 193 rgw_clients_dispose(&cli); 194 194 195 TRACE_DEBUG(INFO, "%d problem(s) occurred while translating a RADIUS message, data discarded. \n", pb);195 TRACE_DEBUG(INFO, "%d problem(s) occurred while translating a RADIUS message, data discarded.", pb); 196 196 continue; 197 197 } … … 207 207 { 208 208 /* If an error occurs, log and destroy the data */ 209 fd_log_debug("An error occurred while sending Diameter message, please turn Debug on for detail. \n");209 fd_log_debug("An error occurred while sending Diameter message, please turn Debug on for detail."); 210 210 if (session) { 211 211 CHECK_FCT_DO( fd_sess_destroy(&session), ); -
extensions/app_radgw/rgwx_acct.c
r965 r974 1266 1266 1267 1267 default: 1268 fd_log_debug("[acct.rgwx] Received Diameter answer with error code '%d' from server '%.*s', session %.*s, not translating into Accounting-Response \n",1268 fd_log_debug("[acct.rgwx] Received Diameter answer with error code '%d' from server '%.*s', session %.*s, not translating into Accounting-Response", 1269 1269 ahdr->avp_value->u32, 1270 1270 oh->avp_value->os.len, oh->avp_value->os.data, … … 1273 1273 if (avp) { 1274 1274 CHECK_FCT( fd_msg_avp_hdr ( avp, &ahdr ) ); 1275 fd_log_debug("[acct.rgwx] Error-Message content: '%.*s' \n",1275 fd_log_debug("[acct.rgwx] Error-Message content: '%.*s'", 1276 1276 ahdr->avp_value->os.len, ahdr->avp_value->os.data); 1277 1277 } … … 1279 1279 if (avp) { 1280 1280 CHECK_FCT( fd_msg_avp_hdr ( avp, &ahdr ) ); 1281 fd_log_debug("[acct.rgwx] Error-Reporting-Host: '%.*s' \n",1281 fd_log_debug("[acct.rgwx] Error-Reporting-Host: '%.*s'", 1282 1282 ahdr->avp_value->os.len, ahdr->avp_value->os.data); 1283 1283 } 1284 1284 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Failed_AVP, &avp) ); 1285 1285 if (avp) { 1286 fd_log_debug("[acct.rgwx] Failed-AVP was included in the message. \n");1286 fd_log_debug("[acct.rgwx] Failed-AVP was included in the message."); 1287 1287 /* Dump its content ? */ 1288 1288 } -
extensions/app_radgw/rgwx_auth.c
r972 r974 1237 1237 /* In any case, the following is processed: */ 1238 1238 (*rad_fw)->hdr->code = RADIUS_CODE_ACCESS_REJECT; 1239 fd_log_debug("[auth.rgwx] Received Diameter answer with error code '%d' from server '%.*s', session %.*s, translating into Access-Reject \n",1239 fd_log_debug("[auth.rgwx] Received Diameter answer with error code '%d' from server '%.*s', session %.*s, translating into Access-Reject", 1240 1240 ahdr->avp_value->u32, 1241 1241 oh->avp_value->os.len, oh->avp_value->os.data, … … 1244 1244 if (avp_x) { 1245 1245 CHECK_FCT( fd_msg_avp_hdr ( avp_x, &ahdr ) ); 1246 fd_log_debug("[auth.rgwx] Error-Message content: '%.*s' \n",1246 fd_log_debug("[auth.rgwx] Error-Message content: '%.*s'", 1247 1247 ahdr->avp_value->os.len, ahdr->avp_value->os.data); 1248 1248 } … … 1250 1250 if (avp_x) { 1251 1251 CHECK_FCT( fd_msg_avp_hdr ( avp_x, &ahdr ) ); 1252 fd_log_debug("[auth.rgwx] Error-Reporting-Host: '%.*s' \n",1252 fd_log_debug("[auth.rgwx] Error-Reporting-Host: '%.*s'", 1253 1253 ahdr->avp_value->os.len, ahdr->avp_value->os.data); 1254 1254 } 1255 1255 CHECK_FCT( fd_msg_search_avp (*diam_ans, cs->dict.Failed_AVP, &avp_x) ); 1256 1256 if (avp_x) { 1257 fd_log_debug("[auth.rgwx] Failed-AVP was included in the message. \n");1257 fd_log_debug("[auth.rgwx] Failed-AVP was included in the message."); 1258 1258 /* Dump its content ? */ 1259 1259 } … … 1449 1449 /* We only check the value */ 1450 1450 if (ahdr->avp_value->u32 != 3) { 1451 fd_log_debug("[auth.rgwx] Received Diameter answer with Auth-Request-Type set to %d (%s) from server %.*s, session %.*s. \n"1451 fd_log_debug("[auth.rgwx] Received Diameter answer with Auth-Request-Type set to %d (%s) from server %.*s, session %.*s." 1452 1452 " This may cause interoperability problems with RADIUS.\n", 1453 1453 ahdr->avp_value->u32, … … 1614 1614 case DIAM_ATTR_NAS_FILTER_RULE: 1615 1615 /* This is not translatable to RADIUS */ 1616 fd_log_debug("[auth.rgwx] Received Diameter answer with non-translatable NAS-Filter-Rule AVP from '%.*s' (session: '%.*s'), ignoring. \n",1616 fd_log_debug("[auth.rgwx] Received Diameter answer with non-translatable NAS-Filter-Rule AVP from '%.*s' (session: '%.*s'), ignoring.", 1617 1617 oh->avp_value->os.len, oh->avp_value->os.data, 1618 1618 sid->avp_value->os.len, sid->avp_value->os.data); … … 1647 1647 case DIAM_ATTR_QOS_FILTER_RULE: 1648 1648 /* This is not translatable to RADIUS */ 1649 fd_log_debug("[auth.rgwx] Received Diameter answer with non-translatable QoS-Filter-Rule AVP from '%.*s' (session: '%.*s'), ignoring. \n",1649 fd_log_debug("[auth.rgwx] Received Diameter answer with non-translatable QoS-Filter-Rule AVP from '%.*s' (session: '%.*s'), ignoring.", 1650 1650 oh->avp_value->os.len, oh->avp_value->os.data, 1651 1651 sid->avp_value->os.len, sid->avp_value->os.data); … … 1856 1856 1857 1857 if (ahdr->avp_value->os.len != 64) { 1858 TRACE_DEBUG(INFO, "Received EAP-Master-Session-Key attribute with length %d != 64. \n", ahdr->avp_value->os.len)1858 TRACE_DEBUG(INFO, "Received EAP-Master-Session-Key attribute with length %d != 64.", ahdr->avp_value->os.len) 1859 1859 } 1860 1860 -
extensions/app_radgw/rgwx_debug.c
r740 r974 57 57 58 58 auth = &(msg->hdr->authenticator[0]); 59 fd_log_debug(" id : 0x%02hhx, code: %hhd (%s) \n", msg->hdr->identifier, msg->hdr->code, rgw_msg_code_str(msg->hdr->code));60 fd_log_debug(" auth: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx \n",59 fd_log_debug(" id : 0x%02hhx, code: %hhd (%s)", msg->hdr->identifier, msg->hdr->code, rgw_msg_code_str(msg->hdr->code)); 60 fd_log_debug(" auth: %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx", 61 61 auth[0], auth[1], auth[2], auth[3], 62 62 auth[4], auth[5], auth[6], auth[7]); 63 fd_log_debug(" %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx \n",63 fd_log_debug(" %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx", 64 64 auth[8], auth[9], auth[10], auth[11], 65 65 auth[12], auth[13], auth[14], auth[15]); 66 66 for (i = 0; i < msg->attr_used; i++) { 67 67 struct radius_attr_hdr *attr = (struct radius_attr_hdr *)(msg->buf + msg->attr_pos[i]); 68 fd_log_debug(" - len:%3hhu, type:0x%02hhx (%s) \n", attr->length, attr->type, rgw_msg_attrtype_str(attr->type));68 fd_log_debug(" - len:%3hhu, type:0x%02hhx (%s)", attr->length, attr->type, rgw_msg_attrtype_str(attr->type)); 69 69 /* If we need to dump the value, it's better to call directly radius_msg_dump instead... */ 70 70 } … … 76 76 TRACE_ENTRY("%p %p %p %p %p %p", cs, session, rad_req, rad_ans, diam_fw, cli); 77 77 78 fd_log_debug("------------- RADIUS/Diameter Request Debug%s%s%s ------------- \n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : "");78 fd_log_debug("------------- RADIUS/Diameter Request Debug%s%s%s -------------", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 79 79 80 80 if (!rad_req) { 81 fd_log_debug(" RADIUS request: NULL pointer \n");81 fd_log_debug(" RADIUS request: NULL pointer"); 82 82 } else { 83 fd_log_debug(" RADIUS request (%p) DUMP: \n", rad_req);83 fd_log_debug(" RADIUS request (%p) DUMP:", rad_req); 84 84 debug_dump_radius(rad_req); 85 85 } 86 86 87 87 if (!rad_ans || ! *rad_ans) { 88 fd_log_debug(" RADIUS answer: NULL pointer \n");88 fd_log_debug(" RADIUS answer: NULL pointer"); 89 89 } else { 90 fd_log_debug(" RADIUS answer (%p) DUMP: \n", *rad_ans);90 fd_log_debug(" RADIUS answer (%p) DUMP:", *rad_ans); 91 91 debug_dump_radius(*rad_ans); 92 92 } 93 93 94 94 if (!diam_fw || ! *diam_fw) { 95 fd_log_debug(" Diameter message: NULL pointer \n");95 fd_log_debug(" Diameter message: NULL pointer"); 96 96 } else { 97 fd_log_debug(" Diameter message (%p) DUMP: \n", *diam_fw);97 fd_log_debug(" Diameter message (%p) DUMP:", *diam_fw); 98 98 fd_msg_dump_walk(0, *diam_fw); 99 99 } 100 100 101 101 if (!session || ! *session) { 102 fd_log_debug(" Diameter session: NULL pointer \n");102 fd_log_debug(" Diameter session: NULL pointer"); 103 103 } else { 104 104 os0_t str; … … 106 106 CHECK_FCT( fd_sess_getsid(*session, &str, &str_len) ); 107 107 108 fd_log_debug(" Diameter session: %s \n", str);108 fd_log_debug(" Diameter session: %s", str); 109 109 } 110 110 111 fd_log_debug("=========== Debug%s%s%s complete ============= \n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : "");111 fd_log_debug("=========== Debug%s%s%s complete =============", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 112 112 113 113 return 0; … … 119 119 TRACE_ENTRY("%p %p %p %p %p %p", cs, session, diam_ans, rad_fw, cli, stateful); 120 120 121 fd_log_debug("------------- RADIUS/Diameter Answer Debug%s%s%s ------------- \n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : "");121 fd_log_debug("------------- RADIUS/Diameter Answer Debug%s%s%s -------------", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 122 122 123 123 if (!diam_ans || ! *diam_ans) { 124 fd_log_debug(" Diameter message: NULL pointer \n");124 fd_log_debug(" Diameter message: NULL pointer"); 125 125 } else { 126 fd_log_debug(" Diameter message (%p) DUMP: \n", *diam_ans);126 fd_log_debug(" Diameter message (%p) DUMP:", *diam_ans); 127 127 fd_msg_dump_walk(0, *diam_ans); 128 128 } 129 129 130 130 if (!rad_fw || ! *rad_fw) { 131 fd_log_debug(" RADIUS answer: NULL pointer \n");131 fd_log_debug(" RADIUS answer: NULL pointer"); 132 132 } else { 133 fd_log_debug(" RADIUS answer (%p) DUMP: \n", *rad_fw);133 fd_log_debug(" RADIUS answer (%p) DUMP:", *rad_fw); 134 134 debug_dump_radius(*rad_fw); 135 135 } 136 136 137 fd_log_debug("=========== Debug%s%s%s complete ============= \n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : "");137 fd_log_debug("=========== Debug%s%s%s complete =============", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 138 138 return 0; 139 139 } -
extensions/app_radgw/rgwx_echodrop.c
r741 r974 60 60 TRACE_ENTRY("%p %p", conffile, state); 61 61 CHECK_PARAMS( state ); 62 CHECK_PARAMS_DO( conffile, { fd_log_debug("[echodrop.rgwx] The configuration file is not optional for this plugin. \n"); return EINVAL; } );62 CHECK_PARAMS_DO( conffile, { fd_log_debug("[echodrop.rgwx] The configuration file is not optional for this plugin."); return EINVAL; } ); 63 63 64 64 CHECK_MALLOC( new = malloc(sizeof(struct rgwp_config)) ); … … 82 82 char * act = (eca->action == ACT_ECHO) ? "ECHO" : "DROP"; 83 83 if (eca->ext) { 84 fd_log_debug(" %s Code: %hhu, Vendor: %u, Ext-Type: %hu \n", act, eca->code, eca->vendor_id, eca->extype);84 fd_log_debug(" %s Code: %hhu, Vendor: %u, Ext-Type: %hu", act, eca->code, eca->vendor_id, eca->extype); 85 85 continue; 86 86 } 87 87 if (eca->tlv) { 88 fd_log_debug(" %s Code: %hhu, Vendor: %u, Type: %hhu \n", act, eca->code, eca->vendor_id, eca->type);88 fd_log_debug(" %s Code: %hhu, Vendor: %u, Type: %hhu", act, eca->code, eca->vendor_id, eca->type); 89 89 continue; 90 90 } 91 91 if (eca->vsa) { 92 fd_log_debug(" %s Code: %hhu, Vendor: %u \n", act, eca->code, eca->vendor_id);93 continue; 94 } 95 fd_log_debug(" %s Code: %hhu \n", act, eca->code);92 fd_log_debug(" %s Code: %hhu, Vendor: %u", act, eca->code, eca->vendor_id); 93 continue; 94 } 95 fd_log_debug(" %s Code: %hhu", act, eca->code); 96 96 } 97 97 } … … 186 186 if (eca->ext) { 187 187 /* To be done */ 188 fd_log_debug("Extended attributes are not implemented yet! \n");188 fd_log_debug("Extended attributes are not implemented yet!"); 189 189 ASSERT(0); 190 190 continue; … … 219 219 CHECK_PARAMS_DO(*session, 220 220 { 221 fd_log_debug( "[echodrop.rgwx] The extension is configured to echo some attributes from this message, but no session object has been created for it (yet). \n"221 fd_log_debug( "[echodrop.rgwx] The extension is configured to echo some attributes from this message, but no session object has been created for it (yet)." 222 222 " Please check your configuration file and include a session-generating extension BEFORE calling echodrop.rgwx to echo attributes.\n" 223 223 " Please use debug.rgwx to retrieve more information.\n" ); -
extensions/app_radgw/rgwx_echodrop.l
r741 r974 71 71 if (ret != 1) { 72 72 /* No matching: an error occurred */ 73 fd_log_debug("[echodrop.rgwx] Unable to convert the value '%s' to a valid number: %s \n", yytext, strerror(errno));73 fd_log_debug("[echodrop.rgwx] Unable to convert the value '%s' to a valid number: %s", yytext, strerror(errno)); 74 74 return LEX_ERROR; /* trig an error in yacc parser */ 75 75 /* Maybe we could REJECT instead of failing here? */ … … 93 93 /* Unrecognized character */ 94 94 <*>. { 95 fd_log_debug("[echodrop.rgwx] Unrecognized text on line %d col %d: '%s'. \n", yylloc->first_line, yylloc->first_column, yytext);95 fd_log_debug("[echodrop.rgwx] Unrecognized text on line %d col %d: '%s'.", yylloc->first_line, yylloc->first_column, yytext); 96 96 return LEX_ERROR; 97 97 } -
extensions/app_radgw/rgwx_echodrop.y
r741 r974 78 78 if (rgwx_echodropin == NULL) { 79 79 ret = errno; 80 fd_log_debug("[echodrop.rgwx] Unable to open plugin configuration file %s for reading: %s \n", conffile, strerror(ret));80 fd_log_debug("[echodrop.rgwx] Unable to open plugin configuration file %s for reading: %s", conffile, strerror(ret)); 81 81 return ret; 82 82 } … … 97 97 { 98 98 if (ploc->first_line != ploc->last_line) 99 fd_log_debug("%s:%d.%d-%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s);99 fd_log_debug("%s:%d.%d-%d.%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s); 100 100 else if (ploc->first_column != ploc->last_column) 101 fd_log_debug("%s:%d.%d-%d : %s \n", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s);101 fd_log_debug("%s:%d.%d-%d : %s", conffile, ploc->first_line, ploc->first_column, ploc->last_column, s); 102 102 else 103 fd_log_debug("%s:%d.%d : %s \n", conffile, ploc->first_line, ploc->first_column, s);103 fd_log_debug("%s:%d.%d : %s", conffile, ploc->first_line, ploc->first_column, s); 104 104 } 105 105 -
extensions/app_radgw/rgwx_sip.c
r924 r974 803 803 default: 804 804 (*rad_fw)->hdr->code = RADIUS_CODE_ACCESS_REJECT; 805 fd_log_debug("[sip.rgwx] Received Diameter answer with error code '%d', session %.*s, translating into Access-Reject \n",805 fd_log_debug("[sip.rgwx] Received Diameter answer with error code '%d', session %.*s, translating into Access-Reject", 806 806 ahdr->avp_value->u32, 807 807 sid->avp_value->os.len, sid->avp_value->os.data);
Note: See TracChangeset
for help on using the changeset viewer.