Changeset 1113:eb4ce68b6e5c in freeDiameter
- Timestamp:
- May 13, 2013, 8:17:13 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_interactive/endpoints.i
r1088 r1113 128 128 char * buf = NULL; 129 129 size_t len; 130 printf("%s", fd_ep_dump_one(&buf, &len, NULL, $self));130 printf("%s", fd_ep_dump_one(&buf, &len, NULL, 1, $self)); 131 131 free(buf); 132 132 } -
extensions/dbg_monitor/dbg_monitor.c
r1088 r1113 126 126 127 127 TRACE_DEBUG(INFO, "[dbg_monitor] Dumping servers information"); 128 TRACE_DEBUG(INFO, "%s", fd_servers_dump(&buf, &len, NULL ));128 TRACE_DEBUG(INFO, "%s", fd_servers_dump(&buf, &len, NULL, 1)); 129 129 130 130 sleep(1); -
include/freeDiameter/libfdcore.h
r1103 r1113 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 );816 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump, int details); 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, struct fd_endpoint * ep );856 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int indent, struct fd_list * eps );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, 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 and is being sent.938 /* Hook called when a request message has been created locally by an extension and is being sent. 939 939 - {msg} points to the message. 940 940 - {peer} is NULL -
include/freeDiameter/libfdproto.h
r1107 r1113 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. 2924 2926 * 2925 2927 * DESCRIPTION: … … 2934 2936 * (other errors) 2935 2937 */ 2936 int fd_msg_dispatch ( struct msg ** msg, struct session * session, enum disp_action *action, char ** error_code );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 ); 2937 2939 2938 2940 -
libfdcore/config.c
r1107 r1113 85 85 FD_DUMP_HANDLE_OFFSET(); 86 86 87 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " {freeDiameter configuration}(@%p):\n", fd_g_config), return NULL);87 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "freeDiameter configuration:\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 ........ : \n"), return NULL);102 CHECK_MALLOC_DO( fd_ep_dump( FD_DUMP_STD_PARAMS, 29, &fd_g_config->cnf_endpoints ), return NULL);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); 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) \n"), return NULL);105 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local applications ..... : (none)"), 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 ..... : \n"), return NULL);108 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " Local applications ..... : "), 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\t%s%s\tVnd: %u\n",111 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "App: %u,%s%s,Vnd:%u\t", 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, " Flags : - 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, "\n 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 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);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); 591 591 CHECK_GNUTLS_DO( gnutls_dh_params_generate2( 592 592 fd_g_config->cnf_sec_data.dh_cache, -
libfdcore/endpoints.c
r1093 r1113 285 285 } 286 286 287 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, struct fd_endpoint * ep )287 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, int preamble, struct fd_endpoint * ep ) 288 288 { 289 289 FD_DUMP_HANDLE_OFFSET(); 290 290 291 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{ep}(@%p): ", ep), return NULL); 291 if (preamble) { 292 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{ep}(@%p): ", ep), return NULL); 293 } 292 294 293 295 if (!ep) { … … 297 299 298 300 CHECK_MALLOC_DO( fd_sa_dump_node_serv( FD_DUMP_STD_PARAMS, &ep->sa, NI_NUMERICHOST | NI_NUMERICSERV ), return NULL); 299 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, " 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);301 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "{%s%s%s%s%s}", 302 (ep->flags & EP_FL_CONF) ? "C" : "-", 303 (ep->flags & EP_FL_DISC) ? "D" : "-", 304 (ep->flags & EP_FL_ADV) ? "A" : "-", 305 (ep->flags & EP_FL_LL) ? "L" : "-", 306 (ep->flags & EP_FL_PRIMARY) ? "P" : "-"), return NULL); 305 307 return *buf; 306 308 } 307 309 308 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int indent, struct fd_list * eps )310 DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int preamble, int indent, struct fd_list * eps ) 309 311 { 310 312 struct fd_list * li; … … 312 314 FD_DUMP_HANDLE_OFFSET(); 313 315 314 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s{eps}(@%p):", indent, "", eps), return NULL); 316 if (preamble) { 317 CHECK_MALLOC_DO( fd_dump_extend( FD_DUMP_STD_PARAMS, "%*s{eps}(@%p):", indent, "", eps), return NULL); 318 } 315 319 if (eps) { 316 320 for (li = eps->next; li != eps; li = li->next) { 317 321 struct fd_endpoint * ep = (struct fd_endpoint *)li; 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 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 -
libfdcore/extensions.c
r1094 r1113 151 151 { 152 152 struct fd_ext_info * ext = (struct fd_ext_info *)li; 153 TRACE_DEBUG (INFO,"Loading : %s", ext->filename);153 LOG_D( "Loading : %s", ext->filename); 154 154 155 155 /* Load the extension */ … … 162 162 if (ext->handler == NULL) { 163 163 /* An error occured */ 164 TRACE_ERROR("Loading of extension %s failed: %s", ext->filename, dlerror());164 LOG_F("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 TRACE_DEBUG (INFO,"All extensions loaded.");210 LOG_N("All extensions loaded."); 211 211 212 212 /* We have finished. */ -
libfdcore/messages.c
r1103 r1113 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; 321 322 /* Save the callback in the message, with the timeout */ 323 CHECK_FCT( fd_msg_anscb_associate( *pmsg, anscb, data, expirecb, timeout ) ); 324 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 /* Post the message in the outgoing queue */ 334 CHECK_FCT( fd_fifo_post(fd_g_outgoing, pmsg) ); 335 336 return 0; 337 } 338 316 339 /* Send a message and optionaly register a callback for an answer */ 317 340 int fd_msg_send ( struct msg ** pmsg, void (*anscb)(void *, struct msg **), void * data ) … … 320 343 CHECK_PARAMS( pmsg ); 321 344 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; 345 return fd_msg_send_int(pmsg, anscb, data, NULL, NULL); 329 346 } 330 347 … … 335 352 CHECK_PARAMS( pmsg && expirecb && timeout ); 336 353 337 /* Save the callback in the message, with the timeout */ 338 CHECK_FCT( fd_msg_anscb_associate( *pmsg, anscb, data, expirecb, timeout ) ); 339 340 /* Post the message in the outgoing queue */ 341 CHECK_FCT( fd_fifo_post(fd_g_outgoing, pmsg) ); 342 343 return 0; 354 return fd_msg_send_int(pmsg, anscb, data, expirecb, timeout); 344 355 } 345 356 -
libfdcore/p_ce.c
r1103 r1113 650 650 *recv_cnx = NULL; 651 651 if (*cer) { 652 //fd_msg_log(FD_MSG_LOG_DROPPED, *cer, "An error occurred while rejecting a CER.");652 fd_hook_call(HOOK_MESSAGE_DROPPED, *cer, NULL, "An error occurred while rejecting this CER.", fd_msg_pmdl_get(*cer)); 653 653 fd_msg_free(*cer); 654 654 *cer = NULL; -
libfdcore/p_out.c
r1103 r1113 98 98 CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &msg), 99 99 { 100 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "An error occurred while attempting to requeue this message during cancellation of the sending function");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)); 101 101 CHECK_FCT_DO(fd_msg_free(msg), /* What can we do more? */); 102 102 } ); … … 131 131 { 132 132 if (msg) { 133 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error: Problem while sending (%s)", strerror(ret) ); 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)); 134 136 fd_msg_free(msg); 135 137 } … … 183 185 { 184 186 if (msg) { 185 //fd_msg_log( FD_MSG_LOG_DROPPED, *msg, "Internal error: Problem while sending (%s)", strerror(ret) ); 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)); 186 190 fd_msg_free(*msg); 187 191 *msg = NULL; -
libfdcore/p_psm.c
r1104 r1113 241 241 case FDEVP_CNX_INCOMING: { 242 242 struct cnx_incoming * evd = ev->data; 243 //fd_msg_log( FD_MSG_LOG_DROPPED, evd->cer, "Message discarded while cleaning peer state machine queue.");243 fd_hook_call(HOOK_MESSAGE_DROPPED, evd->cer, NULL, "Message discarded while cleaning peer state machine queue.", fd_msg_pmdl_get(evd->cer)); 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); 579 580 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, peer, buf, fd_msg_pmdl_get(msg)); 580 581 fd_msg_free(msg); … … 590 591 if (ret != EBADMSG) { 591 592 CHECK_FCT_DO( ret, 592 { 593 LOG_E("%s: An unexpected error occurred while parsing a link-local message", peer->p_hdr.info.pi_diamid); 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)); 594 598 fd_msg_free(msg); 595 599 goto psm_end; … … 600 604 CHECK_FCT_DO( ret = fd_out_send(&error, NULL, peer, FD_CNX_ORDERED), ); 601 605 if (error) { 606 char buf[256]; 602 607 /* Only if an error occurred & the message was not saved / dumped */ 603 LOG_E("%s: error sending a message", peer->p_hdr.info.pi_diamid); 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)); 604 611 CHECK_FCT_DO( fd_msg_free(error), goto psm_end); 605 612 } 606 613 } else { 614 char buf[256]; 607 615 /* We received an invalid answer, let's disconnect */ 608 LOG_E("%s: Received invalid answer to Base protocol message, disconnecting...", peer->p_hdr.info.pi_diamid); 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); 609 618 CHECK_FCT_DO( fd_msg_free(msg), goto psm_end); 610 619 CHECK_FCT_DO( fd_event_send(peer->p_events, FDEVP_CNX_ERROR, 0, NULL), goto psm_reset ); … … 657 666 /* Cleanup the message if not done */ 658 667 if (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 ); 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)); 660 672 CHECK_FCT_DO( fd_msg_free(msg), /* continue */); 661 673 msg = NULL; … … 665 677 /* At this point the message must have been fully handled already */ 666 678 if (msg) { 667 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Internal error ('%s'): unhandled message.", peer->p_hdr.info.pi_diamid ); 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)); 668 683 fd_msg_free(msg); 669 684 } … … 732 747 char * buf = NULL; 733 748 size_t len = 0; 734 LOG_D("New remote endpoint(s): %s", fd_ep_dump(&buf, &len, NULL, 6, &peer->p_hdr.info.pi_endpoints) ?: "error");749 LOG_D("New remote endpoint(s): %s", fd_ep_dump(&buf, &len, NULL, 0, 0, &peer->p_hdr.info.pi_endpoints) ?: "error"); 735 750 free(buf); 736 751 } -
libfdcore/p_sr.c
r1110 r1113 119 119 /* If the callback did not dispose of the message, do it now */ 120 120 if (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.");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)); 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 325 327 /* Requeue for sending to another peer */ 326 328 CHECK_FCT_DO( ret = fd_fifo_post(fd_g_outgoing, &sr->req), 327 329 { 328 //fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Internal error: error while requeuing during failover: %s", strerror(ret) ); 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)); 329 333 CHECK_FCT_DO(fd_msg_free(sr->req), /* What can we do more? */) 330 334 }); 331 335 } else { 332 336 /* Just free the request. */ 333 / /fd_msg_log( FD_MSG_LOG_DROPPED, sr->req, "Sent & unanswered local message discarded during failover." );337 /* fd_hook_call(HOOK_MESSAGE_DROPPED, sr->req, NULL, "Sent & unanswered local message discarded during failover.", fd_msg_pmdl_get(sr->req)); */ 334 338 CHECK_FCT_DO(fd_msg_free(sr->req), /* Ignore */); 335 339 } -
libfdcore/peers.c
r1103 r1113 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)); 244 245 CHECK_FCT_DO(fd_fifo_post(fd_g_outgoing, &m), 245 246 { 246 247 /* fallback: destroy the message */ 247 //fd_msg_log(FD_MSG_LOG_DROPPED, m, "Internal error: unable to requeue this message during failover process");248 fd_hook_call(HOOK_MESSAGE_DROPPED, m, NULL, "Internal error: unable to requeue this message during failover process", fd_msg_pmdl_get(m)); 248 249 CHECK_FCT_DO(fd_msg_free(m), /* What can we do more? */) 249 250 } ); -
libfdcore/queues.c
r1078 r1113 74 74 75 75 /* We got one! */ 76 //fd_msg_log( FD_MSG_LOG_DROPPED, msg, "Message lost because framework is terminating.");76 fd_hook_call(HOOK_MESSAGE_DROPPED, msg, NULL, "Message lost because framework is terminating.", fd_msg_pmdl_get(msg)); 77 77 fd_msg_free(msg); 78 78 } -
libfdcore/routing_dispatch.c
r1103 r1113 393 393 394 394 if (!peer) { 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); 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)); 396 398 fd_msg_free(*pmsg); 397 399 *pmsg = NULL; … … 496 498 497 499 /* Now, call any callback registered for the message */ 498 CHECK_FCT( fd_msg_dispatch ( &msgptr, sess, &action, &ec ) );500 CHECK_FCT( fd_msg_dispatch ( &msgptr, sess, &action, &ec, &em, &error) ); 499 501 500 502 /* Now, act depending on msg and action and ec */ … … 505 507 if (!fd_g_config->cnf_flags.no_fwd) { 506 508 /* requeue to fd_g_outgoing */ 509 fd_hook_call(HOOK_MESSAGE_ROUTING_FORWARD, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr)); 507 510 CHECK_FCT( fd_fifo_post(fd_g_outgoing, &msgptr) ); 508 511 break; … … 519 522 520 523 if (!is_req) { 521 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Internal error: Answer received to locally issued request, but not handled by any handler.");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)); 522 525 fd_msg_free(msgptr); 523 526 break; … … 532 535 CHECK_FCT( fd_fifo_post(fd_g_outgoing, &msgptr) ); 533 536 } 537 } else if (em) { 538 fd_hook_call(HOOK_MESSAGE_DROPPED, error, NULL, em, fd_msg_pmdl_get(error)); 539 fd_msg_free(error); 534 540 } 535 541 … … 555 561 /* Handle incorrect bits */ 556 562 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)); 557 564 CHECK_FCT( return_error( &msgptr, "DIAMETER_INVALID_HDR_BITS", "R & E bits were set", NULL) ); 558 565 return 0; … … 573 580 /* Check if we have local support for the message application */ 574 581 if ( (hdr->msg_appl == 0) || (hdr->msg_appl == AI_RELAY) ) { 575 TRACE_DEBUG(INFO, "Received a routable message with application id 0 or " _stringize(AI_RELAY) " (relay)," 576 " returning DIAMETER_APPLICATION_UNSUPPORTED"); 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)); 577 583 CHECK_FCT( return_error( &msgptr, "DIAMETER_APPLICATION_UNSUPPORTED", "Routable message with application id 0 or relay", NULL) ); 578 584 return 0; … … 601 607 { 602 608 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)); 603 610 CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) ); 604 611 return 0; 605 612 } else { 613 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Unspecified error while parsing Destination-Host AVP", fd_msg_pmdl_get(msgptr)); 606 614 return ret; 607 615 } … … 621 629 { 622 630 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)); 623 632 CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) ); 624 633 return 0; 625 634 } else { 635 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Unspecified error while parsing Destination-Realm AVP", fd_msg_pmdl_get(msgptr)); 626 636 return ret; 627 637 } … … 643 653 { 644 654 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)); 645 656 CHECK_FCT( return_error( &msgptr, error_info.pei_errcode, error_info.pei_message, error_info.pei_avp) ); 646 657 return 0; 647 658 } else { 659 fd_hook_call(HOOK_MESSAGE_PARSING_ERROR, msgptr, NULL, "Unspecified error while parsing User-Name AVP", fd_msg_pmdl_get(msgptr)); 648 660 return ret; 649 661 } … … 668 680 /* Handle the missing routing AVPs first */ 669 681 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)); 670 683 CHECK_FCT( return_error( &msgptr, "DIAMETER_COMMAND_UNSUPPORTED", "Non-routable message not supported (invalid bit ? missing Destination-Realm ?)", NULL) ); 671 684 return 0; … … 676 689 if (is_local_app == YES) { 677 690 /* Ok, give the message to the dispatch thread */ 691 fd_hook_call(HOOK_MESSAGE_ROUTING_LOCAL, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr)); 678 692 CHECK_FCT( fd_fifo_post(fd_g_local, &msgptr) ); 679 693 } else { 680 694 /* 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)); 681 696 CHECK_FCT( return_error( &msgptr, "DIAMETER_APPLICATION_UNSUPPORTED", NULL, NULL) ); 682 697 } … … 687 702 if ((is_dest_host == NO) || (is_dest_realm == NO)) { 688 703 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)); 689 705 CHECK_FCT( return_error( &msgptr, "DIAMETER_UNABLE_TO_DELIVER", "I am not a Diameter agent", NULL) ); 690 706 return 0; … … 700 716 { 701 717 /* 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)); 702 719 CHECK_FCT( return_error( &msgptr, "DIAMETER_INVALID_AVP_VALUE", "Failed to process decorated NAI", un) ); 703 720 return 0; … … 713 730 if (is_local_app == YES) { 714 731 /* Handle localy since we are able to */ 732 fd_hook_call(HOOK_MESSAGE_ROUTING_LOCAL, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr)); 715 733 CHECK_FCT(fd_fifo_post(fd_g_local, &msgptr) ); 716 734 return 0; … … 719 737 if (fd_g_config->cnf_flags.no_fwd) { 720 738 /* We return an error */ 739 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, "Application unsupported", fd_msg_pmdl_get(msgptr)); 721 740 CHECK_FCT( return_error( &msgptr, "DIAMETER_APPLICATION_UNSUPPORTED", NULL, NULL) ); 722 741 return 0; … … 736 755 if ((!qry_src) && (!is_err)) { 737 756 /* 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)); 738 758 CHECK_FCT(fd_fifo_post(fd_g_local, &msgptr) ); 739 759 return 0; … … 764 784 CHECK_FCT_DO( ret = (*rh->rt_fwd_cb)(rh->cbdata, &msgptr), 765 785 { 766 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Internal error: a FWD routing callback returned an error (%s)", strerror(ret)); 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)); 767 790 fd_msg_free(msgptr); 768 791 msgptr = NULL; 792 break; 769 793 } ); 770 794 } … … 780 804 /* Now pass the message to the next step: either forward to another peer, or dispatch to local extensions */ 781 805 if (is_req || qry_src) { 806 fd_hook_call(HOOK_MESSAGE_ROUTING_FORWARD, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr)); 782 807 CHECK_FCT(fd_fifo_post(fd_g_outgoing, &msgptr) ); 783 808 } else { 809 fd_hook_call(HOOK_MESSAGE_ROUTING_LOCAL, msgptr, NULL, NULL, fd_msg_pmdl_get(msgptr)); 784 810 CHECK_FCT(fd_fifo_post(fd_g_local, &msgptr) ); 785 811 } … … 823 849 CHECK_FCT( fd_peer_getbyid( qry_src, qry_src_len, 0, (void *) &peer ) ); 824 850 if (fd_peer_getstate(peer) != STATE_OPEN) { 825 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Unable to forward answer to deleted / closed peer '%s'.", qry_src); 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)); 826 855 fd_msg_free(msgptr); 827 856 return 0; … … 908 937 CHECK_FCT_DO( ret = (*rh->rt_out_cb)(rh->cbdata, msgptr, candidates), 909 938 { 910 //fd_msg_log( FD_MSG_LOG_DROPPED, msgptr, "Internal error: an OUT routing callback returned an error (%s)", strerror(ret)); 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)); 911 943 fd_msg_free(msgptr); 912 944 msgptr = NULL; … … 956 988 /* If the message has not been sent, return an error */ 957 989 if (msgptr) { 958 //fd_msg_log( FD_MSG_LOG_NODELIVER, msgptr, "No suitable candidate to route the message to.");990 fd_hook_call(HOOK_MESSAGE_ROUTING_ERROR, msgptr, NULL, "No remaining suitable candidate to route the message to", fd_msg_pmdl_get(msgptr)); 959 991 return_error( &msgptr, "DIAMETER_UNABLE_TO_DELIVER", "No suitable candidate to route the message to", NULL); 960 992 } -
libfdcore/server.c
r1103 r1113 94 94 95 95 /* Dump all servers information */ 96 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump )96 DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump, int details) 97 97 { 98 98 struct fd_list * li, *cli; … … 104 104 enum s_state st = get_status(s); 105 105 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); 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); 124 129 } 125 130 } … … 446 451 size_t len = 0, offset = 0; 447 452 CHECK_MALLOC_DO( fd_dump_extend( &buf, &len, &offset , "Local server address(es): "), ); 448 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 5, &fd_g_config->cnf_endpoints ), );453 CHECK_MALLOC_DO( fd_ep_dump( &buf, &len, &offset, 0, 0, &fd_g_config->cnf_endpoints ), ); 449 454 LOG_N("%s", buf ?: "Error dumping addresses"); 450 455 free(buf); -
libfdproto/dispatch.c
r1078 r1113 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) 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) 71 72 { 72 73 struct fd_list * senti, *li; … … 97 98 CHECK_FCT_DO( (r = (*hdl->cb)(msg, avp, sess, hdl->opaque, action)), 98 99 { 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);100 *drop_reason = "Internal error: a DISPATCH callback returned an error"; 101 *drop_msg = *msg; 101 102 *msg = NULL; 102 103 } -
libfdproto/fdproto-internal.h
r1088 r1113 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); 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); 58 59 extern pthread_rwlock_t fd_disp_lock; 59 60 -
libfdproto/messages.c
r1103 r1113 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 )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) 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; 2686 2688 *action = DISP_ACT_CONT; 2687 2689 … … 2691 2693 2692 2694 /* First, call the DISP_HOW_ANY callbacks */ 2693 CHECK_FCT_DO( ret = fd_disp_call_cb_int( NULL, msg, NULL, session, action, NULL, NULL, NULL, NULL ), goto out );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 ); 2694 2696 2695 2697 TEST_ACTION_STOP(); … … 2708 2710 *action = DISP_ACT_ERROR; 2709 2711 } else { 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);2712 *drop_reason = "Internal error: Received this answer to a local query with an unsupported application"; 2713 *drop_msg = *msg; 2712 2714 *msg = NULL; 2713 2715 } … … 2740 2742 2741 2743 /* Call the callbacks */ 2742 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, avp, session, action, app, cmd, avp->avp_model, enumval ), goto out );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 ); 2743 2745 TEST_ACTION_STOP(); 2744 2746 } … … 2749 2751 /* Now call command and application callbacks */ 2750 2752 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_COMMAND, cmd, &cb_list), goto out ); 2751 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL ), 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 ); 2752 2754 TEST_ACTION_STOP(); 2753 2755 2754 2756 if (app) { 2755 2757 CHECK_FCT_DO( ret = fd_dict_disp_cb(DICT_APPLICATION, app, &cb_list), goto out ); 2756 CHECK_FCT_DO( ret = fd_disp_call_cb_int( cb_list, msg, NULL, session, action, app, cmd, NULL, NULL ), 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 ); 2757 2759 TEST_ACTION_STOP(); 2758 2760 } -
tests/testdisp.c
r1088 r1113 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 ;108 struct msg * msg = NULL, *error; 109 109 enum disp_action action; 110 110 struct disp_hdl * hdl[NB_CB]; 111 111 struct disp_when when; 112 char * ec ;112 char * ec, *em; 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 ) );158 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );182 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );193 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );204 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );238 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );248 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );258 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );268 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );318 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );330 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );342 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );354 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );366 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );379 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );392 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );439 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );449 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );459 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );469 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );479 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );497 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) );521 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 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 ) ); 528 530 529 531 CHECK( 0, fd_disp_unregister( &hdl[0], NULL ) ); … … 541 543 memset(cbcalled, 0, sizeof(cbcalled)); 542 544 msg = new_msg( 1, cmd1, avp1, avp2, 1 ); 543 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );545 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 544 546 CHECK( 1, cbcalled[0] ); 545 547 CHECK( 1, cbcalled[1] ); … … 548 550 CHECK( 0, cbcalled[3] ); 549 551 CHECK( NULL, msg ); 552 CHECK( NULL, ec ); 550 553 551 554 CHECK( 0, fd_disp_unregister( &hdl[0], NULL ) ); … … 563 566 memset(cbcalled, 0, sizeof(cbcalled)); 564 567 msg = new_msg( 1, cmd1, avp1, avp2, 1 ); 565 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );568 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 566 569 CHECK( 1, cbcalled[0] ); 567 570 CHECK( 1, cbcalled[1] ); … … 594 597 memset(cbcalled, 0, sizeof(cbcalled)); 595 598 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 596 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );599 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 597 600 CHECK( 1, cbcalled[0] ); 598 601 CHECK( 1, cbcalled[1] ); … … 606 609 memset(cbcalled, 0, sizeof(cbcalled)); 607 610 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 608 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );611 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 609 612 CHECK( 1, cbcalled[0] ); 610 613 CHECK( 0, cbcalled[1] ); … … 619 622 memset(cbcalled, 0, sizeof(cbcalled)); 620 623 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 621 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );624 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 622 625 CHECK( 1, cbcalled[0] ); 623 626 CHECK( 1, cbcalled[1] ); … … 632 635 memset(cbcalled, 0, sizeof(cbcalled)); 633 636 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 634 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );637 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 635 638 CHECK( 1, cbcalled[0] ); 636 639 CHECK( 1, cbcalled[1] ); … … 645 648 memset(cbcalled, 0, sizeof(cbcalled)); 646 649 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 647 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );650 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 648 651 CHECK( 1, cbcalled[0] ); 649 652 CHECK( 1, cbcalled[1] ); … … 658 661 memset(cbcalled, 0, sizeof(cbcalled)); 659 662 msg = new_msg( 2, cmd2, avp1, avp2, 2 ); 660 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );663 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 661 664 CHECK( 1, cbcalled[0] ); 662 665 CHECK( 1, cbcalled[1] ); … … 711 714 msg = new_msg( 0, cmd1, avp1, NULL, 0 ); 712 715 memset(cbcalled, 0, sizeof(cbcalled)); 713 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec ) );716 CHECK( 0, fd_msg_dispatch ( &msg, sess, &action, &ec, &em, &error ) ); 714 717 CHECK( 1, cbcalled[0] ); 715 718 CHECK( DISP_ACT_CONT, action );
Note: See TracChangeset
for help on using the changeset viewer.