Changeset 1124:769b867c8637 in freeDiameter
- Timestamp:
- May 14, 2013, 7:43:08 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- extensions/app_radgw
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/rgw_main.c
r741 r1124 48 48 CHECK_FCT( rgw_conf_handle(conffile) ); 49 49 50 TRACE_DEBUG(INFO,"Extension RADIUS Gateway initialized with configuration: '%s'", conffile);50 LOG_D( "Extension RADIUS Gateway initialized with configuration: '%s'", conffile); 51 51 rgw_servers_dump(); 52 52 rgw_clients_dump(); -
extensions/app_radgw/rgw_servers.c
r1107 r1124 49 49 char ipstr[INET6_ADDRSTRLEN]; 50 50 51 if ( ! TRACE_BOOL(FULL) ) 52 return; 53 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)); 51 LOG_D(" auth server:"); 52 LOG_D(" disabled..... : %s", rgw_servers.auth_serv.disabled ? "TRUE":"false"); 53 LOG_D(" IP disabled.. : %s", rgw_servers.auth_serv.ip_disabled ? "TRUE":"false"); 54 LOG_D(" IPv6 disabled : %s", rgw_servers.auth_serv.ip6_disabled ? "TRUE":"false"); 55 LOG_D(" port......... : %hu", ntohs(rgw_servers.auth_serv.port)); 59 56 inet_ntop(AF_INET, &rgw_servers.auth_serv.ip_endpoint,ipstr,sizeof(ipstr)); 60 fd_log_debug(" IP bind...... : %s", ipstr);57 LOG_D(" IP bind...... : %s", ipstr); 61 58 inet_ntop(AF_INET6, &rgw_servers.auth_serv.ip6_endpoint,ipstr,sizeof(ipstr)); 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));59 LOG_D(" IPv6 bind.... : %s", ipstr); 60 61 LOG_D(" acct server:"); 62 LOG_D(" disabled..... : %s", rgw_servers.acct_serv.disabled ? "TRUE":"false"); 63 LOG_D(" IP disabled.. : %s", rgw_servers.acct_serv.ip_disabled ? "TRUE":"false"); 64 LOG_D(" IPv6 disabled : %s", rgw_servers.acct_serv.ip6_disabled ? "TRUE":"false"); 65 LOG_D(" port......... : %hu", ntohs(rgw_servers.acct_serv.port)); 69 66 inet_ntop(AF_INET, &rgw_servers.acct_serv.ip_endpoint,ipstr,sizeof(ipstr)); 70 fd_log_debug(" IP bind...... : %s", ipstr);67 LOG_D(" IP bind...... : %s", ipstr); 71 68 inet_ntop(AF_INET6, &rgw_servers.acct_serv.ip6_endpoint,ipstr,sizeof(ipstr)); 72 fd_log_debug(" IPv6 bind.... : %s", ipstr);69 LOG_D(" IPv6 bind.... : %s", ipstr); 73 70 74 71 } … … 125 122 126 123 /* Get the port */ 127 if (from.ss_family == AF_INET) 128 port = ((struct sockaddr_in *)&from)->sin_port; 129 if (from.ss_family == AF_INET6) 130 port = ((struct sockaddr_in6 *)&from)->sin6_port; 124 port = sSAport(&from); 131 125 if (!port) { 132 TRACE_DEBUG(INFO,"Invalid port (family: %d), discarding received %d bytes...", from.ss_family, len);126 LOG_E("Invalid port (family: %d), discarding received %d bytes...", from.ss_family, len); 133 127 continue; 134 128 } 135 129 136 130 fd_sa_sdump_numeric(sa_buf, (sSA*)&from); 137 TRACE_DEBUG(FULL, "Received %d bytesfrom %s", len, sa_buf);131 LOG_D("RADIUS: RCV %dB from %s", len, sa_buf); 138 132 139 133 /* Search the associated client definition, if any */ 140 134 CHECK_FCT_DO( rgw_clients_search((struct sockaddr *) &from, &nas_info), 141 135 { 142 TRACE_NOTICE("Discarding %d bytes received from unknown IP: %s", len, sa_buf);136 LOG_E("Discarding %d bytes received from unknown IP: %s", len, sa_buf); 143 137 continue; 144 138 } ); … … 151 145 size_t clisz; 152 146 CHECK_FCT_DO( rgw_clients_get_origin(nas_info, &cliname, &clisz, NULL, NULL), ); 153 TRACE_DEBUG(INFO,"Discarding invalid RADIUS message from '%s'", cliname);147 LOG_E( "Discarding invalid RADIUS message from '%s'", cliname); 154 148 rgw_clients_dispose(&nas_info); 155 149 continue; … … 258 252 259 253 if (!ret) { 260 TRACE_DEBUG(INFO,"Trying to send a message from a disabled server: %s / %s",254 LOG_E( "Trying to send a message from a disabled server: %s / %s", 261 255 (type == RGW_PLG_TYPE_AUTH) ? "Auth" : "Acct", 262 256 (to->sa_family == AF_INET) ? "IP (v4)" : "IPv6"); … … 275 269 276 270 fd_sa_sdump_numeric(sa_buf, (sSA*)&sto); 277 TRACE_DEBUG(FULL, "Sending %zd bytesto %s", buflen, sa_buf);278 271 LOG_D("RADIUS: SND %zdB to %s", buflen, sa_buf); 272 279 273 /* Send */ 280 274 ret = sendto(SERVERS[idx].sock, buf, buflen, 0, (struct sockaddr *)&sto, sSAlen(&sto)); -
extensions/app_radgw/rgw_worker.c
r996 r1124 247 247 switch (ahdr->avp_code) { 248 248 /* A few AVPs can be safely ignored here: */ 249 case DIAM_ATTR_SESSION_ID: 249 250 case DIAM_ATTR_ROUTE_RECORD: 250 251 case DIAM_ATTR_PROXY_INFO: … … 255 256 256 257 default: 257 TRACE_DEBUG(FULL,"Remaining Mandatory AVP, code %d", ahdr->avp_code);258 LOG_D("Remaining Mandatory AVP, code %d", ahdr->avp_code); 258 259 pb++; 259 260 }
Note: See TracChangeset
for help on using the changeset viewer.