mod_fix.c File Reference

Generic fixup functions for module function parameter. More...

#include <stdio.h>
#include <stdlib.h>
#include <regex.h>
#include "mem/mem.h"
#include "str.h"
#include "ut.h"
#include "error.h"
#include "pvar.h"
#include "mod_fix.h"

Include dependency graph for mod_fix.c:

Go to the source code of this file.

Functions

int fixup_free_igp_pvar_pvar (void **param, int param_no)
 fixup free for functions that get three parameters
  • first parameter was converted to gparam_t (int or PV)
  • second parameter was converted to PV spec
  • third parameter was converted to PV spec

int fixup_free_pvar (void **param)
 
  • helper function: free the PV parameter

int fixup_free_pvar_null (void **param, int param_no)
 fixup free for functions that get one parameter
  • first parameter was converted to PV spec

int fixup_free_pvar_pvar (void **param, int param_no)
 fixup free for functions that get two parameters
  • both parameters were converted to PV spec

int fixup_free_pvar_str (void **param, int param_no)
 fixup free for functions that get two parameters
  • first parameter was converted to PV spec
  • second parameter was converted to str*

int fixup_free_pvar_str_str (void **param, int param_no)
 fixup free for functions that get three parameters
  • first parameter was converted to PV spec
  • second parameter was converted to str*
  • third parameter was converted to str*

int fixup_free_regexp (void **param)
 
  • helper function: free the regular expression parameter

int fixup_free_regexp_none (void **param, int param_no)
int fixup_free_regexp_null (void **param, int param_no)
int fixup_free_str (void **param)
 
  • helper function free the str* parameter

int fixup_free_str_null (void **param, int param_no)
 fixup free for functions that get one parameter
  • first parameter was converted to str*

int fixup_free_str_str (void **param, int param_no)
 fixup free for functions that get two parameters
  • first parameter was converted to str*
  • second parameter was converted to str*

int fixup_get_ivalue (struct sip_msg *msg, gparam_p gp, int *val)
 
  • helper function Return integer value from a gparam_t

int fixup_get_svalue (struct sip_msg *msg, gparam_p gp, str *val)
 
  • helper function Return string value from a gparam_t

int fixup_igp (void **param)
 
  • helper function Convert char* parameter to gparam_t (int or PV)

