parse_rr.c File Reference

Route & Record-Route header field parser. More...

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

Include dependency graph for parse_rr.c:

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)


Detailed Description

Route & Record-Route header field parser.

Definition in file parse_rr.c.


Define Documentation

#define MAX_RR_HDRS   64

Referenced by print_rr_body().


Function Documentation

static int do_duplicate_rr ( rr_t **  _new,
rr_t _r,
int  _shm,
int  _first 
) [inline, static]

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]

int duplicate_rr ( rr_t **  _new,
rr_t _r,
int  first 
)

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  ) 

int get_path_dst_uri ( str _p,
str _dst 
)

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  ) 

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().

int print_rr_body ( struct hdr_field iroute,
str oroute,
int  order,
unsigned int *  nb_recs 
)

get first RR header and print comma separated bodies in oroute

  • order = 0 normal; order = 1 reverse
  • nb_recs - input=skip number of rr; output=number of printed rrs

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().

int shm_duplicate_rr ( rr_t **  _new,
rr_t _r,
int  first 
)

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().

static void xlate_pointers ( rr_t _orig,
rr_t _r 
) [inline, static]

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().


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