Navigation



Ignore:
Timestamp:
Apr 16, 2010, 4:57:39 PM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Ported the auth plugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/rgwx_sample.c

    r255 r256  
    4141struct rgwp_config {
    4242        /* In a real extension, we would store the parsed configuration file, and the states of the extension */
    43         int state;
     43        int init;
    4444};
    4545
    4646/* The function called at plugin initialization */
    47 static struct rgwp_config * sample_conf_parse ( char * conf_file )
     47static int sample_conf_parse ( char * conf_file, struct rgwp_config ** state )
    4848{
    49         struct rgwp_config * ret = NULL;
     49        TRACE_ENTRY("%p %p", conf_file, state);
     50        CHECK_PARAMS(state);
    5051       
    51         TRACE_ENTRY("%p", conf_file);
     52        CHECK_MALLOC( *state = malloc(sizeof(struct rgwp_config)) );
    5253       
    53         CHECK_MALLOC_DO( ret = malloc(sizeof(struct rgwp_config)), return NULL );
     54        (*state)->init = 1;
    5455       
    55         ret->state = 1;
    56        
    57         return ret;
     56        return 0;
    5857}
    5958
    6059/* This function is called when the plugin is unloaded, to cleanup all the states */
    61 static void sample_conf_free(struct rgwp_config * cs)
     60static void sample_conf_free(struct rgwp_config * state)
    6261{
    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);
    6665        return;
    6766}
     
    8887/* Finally, we declare the structure that will be loaded by main RADIUS/Diameter gateway extension */
    8988struct 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
    9494};     
Note: See TracChangeset for help on using the changeset viewer.