Changeset 1245:4b511d9b3def in freeDiameter for extensions/dbg_msg_dumps/dbg_msg_dumps.c
- Timestamp:
- Nov 11, 2013, 4:30:26 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/dbg_msg_dumps/dbg_msg_dumps.c
r1244 r1245 53 53 #define HK_ROUTING_QUIET 0x0100 /* routing decisions are not dumped -- removes the default handling as well */ 54 54 #define HK_ROUTING_COMPACT 0x0200 /* routing decisions in compact mode */ 55 #define HK_ROUTING_FULL 0x0400 /* routing decisions in full mode */ 56 #define HK_ROUTING_TREE 0x0800 /* routing decisions in tree mode */ 55 57 56 58 #define HK_PEERS_QUIET 0x1000 /* peers connections events are not dumped -- removes the default handling as well */ 57 59 #define HK_PEERS_COMPACT 0x2000 /* peers connections events in compact mode */ 60 #define HK_PEERS_FULL 0x4000 /* peers connections events in full mode */ 61 #define HK_PEERS_TREE 0x8000 /* peers connections events in tree mode */ 58 62 /* 59 Default value is HK_ERRORS_ DETAIL + HK_SNDRCV_DETAIL + HK_PEERS_COMPACT63 Default value is HK_ERRORS_TREE + HK_SNDRCV_TREE + HK_PEERS_TREE 60 64 */ 61 65 … … 63 67 64 68 static struct fd_hook_hdl *md_hdl[4] = {NULL,NULL,NULL,NULL}; 65 static uint32_t dump_level = HK_ERRORS_TREE | HK_SNDRCV_TREE | HK_PEERS_ COMPACT; /* default */69 static uint32_t dump_level = HK_ERRORS_TREE | HK_SNDRCV_TREE | HK_PEERS_TREE; /* default */ 66 70 static char * buf = NULL; 67 71 static size_t len; … … 120 124 break; 121 125 122 /* The following are not received in this hook*/126 /* routing */ 123 127 case HOOK_MESSAGE_LOCAL: 128 LOG_N("ISSUED:"); 129 LOG_SPLIT(FD_LOG_NOTICE, " ", buf, NULL); 130 break; 124 131 case HOOK_MESSAGE_ROUTING_FORWARD: 132 LOG_N("FORWARDING: %s", buf); 133 LOG_SPLIT(FD_LOG_NOTICE, " ", buf, NULL); 134 break; 125 135 case HOOK_MESSAGE_ROUTING_LOCAL: 126 136 LOG_N("DISPATCHING: %s", buf); 137 LOG_SPLIT(FD_LOG_NOTICE, " ", buf, NULL); 138 break; 139 140 /* peers */ 127 141 case HOOK_PEER_CONNECT_FAILED: 142 LOG_N("CONNECT FAILED to %s: %s", peer_name, (char *)other); 143 break; 128 144 case HOOK_PEER_CONNECT_SUCCESS: 129 145 { 146 char protobuf[40]; 147 if (peer) { 148 CHECK_FCT_DO(fd_peer_cnx_proto_info(peer, protobuf, sizeof(protobuf)), break ); 149 } else { 150 protobuf[0] = '-'; 151 protobuf[1] = '\0'; 152 } 153 LOG_N("CONNECTED TO '%s' (%s):", peer_name, protobuf); 154 LOG_SPLIT(FD_LOG_NOTICE, " ", buf, NULL); 155 } 156 break; 157 158 /* Not handled */ 130 159 case HOOK_DATA_RECEIVED: 131 160 break; … … 180 209 break; 181 210 182 /* The following are not received in this hook*/211 /* routing */ 183 212 case HOOK_MESSAGE_LOCAL: 213 LOG_N("ISSUED: %s", buf); 214 break; 184 215 case HOOK_MESSAGE_ROUTING_FORWARD: 216 LOG_N("FORWARDING: %s", buf); 217 break; 185 218 case HOOK_MESSAGE_ROUTING_LOCAL: 186 219 LOG_N("DISPATCHING: %s", buf); 220 break; 221 222 /* peers */ 187 223 case HOOK_PEER_CONNECT_FAILED: 188 case HOOK_PEER_CONNECT_SUCCESS: 189 224 LOG_N("CONNECT FAILED to %s: %s", peer_name, (char *)other); 225 break; 226 case HOOK_PEER_CONNECT_SUCCESS: { 227 char protobuf[40]; 228 if (peer) { 229 CHECK_FCT_DO(fd_peer_cnx_proto_info(peer, protobuf, sizeof(protobuf)), break ); 230 } else { 231 protobuf[0] = '-'; 232 protobuf[1] = '\0'; 233 } 234 LOG_N("CONNECTED TO '%s' (%s): %s", peer_name, protobuf, buf); 235 } 236 break; 237 /* Not handled */ 190 238 case HOOK_DATA_RECEIVED: 191 239 break; … … 310 358 mask_full = (dump_level & HK_ERRORS_FULL) ? mask_errors : 0; 311 359 mask_full |= (dump_level & HK_SNDRCV_FULL) ? mask_sndrcv : 0; 360 mask_full |= (dump_level & HK_ROUTING_FULL) ? mask_routing : 0; 361 mask_full |= (dump_level & HK_PEERS_FULL) ? mask_peers : 0; 312 362 313 363 mask_tree = (dump_level & HK_ERRORS_TREE) ? mask_errors : 0; 314 364 mask_tree |= (dump_level & HK_SNDRCV_TREE) ? mask_sndrcv : 0; 365 mask_tree |= (dump_level & HK_ROUTING_TREE) ? mask_routing : 0; 366 mask_tree |= (dump_level & HK_PEERS_TREE) ? mask_peers : 0; 315 367 316 368 if (mask_quiet) {
Note: See TracChangeset
for help on using the changeset viewer.