Changes in / [1116:5da2ea1585a1:1115:a325f95de659] in freeDiameter
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_interactive/endpoints.i
r1113 r1088 128 128 char * buf = NULL; 129 129 size_t len; 130 printf("%s", fd_ep_dump_one(&buf, &len, NULL, 1,$self));130 printf("%s", fd_ep_dump_one(&buf, &len, NULL, $self)); 131 131 free(buf); 132 132 } -
extensions/dbg_monitor/dbg_monitor.c
r1113 r1088 126 126 127 127 TRACE_DEBUG(INFO, "[dbg_monitor] Dumping servers information"); 128 TRACE_DEBUG(INFO, "%s", fd_servers_dump(&buf, &len, NULL , 1));128 TRACE_DEBUG(INFO, "%s", fd_servers_dump(&buf, &len, NULL)); 129 129 130 130 sleep(1); -
include/freeDiameter/libfdcore.h
r1113 r1103 814 814 DECLARE_FD_DUMP_PROTOTYPE(fd_conf_dump); 815 815 DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump); 816 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump , int details);816 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump); 817 817 #endif /* SWIG */ 818 818 DECLARE_FD_DUMP_PROTOTYPE(fd_peer_dump_list, int details); … … 853 853 int fd_ep_filter_list( struct fd_list * list, struct fd_list * exclude_list ); 854 854 int fd_ep_clearflags( struct fd_list * list, uint32_t flags ); 855 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, int preamble,struct fd_endpoint * ep );856 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int preamble, intindent, struct fd_list * eps );855 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, struct fd_endpoint * ep ); 856 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int indent, struct fd_list * eps ); 857 857 858 858 … … 936 936 937 937 HOOK_MESSAGE_LOCAL, 938 /* Hook called when a request message has been created locally by an extensionand is being sent.938 /* Hook called when a request message has been created locally and is being sent. 939 939 - {msg} points to the message. 940 940 - {peer} is NULL -
include/freeDiameter/libfdproto.h
r1113 r1107 2922 2922 * action : Upon return, the action that must be taken on the message 2923 2923 * error_code : Upon return with action == DISP_ACT_ERROR, contains the error (such as "DIAMETER_UNABLE_TO_COMPLY") 2924 * drop_reason : if set on return, the message must be freed for this reason.2925 * drop_msg : if drop_reason is set, this points to the message to be freed while *msg is NULL.2926 2924 * 2927 2925 * DESCRIPTION: … … 2936 2934 * (other errors) 2937 2935 */ 2938 int fd_msg_dispatch ( struct msg ** msg, struct session * session, enum disp_action *action, char ** error_code , char ** drop_reason, struct msg ** drop_msg);2936 int fd_msg_dispatch ( struct msg ** msg, struct session * session, enum disp_action *action, char ** error_code ); 2939 2937 2940 2938 -
libfdcore/config.c
r1113 r1107 85 85 FD_DUMP_HANDLE_OFFSET(); 86 86 87 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " freeDiameter configuration:\n", fd_g_config), return NULL);87 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{freeDiameter configuration}(@%p): \n", fd_g_config), return NULL); 88 88 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Default trace level .... : %+d\n", fd_g_debug_lvl), return NULL); 89 89 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Configuration file ..... : %s\n", fd_g_config->cnf_file), return NULL); … … 99 99 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local endpoints ........ : Default (use all available)\n"), return NULL); 100 100 } else { 101 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local endpoints ........ : "), return NULL);102 CHECK_MALLOC_DO( fd_ep_dump( FD_DUMP_STD_PARAMS, 0, 0, &fd_g_config->cnf_endpoints ), return NULL);101 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local endpoints ........ : \n"), return NULL); 102 CHECK_MALLOC_DO( fd_ep_dump( FD_DUMP_STD_PARAMS, 29, &fd_g_config->cnf_endpoints ), return NULL); 103 103 } 104 104 if (FD_IS_LIST_EMPTY(&fd_g_config->cnf_apps)) { 105 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local applications ..... : (none) "), return NULL);105 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local applications ..... : (none)\n"), return NULL); 106 106 } else { 107 107 struct fd_list * li = fd_g_config->cnf_apps.next; 108 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local applications ..... : "), return NULL);108 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local applications ..... : \n"), return NULL); 109 109 while (li != &fd_g_config->cnf_apps) { 110 110 struct fd_app * app = (struct fd_app *)li; 111 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " App: %u,%s%s,Vnd:%u\t",111 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " App: %u\t%s%s\tVnd: %u\n", 112 112 app->appid, 113 113 app->flags.auth ? "Au" : "--", … … 118 118 } 119 119 120 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " \nFlags : - IP ........... : %s\n", fd_g_config->cnf_flags.no_ip4 ? "DISABLED" : "Enabled"), return NULL);120 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Flags : - IP ........... : %s\n", fd_g_config->cnf_flags.no_ip4 ? "DISABLED" : "Enabled"), return NULL); 121 121 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " - IPv6 ......... : %s\n", fd_g_config->cnf_flags.no_ip6 ? "DISABLED" : "Enabled"), return NULL); 122 122 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " - Relay app .... : %s\n", fd_g_config->cnf_flags.no_fwd ? "DISABLED" : "Enabled"), return NULL); … … 588 588 589 589 } else { 590 LOG_D("Generating fresh Diffie-Hellman parameters of size %d (this takes some time)... ", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS);590 TRACE_DEBUG(INFO, "Generating fresh Diffie-Hellman parameters of size %d (this takes some time)... ", fd_g_config->cnf_sec_data.dh_bits ?: GNUTLS_DEFAULT_DHBITS); 591 591 CHECK_GNUTLS_DO( gnutls_dh_params_generate2( 592 592 fd_g_config->cnf_sec_data.dh_cache, -
libfdcore/core.c
r1112 r1111 84 84 static int core_state_wait(enum core_state waitstate) 85 85 { 86 int ret = 0;86 int ret; 87 87 CHECK_POSIX( pthread_mutex_lock( &core_mtx )); 88 88 pthread_cleanup_push( fd_cleanup_mutex, &core_mtx ); 89 while (waitstate > core_state){89 do { 90 90 CHECK_POSIX_DO(ret = pthread_cond_wait(&core_cnd, &core_mtx), break); 91 } 91 } while (waitstate > core_state); 92 92 pthread_cleanup_pop( 0 ); 93 93 CHECK_POSIX( pthread_mutex_unlock( &core_mtx )); … … 189 189 } 190 190 191 LOG_ N("libfdproto initialized.");191 LOG_D("libfdproto initialized."); 192 192 193 193 /* Name this thread */ … … 305 305 if (cur_state < CORE_RUNNING) { 306 306 core_shutdown(); 307 core_state_set(CORE_TERM);308 307 } else if (cur_state == CORE_RUNNING) { 309 308 core_state_set(CORE_SHUTDOWN); … … 324 323 void * th_ret = NULL; 325 324 326 CHECK_FCT(core_state_wait(CORE_SHUTDOWN));327 328 325 if (cur_state == CORE_TERM) 329 326 return 0; 330 327 328 CHECK_FCT(core_state_wait(CORE_SHUTDOWN)); 329 331 330 /* Just wait for core_runner_thread to complete and return gracefully */ 332 331 CHECK_POSIX(pthread_join(core_runner, &th_ret)); -
libfdcore/endpoints.c
r1113 r1093 285 285 } 286 286 287 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, int preamble,struct fd_endpoint * ep )287 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, struct fd_endpoint * ep ) 288 288 { 289 289 FD_DUMP_HANDLE_OFFSET(); 290 290 291 if (preamble) { 292 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{ep}(@%p): ", ep), return NULL); 293 } 291 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{ep}(@%p): ", ep), return NULL); 294 292 295 293 if (!ep) { … … 299 297 300 298 CHECK_MALLOC_DO( fd_sa_dump_node_serv( FD_DUMP_STD_PARAMS, &ep->sa, NI_NUMERICHOST | NI_NUMERICSERV ), return NULL); 301 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " {%s%s%s%s%s}",302 303 304 305 306 299 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " {%s%s%s%s%s}", 300 (ep->flags & EP_FL_CONF) ? "C" : "-", 301 (ep->flags & EP_FL_DISC) ? "D" : "-", 302 (ep->flags & EP_FL_ADV) ? "A" : "-", 303 (ep->flags & EP_FL_LL) ? "L" : "-", 304 (ep->flags & EP_FL_PRIMARY) ? "P" : "-"), return NULL); 307 305 return *buf; 308 306 } 309 307 310 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int preamble, intindent, struct fd_list * eps )308 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int indent, struct fd_list * eps ) 311 309 { 312 310 struct fd_list * li; … … 314 312 FD_DUMP_HANDLE_OFFSET(); 315 313 316 if (preamble) { 317 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s{eps}(@%p):", indent, "", eps), return NULL); 318 } 314 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s{eps}(@%p):", indent, "", eps), return NULL); 319 315 if (eps) { 320 316 for (li = eps->next; li != eps; li = li->next) { 321 317 struct fd_endpoint * ep = (struct fd_endpoint *)li; 322 if (preamble) { 323 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n%*s", indent+1, ""), return NULL); 324 } else if (li->prev != eps) { 325 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\t"), return NULL); 326 } 327 CHECK_MALLOC_DO( fd_ep_dump_one( FD_DUMP_STD_PARAMS, preamble, ep ), return NULL); 328 } 329 } 330 } 331 318 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n%*s", indent+1, ""), return NULL); 319 CHECK_MALLOC_DO( fd_ep_dump_one( FD_DUMP_STD_PARAMS, ep ), return NULL); 320 } 321 } 322 } 323 -
libfdcore/extensions.c
r1113 r1094 151 151 { 152 152 struct fd_ext_info * ext = (struct fd_ext_info *)li; 153 LOG_D("Loading : %s", ext->filename);153 TRACE_DEBUG (INFO, "Loading : %s", ext->filename); 154 154 155 155 /* Load the extension */ … … 162 162 if (ext->handler == NULL) { 163 163 /* An error occured */ 164 LOG_F("Loading of extension %s failed: %s", ext->filename, dlerror());164 TRACE_ERROR("Loading of extension %s failed: %s", ext->filename, dlerror()); 165 165 #ifdef DEBUG 166 166 ext->handler = dlopen(ext->filename, RTLD_LAZY | RTLD_GLOBAL); … … 208 208 } 209 209 210 LOG_N("All extensions loaded.");210 TRACE_DEBUG (INFO, "All extensions loaded."); 211 211 212 212 /* We have finished. */ -
libfdcore/messages.c
r1113 r1103 314 314 } 315 315 316 static int fd_msg_send_int( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data, void (*expirecb)(void *, DiamId_t, size_t, struct msg **), const struct timespec *timeout ) 317 { 318 struct msg_hdr *hdr; 319 DiamId_t diamid; 320 size_t diamidlen; 316 /* Send a message and optionaly register a callback for an answer */ 317 int fd_msg_send ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data ) 318 { 319 TRACE_ENTRY("%p %p %p", pmsg, anscb, data); 320 CHECK_PARAMS( pmsg ); 321 322 /* Save the callback in the message */ 323 CHECK_FCT( fd_msg_anscb_associate( *pmsg, anscb, data, NULL, NULL /* we should maybe use a safeguard here like 1 hour or so? */ ) ); 324 325 /* Post the message in the outgoing queue */ 326 CHECK_FCT( fd_fifo_post(fd_g_outgoing, pmsg) ); 327 328 return 0; 329 } 330 331 /* The variation of the same function with a timeout callback */ 332 int fd_msg_send_timeout ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data, void (*expirecb)(void *, DiamId_t, size_t, struct msg **), const struct timespec *timeout ) 333 { 334 TRACE_ENTRY("%p %p %p %p %p", pmsg, anscb, data, expirecb, timeout); 335 CHECK_PARAMS( pmsg && expirecb && timeout ); 321 336 322 337 /* Save the callback in the message, with the timeout */ 323 338 CHECK_FCT( fd_msg_anscb_associate( *pmsg, anscb, data, expirecb, timeout ) ); 324 339 325 /* If this is a new request, call the HOOK_MESSAGE_LOCAL hook */326 if ( (fd_msg_hdr(*pmsg, &hdr) == 0)327 && (hdr->msg_flags & CMD_FLAG_REQUEST)328 && (fd_msg_source_get(*pmsg, &diamid, &diamidlen) == 0)329 && (diamid == NULL)) {330 fd_hook_call(HOOK_MESSAGE_LOCAL, *pmsg, NULL, NULL, fd_msg_pmdl_get(*pmsg));331 }332 333 340 /* Post the message in the outgoing queue */ 334 341 CHECK_FCT( fd_fifo_post(fd_g_outgoing, pmsg) ); 335 342 336 343 return 0; 337 }338 339 /* Send a message and optionaly register a callback for an answer */340 int fd_msg_send ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data )341 {342 TRACE_ENTRY("%p %p %p", pmsg, anscb, data);343 CHECK_PARAMS( pmsg );344 345 return fd_msg_send_int(pmsg, anscb, data, NULL, NULL);346 }347 348 /* The variation of the same function with a timeout callback */349 int fd_msg_send_timeout ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data, void (*expirecb)(void *, DiamId_t, size_t, struct msg **), const struct timespec *timeout )350 {351 TRACE_ENTRY("%p %p %p %p %p", pmsg, anscb, data, expirecb, timeout);352 CHECK_PARAMS( pmsg && expirecb && timeout );353 354 return fd_msg_send_int(pmsg, anscb, data, expirecb, timeout);355 344 } 356 345 -
libfdcore/p_ce.c
r1113 r1103 650 650 *recv_cnx = NULL; 651 651 if (*cer) { 652 fd_hook_call(HOOK_MESSAGE_DROPPED, *cer, NULL, "An error occurred while rejecting this CER.", fd_msg_pmdl_get(*cer));652 //fd_msg_log(FD_MSG_LOG_DROPPED, *cer, "An error occurred while rejecting a CER."); 653 653 fd_msg_free(*cer); 654 654 *cer = NULL; -
libfdcore/p_out.c
r1113 r1103 98 98 CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &msg), 99 99 { 100 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, "An error occurred while attempting to requeue this message during cancellation of the sending function", fd_msg_pmdl_get(msg));100 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function"); 101 101 CHECK_FCT_DO(fd_msg_free(msg), /* What can we do more? */); 102 102 } ); … … 131 131 { 132 132 if (msg) { 133 char buf[256]; 134 snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret)); 135 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, buf, fd_msg_pmdl_get(msg)); 133 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) ); 136 134 fd_msg_free(msg); 137 135 } … … 185 183 { 186 184 if (msg) { 187 char buf[256]; 188 snprintf(buf, sizeof(buf), "Error while sending this message: s", strerror(ret)); 189 fd_hook_call(HOOK_MESSAGE_DROPPED, *msg, NULL, buf, fd_msg_pmdl_get(*msg)); 185 //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) ); 190 186 fd_msg_free(*msg); 191 187 *msg = NULL; -
libfdcore/p_psm.c
r1113 r1104 241 241 case FDEVP_CNX_INCOMING: { 242 242 struct cnx_incoming * evd = ev->data; 243 fd_hook_call(HOOK_MESSAGE_DROPPED, evd->cer, NULL, "Message discarded while cleaning peer state machine queue.", fd_msg_pmdl_get(evd->cer));243 //fd_msg_log( FD_MSG_LOG_DROPPED, evd->cer, "Message discarded while cleaning peer state machine queue." ); 244 244 CHECK_FCT_DO( fd_msg_free(evd->cer), /* continue */); 245 245 fd_cnx_destroy(evd->cnx); … … 577 577 char buf[128]; 578 578 snprintf(buf, sizeof(buf), "Received while peer state machine was in state %s.", STATE_STR(cur_state)); 579 LOG_E("%s",buf);580 579 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, peer, buf, fd_msg_pmdl_get(msg)); 581 580 fd_msg_free(msg); … … 591 590 if (ret != EBADMSG) { 592 591 CHECK_FCT_DO( ret, 593 { 594 char buf[256]; 595 snprintf(buf, sizeof(buf), "%s: An unexpected error occurred while parsing a link-local message", peer->p_hdr.info.pi_diamid); 596 LOG_E("%s",buf); 597 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, peer, buf, fd_msg_pmdl_get(msg)); 592 { 593 LOG_E("%s: An unexpected error occurred while parsing a link-local message", peer->p_hdr.info.pi_diamid); 598 594 fd_msg_free(msg); 599 595 goto psm_end; … … 604 600 CHECK_FCT_DO( ret = fd_out_send(&error, NULL, peer, FD_CNX_ORDERED), ); 605 601 if (error) { 606 char buf[256];607 602 /* Only if an error occurred & the message was not saved / dumped */ 608 snprintf(buf, sizeof(buf), "%s: error sending a message", peer->p_hdr.info.pi_diamid); 609 LOG_E("%s",buf); 610 fd_hook_call(HOOK_MESSAGE_DROPPED, error, peer, buf, fd_msg_pmdl_get(error)); 603 LOG_E("%s: error sending a message", peer->p_hdr.info.pi_diamid); 611 604 CHECK_FCT_DO( fd_msg_free(error), goto psm_end); 612 605 } 613 606 } else { 614 char buf[256];615 607 /* We received an invalid answer, let's disconnect */ 616 snprintf(buf, sizeof(buf), "%s: Received invalid answer to Base protocol message, disconnecting...", peer->p_hdr.info.pi_diamid); 617 LOG_E("%s",buf); 608 LOG_E("%s: Received invalid answer to Base protocol message, disconnecting...", peer->p_hdr.info.pi_diamid); 618 609 CHECK_FCT_DO( fd_msg_free(msg), goto psm_end); 619 610 CHECK_FCT_DO( fd_event_send(peer->p_events, FDEVP_CNX_ERROR, 0, NULL), goto psm_reset ); … … 666 657 /* Cleanup the message if not done */ 667 658 if (msg) { 668 char buf[256]; 669 snprintf(buf, sizeof(buf), "Received un-handled non-routable command from peer '%s'.", peer->p_hdr.info.pi_diamid); 670 LOG_E("%s",buf); 671 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, buf, fd_msg_pmdl_get(msg)); 659 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Received un-handled non-routable command from peer '%s'.", peer->p_hdr.info.pi_diamid ); 672 660 CHECK_FCT_DO( fd_msg_free(msg), /* continue */); 673 661 msg = NULL; … … 677 665 /* At this point the message must have been fully handled already */ 678 666 if (msg) { 679 char buf[256]; 680 snprintf(buf, sizeof(buf), "Internal error ('%s'): unhandled message.", peer->p_hdr.info.pi_diamid); 681 LOG_E("%s",buf); 682 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, buf, fd_msg_pmdl_get(msg)); 667 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error ('%s'): unhandled message.", peer->p_hdr.info.pi_diamid ); 683 668 fd_msg_free(msg); 684 669 } … … 747 732 char * buf = NULL; 748 733 size_t len = 0; 749 LOG_D("New remote endpoint(s): %s", fd_ep_dump(&buf, &len, NULL, 0, 0, &peer->p_hdr.info.pi_endpoints) ?: "error");734 LOG_D("New remote endpoint(s): %s", fd_ep_dump(&buf, &len, NULL, 6, &peer->p_hdr.info.pi_endpoints) ?: "error"); 750 735 free(buf); 751 736 } -
libfdcore/p_sr.c
r1113 r1110 119 119 /* If the callback did not dispose of the message, do it now */ 120 120 if (ed->request) { 121 fd_hook_call(HOOK_MESSAGE_DROPPED, ed->request, NULL, "Expiration period completed without an answer, and the expiry callback did not dispose of the message.", fd_msg_pmdl_get(ed->request));121 //fd_msg_log(FD_MSG_LOG_DROPPED, ed->request, "Expiration period completed without an answer, and the expiry callback did not dispose of the message."); 122 122 CHECK_FCT_DO( fd_msg_free(ed->request), /* ignore */ ); 123 123 } … … 323 323 hdr->msg_flags |= CMD_FLAG_RETRANSMIT; 324 324 325 fd_hook_call(HOOK_MESSAGE_FAILOVER, sr->req, (struct fd_peer *)srlist->srs.o, NULL, fd_msg_pmdl_get(sr->req));326 327 325 /* Requeue for sending to another peer */ 328 326 CHECK_FCT_DO( ret = fd_fifo_post(fd_g_outgoing, &sr->req), 329 327 { 330 char buf[256]; 331 snprintf(buf, sizeof(buf), "Internal error: error while requeuing during failover: %s", strerror(ret)); 332 fd_hook_call(HOOK_MESSAGE_DROPPED, sr->req, NULL, buf, fd_msg_pmdl_get(sr->req)); 328 //fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Internal error: error while requeuing during failover: %s", strerror(ret) ); 333 329 CHECK_FCT_DO(fd_msg_free(sr->req), /* What can we do more? */) 334 330 }); 335 331 } else { 336 332 /* Just free the request. */ 337 / * fd_hook_call(HOOK_MESSAGE_DROPPED, sr->req, NULL, "Sent & unanswered local message discarded during failover.", fd_msg_pmdl_get(sr->req)); */333 //fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Sent & unanswered local message discarded during failover." ); 338 334 CHECK_FCT_DO(fd_msg_free(sr->req), /* Ignore */); 339 335 } -
libfdcore/peers.c
r1113 r1103 242 242 /* Requeue all messages in the "out" queue */ 243 243 while ( fd_fifo_tryget(peer->p_tosend, &m) == 0 ) { 244 fd_hook_call(HOOK_MESSAGE_FAILOVER, m, peer, NULL, fd_msg_pmdl_get(m));245 244 CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &m), 246 245 { 247 246 /* fallback: destroy the message */ 248 fd_hook_call(HOOK_MESSAGE_DROPPED, m, NULL, "Internal error: unable to requeue this message during failover process", fd_msg_pmdl_get(m));247 //fd_msg_log(FD_MSG_LOG_DROPPED, m, "Internal error: unable to requeue this message during failover process"); 249 248 CHECK_FCT_DO(fd_msg_free(m), /* What can we do more? */) 250 249 } ); -
libfdcore/queues.c
r1113 r1078 74 74 75 75 /* We got one! */ 76 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, "Message lost because framework is terminating.", fd_msg_pmdl_get(msg));76 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Message lost because framework is terminating." ); 77 77 fd_msg_free(msg); 78 78 } -
libfdcore/routing_dispatch.c
r1113 r1103 393 393 394 394 if (!peer) { 395 char buf[256]; 396 snprintf(buf, sizeof(buf), "Unable to send error '%s' to deleted peer '%s' in reply to this message.", error_code, id); 397 fd_hook_call(HOOK_MESSAGE_DROPPED, *pmsg, NULL, buf, fd_msg_pmdl_get(*pmsg)); 395 //fd_msg_log(FD_MSG_LOG_DROPPED, *pmsg, "Unable to send error '%s' to deleted peer '%s' in reply to this message.", error_code, id); 398 396 fd_msg_free(*pmsg); 399 397 *pmsg = NULL; … … 498 496 499 497 /* Now, call any callback registered for the message */ 500 CHECK_FCT( fd_msg_dispatch ( &msgptr, sess, &action, &ec , &em, &error) );498 CHECK_FCT( fd_msg_dispatch ( &msgptr, sess, &action, &ec) ); 501 499 502 500 /* Now, act depending on msg and action and ec */ … … 507 505 if (!fd_g_config->cnf_flags.no_fwd) { 508 506 /* requeue to fd_g_outgoing */ 509 fd_hook_call(HOOK_MESSAGE_ROUTING_FORWARD, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr));510 507 CHECK_FCT( fd_fifo_post(fd_g_outgoing, &msgptr) ); 511 508 break; … … 522 519 523 520 if (!is_req) { 524 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, "Internal error: Answer received to locally issued request, but not handled by any handler.", fd_msg_pmdl_get(msgptr));521 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Internal error: Answer received to locally issued request, but not handled by any handler."); 525 522 fd_msg_free(msgptr); 526 523 break; … … 535 532 CHECK_FCT( fd_fifo_post(fd_g_outgoing, &msgptr) ); 536 533 } 537 } else if (em) {538 fd_hook_call(HOOK_MESSAGE_DROPPED, error, NULL, em, fd_msg_pmdl_get(error));539 fd_msg_free(error);540 534 } 541 535 … … 561 555 /* Handle incorrect bits */ 562 556 if (is_req && is_err) { 563 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "R & E bits were set", fd_msg_pmdl_get(msgptr));564 557 CHECK_FCT( return_error( &msgptr, "DIAMETER_INVALID_HDR_BITS", "R & E bits were set", NULL) ); 565 558 return 0; … … 580 573 /* Check if we have local support for the message application */ 581 574 if ( (hdr->msg_appl == 0) || (hdr->msg_appl == AI_RELAY) ) { 582 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Received a routable message with application id 0 or " _stringize(AI_RELAY) " (relay)", fd_msg_pmdl_get(msgptr)); 575 TRACE_DEBUG(INFO, "Received a routable message with application id 0 or " _stringize(AI_RELAY) " (relay)," 576 " returning DIAMETER_APPLICATION_UNSUPPORTED"); 583 577 CHECK_FCT( return_error( &msgptr, "DIAMETER_APPLICATION_UNSUPPORTED", "Routable message with application id 0 or relay", NULL) ); 584 578 return 0; … … 607 601 { 608 602 if (error_info.pei_errcode) { 609 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, error_info.pei_message ?: error_info.pei_errcode, fd_msg_pmdl_get(msgptr));610 603 CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) ); 611 604 return 0; 612 605 } else { 613 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Unspecified error while parsing Destination-Host AVP", fd_msg_pmdl_get(msgptr));614 606 return ret; 615 607 } … … 629 621 { 630 622 if (error_info.pei_errcode) { 631 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, error_info.pei_message ?: error_info.pei_errcode, fd_msg_pmdl_get(msgptr));632 623 CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) ); 633 624 return 0; 634 625 } else { 635 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Unspecified error while parsing Destination-Realm AVP", fd_msg_pmdl_get(msgptr));636 626 return ret; 637 627 } … … 653 643 { 654 644 if (error_info.pei_errcode) { 655 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, error_info.pei_message ?: error_info.pei_errcode, fd_msg_pmdl_get(msgptr));656 645 CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) ); 657 646 return 0; 658 647 } else { 659 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Unspecified error while parsing User-Name AVP", fd_msg_pmdl_get(msgptr));660 648 return ret; 661 649 } … … 680 668 /* Handle the missing routing AVPs first */ 681 669 if ( is_dest_realm == UNKNOWN ) { 682 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Non-routable message not supported (invalid bit ? missing Destination-Realm ?)", fd_msg_pmdl_get(msgptr));683 670 CHECK_FCT( return_error( &msgptr, "DIAMETER_COMMAND_UNSUPPORTED", "Non-routable message not supported (invalid bit ? missing Destination-Realm ?)", NULL) ); 684 671 return 0; … … 689 676 if (is_local_app == YES) { 690 677 /* Ok, give the message to the dispatch thread */ 691 fd_hook_call(HOOK_MESSAGE_ROUTING_LOCAL, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr));692 678 CHECK_FCT( fd_fifo_post(fd_g_local, &msgptr) ); 693 679 } else { 694 680 /* We don't support the application, reply an error */ 695 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Application unsupported", fd_msg_pmdl_get(msgptr));696 681 CHECK_FCT( return_error( &msgptr, "DIAMETER_APPLICATION_UNSUPPORTED", NULL, NULL) ); 697 682 } … … 702 687 if ((is_dest_host == NO) || (is_dest_realm == NO)) { 703 688 if (fd_g_config->cnf_flags.no_fwd) { 704 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, "Message for another realm/host", fd_msg_pmdl_get(msgptr));705 689 CHECK_FCT( return_error( &msgptr, "DIAMETER_UNABLE_TO_DELIVER", "I am not a Diameter agent", NULL) ); 706 690 return 0; … … 716 700 { 717 701 /* If the process failed, we assume it is because of the AVP format */ 718 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Failed to process decorated NAI", fd_msg_pmdl_get(msgptr));719 702 CHECK_FCT( return_error( &msgptr, "DIAMETER_INVALID_AVP_VALUE", "Failed to process decorated NAI", un) ); 720 703 return 0; … … 730 713 if (is_local_app == YES) { 731 714 /* Handle localy since we are able to */ 732 fd_hook_call(HOOK_MESSAGE_ROUTING_LOCAL, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr));733 715 CHECK_FCT(fd_fifo_post(fd_g_local, &msgptr) ); 734 716 return 0; … … 737 719 if (fd_g_config->cnf_flags.no_fwd) { 738 720 /* We return an error */ 739 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, "Application unsupported", fd_msg_pmdl_get(msgptr));740 721 CHECK_FCT( return_error( &msgptr, "DIAMETER_APPLICATION_UNSUPPORTED", NULL, NULL) ); 741 722 return 0; … … 755 736 if ((!qry_src) && (!is_err)) { 756 737 /* The message is a normal answer to a request issued localy, we do not call the callbacks chain on it. */ 757 fd_hook_call(HOOK_MESSAGE_ROUTING_LOCAL, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr));758 738 CHECK_FCT(fd_fifo_post(fd_g_local, &msgptr) ); 759 739 return 0; … … 784 764 CHECK_FCT_DO( ret = (*rh->rt_fwd_cb)(rh->cbdata, &msgptr), 785 765 { 786 char buf[256]; 787 snprintf(buf, sizeof(buf), "A FWD routing callback returned an error: %s", strerror(ret)); 788 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, buf, fd_msg_pmdl_get(msgptr)); 789 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, buf, fd_msg_pmdl_get(msgptr)); 766 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Internal error: a FWD routing callback returned an error (%s)", strerror(ret)); 790 767 fd_msg_free(msgptr); 791 768 msgptr = NULL; 792 break;793 769 } ); 794 770 } … … 804 780 /* Now pass the message to the next step: either forward to another peer, or dispatch to local extensions */ 805 781 if (is_req || qry_src) { 806 fd_hook_call(HOOK_MESSAGE_ROUTING_FORWARD, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr));807 782 CHECK_FCT(fd_fifo_post(fd_g_outgoing, &msgptr) ); 808 783 } else { 809 fd_hook_call(HOOK_MESSAGE_ROUTING_LOCAL, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr));810 784 CHECK_FCT(fd_fifo_post(fd_g_local, &msgptr) ); 811 785 } … … 849 823 CHECK_FCT( fd_peer_getbyid( qry_src, qry_src_len, 0, (void *) &peer ) ); 850 824 if (fd_peer_getstate(peer) != STATE_OPEN) { 851 char buf[128]; 852 snprintf(buf, sizeof(buf), "Unable to forward answer to deleted / closed peer '%s'.", qry_src); 853 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, buf, fd_msg_pmdl_get(msgptr)); 854 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, buf, fd_msg_pmdl_get(msgptr)); 825 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Unable to forward answer to deleted / closed peer '%s'.", qry_src); 855 826 fd_msg_free(msgptr); 856 827 return 0; … … 937 908 CHECK_FCT_DO( ret = (*rh->rt_out_cb)(rh->cbdata, msgptr, candidates), 938 909 { 939 char buf[256]; 940 snprintf(buf, sizeof(buf), "An OUT routing callback returned an error: %s", strerror(ret)); 941 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, buf, fd_msg_pmdl_get(msgptr)); 942 fd_hook_call(HOOK_MESSAGE_DROPPED, msgptr, NULL, buf, fd_msg_pmdl_get(msgptr)); 910 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Internal error: an OUT routing callback returned an error (%s)", strerror(ret)); 943 911 fd_msg_free(msgptr); 944 912 msgptr = NULL; … … 988 956 /* If the message has not been sent, return an error */ 989 957 if (msgptr) { 990 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, "No remaining suitable candidate to route the message to", fd_msg_pmdl_get(msgptr));958 //fd_msg_log( FD_MSG_LOG_NODELIVER, msgptr, "No suitable candidate to route the message to." ); 991 959 return_error( &msgptr, "DIAMETER_UNABLE_TO_DELIVER", "No suitable candidate to route the message to", NULL); 992 960 } -
libfdcore/server.c
r1113 r1103 94 94 95 95 /* Dump all servers information */ 96 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump , int details)96 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump) 97 97 { 98 98 struct fd_list * li, *cli; … … 104 104 enum s_state st = get_status(s); 105 105 106 if (details) { 107 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{server}(@%p)'%s': %s, %s, %s", s, fd_cnx_getid(s->conn), 108 IPPROTO_NAME( s->proto ), 109 s->secur ? "Secur" : "NotSecur", 110 (st == NOT_CREATED) ? "Thread not created" : 111 ((st == RUNNING) ? "Thread running" : 112 ((st == TERMINATED) ? "Thread terminated" : 113 "Thread status unknown"))), return NULL); 114 /* Dump the client list of this server */ 115 CHECK_POSIX_DO( pthread_mutex_lock(&s->clients_mtx), ); 116 for (cli = s->clients.next; cli != &s->clients; cli = cli->next) { 117 struct client * c = (struct client *)cli; 118 char bufts[128]; 119 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n {client}(@%p)'%s': to:%s", c, fd_cnx_getid(c->conn), fd_log_time(&c->ts, bufts, sizeof(bufts))), break); 120 } 121 CHECK_POSIX_DO( pthread_mutex_unlock(&s->clients_mtx), ); 122 123 if (li->next != &FD_SERVERS) { 124 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n"), return NULL); 125 } 126 } else { 127 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "'%s'(%s,%s) ", fd_cnx_getid(s->conn), 128 IPPROTO_NAME( s->proto ), s->secur ? "Secur" : "NotSecur"), return NULL); 106 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{server}(@%p)'%s': %s, %s, %s", s, fd_cnx_getid(s->conn), 107 IPPROTO_NAME( s->proto ), 108 s->secur ? "Secur" : "NotSecur", 109 (st == NOT_CREATED) ? "Thread not created" : 110 ((st == RUNNING) ? "Thread running" : 111 ((st == TERMINATED) ? "Thread terminated" : 112 "Thread status unknown"))), return NULL); 113 /* Dump the client list of this server */ 114 CHECK_POSIX_DO( pthread_mutex_lock(&s->clients_mtx), ); 115 for (cli = s->clients.next; cli != &s->clients; cli = cli->next) { 116 struct client * c = (struct client *)cli; 117 char bufts[128]; 118 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n {client}(@%p)'%s': to:%s", c, fd_cnx_getid(c->conn), fd_log_time(&c->ts, bufts, sizeof(bufts))), break); 119 } 120 CHECK_POSIX_DO( pthread_mutex_unlock(&s->clients_mtx), ); 121 122 if (li->next != &FD_SERVERS) { 123 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "\n"), return NULL); 129 124 } 130 125 } … … 451 446 size_t len = 0, offset = 0; 452 447 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset , "Local server address(es): "), ); 453 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, &fd_g_config->cnf_endpoints ), );448 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 5, &fd_g_config->cnf_endpoints ), ); 454 449 LOG_N("%s", buf ?: "Error dumping addresses"); 455 450 free(buf); -
libfdproto/dispatch.c
r1113 r1078 68 68 /* Call CBs from a given list (any_handlers if cb_list is NULL) -- must have locked fd_disp_lock before */ 69 69 int fd_disp_call_cb_int( struct fd_list * cb_list, struct msg ** msg, struct avp *avp, struct session *sess, enum disp_action *action, 70 struct dict_object * obj_app, struct dict_object * obj_cmd, struct dict_object * obj_avp, struct dict_object * obj_enu, 71 char ** drop_reason, struct msg ** drop_msg) 70 struct dict_object * obj_app, struct dict_object * obj_cmd, struct dict_object * obj_avp, struct dict_object * obj_enu) 72 71 { 73 72 struct fd_list * senti, *li; … … 98 97 CHECK_FCT_DO( (r = (*hdl->cb)(msg, avp, sess, hdl->opaque, action)), 99 98 { 100 *drop_reason = "Internal error: a DISPATCH callback returned an error";101 *drop_msg = *msg;99 //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: a DISPATCH callback returned an error (%s)", strerror(r)); 100 fd_msg_free(*msg); 102 101 *msg = NULL; 103 102 } -
libfdproto/fdproto-internal.h
r1113 r1088 55 55 DECLARE_FD_DUMP_PROTOTYPE(fd_dict_dump_avp_value, union avp_value *avp_value, struct dict_object * model, int indent, int header); 56 56 int fd_disp_call_cb_int( struct fd_list * cb_list, struct msg ** msg, struct avp *avp, struct session *sess, enum disp_action *action, 57 struct dict_object * obj_app, struct dict_object * obj_cmd, struct dict_object * obj_avp, struct dict_object * obj_enu, 58 char ** drop_reason, struct msg ** drop_msg); 57 struct dict_object * obj_app, struct dict_object * obj_cmd, struct dict_object * obj_avp, struct dict_object * obj_enu); 59 58 extern pthread_rwlock_t fd_disp_lock; 60 59 -
libfdproto/messages.c
r1113 r1103 2670 2670 2671 2671 /* Call all dispatch callbacks for a given message */ 2672 int fd_msg_dispatch ( struct msg ** msg, struct session * session, enum disp_action *action, char ** error_code , char ** drop_reason, struct msg ** drop_msg)2672 int fd_msg_dispatch ( struct msg ** msg, struct session * session, enum disp_action *action, char ** error_code) 2673 2673 { 2674 2674 struct dictionary * dict; … … 2684 2684 if (error_code) 2685 2685 *error_code = NULL; 2686 if (drop_reason)2687 *drop_reason = NULL;2688 2686 *action = DISP_ACT_CONT; 2689 2687 … … 2693 2691 2694 2692 /* First, call the DISP_HOW_ANY callbacks */ 2695 CHECK_FCT_DO( ret = fd_disp_call_cb_int( NULL, msg, NULL, session, action, NULL, NULL, NULL, NULL , drop_reason, drop_msg), goto out );2693 CHECK_FCT_DO( ret = fd_disp_call_cb_int( NULL, msg, NULL, session, action, NULL, NULL, NULL, NULL ), goto out ); 2696 2694 2697 2695 TEST_ACTION_STOP(); … … 2710 2708 *action = DISP_ACT_ERROR; 2711 2709 } else { 2712 *drop_reason = "Internal error: Received this answer to a local query with an unsupported application";2713 *drop_msg = *msg;2710 //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Received this answer to a local query with an unsupported application %d", (*msg)->msg_public.msg_appl); 2711 fd_msg_free(*msg); 2714 2712 *msg = NULL; 2715 2713 } … … 2742 2740 2743 2741 /* Call the callbacks */ 2744 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, avp, session, action, app, cmd, avp->avp_model, enumval , drop_reason, drop_msg), goto out );2742 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, avp, session, action, app, cmd, avp->avp_model, enumval ), goto out ); 2745 2743 TEST_ACTION_STOP(); 2746 2744 } … … 2751 2749 /* Now call command and application callbacks */ 2752 2750 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_COMMAND, cmd, &cb_list), goto out ); 2753 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL , drop_reason, drop_msg), goto out );2751 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL ), goto out ); 2754 2752 TEST_ACTION_STOP(); 2755 2753 2756 2754 if (app) { 2757 2755 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_APPLICATION, app, &cb_list), goto out ); 2758 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL , drop_reason, drop_msg), goto out );2756 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL ), goto out ); 2759 2757 TEST_ACTION_STOP(); 2760 2758 } -
tests/testdisp.c
r1113 r1088 106 106 struct dict_object * avp1, * avp2; /* avp2 is enumerated; they are both unsigned32 types */ 107 107 struct dict_object * enu1, * enu2; 108 struct msg * msg = NULL , *error;108 struct msg * msg = NULL; 109 109 enum disp_action action; 110 110 struct disp_hdl * hdl[NB_CB]; 111 111 struct disp_when when; 112 char * ec , *em;112 char * ec; 113 113 114 114 /* First, initialize the daemon modules */ … … 156 156 msg = new_msg( 0, cmd1, avp1, NULL, 0 ); 157 157 memset(cbcalled, 0, sizeof(cbcalled)); 158 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );158 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 159 159 CHECK( 1, cbcalled[0] ); 160 160 CHECK( DISP_ACT_CONT, action ); … … 180 180 memset(cbcalled, 0, sizeof(cbcalled)); 181 181 msg = new_msg( 0, cmd1, avp1, NULL, 0 ); 182 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );182 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 183 183 CHECK( 1, cbcalled[0] ); 184 184 CHECK( 0, cbcalled[1] ); … … 191 191 memset(cbcalled, 0, sizeof(cbcalled)); 192 192 msg = new_msg( 1, cmd1, avp1, NULL, 0 ); 193 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );193 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 194 194 CHECK( 1, cbcalled[0] ); 195 195 CHECK( 1, cbcalled[1] ); … … 202 202 memset(cbcalled, 0, sizeof(cbcalled)); 203 203 msg = new_msg( 2, cmd1, avp1, NULL, 0 ); 204 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );204 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 205 205 CHECK( 1, cbcalled[0] ); 206 206 CHECK( 0, cbcalled[1] ); … … 236 236 memset(cbcalled, 0, sizeof(cbcalled)); 237 237 msg = new_msg( 0, cmd1, avp1, NULL, 0 ); 238 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );238 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 239 239 CHECK( 1, cbcalled[0] ); 240 240 CHECK( 1, cbcalled[1] ); … … 246 246 memset(cbcalled, 0, sizeof(cbcalled)); 247 247 msg = new_msg( 2, cmd1, avp1, NULL, 0 ); 248 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );248 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 249 249 CHECK( 1, cbcalled[0] ); 250 250 CHECK( 1, cbcalled[1] ); … … 256 256 memset(cbcalled, 0, sizeof(cbcalled)); 257 257 msg = new_msg( 2, cmd2, avp1, NULL, 0 ); 258 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );258 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 259 259 CHECK( 1, cbcalled[0] ); 260 260 CHECK( 0, cbcalled[1] ); … … 266 266 memset(cbcalled, 0, sizeof(cbcalled)); 267 267 msg = new_msg( 1, cmd2, NULL, avp2, 0 ); 268 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );268 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 269 269 CHECK( 1, cbcalled[0] ); 270 270 CHECK( 0, cbcalled[1] ); … … 316 316 memset(cbcalled, 0, sizeof(cbcalled)); 317 317 msg = new_msg( 0, cmd1, NULL, NULL, 0 ); 318 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );318 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 319 319 CHECK( 1, cbcalled[0] ); 320 320 CHECK( 0, cbcalled[1] ); … … 328 328 memset(cbcalled, 0, sizeof(cbcalled)); 329 329 msg = new_msg( 0, cmd1, avp1, NULL, 0 ); 330 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );330 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 331 331 CHECK( 1, cbcalled[0] ); 332 332 CHECK( 1, cbcalled[1] ); … … 340 340 memset(cbcalled, 0, sizeof(cbcalled)); 341 341 msg = new_msg( 1, cmd2, avp1, NULL, 0 ); 342 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );342 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 343 343 CHECK( 1, cbcalled[0] ); 344 344 CHECK( 1, cbcalled[1] ); … … 352 352 memset(cbcalled, 0, sizeof(cbcalled)); 353 353 msg = new_msg( 1, cmd1, avp1, NULL, 0 ); 354 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );354 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 355 355 CHECK( 1, cbcalled[0] ); 356 356 CHECK( 1, cbcalled[1] ); … … 364 364 memset(cbcalled, 0, sizeof(cbcalled)); 365 365 msg = new_msg( 1, cmd1, avp1, avp2, 0 ); 366 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );366 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 367 367 CHECK( 1, cbcalled[0] ); 368 368 CHECK( 1, cbcalled[1] ); … … 377 377 memset(cbcalled, 0, sizeof(cbcalled)); 378 378 msg = new_msg( 1, cmd1, NULL, avp2, 1 ); 379 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );379 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 380 380 CHECK( 1, cbcalled[0] ); 381 381 CHECK( 0, cbcalled[1] ); … … 390 390 memset(cbcalled, 0, sizeof(cbcalled)); 391 391 msg = new_msg( 1, cmd1, NULL, avp2, 2 ); 392 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );392 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 393 393 CHECK( 1, cbcalled[0] ); 394 394 CHECK( 0, cbcalled[1] ); … … 437 437 memset(cbcalled, 0, sizeof(cbcalled)); 438 438 msg = new_msg( 0, cmd1, avp1, NULL, 0 ); 439 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );439 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 440 440 CHECK( 1, cbcalled[0] ); 441 441 CHECK( 0, cbcalled[1] ); … … 447 447 memset(cbcalled, 0, sizeof(cbcalled)); 448 448 msg = new_msg( 1, cmd2, avp1, avp2, 0 ); 449 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );449 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 450 450 CHECK( 1, cbcalled[0] ); 451 451 CHECK( 0, cbcalled[1] ); … … 457 457 memset(cbcalled, 0, sizeof(cbcalled)); 458 458 msg = new_msg( 1, cmd2, avp1, avp2, 1 ); 459 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );459 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 460 460 CHECK( 1, cbcalled[0] ); 461 461 CHECK( 1, cbcalled[1] ); … … 467 467 memset(cbcalled, 0, sizeof(cbcalled)); 468 468 msg = new_msg( 1, cmd2, avp1, avp2, 2 ); 469 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );469 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 470 470 CHECK( 1, cbcalled[0] ); 471 471 CHECK( 0, cbcalled[1] ); … … 477 477 memset(cbcalled, 0, sizeof(cbcalled)); 478 478 msg = new_msg( 1, cmd1, avp1, avp2, 1 ); 479 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );479 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 480 480 CHECK( 1, cbcalled[0] ); 481 481 CHECK( 1, cbcalled[1] ); … … 495 495 CHECK( 0, fd_msg_avp_add ( msg, MSG_BRW_LAST_CHILD, avp ) ); 496 496 } 497 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );497 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 498 498 CHECK( 1, cbcalled[0] ); 499 499 CHECK( 1, cbcalled[1] ); … … 519 519 memset(cbcalled, 0, sizeof(cbcalled)); 520 520 msg = new_msg( 1, cmd1, avp1, avp2, 1 ); 521 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );521 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 522 522 CHECK( 1, cbcalled[0] ); 523 523 CHECK( 1, cbcalled[1] ); … … 526 526 CHECK( 0, cbcalled[3] ); 527 527 CHECK( 0, msg ? 1 : 0); 528 CHECK( 1, ec ? 1 : 0);529 CHECK( 0, fd_msg_free( error ) );530 528 531 529 CHECK( 0, fd_disp_unregister( &hdl[0], NULL ) ); … … 543 541 memset(cbcalled, 0, sizeof(cbcalled)); 544 542 msg = new_msg( 1, cmd1, avp1, avp2, 1 ); 545 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );543 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 546 544 CHECK( 1, cbcalled[0] ); 547 545 CHECK( 1, cbcalled[1] ); … … 550 548 CHECK( 0, cbcalled[3] ); 551 549 CHECK( NULL, msg ); 552 CHECK( NULL, ec );553 550 554 551 CHECK( 0, fd_disp_unregister( &hdl[0], NULL ) ); … … 566 563 memset(cbcalled, 0, sizeof(cbcalled)); 567 564 msg = new_msg( 1, cmd1, avp1, avp2, 1 ); 568 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );565 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 569 566 CHECK( 1, cbcalled[0] ); 570 567 CHECK( 1, cbcalled[1] ); … … 597 594 memset(cbcalled, 0, sizeof(cbcalled)); 598 595 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 599 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );596 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 600 597 CHECK( 1, cbcalled[0] ); 601 598 CHECK( 1, cbcalled[1] ); … … 609 606 memset(cbcalled, 0, sizeof(cbcalled)); 610 607 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 611 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );608 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 612 609 CHECK( 1, cbcalled[0] ); 613 610 CHECK( 0, cbcalled[1] ); … … 622 619 memset(cbcalled, 0, sizeof(cbcalled)); 623 620 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 624 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );621 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 625 622 CHECK( 1, cbcalled[0] ); 626 623 CHECK( 1, cbcalled[1] ); … … 635 632 memset(cbcalled, 0, sizeof(cbcalled)); 636 633 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 637 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );634 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 638 635 CHECK( 1, cbcalled[0] ); 639 636 CHECK( 1, cbcalled[1] ); … … 648 645 memset(cbcalled, 0, sizeof(cbcalled)); 649 646 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 650 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );647 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 651 648 CHECK( 1, cbcalled[0] ); 652 649 CHECK( 1, cbcalled[1] ); … … 661 658 memset(cbcalled, 0, sizeof(cbcalled)); 662 659 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 663 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );660 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 664 661 CHECK( 1, cbcalled[0] ); 665 662 CHECK( 1, cbcalled[1] ); … … 714 711 msg = new_msg( 0, cmd1, avp1, NULL, 0 ); 715 712 memset(cbcalled, 0, sizeof(cbcalled)); 716 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec , &em, &error) );713 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) ); 717 714 CHECK( 1, cbcalled[0] ); 718 715 CHECK( DISP_ACT_CONT, action );
Note: See TracChangeset
for help on using the changeset viewer.