#include <string.h>
#include "parse_rr.h"
#include "../mem/mem.h"
#include "../mem/shm_mem.h"
#include "../dprint.h"
#include "../trim.h"
#include "../ut.h"

Go to the source code of this file.
Defines | |
| #define | MAX_RR_HDRS 64 |
Functions | |
| static int | do_duplicate_rr (rr_t **_new, rr_t *_r, int _shm, int _first) |
| static void | do_free_rr (rr_t **_r, int _shm) |
| static int | do_parse_rr_body (char *buf, int len, rr_t **head) |
| int | duplicate_rr (rr_t **_new, rr_t *_r, int first) |
| void | free_rr (rr_t **_r) |
| int | get_path_dst_uri (str *_p, str *_dst) |
| int | parse_rr (struct hdr_field *_h) |
| int | parse_rr_body (char *buf, int len, rr_t **head) |
| void | print_rr (FILE *_o, rr_t *_r) |
| int | print_rr_body (struct hdr_field *iroute, str *oroute, int order, unsigned int *nb_recs) |
| int | shm_duplicate_rr (rr_t **_new, rr_t *_r, int first) |
| void | shm_free_rr (rr_t **_r) |
| static void | xlate_pointers (rr_t *_orig, rr_t *_r) |
Definition in file parse_rr.c.
| #define MAX_RR_HDRS 64 |
Referenced by print_rr_body().
Duplicate a single rr_t structure using pkg_malloc or shm_malloc
Definition at line 258 of file parse_rr.c.
References duplicate_params(), to_body::error, free_rr(), name_addr::len, param::len, len, LM_ERR, name_addr::name, param::name, rr::nameaddr, rr::next, NULL, rr::params, pkg_free, pkg_malloc, _str::s, shm_duplicate_params(), shm_free, shm_free_rr(), shm_malloc(), and xlate_pointers().
Referenced by duplicate_rr(), and shm_duplicate_rr().
| static void do_free_rr | ( | rr_t ** | _r, | |
| int | _shm | |||
| ) | [inline, static] |
Free list of rrs _r is head of the list
Definition at line 174 of file parse_rr.c.
References free_params(), rr::next, rr::params, pkg_free, shm_free, and shm_free_params().
Referenced by free_rr(), and shm_free_rr().
| static int do_parse_rr_body | ( | char * | buf, | |
| int | len, | |||
| rr_t ** | head | |||
| ) | [inline, static] |
Parse Route or Record-Route body
Definition at line 40 of file parse_rr.c.
References CLASS_ANY, to_body::error, free_rr(), param::len, name_addr::len, rr::len, _str::len, LM_DBG, LM_ERR, param::name, name_addr::name, rr::nameaddr, rr::next, rr::params, parse_nameaddr(), parse_params(), pkg_free, pkg_malloc, _str::s, s, and trim_leading().
Referenced by parse_rr(), and parse_rr_body().
Duplicate a single rr_t structure or the whole list (based on "first" param) using pkg_malloc
Definition at line 329 of file parse_rr.c.
References do_duplicate_rr().
| void free_rr | ( | rr_t ** | _r | ) |
Free list of rrs in pkg_mem _r is head of the list
Definition at line 196 of file parse_rr.c.
References do_free_rr().
Referenced by build_path_vector(), clean_hdr_field(), do_duplicate_rr(), do_parse_rr_body(), extract_allowed_headers(), free_tm_dlg(), get_path_dst_uri(), recordroute_diff(), and send_subscribe().
Path must be available. Function returns the first uri from Path without any duplication.
Definition at line 459 of file parse_rr.c.
References free_rr(), _str::len, LM_DBG, LM_ERR, rr::nameaddr, parse_rr_body(), _str::s, and name_addr::uri.
Referenced by lookup(), and nh_timer().
| int parse_rr | ( | struct hdr_field * | _h | ) |
Parse Route and Record-Route header fields
Definition at line 150 of file parse_rr.c.
References hdr_field::body, do_parse_rr_body(), _str::len, LM_ERR, NULL, hdr_field::parsed, and _str::s.
Referenced by ac_sl_msg(), ac_uac_req(), assemble_msg(), encode_header(), extract_allowed_headers(), find_first_route(), find_next_route(), find_rem_target(), get_route_set(), print_rr_body(), process_routeset(), and recordroute_diff().
| int parse_rr_body | ( | char * | buf, | |
| int | len, | |||
| rr_t ** | head | |||
| ) |
Wrapper to do_parse_rr_body() for external calls
Definition at line 142 of file parse_rr.c.
References do_parse_rr_body().
Referenced by build_dlg_t(), build_path_vector(), get_path_dst_uri(), pua_build_dlg_t(), and rls_notify_dlg().
| void print_rr | ( | FILE * | _o, | |
| rr_t * | _r | |||
| ) |
Print list of RRs, just for debugging
Definition at line 216 of file parse_rr.c.
References rr::len, rr::nameaddr, rr::next, rr::params, print_nameaddr(), print_params(), and rr::r2.
Referenced by print_dlg().
get first RR header and print comma separated bodies in oroute
Definition at line 350 of file parse_rr.c.
References to_body::error, len, rr::len, _str::len, LM_DBG, LM_ERR, MAX_RR_HDRS, name_addr::name, rr::nameaddr, rr::next, NULL, parse_rr(), hdr_field::parsed, pkg_malloc, s, _str::s, and hdr_field::sibling.
Referenced by extract_sdialog_info(), populate_leg_info(), and subs_cback_func().
Duplicate a single rr_t structure or the whole list (based on "first" param) using shm_malloc
Definition at line 339 of file parse_rr.c.
References do_duplicate_rr().
Referenced by get_route_set().
| void shm_free_rr | ( | rr_t ** | _r | ) |
Free list of rrs in shm_mem _r is head of the list
Definition at line 207 of file parse_rr.c.
References do_free_rr().
Referenced by do_duplicate_rr(), free_dlg(), and get_route_set().
Translate all pointers in the structure and also in all parameters in the list
Definition at line 240 of file parse_rr.c.
References param::body, param::name, name_addr::name, rr::nameaddr, param::next, rr::params, _str::s, translate_pointer, and name_addr::uri.
Referenced by do_duplicate_rr().
1.5.6