Navigation


Changeset 255:cb4307a1cd29 in freeDiameter


Ignore:
Timestamp:
Apr 15, 2010, 11:56:32 AM (14 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Added two plugins for RADIUS/Diameter gateway debug.

Location:
extensions/app_radgw
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/app_radgw/CMakeLists.txt

    r254 r255  
    1717        radius.c
    1818        md5.c
     19        rgw_msg_codes.c
     20        rgw_msg_attrtype.c
    1921)
    2022SET( RG_COMMON_HEADER
     
    5456
    5557
     58########### RADIUS/Diameter translation agent plugins (support for RADIUS protocol) ############
     59# Use the macro RGWX_ADD_PLUGIN(name files...) to create a plugin.
     60# It is equivalent to add_library with the appropriate parameters
     61# and naming conventions (.rgwx : Radius GateWay eXtension)
     62MACRO(RGWX_ADD_PLUGIN PLGNAME)
     63  ADD_LIBRARY(${PLGNAME} MODULE ${ARGN})
     64  SET_TARGET_PROPERTIES(${PLGNAME} PROPERTIES PREFIX "" )
     65  SET_TARGET_PROPERTIES(${PLGNAME} PROPERTIES SUFFIX ".rgwx" )
     66  TARGET_LINK_LIBRARIES(${PLGNAME} rgw_common)
     67ENDMACRO(RGWX_ADD_PLUGIN)
     68
     69# Example of plugin:
     70OPTION(BUILD_RGWX_SAMPLE "Build sample plugin? (for developers only)" OFF)
     71        IF (BUILD_RGWX_SAMPLE)
     72           RGWX_ADD_PLUGIN(sample ${RG_COMMON_HEADER} rgwx_sample.c)
     73        ENDIF (BUILD_RGWX_SAMPLE)
     74
     75# A plugin for debug: dumps RADIUS and Diameter messages state at the time the plugin is called.
     76OPTION(BUILD_RGWX_DEBUG "Build debug plugin? (display status of RADIUS and Diameter messages)" ON)
     77        IF (BUILD_RGWX_DEBUG)
     78           RGWX_ADD_PLUGIN(debug ${RG_COMMON_HEADER} rgwx_debug.c)
     79        ENDIF (BUILD_RGWX_DEBUG)
    5680
    5781
     
    6387
    6488
    65 ########### Sub extensions #############
    66 # Example of support extension:
    67 # OPTION(BUILD_RADIUS_GW_SAMPLE "Build sample sub-extension? (for debug only)" OFF)
    68 #       IF (BUILD_RADIUS_GW_SAMPLE)
    69 #          ADD_LIBRARY(sub_sample MODULE ${RG_COMMON_HEADER} sub_sample.c)
    70 #          TARGET_LINK_LIBRARIES(sub_sample rg_common)
    71 #       ENDIF (BUILD_RADIUS_GW_SAMPLE)
    72        
    73 # OPTION(BUILD_SUB_DEBUG "Build debug sub-extension? (display status of RADIUS and Diameter messages)" ON)
    74 #       IF (BUILD_SUB_DEBUG)
    75 #          ADD_LIBRARY(sub_debug MODULE ${RG_COMMON_HEADER} sub_debug.c)
    76 #          TARGET_LINK_LIBRARIES(sub_debug rg_common)
    77 #       ENDIF (BUILD_SUB_DEBUG)
     89
    7890#
    7991# OPTION(BUILD_SUB_ECHO_DROP "Build 'echo/drop' sub-extension? (echo or drop specific RADIUS attributes, no Diameter translation)" ON)
  • extensions/app_radgw/rgw_common.h

    r254 r255  
    219219};
    220220
     221const char * rgw_msg_attrtype_str(unsigned char c);
     222const char * rgw_msg_code_str(unsigned char c);
     223
    221224#endif /* _RGW_COMMON_H */
    222225 
  • extensions/app_radgw/rgw_msg.c

    r254 r255  
    4141#include "rgw.h"
    4242
    43 /* Directly include the code of the functions for dumping (generated from the IANA registries) */
    44 #include "rgw_msg_codes.c"
    45 #include "rgw_msg_attrtype.c"
    46 
    4743/* Destroy a message */
    4844void rgw_msg_free(struct rgw_radius_msg_meta ** msg)
  • extensions/app_radgw/rgw_msg_attrtype.c

    r254 r255  
     1/*********************************************************************************************************
     2* Software License Agreement (BSD License)                                                               *
     3* Author: Sebastien Decugis <sdecugis@nict.go.jp>                                                        *
     4*                                                                                                        *
     5* Copyright (c) 2009, WIDE Project and NICT                                                              *
     6* All rights reserved.                                                                                   *
     7*                                                                                                        *
     8* Redistribution and use of this software in source and binary forms, with or without modification, are  *
     9* permitted provided that the following conditions are met:                                              *
     10*                                                                                                        *
     11* * Redistributions of source code must retain the above                                                 *
     12*   copyright notice, this list of conditions and the                                                    *
     13*   following disclaimer.                                                                                *
     14*                                                                                                        *
     15* * Redistributions in binary form must reproduce the above                                              *
     16*   copyright notice, this list of conditions and the                                                    *
     17*   following disclaimer in the documentation and/or other                                               *
     18*   materials provided with the distribution.                                                            *
     19*                                                                                                        *
     20* * Neither the name of the WIDE Project or NICT nor the                                                 *
     21*   names of its contributors may be used to endorse or                                                  *
     22*   promote products derived from this software without                                                  *
     23*   specific prior written permission of WIDE Project and                                                *
     24*   NICT.                                                                                                *
     25*                                                                                                        *
     26* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
     27* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
     28* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
     29* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT     *
     30* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS    *
     31* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
     32* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   *
     33* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                                             *
     34*********************************************************************************************************/
     35#include "rgw_common.h"
     36
     37/* The content of this file was semi-automatically generated from the IANA registry. */
     38
    139/*  Name of RADIUS attribute from its code */
    240const char * rgw_msg_attrtype_str(unsigned char c) {
  • extensions/app_radgw/rgw_msg_codes.c

    r254 r255  
     1/*********************************************************************************************************
     2* Software License Agreement (BSD License)                                                               *
     3* Author: Sebastien Decugis <sdecugis@nict.go.jp>                                                        *
     4*                                                                                                        *
     5* Copyright (c) 2009, WIDE Project and NICT                                                              *
     6* All rights reserved.                                                                                   *
     7*                                                                                                        *
     8* Redistribution and use of this software in source and binary forms, with or without modification, are  *
     9* permitted provided that the following conditions are met:                                              *
     10*                                                                                                        *
     11* * Redistributions of source code must retain the above                                                 *
     12*   copyright notice, this list of conditions and the                                                    *
     13*   following disclaimer.                                                                                *
     14*                                                                                                        *
     15* * Redistributions in binary form must reproduce the above                                              *
     16*   copyright notice, this list of conditions and the                                                    *
     17*   following disclaimer in the documentation and/or other                                               *
     18*   materials provided with the distribution.                                                            *
     19*                                                                                                        *
     20* * Neither the name of the WIDE Project or NICT nor the                                                 *
     21*   names of its contributors may be used to endorse or                                                  *
     22*   promote products derived from this software without                                                  *
     23*   specific prior written permission of WIDE Project and                                                *
     24*   NICT.                                                                                                *
     25*                                                                                                        *
     26* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED *
     27* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
     28* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR *
     29* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT     *
     30* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS    *
     31* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
     32* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF   *
     33* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                                             *
     34*********************************************************************************************************/
     35#include "rgw_common.h"
     36
     37/* The content of this file was semi-automatically generated from the IANA registry. */
     38
    139/*  Name of RADIUS command from its command code */
    240const char * rgw_msg_code_str(unsigned char c) {
  • extensions/app_radgw/rgw_plugins.c

    r254 r255  
    220220                        goto error;
    221221                }
     222                TRACE_DEBUG(INFO, "RADIUS/Diameter gateway plugin '%s%s%s%s' initialized.", new->plgname, conffile ? " (" : "",  conffile ? new->conffile : "", conffile ? ")" : "");
    222223        }
    223224       
     
    493494                fd_list_unlink(&plg->chain);
    494495                free(plg->conffile);
     496                free(plg->cc);
     497                if (plg->cs && plg->descriptor && plg->descriptor->rgwp_conf_free ) {
     498                        TRACE_DEBUG(INFO, "RADIUS/Diameter gateway plugin '%s' cleaning up...", plg->plgname);
     499                        (*plg->descriptor->rgwp_conf_free)(plg->cs);
     500                }
    495501                free(plg->plgname);
    496                 free(plg->cc);
    497                 if (plg->cs && plg->descriptor && plg->descriptor->rgwp_conf_free )
    498                         (*plg->descriptor->rgwp_conf_free)(plg->cs);
    499502                dlclose(plg->dlo);
    500503                free(plg);
Note: See TracChangeset for help on using the changeset viewer.