Functions

dset.c File Reference

destination set / branches support. More...

#include <string.h>
#include "dprint.h"
#include "config.h"
#include "parser/parser_f.h"
#include "parser/msg_parser.h"
#include "ut.h"
#include "hash_func.h"
#include "error.h"
#include "dset.h"
#include "mem/mem.h"
#include "ip_addr.h"
Include dependency graph for dset.c:

Go to the source code of this file.

Functions


Detailed Description

Module: SIP-router core

Definition in file dset.c.


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:

int get_branch_iterator ( void   ) 

Return branch iterator position.

Definition at line 197 of file dset.c.

Referenced by print_dset().

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 
)

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.

void set_branch_iterator ( int  n  ) 

Set branch iterator position.

Definition at line 205 of file dset.c.

Referenced by print_dset().

Here is the caller 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: