Changeset 256:042af0000c0a in freeDiameter for extensions/app_radgw/rgwx_sample.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_sample.c
r255 r256 41 41 struct rgwp_config { 42 42 /* In a real extension, we would store the parsed configuration file, and the states of the extension */ 43 int state;43 int init; 44 44 }; 45 45 46 46 /* The function called at plugin initialization */ 47 static struct rgwp_config * sample_conf_parse ( char * conf_file )47 static int sample_conf_parse ( char * conf_file, struct rgwp_config ** state ) 48 48 { 49 struct rgwp_config * ret = NULL; 49 TRACE_ENTRY("%p %p", conf_file, state); 50 CHECK_PARAMS(state); 50 51 51 TRACE_ENTRY("%p", conf_file);52 CHECK_MALLOC( *state = malloc(sizeof(struct rgwp_config)) ); 52 53 53 CHECK_MALLOC_DO( ret = malloc(sizeof(struct rgwp_config)), return NULL );54 (*state)->init = 1; 54 55 55 ret->state = 1; 56 57 return ret; 56 return 0; 58 57 } 59 58 60 59 /* This function is called when the plugin is unloaded, to cleanup all the states */ 61 static void sample_conf_free(struct rgwp_config * cs)60 static void sample_conf_free(struct rgwp_config * state) 62 61 { 63 TRACE_ENTRY("%p", cs);64 CHECK_PARAMS_DO( cs, );65 free( cs);62 TRACE_ENTRY("%p", state); 63 CHECK_PARAMS_DO( state, ); 64 free(state); 66 65 return; 67 66 } … … 88 87 /* Finally, we declare the structure that will be loaded by main RADIUS/Diameter gateway extension */ 89 88 struct rgw_api rgwp_descriptor = { 90 sample_conf_parse, 91 sample_conf_free, 92 sample_rad_req, 93 sample_diam_ans 89 .rgwp_name = "sample", 90 .rgwp_conf_parse = sample_conf_parse, 91 .rgwp_conf_free = sample_conf_free, 92 .rgwp_rad_req = sample_rad_req, 93 .rgwp_diam_ans = sample_diam_ans 94 94 };
Note: See TracChangeset
for help on using the changeset viewer.