t_msgbuilder.c File Reference

TM :: Message printing. More...

#include "../../hash_func.h"
#include "../../dprint.h"
#include "../../parser/parser_f.h"
#include "../../ut.h"
#include "../../parser/msg_parser.h"
#include "../../parser/contact/parse_contact.h"
#include "t_funcs.h"
#include "t_msgbuilder.h"
#include "uac.h"

Include dependency graph for t_msgbuilder.c:

Go to the source code of this file.

Data Structures

struct  rte

Defines

#define GET_CSEQ()
#define LC(_cp)   ((*(_cp))|0x20)
#define LOCAL_MAXFWD_HEADER   "Max-Forwards: " LOCAL_MAXFWD_VALUE CRLF
#define LOCAL_MAXFWD_HEADER_LEN   (sizeof(LOCAL_MAXFWD_HEADER) - 1)
#define ROUTE_PREFIX   "Route: "
#define ROUTE_PREFIX_LEN   (sizeof(ROUTE_PREFIX) - 1)
#define ROUTE_SEPARATOR   ", "
#define ROUTE_SEPARATOR_LEN   (sizeof(ROUTE_SEPARATOR) - 1)
#define SET_FOUND(_new_state)

Functions

static int assemble_via (str *dest, struct cell *t, struct socket_info *sock, int branch)
char * build_dlg_ack (struct sip_msg *rpl, struct cell *Trans, unsigned int branch, str *to, unsigned int *len)
char * build_local (struct cell *Trans, unsigned int branch, unsigned int *len, char *method, int method_len, str *uas_to)
char * build_uac_cancel (str *headers, str *body, struct cell *cancelledT, unsigned int branch, unsigned int *len)
char * build_uac_req (str *method, str *headers, str *body, dlg_t *dialog, int branch, struct cell *t, int *len)
static int calc_routeset_len (struct rte *list, str *contact)
void check_hdrs_changes (struct sip_msg *msg)
 Check if From/To/CSeq were altered and set approriate flags.
static int extract_hdrs (char *buf, int len, str *from, str *to, str *cseq)
static struct hdr_fieldextract_parsed_hdrs (char *buf, int len)
static void free_rte_list (struct rte *list)
static int get_contact_uri (struct sip_msg *msg, str *uri)
static char * print_callid (char *w, dlg_t *dialog, struct cell *t)
char * print_callid_mini (char *target, str callid)
static int print_content_length (str *dest, str *body)
static char * print_cseq (char *w, str *cseq, str *method, struct cell *t)
char * print_cseq_mini (char *target, str *cseq, str *method)
static int print_cseq_num (str *_s, dlg_t *_d)
static char * print_from (char *w, dlg_t *dialog, struct cell *t)
static char * print_request_uri (char *w, str *method, dlg_t *dialog, struct cell *t, int branch)
static char * print_rs (char *p, struct rte *list, str *contact)
static char * print_to (char *w, dlg_t *dialog, struct cell *t)
static int process_routeset (struct sip_msg *msg, str *contact, struct rte **list, str *ruri, str *next_hop)
int t_calc_branch (struct cell *t, int b, char *branch, int *branch_len)


Detailed Description

TM :: Message printing.

Definition in file t_msgbuilder.c.


Define Documentation

 
#define GET_CSEQ (  ) 

Definition at line 78 of file t_msgbuilder.c.

Referenced by extract_hdrs().

#define LC ( _cp   )     ((*(_cp))|0x20)

Definition at line 68 of file t_msgbuilder.c.

Referenced by extract_hdrs().

#define LOCAL_MAXFWD_HEADER   "Max-Forwards: " LOCAL_MAXFWD_VALUE CRLF

Definition at line 64 of file t_msgbuilder.c.

Referenced by build_local().

#define LOCAL_MAXFWD_HEADER_LEN   (sizeof(LOCAL_MAXFWD_HEADER) - 1)

Definition at line 65 of file t_msgbuilder.c.

Referenced by build_local().

#define ROUTE_PREFIX   "Route: "

Definition at line 58 of file t_msgbuilder.c.

#define ROUTE_PREFIX_LEN   (sizeof(ROUTE_PREFIX) - 1)

Definition at line 59 of file t_msgbuilder.c.

#define ROUTE_SEPARATOR   ", "

Definition at line 61 of file t_msgbuilder.c.

