Changeset 1107:96f2051215c8 in freeDiameter
- Timestamp:
- May 12, 2013, 11:39:07 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/rgw_clients.c
r1033 r1107 921 921 /* Dump the entry in debug mode */ 922 922 if (TRACE_BOOL(FULL + 1 )) { 923 char sa_buf[sSA_DUMP_STRLEN]; 924 fd_sa_sdump_numeric(sa_buf, ip_port); 923 925 TRACE_DEBUG(FULL, "Adding %s:", (type == RGW_CLI_NAS) ? "NAS" : "PROXY" ); 924 TRACE_ sSA(FD_LOG_DEBUG, FULL, "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "");926 TRACE_DEBUG(FULL, "\tIP : %s", sa_buf ); 925 927 TRACE_BUFFER(FD_LOG_DEBUG, FULL, "\tKey: [", *key, keylen, "]" ); 926 928 } … … 941 943 942 944 if (ret == EEXIST) { 945 char sa_buf[sSA_DUMP_STRLEN]; 943 946 /* Check if the key is the same, then skip or return an error */ 944 947 if ((keylen == prev->key.len ) && ( ! memcmp(*key, prev->key.data, keylen) ) && (type == prev->type)) { … … 950 953 fd_log_error("ERROR: Conflicting RADIUS clients descriptions!"); 951 954 TRACE_ERROR("Previous entry: %s", (prev->type == RGW_CLI_NAS) ? "NAS" : "PROXY"); 952 TRACE_sSA(FD_LOG_ERROR, NONE, "\tIP : ", prev->sa, NI_NUMERICHOST | NI_NUMERICSERV, "" ); 955 fd_sa_sdump_numeric(sa_buf, prev->sa); 956 TRACE_ERROR("\tIP : %s", sa_buf); 953 957 TRACE_BUFFER(FD_LOG_ERROR, NONE, "\tKey: [", prev->key.data, prev->key.len, "]" ); 954 958 TRACE_ERROR("Conflicting entry: %s", (type == RGW_CLI_NAS) ? "NAS" : "PROXY"); 955 TRACE_sSA(FD_LOG_ERROR, NONE, "\tIP : ", ip_port, NI_NUMERICHOST | NI_NUMERICSERV, "" ); 959 fd_sa_sdump_numeric(sa_buf, ip_port); 960 TRACE_ERROR("\tIP : %s", sa_buf); 956 961 TRACE_BUFFER(FD_LOG_ERROR, NONE, "\tKey: [", *key, keylen, "]" ); 957 962 } … … 969 974 970 975 for (ref = senti->next; ref != senti; ref = ref->next) { 976 char sa_buf[sSA_DUMP_STRLEN]; 971 977 client = (struct rgw_client *)ref; 972 978 /* TODO: use a fct param instead of hardcoded FD_LOG_DEBUG */ 973 TRACE_sSA(FD_LOG_DEBUG, NONE, " - ", client->sa, NI_NUMERICHOST | NI_NUMERICSERV, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" ); 979 TODO("Replace with appropriate code"); 980 /* TRACE_sSA(FD_LOG_DEBUG, NONE, " - ", client->sa, NI_NUMERICHOST | NI_NUMERICSERV, (client->type == RGW_CLI_NAS) ? "" : " [PROXY]" ); */ 974 981 } 975 982 } -
extensions/app_radgw/rgw_servers.c
r1027 r1107 111 111 while (1) { 112 112 struct sockaddr_storage from; 113 char sa_buf[sSA_DUMP_STRLEN]; 113 114 socklen_t fromlen = sizeof(from); 114 115 int len; … … 133 134 } 134 135 135 { 136 char __buf[1024]; 137 sSA_DUMP_NODE_SERV(__buf, sizeof(__buf), &from, NI_NUMERICHOST | NI_NUMERICSERV ); 138 TRACE_DEBUG(FULL, "Received %d bytes from %s", len, __buf); 139 } 136 fd_sa_sdump_numeric(sa_buf, (sSA*)&from); 137 TRACE_DEBUG(FULL, "Received %d bytes from %s", len, sa_buf); 140 138 141 139 /* Search the associated client definition, if any */ 142 140 CHECK_FCT_DO( rgw_clients_search((struct sockaddr *) &from, &nas_info), 143 141 { 144 TRACE_NOTICE("Discarding %d bytes received from unknown IP:", len); 145 TRACE_sSA(FD_LOG_NOTICE, INFO, " ", &from, NI_NUMERICHOST | NI_NUMERICSERV, "" ); 142 TRACE_NOTICE("Discarding %d bytes received from unknown IP: %s", len, sa_buf); 146 143 continue; 147 144 } ); … … 250 247 int ret = 0; 251 248 struct sockaddr_storage sto; 249 char sa_buf[sSA_DUMP_STRLEN]; 252 250 253 251 /* Find the appropriate socket to use (not sure if it is important) */ … … 276 274 } 277 275 278 { 279 char __buf[1024]; 280 sSA_DUMP_NODE_SERV(__buf, sizeof(__buf), &sto, NI_NUMERICHOST | NI_NUMERICSERV ); 281 TRACE_DEBUG(FULL, "Sending %zd bytes to %s", buflen, __buf); 282 } 276 fd_sa_sdump_numeric(sa_buf, (sSA*)&sto); 277 TRACE_DEBUG(FULL, "Sending %zd bytes to %s", buflen, sa_buf); 283 278 284 279 /* Send */ -
include/freeDiameter/libfdproto.h
r1103 r1107 473 473 static __inline__ void replace_me() MARK_DEPRECATED { } 474 474 475 #define TRACE_sSA(...) replace_me();476 #define sSA_DUMP_NODE_SERV(...) replace_me();477 #define sSA_DUMP_NODE(...) replace_me();478 475 #define TRACE_BUFFER(...) replace_me(); 479 476 #define TRACE_NOTICE(...) replace_me(); -
libfdcore/config.c
r1093 r1107 347 347 if ( (fd_g_config->cnf_flags.no_ip4 && (ep->sa.sa_family == AF_INET)) 348 348 ||(fd_g_config->cnf_flags.no_ip6 && (ep->sa.sa_family == AF_INET6)) ) { 349 char sa_buf[sSA_DUMP_STRLEN];; 349 350 li = li->prev; 350 351 fd_list_unlink(&ep->chain); 351 if (TRACE_BOOL(INFO)) { 352 char buf[1024]; 353 sSA_DUMP_NODE( buf, sizeof(buf), &ep->sa, NI_NUMERICHOST ); 354 fd_log_debug("Info: Removing local address conflicting with the flags no_IP / no_IP6 : %s", buf); 355 } 352 fd_sa_sdump_numeric(sa_buf, &ep->sa); 353 LOG_N("Info: Removing local address conflicting with the flags no_IP / no_IP6 : %s", sa_buf); 356 354 free(ep); 357 355 } -
libfdcore/core.c
r1098 r1107 220 220 /* Display configuration */ 221 221 b = fd_conf_dump(&buf, &len, NULL); 222 LOG_N("%s \n", b ?: "Error during configuration dump...");222 LOG_N("%s", b ?: "Error during configuration dump..."); 223 223 224 224 /* Display registered triggers for FDEV_TRIGGER */ 225 225 b = fd_event_trig_dump(&buf, &len, &offset); 226 226 if (!b || offset) { 227 LOG_N("%s \n", b ?: "Error during triggers dump...");227 LOG_N("%s", b ?: "Error during triggers dump..."); 228 228 } 229 229 -
libfdcore/sctp.c
r1102 r1107 739 739 } 740 740 741 if (TRACE_BOOL(SCTP_LEVEL)) {741 #if 0 742 742 union { 743 743 sSA *sa; … … 751 751 ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6) ; 752 752 } 753 }753 #endif 754 754 755 755 /* Bind to this array */ … … 764 764 765 765 /* Debug: show all local listening addresses */ 766 if (TRACE_BOOL(SCTP_LEVEL)) {766 #if 0 767 767 sSA *sar; 768 768 union { … … 779 779 } 780 780 sctp_freeladdrs(sar); 781 }781 #endif 782 782 783 783 return 0; … … 830 830 831 831 /* Try connecting */ 832 if (TRACE_BOOL(FULL)) { 833 TRACE_DEBUG(FULL, "Attempting SCTP connection (%d addresses attempted) :", count); 832 LOG_A("Attempting SCTP connection (%d addresses attempted) ", count); 833 834 #if 0 834 835 /* Dump the SAs */ 835 836 union { … … 845 846 ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6); 846 847 } 847 } 848 #endif 848 849 849 850 #ifdef SCTP_CONNECTX_4_ARGS … … 908 909 return ENOTSUP; 909 910 } 910 if (TRACE_BOOL(SCTP_LEVEL)) { 911 char buf[1024];912 sSA_DUMP_NODE_SERV(buf, sizeof(buf), &status.sstat_primary.spinfo_address, NI_NUMERICHOST | NI_NUMERICSERV);911 #if 0 912 char sa_buf[sSA_DUMP_STRLEN]; 913 fd_sa_sdump_numeric(sa_buf, &status.sstat_primary.spinfo_address); 913 914 fd_log_debug( "SCTP_STATUS : sstat_state : %i" , status.sstat_state); 914 915 fd_log_debug( " sstat_rwnd : %u" , status.sstat_rwnd); … … 918 919 fd_log_debug( " sstat_outstrms : %hu", status.sstat_outstrms); 919 920 fd_log_debug( " sstat_fragmentation_point : %u" , status.sstat_fragmentation_point); 920 fd_log_debug( " sstat_primary.spinfo_address : %s" , buf);921 fd_log_debug( " sstat_primary.spinfo_address : %s" , sa_buf); 921 922 fd_log_debug( " sstat_primary.spinfo_state : %d" , status.sstat_primary.spinfo_state); 922 923 fd_log_debug( " sstat_primary.spinfo_cwnd : %u" , status.sstat_primary.spinfo_cwnd); … … 924 925 fd_log_debug( " sstat_primary.spinfo_rto : %u" , status.sstat_primary.spinfo_rto); 925 926 fd_log_debug( " sstat_primary.spinfo_mtu : %u" , status.sstat_primary.spinfo_mtu); 926 } 927 #endif /* 0 */ 927 928 928 929 *in = status.sstat_instrms; … … 1150 1151 case SCTP_PEER_ADDR_CHANGE: 1151 1152 TRACE_DEBUG(FULL, "Received SCTP_PEER_ADDR_CHANGE notification"); 1152 TRACE_sSA(FD_LOG_DEBUG, SCTP_LEVEL, " intf_change : ", &(notif->sn_paddr_change.spc_aaddr), NI_NUMERICHOST | NI_NUMERICSERV, "" );1153 /* TRACE_sSA(FD_LOG_DEBUG, SCTP_LEVEL, " intf_change : ", &(notif->sn_paddr_change.spc_aaddr), NI_NUMERICHOST | NI_NUMERICSERV, "" ); */ 1153 1154 TRACE_DEBUG(SCTP_LEVEL, " state : %d", notif->sn_paddr_change.spc_state); 1154 1155 TRACE_DEBUG(SCTP_LEVEL, " error : %d", notif->sn_paddr_change.spc_error);
Note: See TracChangeset
for help on using the changeset viewer.