conf.h File Reference

#include "../../mi/mi.h"
#include "../../parser/msg_parser.h"
#include "../../proxy.h"

Include dependency graph for conf.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void conf_destroy (void)
 Destroy configuration.
int conf_init (int max_id)
 Initialize configuration.
struct proxy_lconf_needs_forward (struct sip_msg *msg, int id)
 Checks forwarding is needed.
int conf_parse_filter (char *settings)
 Parses a configuration string for the filter Parses a configuration string for switch settings and updates the configuration structure.
int conf_parse_proxy (char *settings)
 Parses a configuration string for proxy settings Parses a configuration string for proxy settings and updates the configuration structure.
int conf_parse_switch (char *settings)
 Parses configuration string for the switch Parses a configuration string for switch settings and updates the configuration structure.
int conf_show (struct mi_root *rpl_tree)
 Output configuration in FIFO format.
int conf_str2id (char *id_str)
 Converts string to integer and checks for validity.


Function Documentation

void conf_destroy ( void   ) 

Destroy configuration.

Definition at line 556 of file conf.c.

References fwd_setting::active, free_shm_proxy(), fwd_max_id, id, proxy, and shm_free.

int conf_init ( int  max_id  ) 

Initialize configuration.

Parameters:
max_id number of configuration statements
Returns:
0 on success, -1 on failure

Definition at line 539 of file conf.c.

References fwd_max_id, NULL, shm_malloc(), and SHM_MEM_ERROR.

Referenced by mod_init().

struct proxy_l* conf_needs_forward ( struct sip_msg msg,
int  id 
) [read]

Checks forwarding is needed.

Parameters:
msg the SIP message to be forwarded
id use configuration with this ID when checking
Returns:
pointer to proxy structure of destination if forwarding is needed, NULL otherwise

Definition at line 508 of file conf.c.

References filter_methods_contains_request(), sip_msg::first_line, NULL, fwd_setting::proxy, msg_start::request, sfidx_reply, sfidx_request, sfilter_mask, SIP_REPLY, SIP_REQUEST, msg_start::type, and msg_start::u.

Referenced by utils_forward().

int conf_parse_filter ( char *  settings  ) 

Parses a configuration string for the filter Parses a configuration string for switch settings and updates the configuration structure.

Parameters:
settings The configuration string in the following form: <id>=<filter>[:<filter>]...[,<id>=<filter>[:<filter>]...]...
Returns:
1 on success, -1 otherwise

Definition at line 398 of file conf.c.

References conf_str2id(), len, LM_ERR, NULL, pkg_free, pkg_malloc, PKG_MEM_ERROR, remove_spaces(), and update_filter().

Referenced by forward_fifo_filter(), and mod_init().

int conf_parse_proxy ( char *  settings  ) 

Parses a configuration string for proxy settings Parses a configuration string for proxy settings and updates the configuration structure.

Parameters:
settings,: The configuration string in the following form: <id>=<host>:<port>[,<id>=<host>:<port>]...
Returns:
: 1 on success, -1 otherwise

Definition at line 441 of file conf.c.

References conf_str2id(), len, LM_ERR, NULL, pkg_free, pkg_malloc, PKG_MEM_ERROR, remove_spaces(), and update_proxy().

Referenced by forward_fifo_proxy(), and mod_init().

int conf_parse_switch ( char *  settings  ) 

Parses configuration string for the switch Parses a configuration string for switch settings and updates the configuration structure.

Parameters:
settings the configuration string in the following form: <id>=<switch>[,<id>=<switch>]...
Returns:
1 on success, -1 otherwise

Definition at line 298 of file conf.c.

References conf_str2id(), len, LM_ERR, NULL, pkg_free, pkg_malloc, PKG_MEM_ERROR, remove_spaces(), and update_switch().

Referenced by forward_fifo_switch(), and mod_init().

int conf_show ( struct mi_root rpl_tree  ) 

Output configuration in FIFO format.

Parameters:
rpl_tree FIFO root
Returns:
0 on success, -1 on failure

Definition at line 340 of file conf.c.

References fwd_setting::active, addf_mi_node_child(), buf, BUFSIZE, fwd_max_id, id, proxy_l::name, mi_root::node, NULL, proxy_l::port, fwd_setting::proxy, _str::s, sfilter_cnt, sfilter_mask, sfilter_str, and snprintf.

Referenced by forward_fifo_list().

int conf_str2id ( char *  id_str  ) 

Converts string to integer and checks for validity.

Todo:
check if we can use the functions from ut.h params: id_str: ID as string to be converted to int. returns: >=0 on success -1 otherwise

Definition at line 121 of file conf.c.

References conf_str2int(), fwd_max_id, and LM_ERR.

Referenced by conf_parse_filter(), conf_parse_proxy(), and conf_parse_switch().


Generated on Mon May 21 18:00:37 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6