#define ROUTE_SEPARATOR_LEN   (sizeof(ROUTE_SEPARATOR) - 1)

Definition at line 62 of file t_msgbuilder.c.

#define SET_FOUND ( _new_state   ) 

Definition at line 69 of file t_msgbuilder.c.

Referenced by extract_hdrs().


Function Documentation

static int assemble_via ( str dest,
struct cell t,
struct socket_info sock,
int  branch 
) [inline, static]

char* build_dlg_ack ( struct sip_msg rpl,
struct cell Trans,
unsigned int  branch,
str to,
unsigned int *  len 
)

char* build_local ( struct cell Trans,
unsigned int  branch,
unsigned int *  len,
char *  method,
int  method_len,
str uas_to 
)

char* build_uac_cancel ( str headers,
str body,
struct cell cancelledT,
unsigned int  branch,
unsigned int *  len 
)

char* build_uac_req ( str method,
str headers,
str body,
dlg_t dialog,
int  branch,
struct cell t,
int *  len 
)

static int calc_routeset_len ( struct rte list,
str contact 
) [inline, static]

Definition at line 436 of file t_msgbuilder.c.

References CRLF_LEN, _str::len, rr::len, rte::next, rte::ptr, ROUTE_PREFIX_LEN, and ROUTE_SEPARATOR_LEN.

Referenced by build_dlg_ack().

void check_hdrs_changes ( struct sip_msg msg  ) 

static int extract_hdrs ( char *  buf,
int  len,
str from,
str to,
str cseq 
) [static]

Definition at line 86 of file t_msgbuilder.c.

References GET_CSEQ, LC, LM_CRIT, and SET_FOUND.

Referenced by build_local().

static struct hdr_field* extract_parsed_hdrs ( char *  buf,
int  len 
) [static, read]

static void free_rte_list ( struct rte list  )  [inline, static]

Definition at line 361 of file t_msgbuilder.c.

References rte::next, pkg_free, and rte::ptr.

Referenced by build_dlg_ack(), and process_routeset().

static int get_contact_uri ( struct sip_msg msg,
str uri 
) [inline, static]

static char* print_callid ( char *  w,
dlg_t dialog,
struct cell t 
) [inline, static]

char* print_callid_mini ( char *  target,
str  callid 
)

Definition at line 843 of file t_msgbuilder.c.

References append_str, CALLID, CALLID_LEN, CRLF, CRLF_LEN, _str::len, and _str::s.

Referenced by print_callid(), and t_lookup_callid().

static int print_content_length ( str dest,
str body 
) [inline, static]

Definition at line 663 of file t_msgbuilder.c.

References int2bstr(), INT2STR_MAX_LEN, _str::len, len, and _str::s.

Referenced by build_uac_cancel(), and build_uac_req().

static char* print_cseq ( char *  w,
str cseq,
str method,
struct cell t 
) [inline, static]

Definition at line 828 of file t_msgbuilder.c.

References CSEQ_LEN, cell::cseq_n, _str::len, print_cseq_mini(), and _str::s.

Referenced by build_uac_req().

char* print_cseq_mini ( char *  target,
str cseq,
str method 
)

Definition at line 820 of file t_msgbuilder.c.

References append_str, CSEQ, CSEQ_LEN, _str::len, and _str::s.

Referenced by print_cseq(), and t_lookup_callid().

static int print_cseq_num ( str _s,
dlg_t _d 
) [inline, static]

Definition at line 683 of file t_msgbuilder.c.

References int2bstr(), INT2STR_MAX_LEN, _str::len, len, dlg::loc_seq, _str::s, and dlg_seq::value.

Referenced by build_uac_req().

static char* print_from ( char *  w,
dlg_t dialog,
struct cell t 
) [inline, static]

static char* print_request_uri ( char *  w,
str method,
dlg_t dialog,
struct cell t,
int  branch 
) [inline, static]

static char* print_rs ( char *  p,
struct rte list,
str contact 
) [inline, static]

static char* print_to ( char *  w,
dlg_t dialog,
struct cell t 
) [inline, static]

static int process_routeset ( struct sip_msg msg,
str contact,
struct rte **  list,
str ruri,
str next_hop 
) [inline, static]

int t_calc_branch ( struct cell t,
int  b,
char *  branch,
int *  branch_len 
)


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