#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"

Go to the source code of this file.
Data Structures | |
| struct | branch |
Defines | |
| #define | CONTACT "Contact: " |
| #define | CONTACT_DELIM ", " |
| #define | CONTACT_DELIM_LEN (sizeof(CONTACT_DELIM) - 1) |
| #define | CONTACT_LEN (sizeof(CONTACT) - 1) |
| #define | Q_PARAM ">;q=" |
| #define | Q_PARAM_LEN (sizeof(Q_PARAM) - 1) |
Functions | |
| 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. | |
| int | branch_uri2dset (str *new_uri) |
| moves the uri to destination for all branches and all uris are set to given uri | |
| void | clear_branches (void) |
| Empty the dset array. | |
| char * | get_branch (unsigned int idx, int *len, qvalue_t *q, str *dst_uri, str *path, unsigned int *flags, struct socket_info **force_socket) |
| Find the next brand from the destination set. | |
| static unsigned int * | get_ptr_bflags (unsigned int b_idx) |
| int | get_request_uri (struct sip_msg *_m, str *_u) |
| Get actual Request-URI. | |
| qvalue_t | get_ruri_q (void) |
| Return the q value of the Request-URI. | |
| unsigned int | getb0flags (void) |
| Get the per branch flags for RURI. | |
| int | isbflagset (unsigned int b_idx, unsigned int mask) |
| Tests the per branch flags. | |
| char * | print_dset (struct sip_msg *msg, int *len) |
| Create a Contact header field from the dset array. | |
| int | resetbflag (unsigned int b_idx, unsigned int mask) |
| Resets the per branch flags. | |
| int | rewrite_uri (struct sip_msg *_m, str *_s) |
| Rewrite Request-URI. | |
| void | set_ruri_q (qvalue_t q) |
| Sets the q parameter of the Request-URI. | |
| unsigned int | setb0flags (unsigned int flags) |
| int | setbflag (unsigned int b_idx, unsigned int mask) |
| Set the per branch flag. | |
Variables | |
| static struct branch | branches [MAX_BRANCHES-1] |
| Where we store URIs of additional transaction branches (-1 because of the default branch, #0). | |
| unsigned int | nr_branches = 0 |
| static unsigned int | ruri_bflags = 0 |
| static qvalue_t | ruri_q = Q_UNSPECIFIED |
Definition in file dset.c.
| #define CONTACT "Contact: " |
| #define CONTACT_DELIM ", " |
| #define CONTACT_DELIM_LEN (sizeof(CONTACT_DELIM) - 1) |
| #define CONTACT_LEN (sizeof(CONTACT) - 1) |
| #define Q_PARAM ">;q=" |
| #define Q_PARAM_LEN (sizeof(Q_PARAM) - 1) |
Definition at line 48 of file dset.c.
Referenced by build_contact(), calc_buf_len(), and print_dset().
| 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.
Definition at line 257 of file dset.c.
References branches, branch::dst_uri, branch::dst_uri_len, E_TOO_MANY_BRANCHES, sip_msg::first_line, branch::flags, branch::force_send_socket, branch::len, _str::len, LM_ERR, MAX_BRANCHES, MAX_PATH_SIZE, MAX_URI_SIZE, sip_msg::new_uri, nr_branches, branch::path, branch::path_len, branch::q, msg_start::request, _str::s, ser_error, msg_start::u, and branch::uri.
Referenced by alias_db_lookup(), cpl_proxy_to_loc_set(), do_action(), do_dns_failover(), do_query(), dp_update(), ds_update_dst(), enum_pv_query_3(), exec_str(), lookup(), ops_pushto_avp(), ospPrepareDestination(), shmcontact2dset(), and t_next_contacts().
| int branch_uri2dset | ( | str * | new_uri | ) |
moves the uri to destination for all branches and all uris are set to given uri
Definition at line 494 of file dset.c.
References branches, branch::dst_uri, branch::dst_uri_len, branch::len, len, _str::len, LM_ERR, MAX_URI_SIZE, nr_branches, _str::s, and branch::uri.
Referenced by t_replicate().
| void clear_branches | ( | void | ) |
Empty the dset array.
Empty the array of branches.
Definition at line 246 of file dset.c.
References nr_branches, Q_UNSPECIFIED, ruri_bflags, and ruri_q.
Referenced by faked_msg_next(), receive_msg(), t_forward_nonack(), and t_load_contacts().
| char* get_branch | ( | unsigned int | idx, | |
| int * | len, | |||
| qvalue_t * | q, | |||
| str * | dst_uri, | |||
| str * | path, | |||
| unsigned int * | flags, | |||
| struct socket_info ** | force_socket | |||
| ) |
Find the next brand from the destination set.
Get the next branch in the current transaction.
Definition at line 208 of file dset.c.
References branches, branch::dst_uri_len, branch::flags, branch::force_send_socket, _str::len, branch::len, nr_branches, branch::path_len, branch::q, Q_UNSPECIFIED, _str::s, and branch::uri.
Referenced by check_routing(), is_uri_host_local(), print_dset(), t_forward_nonack(), and t_load_contacts().
| static unsigned int* get_ptr_bflags | ( | unsigned int | b_idx | ) | [inline, static] |
Definition at line 91 of file dset.c.
References branches, branch::flags, nr_branches, and ruri_bflags.
Referenced by isbflagset(), resetbflag(), and setbflag().
Get actual Request-URI.
Definition at line 448 of file dset.c.
References sip_msg::first_line, _str::len, sip_msg::new_uri, msg_start::request, _str::s, and msg_start::u.
| qvalue_t get_ruri_q | ( | void | ) |
Return the q value of the Request-URI.
Get the q value of the Request-URI.
Definition at line 438 of file dset.c.
References ruri_q.
Referenced by t_load_contacts().
| unsigned int getb0flags | ( | void | ) |
Get the per branch flags for RURI.
Get/set the per branch flags for the RURI (branch 0).
Definition at line 108 of file dset.c.
References ruri_bflags.
Referenced by add_uac(), do_action(), pack_ci(), reply_received(), t_forward_nonack(), and t_load_contacts().
| int isbflagset | ( | unsigned int | b_idx, | |
| unsigned int | mask | |||
| ) |
Tests the per branch flags.
Test the per branch flag.
Definition at line 137 of file dset.c.
References get_ptr_bflags().
Referenced by do_action().
| char* print_dset | ( | struct sip_msg * | msg, | |
| int * | len | |||
| ) |
Create a Contact header field from the dset array.
Create a Contact header field from the list of current branches.
Definition at line 338 of file dset.c.
References CONTACT, CONTACT_DELIM, CONTACT_DELIM_LEN, CONTACT_LEN, CRLF, CRLF_LEN, get_branch(), _str::len, len_q(), LM_ERR, MAX_REDIRECTION_LEN, sip_msg::new_uri, branch::q, q2str(), Q_PARAM, Q_PARAM_LEN, Q_UNSPECIFIED, ruri_q, _str::s, and branch::uri.
Referenced by _reply(), and sl_send_reply_helper().
| int resetbflag | ( | unsigned int | b_idx, | |
| unsigned int | mask | |||
| ) |
Resets the per branch flags.
Reset the per branch flag.
Definition at line 152 of file dset.c.
References get_ptr_bflags().
Referenced by do_action().
Rewrite Request-URI.
Definition at line 466 of file dset.c.
References buf, _str::len, LM_DBG, LM_ERR, sip_msg::new_uri, sip_msg::parsed_uri_ok, pkg_free, pkg_malloc, and _str::s.
Referenced by add_uri_param(), after_strict(), do_query(), enum_pv_query_3(), handle_sr(), lookup(), ospPrepareDestination(), t_next_contacts(), and tel2sip().
| void set_ruri_q | ( | qvalue_t | q | ) |
Sets the q parameter of the Request-URI.
Set the q value of the Request-URI.
Definition at line 429 of file dset.c.
References ruri_q.
Referenced by do_query(), enum_pv_query_3(), and lookup().
| unsigned int setb0flags | ( | unsigned int | flags | ) |
Definition at line 114 of file dset.c.
References ruri_bflags.
Referenced by do_action(), fake_req(), reply_received(), t_forward_nonack(), and t_next_contacts().
| int setbflag | ( | unsigned int | b_idx, | |
| unsigned int | mask | |||
| ) |
Set the per branch flag.
Definition at line 121 of file dset.c.
References get_ptr_bflags().
Referenced by cpl_proxy_to_loc_set(), do_action(), and lookup().
Where we store URIs of additional transaction branches (-1 because of the default branch, #0).
Definition at line 73 of file dset.c.
Referenced by append_branch(), branch_uri2dset(), get_branch(), and get_ptr_bflags().
| unsigned int nr_branches = 0 |
how many of them we have
Definition at line 80 of file dset.c.
Referenced by append_branch(), branch_uri2dset(), clear_branches(), get_branch(), get_ptr_bflags(), and t_load_contacts().
unsigned int ruri_bflags = 0 [static] |
Branch flags of the Request-URI
Definition at line 87 of file dset.c.
Referenced by clear_branches(), get_ptr_bflags(), getb0flags(), and setb0flags().
The q parameter of the Request-URI
Definition at line 83 of file dset.c.
Referenced by clear_branches(), get_ruri_q(), print_dset(), and set_ruri_q().
1.5.6