Changeset 256:042af0000c0a in freeDiameter for extensions/app_radgw/rgwx_debug.c
- Timestamp:
- Apr 16, 2010, 4:57:39 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/rgwx_debug.c
r255 r256 38 38 #include "rgw_common.h" 39 39 40 struct rgwp_config { 41 char * confstring; 42 }; 43 44 /* The function called at plugin initialization */ 45 static struct rgwp_config * debug_conf_parse ( char * conf_file ) 40 /* Store the configuration string in the state */ 41 static int debug_conf_parse ( char * conf_file, struct rgwp_config ** state ) 46 42 { 47 struct rgwp_config * ret = NULL; 43 TRACE_ENTRY("%p %p", conf_file, state); 44 CHECK_PARAMS(state); 48 45 49 TRACE_ENTRY("%p", conf_file);46 *state = (void *)conf_file; 50 47 51 CHECK_MALLOC_DO( ret = malloc(sizeof(struct rgwp_config)), return NULL ); 52 53 ret->confstring = conf_file; 54 55 return ret; 48 return 0; 56 49 } 57 50 58 /* This function is called when the plugin is unloaded, to cleanup all the states */59 static void debug_conf_free(struct rgwp_config * cs)60 {61 TRACE_ENTRY("%p", cs);62 CHECK_PARAMS_DO( cs, );63 free(cs);64 return;65 }66 51 67 52 /* Function to display the content of a RADIUS message (more friendly way than radius_msg_dump) */ … … 91 76 TRACE_ENTRY("%p %p %p %p %p %p", cs, session, rad_req, rad_ans, diam_fw, cli); 92 77 93 fd_log_debug("------------- RADIUS/Diameter Request Debug%s%s%s -------------\n", cs ->confstring ? " [" : "", cs->confstring ?: "", cs->confstring? "]" : "");78 fd_log_debug("------------- RADIUS/Diameter Request Debug%s%s%s -------------\n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 94 79 95 80 if (!rad_req) { … … 114 99 } 115 100 116 fd_log_debug("=========== Debug%s%s%s complete =============\n", cs ->confstring ? " [" : "", cs->confstring ?: "", cs->confstring? "]" : "");101 fd_log_debug("=========== Debug%s%s%s complete =============\n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 117 102 118 103 return 0; … … 124 109 TRACE_ENTRY("%p %p %p %p %p", cs, session, diam_ans, rad_fw, cli); 125 110 126 fd_log_debug("------------- RADIUS/Diameter Answer Debug%s%s%s -------------\n", cs ->confstring ? " [" : "", cs->confstring ?: "", cs->confstring? "]" : "");111 fd_log_debug("------------- RADIUS/Diameter Answer Debug%s%s%s -------------\n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 127 112 128 113 if (!diam_ans || ! *diam_ans) { … … 140 125 } 141 126 142 fd_log_debug("=========== Debug%s%s%s complete =============\n", cs ->confstring ? " [" : "", cs->confstring ?: "", cs->confstring? "]" : "");127 fd_log_debug("=========== Debug%s%s%s complete =============\n", cs ? " [" : "", cs ? (char *)cs : "", cs ? "]" : ""); 143 128 return 0; 144 129 } … … 147 132 /* The exported symbol */ 148 133 struct rgw_api rgwp_descriptor = { 149 debug_conf_parse, 150 debug_conf_free, 151 debug_rad_req, 152 debug_diam_ans 134 .rgwp_name = "debug", 135 .rgwp_conf_parse = debug_conf_parse, 136 .rgwp_conf_free = NULL, 137 .rgwp_rad_req = debug_rad_req, 138 .rgwp_diam_ans = debug_diam_ans 153 139 };
Note: See TracChangeset
for help on using the changeset viewer.