Navigation


Changeset 256:042af0000c0a in freeDiameter for extensions/app_radgw/rgwx_debug.c


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_debug.c

    r255 r256  
    3838#include "rgw_common.h"
    3939
    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 */
     41static int debug_conf_parse ( char * conf_file, struct rgwp_config ** state )
    4642{
    47         struct rgwp_config * ret = NULL;
     43        TRACE_ENTRY("%p %p", conf_file, state);
     44        CHECK_PARAMS(state);
    4845       
    49         TRACE_ENTRY("%p", conf_file);
     46        *state = (void *)conf_file;
    5047       
    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;
    5649}
    5750
    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 }
    6651
    6752/* Function to display the content of a RADIUS message (more friendly way than radius_msg_dump) */
     
    9176        TRACE_ENTRY("%p %p %p %p %p %p", cs, session, rad_req, rad_ans, diam_fw, cli);
    9277       
    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 ? "]" : "");
    9479       
    9580        if (!rad_req) {
     
    11499        }
    115100       
    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 ? "]" : "");
    117102       
    118103        return 0;
     
    124109        TRACE_ENTRY("%p %p %p %p %p", cs, session, diam_ans, rad_fw, cli);
    125110
    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 ? "]" : "");
    127112       
    128113        if (!diam_ans || ! *diam_ans) {
     
    140125        }
    141126       
    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 ? "]" : "");
    143128        return 0;
    144129}
     
    147132/* The exported symbol */
    148133struct 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
    153139};     
Note: See TracChangeset for help on using the changeset viewer.