route.h File Reference

SIP routing engine. More...

#include <sys/types.h>
#include <regex.h>
#include <netdb.h>
#include "pvar.h"
#include "config.h"
#include "error.h"
#include "route_struct.h"
#include "parser/msg_parser.h"

Include dependency graph for route.h:

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

Go to the source code of this file.

Defines

#define BRANCH_ROUTE   8
#define ERROR_ROUTE   16
#define FAILURE_ROUTE   2
#define is_route_type(_type)   (route_type==_type)
#define LOCAL_ROUTE   32
#define ONREPLY_ROUTE   4
#define REQUEST_ROUTE   1
#define set_route_type(_new_type)
#define swap_route_type(_backup, _new_type)

Functions

int add_actions (struct action *a, struct action **head)
 Add actions to the list.
int check_rls (void)
 Check all routing tables for compatiblity between route types and called module functions.
int eval_expr (struct expr *e, struct sip_msg *msg, pv_value_t *val)
 Evaluate expression.
int fix_rls (void)
 Fixes all action tables.
void init_route_lists (void)
 Initialize routing lists.
void print_rl (void)
 Debug function, prints main routing table.
void push (struct action *a, struct action **head)
 Adds an action list to head.

Variables

struct actionbranch_rlist [BRANCH_RT_NO]
struct actionerror_rlist
struct actionfailure_rlist [FAILURE_RT_NO]
struct actiononreply_rlist [ONREPLY_RT_NO]
struct actionrlist [RT_NO]
int route_type


Detailed Description

SIP routing engine.

Definition in file route.h.


Define Documentation

#define BRANCH_ROUTE   8

Sending-branch route block

Definition at line 56 of file route.h.

Referenced by check_rls(), is_uri_host_local(), pre_print_uac_request(), and t_on_branch().

#define ERROR_ROUTE   16

Error-handling route block

Definition at line 57 of file route.h.

Referenced by check_rls(), and run_action_list().

#define FAILURE_ROUTE   2

#define is_route_type ( _type   )     (route_type==_type)

Definition at line 73 of file route.h.

Referenced by run_action_list().

#define LOCAL_ROUTE   32

Local-requests route block

Definition at line 58 of file route.h.

Referenced by check_rls(), is_uri_host_local(), pv_get_spec_value(), pv_set_spec_value(), run_action_list(), and t_uac().

#define ONREPLY_ROUTE   4

Received-reply route block

Definition at line 55 of file route.h.

Referenced by check_rls(), pv_get_tm_reply_code(), receive_msg(), run_action_list(), and t_check_status().

#define REQUEST_ROUTE   1

#define set_route_type ( _new_type   ) 

Value:

do{\
      route_type=_new_type;\
   }while(0)

Definition at line 62 of file route.h.

Referenced by dlg_ontimeout(), faked_env(), pre_print_uac_request(), receive_msg(), run_action_list(), and t_uac().

#define swap_route_type ( _backup,
_new_type   ) 

Value:

do{\
      _backup=route_type;\
      route_type=_new_type;\
   }while(0)

Definition at line 67 of file route.h.

Referenced by faked_env(), pre_print_uac_request(), and t_uac().


Function Documentation

int add_actions ( struct action a,
struct action **  head 
)

Add actions to the list.

Parameters:
a action
head head of action list
Returns:
0 on success, negative on failure

Definition at line 1533 of file route.c.

References fix_actions(), LM_DBG, and push().

int check_rls ( void   ) 

Check all routing tables for compatiblity between route types and called module functions.

Returns:
0 if ok , <0 on error

Definition at line 1681 of file route.c.

References BRANCH_ROUTE, BRANCH_RT_NO, check_actions(), ERROR_ROUTE, FAILURE_ROUTE, FAILURE_RT_NO, LM_ERR, LOCAL_ROUTE, ONREPLY_ROUTE, ONREPLY_RT_NO, rcheck_status, and REQUEST_ROUTE.

Referenced by main().

int eval_expr ( struct expr e,
struct sip_msg msg,
pv_value_t val 
)

Evaluate expression.

Parameters:
e expression
msg SIP message
val pseudo-variable
Returns:
ret= 0/1 (true/false) , -1 on error or EXPR_DROP (-127)

Definition at line 1459 of file route.c.

References AND_OP, ELEM_T, eval_elem(), eval_expr(), EVAL_OP, EXP_T, operand::operand_val::expr, expr::left, LM_CRIT, MAX_REC_LEV, NOT_OP, expr::op, OR_OP, rec_lev, expr::right, expr::type, and operand::v.

Referenced by do_action(), do_assign(), eval_elem(), and eval_expr().

int fix_rls ( void   ) 

Fixes all action tables.

Returns:
0 if ok , <0 on error

Definition at line 1552 of file route.c.

References BRANCH_RT_NO, FAILURE_RT_NO, fix_actions(), ONREPLY_RT_NO, and RT_NO.

Referenced by main().

void init_route_lists ( void   ) 

Initialize routing lists.

Definition at line 98 of file route.c.

Referenced by main().

void print_rl ( void   ) 

Debug function, prints main routing table.

Definition at line 1738 of file route.c.

References BRANCH_RT_NO, FAILURE_RT_NO, LM_DBG, ONREPLY_RT_NO, print_actions(), and RT_NO.

Referenced by main().

void push ( struct action a,
struct action **  head 
)

Adds an action list to head.

Parameters:
a action, must be null terminated (last a->next=0)
head head of action list

Definition at line 1515 of file route.c.

References action::next.

Referenced by add_actions().


Variable Documentation

struct action* branch_rlist[BRANCH_RT_NO]

Branch routes table

Definition at line 82 of file route.c.

Referenced by pre_print_uac_request().

Error route table

Definition at line 86 of file route.c.

Referenced by run_action_list().

struct action* failure_rlist[FAILURE_RT_NO]

Failure route table

Definition at line 81 of file route.c.

Referenced by run_failure_handlers().

struct action* onreply_rlist[ONREPLY_RT_NO]

main reply route table

Definition at line 80 of file route.c.

Referenced by receive_msg(), and reply_received().

struct action* rlist[RT_NO]

main "script table"

Definition at line 78 of file route.c.

Referenced by cpl_proxy_to_loc_set(), dlg_ontimeout(), do_action(), and receive_msg().


Generated on Thu May 24 12:00:42 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6