int fixup_igp_igp (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to gparam_t (int or PV)
  • second parameter is converted to gparam_t (int or PV)

int fixup_igp_null (void **param, int param_no)
 fixup for functions that get one parameter
  • first parameter is converted to gparam_t (int or PV)

int fixup_igp_pvar_pvar (void **param, int param_no)
 fixup for functions that get three parameters
  • first parameter is converted to gparam_t (int or PV)
  • second parameter is converted to PV spec
  • third parameter is converted to PV spec

int fixup_pvar (void **param)
 
  • helper function: Convert char* parameter to PV spec structure

int fixup_pvar_null (void **param, int param_no)
 fixup for functions that get one parameter
  • first parameter is converted to PV spec

int fixup_pvar_pvar (void **param, int param_no)
 fixup for functions that get two parameters
  • both parameters are converted to PV spec

int fixup_pvar_str (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to PV spec
  • second parameter is converted to str*

int fixup_pvar_str_str (void **param, int param_no)
 fixup for functions that get three parameters
  • first parameter is converted to PV spec
  • second parameter is converted to str*
  • third parameter is converted to str*

static int fixup_regexp (void **param, int rflags)
 
  • helper function: Convert char* parameter to regular expression structure
    • the input parameter must be pkg-allocated and will be freed by function (it is how it comes from the config parser)

int fixup_regexp_none (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to regular expression structure
  • second parameter is not converted

int fixup_regexp_null (void **param, int param_no)
 fixup for functions that get one parameter
  • first parameter is converted to regular expression structure

int fixup_regexpNL_none (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to regular expression structure where "match-any-character" operators also match a newline
  • second parameter is not converted

int fixup_regexpNL_null (void **param, int param_no)
 fixup for functions that get one parameter
  • first parameter is converted to regular expression structure where "match-any-character" operators also match a newline

int fixup_spve (void **param)
 
  • helper function Convert char* parameter to gparam_t (str or pv_elem_t)

int fixup_spve_null (void **param, int param_no)
 fixup for functions that get one parameter
  • first parameter is converted to gparam_t (str or pv_elem_t)

int fixup_spve_spve (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to gparam_t (str or pv_elem_t)
  • second parameter is converted to gparam_t (str or pv_elem_t)

int fixup_spve_str (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to gparam_t (str or pv_elem_t)
  • second parameter is converted to str

int fixup_spve_uint (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to gparam_t (str or pv_elem_t)
  • second parameter is converted to uint

int fixup_str (void **param)
 helper function Convert char* parameter to str* parameter
int fixup_str_null (void **param, int param_no)
 fixup for functions that get one parameter
  • first parameter is converted to str*

int fixup_str_str (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to str*
  • second parameter is converted to str*

int fixup_uint (void **param)
 
  • helper function Convert char* parameter to unsigned int
    • the input parameter must be pkg-allocated and will be freed by function (it is how it comes from the config parser)

int fixup_uint_null (void **param, int param_no)
 fixup for functions that get one parameter
  • first parameter is converted to unsigned int

int fixup_uint_uint (void **param, int param_no)
 fixup for functions that get two parameters
  • first parameter is converted to unsigned int
  • second parameter is converted to unsigned int


Detailed Description

Generic fixup functions for module function parameter.

Definition in file mod_fix.c.


Function Documentation

int fixup_free_igp_pvar_pvar ( void **  param,
int  param_no 
)

fixup free for functions that get three parameters

  • first parameter was converted to gparam_t (int or PV)
  • second parameter was converted to PV spec
  • third parameter was converted to PV spec

Definition at line 713 of file mod_fix.c.

References E_UNSPEC, fixup_free_pvar(), and LM_ERR.

int fixup_free_pvar ( void **  param  ) 

  • helper function: free the PV parameter

Definition at line 461 of file mod_fix.c.

References pv_spec_free().

Referenced by fixup_free_igp_pvar_pvar(), fixup_free_pvar_null(), fixup_free_pvar_pvar(), fixup_free_pvar_str(), and fixup_free_pvar_str_str().

int fixup_free_pvar_null ( void **  param,
int  param_no 
)

fixup free for functions that get one parameter

  • first parameter was converted to PV spec

Definition at line 488 of file mod_fix.c.

References E_UNSPEC, fixup_free_pvar(), and LM_ERR.

Referenced by fixup_free_http_query().

int fixup_free_pvar_pvar ( void **  param,
int  param_no 
)

fixup free for functions that get two parameters

  • both parameters were converted to PV spec

Definition at line 520 of file mod_fix.c.

References E_UNSPEC, fixup_free_pvar(), and LM_ERR.

int fixup_free_pvar_str ( void **  param,
int  param_no 
)

fixup free for functions that get two parameters

  • first parameter was converted to PV spec
  • second parameter was converted to str*

Definition at line 558 of file mod_fix.c.

References E_UNSPEC, fixup_free_pvar(), fixup_free_str(), and LM_ERR.

int fixup_free_pvar_str_str ( void **  param,
int  param_no 
)

fixup free for functions that get three parameters

  • first parameter was converted to PV spec
  • second parameter was converted to str*
  • third parameter was converted to str*

Definition at line 598 of file mod_fix.c.

References E_UNSPEC, fixup_free_pvar(), fixup_free_str(), and LM_ERR.

int fixup_free_regexp ( void **  param  ) 

  • helper function: free the regular expression parameter

Definition at line 322 of file mod_fix.c.

References pkg_free.

Referenced by fixup_free_regexp_none(), and fixup_free_regexp_null().

int fixup_free_regexp_none ( void **  param,
int  param_no 
)

fixup free for functions that get two parameters

  • first parameter was converted to regular expression
  • second parameter was notconverted

Definition at line 416 of file mod_fix.c.

References E_UNSPEC, fixup_free_regexp(), and LM_ERR.

Referenced by search_api(), and search_append_api().

int fixup_free_regexp_null ( void **  param,
int  param_no 
)

fixup free for functions that get one parameter

  • first parameter was converted to regular expression

Definition at line 366 of file mod_fix.c.

References E_UNSPEC, fixup_free_regexp(), and LM_ERR.

int fixup_free_str ( void **  param  ) 

  • helper function free the str* parameter

Definition at line 87 of file mod_fix.c.

References pkg_free.

Referenced by fixup_free_pvar_str(), fixup_free_pvar_str_str(), fixup_free_str_null(), and fixup_free_str_str().

int fixup_free_str_null ( void **  param,
int  param_no 
)

fixup free for functions that get one parameter

  • first parameter was converted to str*

Definition at line 129 of file mod_fix.c.

References E_UNSPEC, fixup_free_str(), and LM_ERR.

int fixup_free_str_str ( void **  param,
int  param_no 
)

fixup free for functions that get two parameters

  • first parameter was converted to str*
  • second parameter was converted to str*

Definition at line 144 of file mod_fix.c.

References E_UNSPEC, fixup_free_str(), and LM_ERR.

int fixup_get_ivalue ( struct sip_msg msg,
gparam_p  gp,
int *  val 
)

int fixup_get_svalue ( struct sip_msg msg,
gparam_p  gp,
str val 
)

int fixup_igp ( void **  param  ) 

  • helper function Convert char* parameter to gparam_t (int or PV)

Definition at line 616 of file mod_fix.c.

References E_UNSPEC, GPARAM_TYPE_INT, GPARAM_TYPE_PVS, _gparam::ival, _str::len, LM_ERR, NULL, pkg_free, pkg_malloc, PV_MARKER, pv_parse_spec(), _gparam::pvs, _str::s, str2sint(), _gparam::type, and _gparam::v.

Referenced by fixup_igp_igp(), fixup_igp_null(), and fixup_igp_pvar_pvar().

int fixup_igp_igp ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to gparam_t (int or PV)
  • second parameter is converted to gparam_t (int or PV)

Definition at line 679 of file mod_fix.c.

References E_UNSPEC, fixup_igp(), and LM_ERR.

int fixup_igp_null ( void **  param,
int  param_no 
)

fixup for functions that get one parameter

  • first parameter is converted to gparam_t (int or PV)

Definition at line 664 of file mod_fix.c.

References E_UNSPEC, fixup_igp(), and LM_ERR.

int fixup_igp_pvar_pvar ( void **  param,
int  param_no 
)

fixup for functions that get three parameters

  • first parameter is converted to gparam_t (int or PV)
  • second parameter is converted to PV spec
  • third parameter is converted to PV spec

Definition at line 695 of file mod_fix.c.

References E_UNSPEC, fixup_igp(), fixup_pvar(), and LM_ERR.

int fixup_pvar ( void **  param  ) 

int fixup_pvar_null ( void **  param,
int  param_no 
)

fixup for functions that get one parameter

  • first parameter is converted to PV spec

Definition at line 474 of file mod_fix.c.

References E_UNSPEC, fixup_pvar(), and LM_ERR.

int fixup_pvar_pvar ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • both parameters are converted to PV spec

Definition at line 502 of file mod_fix.c.

References E_UNSPEC, fixup_pvar(), and LM_ERR.

int fixup_pvar_str ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to PV spec
  • second parameter is converted to str*

Definition at line 539 of file mod_fix.c.

References E_UNSPEC, fixup_pvar(), fixup_str(), and LM_ERR.

int fixup_pvar_str_str ( void **  param,
int  param_no 
)

fixup for functions that get three parameters

  • first parameter is converted to PV spec
  • second parameter is converted to str*
  • third parameter is converted to str*

Definition at line 578 of file mod_fix.c.

References E_UNSPEC, fixup_pvar(), fixup_str(), and LM_ERR.

static int fixup_regexp ( void **  param,
int  rflags 
) [static]

  • helper function: Convert char* parameter to regular expression structure
    • the input parameter must be pkg-allocated and will be freed by function (it is how it comes from the config parser)

Definition at line 299 of file mod_fix.c.

References E_BAD_RE, E_OUT_OF_MEM, LM_ERR, pkg_free, and pkg_malloc.

Referenced by fixup_regexp_none(), fixup_regexp_null(), fixup_regexpNL_none(), and fixup_regexpNL_null().

int fixup_regexp_none ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to regular expression structure
  • second parameter is not converted

Definition at line 381 of file mod_fix.c.

References E_UNSPEC, fixup_regexp(), and LM_ERR.

Referenced by search_api(), and search_append_api().

int fixup_regexp_null ( void **  param,
int  param_no 
)

fixup for functions that get one parameter

  • first parameter is converted to regular expression structure

Definition at line 337 of file mod_fix.c.

References E_UNSPEC, fixup_regexp(), and LM_ERR.

int fixup_regexpNL_none ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to regular expression structure where "match-any-character" operators also match a newline
  • second parameter is not converted

Definition at line 399 of file mod_fix.c.

References E_UNSPEC, fixup_regexp(), and LM_ERR.

int fixup_regexpNL_null ( void **  param,
int  param_no 
)

fixup for functions that get one parameter

  • first parameter is converted to regular expression structure where "match-any-character" operators also match a newline

Definition at line 352 of file mod_fix.c.

References E_UNSPEC, fixup_regexp(), and LM_ERR.

int fixup_spve ( void **  param  ) 

int fixup_spve_null ( void **  param,
int  param_no 
)

fixup for functions that get one parameter

  • first parameter is converted to gparam_t (str or pv_elem_t)

Definition at line 788 of file mod_fix.c.

References E_UNSPEC, fixup_spve(), and LM_ERR.

Referenced by add_header_fixup(), auth_fixup(), avp_name_fixup(), carrier_fixup(), cr_load_next_domain_fixup(), cr_load_user_carrier_fixup(), cr_route_fixup(), domain_fixup(), exec_avp_fixup(), fetchc_fixup(), fixup_dlg_bridge(), fixup_dlg_refer(), fixup_http_query(), mod_init(), and unreg_fixup().

int fixup_spve_spve ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to gparam_t (str or pv_elem_t)
  • second parameter is converted to gparam_t (str or pv_elem_t)

Definition at line 803 of file mod_fix.c.

References E_UNSPEC, fixup_spve(), and LM_ERR.

int fixup_spve_str ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to gparam_t (str or pv_elem_t)
  • second parameter is converted to str

Definition at line 836 of file mod_fix.c.

References E_UNSPEC, fixup_spve(), fixup_str(), and LM_ERR.

int fixup_spve_uint ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to gparam_t (str or pv_elem_t)
  • second parameter is converted to uint

Definition at line 818 of file mod_fix.c.

References E_UNSPEC, fixup_spve(), fixup_uint(), and LM_ERR.

int fixup_str ( void **  param  ) 

helper function Convert char* parameter to str* parameter

Definition at line 66 of file mod_fix.c.

References E_UNSPEC, _str::len, LM_ERR, pkg_malloc, _str::s, and s.

Referenced by fixup_pvar_str(), fixup_pvar_str_str(), fixup_spve_str(), fixup_str_null(), and fixup_str_str().

int fixup_str_null ( void **  param,
int  param_no 
)

fixup for functions that get one parameter

  • first parameter is converted to str*

Definition at line 100 of file mod_fix.c.

References E_UNSPEC, fixup_str(), and LM_ERR.

Referenced by fetchc_fixup().

int fixup_str_str ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to str*
  • second parameter is converted to str*

Definition at line 115 of file mod_fix.c.

References E_UNSPEC, fixup_str(), and LM_ERR.

int fixup_uint ( void **  param  ) 

  • helper function Convert char* parameter to unsigned int
    • the input parameter must be pkg-allocated and will be freed by function (it is how it comes from the config parser)

Definition at line 160 of file mod_fix.c.

References E_CFG, _str::len, LM_ERR, pkg_free, _str::s, s, and str2int().

Referenced by fixup_spve_uint(), fixup_uint_null(), and fixup_uint_uint().

int fixup_uint_null ( void **  param,
int  param_no 
)

fixup for functions that get one parameter

  • first parameter is converted to unsigned int

Definition at line 181 of file mod_fix.c.

References E_UNSPEC, fixup_uint(), and LM_ERR.

Referenced by fixup_fix_sdp().

int fixup_uint_uint ( void **  param,
int  param_no 
)

fixup for functions that get two parameters

  • first parameter is converted to unsigned int
  • second parameter is converted to unsigned int

Definition at line 196 of file mod_fix.c.

References E_UNSPEC, fixup_uint(), and LM_ERR.


Generated on Wed May 23 20:00:40 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6