Changeset 965:9b37f34c1b1f in freeDiameter for libfdcore
- Timestamp:
- Mar 13, 2013, 1:23:37 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libfdcore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/config.c
r947 r965 248 248 if (fddin == NULL) { 249 249 int ret = errno; 250 TRACE_ DEBUG_ERROR("Unable to open configuration file for reading; tried the following locations: %s%s%s; Error: %s\n",250 TRACE_ERROR("Unable to open configuration file for reading; tried the following locations: %s%s%s; Error: %s\n", 251 251 orig ?: "", orig? " and " : "", fd_g_config->cnf_file, strerror(ret)); 252 252 return ret; -
libfdcore/fdd.l
r961 r965 52 52 yylloc->first_column = yylloc->last_column + 1; \ 53 53 yylloc->last_column = yylloc->first_column + yyleng - 1; \ 54 TRACE_ DEBUG_ERROR( \54 TRACE_ERROR( \ 55 55 "(%d:%d-%d:%d) matched rule %d, length=%d, txt='%s'\n", \ 56 56 yylloc->first_line, yylloc->first_column, \ … … 84 84 int globerrfct(const char *epath, int eerrno) 85 85 { 86 TRACE_ DEBUG_ERROR("Failed to scan %s: %s\n", epath, strerror(eerrno));86 TRACE_ERROR("Failed to scan %s: %s\n", epath, strerror(eerrno)); 87 87 return 1; 88 88 } … … 119 119 if (buf[yyleng-2] != '"') 120 120 { 121 TRACE_ DEBUG_ERROR("Unterminated string: %s\n", yytext);121 TRACE_ERROR("Unterminated string: %s\n", yytext); 122 122 return LEX_ERROR; 123 123 } … … 126 126 if (current_nested_level >= MAX_NESTED_CONF_FILES) 127 127 { 128 TRACE_ DEBUG_ERROR("Too many recursion levels in configuration files includes\n");128 TRACE_ERROR("Too many recursion levels in configuration files includes\n"); 129 129 return LEX_ERROR; 130 130 } … … 135 135 if (globerror == GLOB_NOSPACE) 136 136 { 137 TRACE_ DEBUG_ERROR("Not enough memory to parse include directive.\n");137 TRACE_ERROR("Not enough memory to parse include directive.\n"); 138 138 return LEX_ERROR; 139 139 } 140 140 if (globerror == GLOB_ABORTED) 141 141 { 142 TRACE_ DEBUG_ERROR("An error was encountered in include directive.\n");142 TRACE_ERROR("An error was encountered in include directive.\n"); 143 143 return LEX_ERROR; 144 144 } … … 150 150 if (globerror) 151 151 { 152 TRACE_ DEBUG_ERROR("Unexpected error in glob (%d).\n", globerror);152 TRACE_ERROR("Unexpected error in glob (%d).\n", globerror); 153 153 return LEX_ERROR; 154 154 } … … 166 166 if ( ! yyin ) 167 167 { 168 TRACE_ DEBUG_ERROR("Error in %s: %s", nested_conffiles[current_nested_level].filelist.gl_pathv[0], strerror(errno));168 TRACE_ERROR("Error in %s: %s", nested_conffiles[current_nested_level].filelist.gl_pathv[0], strerror(errno)); 169 169 return LEX_ERROR; 170 170 } … … 206 206 if ( ! yyin ) 207 207 { 208 TRACE_ DEBUG_ERROR("Error in %s: %s", nested_conffiles[current_nested_level].filelist.gl_pathv[nested_conffiles[current_nested_level].current_file], strerror(errno));208 TRACE_ERROR("Error in %s: %s", nested_conffiles[current_nested_level].filelist.gl_pathv[nested_conffiles[current_nested_level].current_file], strerror(errno)); 209 209 return LEX_ERROR; 210 210 } … … 234 234 if (ret != 1) { 235 235 /* No matching: an error occurred */ 236 TRACE_ DEBUG_ERROR("Unable to convert the value '%s' to a valid number: %s\n", yytext, strerror(errno));236 TRACE_ERROR("Unable to convert the value '%s' to a valid number: %s\n", yytext, strerror(errno)); 237 237 return LEX_ERROR; /* trig an error in yacc parser */ 238 238 /* Maybe we could REJECT instead of failing here? */ … … 277 277 /* Unrecognized character */ 278 278 <*>. { 279 TRACE_ DEBUG_ERROR("Unrecognized text on line %d col %d: '%s'.\n", yylloc->first_line, yylloc->first_column, yytext);279 TRACE_ERROR("Unrecognized text on line %d col %d: '%s'.\n", yylloc->first_line, yylloc->first_column, yytext); 280 280 return LEX_ERROR; 281 281 } -
libfdcore/fdd.y
r964 r965 63 63 { 64 64 if (ploc->first_line != ploc->last_line) { 65 TRACE_ DEBUG_ERROR("%s:%d.%d-%d.%d : %s\n", conf->cnf_file, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s);65 TRACE_ERROR("%s:%d.%d-%d.%d : %s\n", conf->cnf_file, ploc->first_line, ploc->first_column, ploc->last_line, ploc->last_column, s); 66 66 } else if (ploc->first_column != ploc->last_column) { 67 TRACE_ DEBUG_ERROR("%s:%d.%d-%d : %s\n", conf->cnf_file, ploc->first_line, ploc->first_column, ploc->last_column, s);67 TRACE_ERROR("%s:%d.%d-%d : %s\n", conf->cnf_file, ploc->first_line, ploc->first_column, ploc->last_column, s); 68 68 } else { 69 TRACE_ DEBUG_ERROR("%s:%d.%d : %s\n", conf->cnf_file, ploc->first_line, ploc->first_column, s);69 TRACE_ERROR("%s:%d.%d : %s\n", conf->cnf_file, ploc->first_line, ploc->first_column, s); 70 70 } 71 71 } … … 328 328 if (fd == NULL) { 329 329 int ret = errno; 330 TRACE_ DEBUG_ERROR("WARNING: Unable to open extension file %s for reading: %s\nLD_LIBRARY_PATH will be used.\n", fname, strerror(ret));330 TRACE_ERROR("WARNING: Unable to open extension file %s for reading: %s\nLD_LIBRARY_PATH will be used.\n", fname, strerror(ret)); 331 331 } else { 332 332 fclose(fd); … … 501 501 if (fd == NULL) { 502 502 int ret = errno; 503 TRACE_ DEBUG_ERROR("Unable to open certificate file %s for reading: %s\n", $3, strerror(ret));503 TRACE_ERROR("Unable to open certificate file %s for reading: %s\n", $3, strerror(ret)); 504 504 yyerror (&yylloc, conf, "Error on file name"); 505 505 YYERROR; … … 509 509 if (fd == NULL) { 510 510 int ret = errno; 511 TRACE_ DEBUG_ERROR("Unable to open private key file %s for reading: %s\n", $5, strerror(ret));511 TRACE_ERROR("Unable to open private key file %s for reading: %s\n", $5, strerror(ret)); 512 512 yyerror (&yylloc, conf, "Error on file name"); 513 513 YYERROR; … … 532 532 if (fd == NULL) { 533 533 int ret = errno; 534 TRACE_ DEBUG_ERROR("Unable to open CA file %s for reading: %s\n", $3, strerror(ret));534 TRACE_ERROR("Unable to open CA file %s for reading: %s\n", $3, strerror(ret)); 535 535 yyerror (&yylloc, conf, "Error on file name"); 536 536 YYERROR; … … 572 572 if (fd == NULL) { 573 573 int ret = errno; 574 TRACE_ DEBUG_ERROR("Unable to open CRL file %s for reading: %s\n", $3, strerror(ret));574 TRACE_ERROR("Unable to open CRL file %s for reading: %s\n", $3, strerror(ret)); 575 575 yyerror (&yylloc, conf, "Error on file name"); 576 576 YYERROR; … … 615 615 &err_pos), 616 616 { yyerror (&yylloc, conf, "Error setting Priority parameter."); 617 TRACE_ DEBUG_ERROR("Error at position : %s\n", err_pos);617 TRACE_ERROR("Error at position : %s\n", err_pos); 618 618 YYERROR; } ); 619 619 } … … 632 632 if (fd == NULL) { 633 633 int ret = errno; 634 TRACE_ DEBUG_ERROR("Unable to open DH file %s for reading: %s\n", $3, strerror(ret));634 TRACE_ERROR("Unable to open DH file %s for reading: %s\n", $3, strerror(ret)); 635 635 yyerror (&yylloc, conf, "Error on file name"); 636 636 YYERROR; -
libfdcore/sctp.c
r961 r965 748 748 fd_log_debug("Calling sctp_bindx with the following address array:\n"); 749 749 for (i = 0; i < count; i++) { 750 TRACE_ DEBUG_sSA(FULL, " - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );750 TRACE_sSA(FD_LOG_DEBUG, FULL, " - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" ); 751 751 ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6) ; 752 752 } … … 776 776 fd_log_debug("SCTP server bound on :\n"); 777 777 for (ptr.sa = sar; sz-- > 0; ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6)) { 778 TRACE_ DEBUG_sSA(FULL, " - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );778 TRACE_sSA(FD_LOG_DEBUG, FULL, " - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" ); 779 779 } 780 780 sctp_freeladdrs(sar); … … 842 842 ptr.buf = sar.buf; 843 843 for (i=0; i< count; i++) { 844 TRACE_ DEBUG_sSA(FULL, " - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" );844 TRACE_sSA(FD_LOG_DEBUG, FULL, " - ", ptr.sa, NI_NUMERICHOST | NI_NUMERICSERV, "" ); 845 845 ptr.buf += (ptr.sa->sa_family == AF_INET) ? sizeof(sSA4) : sizeof(sSA6); 846 846 } … … 1151 1151 case SCTP_PEER_ADDR_CHANGE: 1152 1152 TRACE_DEBUG(FULL, "Received SCTP_PEER_ADDR_CHANGE notification"); 1153 TRACE_ DEBUG_sSA(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, "" ); 1154 1154 TRACE_DEBUG(SCTP_LEVEL, " state : %d", notif->sn_paddr_change.spc_state); 1155 1155 TRACE_DEBUG(SCTP_LEVEL, " error : %d", notif->sn_paddr_change.spc_error); -
libfdcore/sctps.c
r894 r965 343 343 344 344 CHECK_POSIX_DO( pthread_rwlock_wrlock(&sto->lock), return -1 ); 345 TRACE_ DEBUG_BUFFER(GNUTLS_DBG_LEVEL, "Session store [key ", key.data, key.size, "]");345 TRACE_BUFFER(FD_LOG_DEBUG, GNUTLS_DBG_LEVEL, "Session store [key ", key.data, key.size, "]"); 346 346 347 347 li = find_or_next(sto, key, &match); … … 352 352 if ((data.size != sr->data.size) || memcmp(data.data, sr->data.data, data.size)) { 353 353 TRACE_DEBUG(INFO, "GnuTLS tried to store a session with same key and different data!"); 354 TRACE_ DEBUG_BUFFER(INFO, "Session store [key ", key.data, key.size, "]");355 TRACE_ DEBUG_BUFFER(INFO, " -- old data [", sr->data.data, sr->data.size, "]");356 TRACE_ DEBUG_BUFFER(INFO, " -- new data [", data.data, data.size, "]");354 TRACE_BUFFER(FD_LOG_DEBUG, INFO, "Session store [key ", key.data, key.size, "]"); 355 TRACE_BUFFER(FD_LOG_DEBUG, INFO, " -- old data [", sr->data.data, sr->data.size, "]"); 356 TRACE_BUFFER(FD_LOG_DEBUG, INFO, " -- new data [", data.data, data.size, "]"); 357 357 358 358 ret = -1; … … 397 397 398 398 CHECK_POSIX_DO( pthread_rwlock_wrlock(&sto->lock), return -1 ); 399 TRACE_ DEBUG_BUFFER(GNUTLS_DBG_LEVEL, "Session delete [key ", key.data, key.size, "]");399 TRACE_BUFFER(FD_LOG_DEBUG, GNUTLS_DBG_LEVEL, "Session delete [key ", key.data, key.size, "]"); 400 400 401 401 li = find_or_next(sto, key, &match); … … 430 430 431 431 CHECK_POSIX_DO( pthread_rwlock_rdlock(&sto->lock), return error ); 432 TRACE_ DEBUG_BUFFER(GNUTLS_DBG_LEVEL, "Session fetch [key ", key.data, key.size, "]");432 TRACE_BUFFER(FD_LOG_DEBUG, GNUTLS_DBG_LEVEL, "Session fetch [key ", key.data, key.size, "]"); 433 433 434 434 li = find_or_next(sto, key, &match); … … 557 557 size_t ids = sizeof(id); 558 558 CHECK_GNUTLS_DO( gnutls_session_get_id(conn->cc_tls_para.session, id, &ids), /* continue */ ); 559 TRACE_ DEBUG_BUFFER(GNUTLS_DBG_LEVEL, "Master session id: [", id, ids, "]");559 TRACE_BUFFER(FD_LOG_DEBUG, GNUTLS_DBG_LEVEL, "Master session id: [", id, ids, "]"); 560 560 } 561 561 } -
libfdcore/tcp.c
r788 r965 137 137 pthread_cleanup_push(fd_cleanup_socket, &s); 138 138 139 TRACE_ DEBUG_sSA(FULL, "Attempting TCP connection with peer: ", sa, NI_NUMERICHOST | NI_NUMERICSERV, "..." );139 TRACE_sSA(FD_LOG_DEBUG, FULL, "Attempting TCP connection with peer: ", sa, NI_NUMERICHOST | NI_NUMERICSERV, "..." ); 140 140 141 141 /* Try connecting to the remote address */
Note: See TracChangeset
for help on using the changeset viewer.