Data Structures | Defines | Functions

dset.h File Reference

SIP-router core :: Destination set handlingModule: SIP-router core. More...

#include "ip_addr.h"
#include "qvalue.h"
#include "flags.h"
#include "parser/msg_parser.h"
Include dependency graph for dset.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

Defines

Functions


Detailed Description

Definition in file dset.h.


Define Documentation

#define ruri_get_forking_state (  )     (ruri_is_new)

(usefull for serial forking)

Returns:
0 if already marked as consumed, 1 if not.

Definition at line 182 of file dset.h.


Function Documentation

int append_branch ( struct sip_msg msg,
str uri,
str dst_uri,
str path,
qvalue_t  q,
unsigned int  flags,
struct socket_info *  force_socket 
)

Add a new branch to current transaction.

Parameters:
msg - sip message, used for getting the uri if not specified (0).
uri - uri, can be 0 (in which case the uri is taken from msg)
dst_uri - destination uri, can be 0.
path - path vector (passed in a string), can be 0.
q - q value.
flags - per branch flags.
force_socket - socket that should be used when sending.
Returns:
<0 (-1) on failure, 1 on success (script convention).

Definition at line 297 of file dset.c.

References sip_msg::first_line, _str::len, MAX_BRANCHES, MAX_PATH_SIZE, MAX_URI_SIZE, sip_msg::new_uri, and _str::s.

Referenced by ser_append_branch().

Here is the caller graph for this function:

int drop_sip_branch ( int  idx  ) 
Parameters:
idx - branch index
Returns:
0 on success, -1 on error

Definition at line 107 of file dset.c.

char* get_branch ( unsigned int  i,
int *  len,
qvalue_t *  q,
str dst_uri,
str path,
unsigned int *  flags,
struct socket_info **  force_socket 
)
Returns:
Return the 'i' branch from the dset array, 0 is returned if there are no more branches

Definition at line 216 of file dset.c.

References _str::len, and _str::s.

Referenced by next_branch().

Here is the caller graph for this function:

branch_t* get_sip_branch ( int  idx  ) 
Parameters:
idx - branch index
Returns:
pointer to branch or NULL if invalid branch

Definition at line 86 of file dset.c.

int getbflagsval ( unsigned int  branch,
flag_t *  res 
)

This function returns the value of all branch flags combined in a single variable.

Parameters:
branch Number of the branch (0 for the main Request-URI branch)
res A pointer to a variable to store the result
Returns:
1 on success, -1 on failure

Definition at line 165 of file dset.c.

Referenced by lookup(), and pack_ci().

Here is the caller graph for this function:

int isbflagset ( unsigned int  branch,
flag_t  flag 
)

This function tests the value of one particular per-branch flag.

Parameters:
branch Number of the branch (0 for the main Request-URI branch)
flag Number of the flag to be tested (starting with 0)
Returns:
1 if the branch flag is set, -1 if not or on failure.

Definition at line 146 of file dset.c.

char* next_branch ( int *  len,
qvalue_t *  q,
str dst_uri,
str path,
unsigned int *  flags,
struct socket_info **  force_socket 
)
Returns:
pointer to the uri of the next branch (which the length written in *len) or 0 if there are no more branches.

Get the next branch in the current transaction.

0 is returned if there are no more branches

Definition at line 260 of file dset.c.

References get_branch().

Referenced by print_dset().

Here is the call graph for this function:

Here is the caller graph for this function:

int resetbflag ( unsigned int  branch,
flag_t  flag 
)

This function resets the value of one particular branch flag to 0.

Parameters:
branch Number of the branch (0 for the main Request-URI branch)
flag Number of the flag to be reset (starting with 0)
Returns:
1 on success, -1 on failure.

Definition at line 155 of file dset.c.

static int ser_append_branch ( struct sip_msg msg,
char *  uri,
int  uri_len,
char *  dst_uri,
int  dst_uri_len,
qvalue_t  q,
struct socket_info *  force_socket 
) [inline, static]

append_branch version compatible with ser: no path or branch flags support and no str parameters.

Definition at line 93 of file dset.h.

References append_branch(), _str::len, and _str::s.

Here is the call graph for this function:

int setbflag ( unsigned int  branch,
flag_t  flag 
)

This function sets the value of one particular branch flag to 1.

Parameters:
branch Number of the branch (0 for the main Request-URI branch)
flag Number of the flag to be set (starting with 0)
Returns:
1 on success, -1 on failure.

Definition at line 136 of file dset.c.

int setbflagsval ( unsigned int  branch,
flag_t  val 
)

This function sets the value of all branch flags for a given branch at once.

Parameters:
branch Number of the branch (0 for the main Request-URI branch)
val All branch flags combined into a single variable
Returns:
1 on success, -1 on failure

Definition at line 175 of file dset.c.

Referenced by lookup().

Here is the caller graph for this function: