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

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_field * | extract_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) |
Definition in file t_msgbuilder.c.
| #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: " |
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 | ) |
| static int assemble_via | ( | str * | dest, | |
| struct cell * | t, | |||
| struct socket_info * | sock, | |||
| int | branch | |||
| ) | [inline, static] |
Definition at line 697 of file t_msgbuilder.c.
References _str::len, len, LM_ERR, MAX_BRANCH_PARAM_LEN, socket_info::proto, _str::s, set_hostport, t_calc_branch(), via_builder(), and via_len.
Referenced by build_uac_req().
| char* build_dlg_ack | ( | struct sip_msg * | rpl, | |
| struct cell * | Trans, | |||
| unsigned int | branch, | |||
| str * | to, | |||
| unsigned int * | len | |||
| ) |
Definition at line 533 of file t_msgbuilder.c.
References ACK, ACK_LEN, append_str, calc_routeset_len(), cell::callid, CONTENT_LENGTH, CONTENT_LENGTH_LEN, CRLF, CRLF_LEN, cell::cseq_n, retr_buf::dst, sip_msg::first_line, free_rte_list(), cell::from, get_contact_uri(), _str::len, LM_ERR, MAX_BRANCH_PARAM_LEN, pkg_free, print_rs(), process_routeset(), socket_info::proto, msg_start::reply, ua_client::request, _str::s, dest_info::send_sock, server_signature, set_hostport, shm_malloc(), SIP_VERSION, SIP_VERSION_LEN, t_calc_branch(), msg_start::u, cell::uac, ua_client::uri, user_agent_header, via_builder(), and via_len.
Referenced by send_ack().
| char* build_local | ( | struct cell * | Trans, | |
| unsigned int | branch, | |||
| unsigned int * | len, | |||
| char * | method, | |||
| int | method_len, | |||
| str * | uas_to | |||
| ) |
Definition at line 221 of file t_msgbuilder.c.
References ACK_LEN, append_str, retr_buf::buffer, cell::callid, CONTENT_LENGTH, CONTENT_LENGTH_LEN, CRLF, CRLF_LEN, cell::cseq_n, retr_buf::dst, extract_hdrs(), extract_parsed_hdrs(), FL_USE_UAC_CSEQ, FL_USE_UAC_FROM, FL_USE_UAC_TO, free_hdr_field_lst(), cell::from, HDR_ROUTE_T, is_local, hdr_field::len, _str::len, LM_DBG, LM_ERR, LOCAL_MAXFWD_HEADER, LOCAL_MAXFWD_HEADER_LEN, MAX_BRANCH_PARAM_LEN, sip_msg::msg_flags, hdr_field::name, hdr_field::next, NULL, pkg_free, dest_info::proto, ua_client::request, ua_server::request, _str::s, dest_info::send_sock, server_signature, set_hostport, shm_malloc(), SIP_VERSION, SIP_VERSION_LEN, t_calc_branch(), hdr_field::type, cell::uac, cell::uas, ua_client::uri, user_agent_header, via_builder(), and via_len.
Referenced by build_cancel(), and send_ack().
| char* build_uac_cancel | ( | str * | headers, | |
| str * | body, | |||
| struct cell * | cancelledT, | |||
| unsigned int | branch, | |||
| unsigned int * | len | |||
| ) |
Definition at line 978 of file t_msgbuilder.c.
References append_str, cell::callid, CANCEL, CANCEL_LEN, CONTENT_LENGTH, CONTENT_LENGTH_LEN, CRLF, CRLF_LEN, cell::cseq_n, retr_buf::dst, cell::from, _str::len, LM_DBG, LM_ERR, MAX_BRANCH_PARAM_LEN, NULL, pkg_free, print_content_length(), dest_info::proto, ua_client::request, _str::s, dest_info::send_sock, server_signature, set_hostport, shm_malloc(), SIP_VERSION, SIP_VERSION_LEN, t_calc_branch(), cell::to, cell::uac, ua_client::uri, USER_AGENT, USER_AGENT_LEN, via_builder(), and via_len.
Referenced by t_uac_cancel().
| char* build_uac_req | ( | str * | method, | |
| str * | headers, | |||
| str * | body, | |||
| dlg_t * | dialog, | |||
| int | branch, | |||
| struct cell * | t, | |||
| int * | len | |||
| ) |
Definition at line 865 of file t_msgbuilder.c.
References append_str, assemble_via(), buf, calculate_routeset_length(), dlg_id::call_id, CALLID_LEN, CONTENT_LENGTH, CONTENT_LENGTH_LEN, CRLF, CRLF_LEN, CSEQ_LEN, FROM_LEN, FROMTAG_LEN, dlg::hooks, dlg::id, _str::len, LM_ERR, dlg::loc_dname, dlg_id::loc_tag, dlg::loc_uri, pkg_free, print_callid(), print_content_length(), print_cseq(), print_cseq_num(), print_from(), print_request_uri(), print_routeset(), print_to(), dlg::rem_dname, dlg_id::rem_tag, dlg::rem_uri, dlg_hooks::request_uri, _str::s, dlg::send_sock, server_signature, shm_malloc(), SIP_VERSION_LEN, TO_LEN, TOTAG_LEN, and user_agent_header.
Referenced by t_uac().
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 | ) |
Check if From/To/CSeq were altered and set approriate flags.
Definition at line 1093 of file t_msgbuilder.c.
References sip_msg::add_rm, sip_msg::buf, sip_msg::cseq, FL_USE_UAC_CSEQ, FL_USE_UAC_FROM, FL_USE_UAC_TO, sip_msg::from, hdr_field::len, lump::len, LUMP_DEL, LUMP_NOP, sip_msg::msg_flags, hdr_field::name, lump::next, NULL, lump::offset, lump::op, _str::s, sip_msg::to, and lump::u.
Referenced by pre_print_uac_request(), run_failure_handlers(), and t_newtran().
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] |
Definition at line 186 of file t_msgbuilder.c.
References sip_msg::buf, eat_line(), free_sip_msg(), HDR_EOH_F, sip_msg::headers, sip_msg::len, LM_DBG, parse_headers(), and sip_msg::unparsed.
Referenced by build_local().
| 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().
Definition at line 504 of file t_msgbuilder.c.
References sip_msg::contact, _str::len, LM_ERR, parse_contact(), hdr_field::parsed, and contact::uri.
Definition at line 850 of file t_msgbuilder.c.
References append_str, dlg_id::call_id, cell::callid, CALLID_LEN, CRLF, CRLF_LEN, dlg::id, _str::len, print_callid_mini(), and _str::s.
Referenced by build_uac_req().
| 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().
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().
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().
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().
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().
Definition at line 786 of file t_msgbuilder.c.
References append_str, CRLF, CRLF_LEN, FROM, cell::from, FROM_LEN, FROMTAG, FROMTAG_LEN, dlg::id, _str::len, dlg::loc_dname, dlg_id::loc_tag, dlg::loc_uri, and _str::s.
Referenced by build_uac_req().
| static char* print_request_uri | ( | char * | w, | |
| str * | method, | |||
| dlg_t * | dialog, | |||
| struct cell * | t, | |||
| int | branch | |||
| ) | [inline, static] |
Definition at line 734 of file t_msgbuilder.c.
References append_str, CRLF, CRLF_LEN, dlg::hooks, _str::len, LM_DBG, dlg_hooks::request_uri, _str::s, SIP_VERSION, SIP_VERSION_LEN, cell::uac, and ua_client::uri.
Referenced by build_uac_req().
Definition at line 468 of file t_msgbuilder.c.
References append_str, CRLF, CRLF_LEN, _str::len, rr::len, name_addr::name, rr::nameaddr, rte::next, rte::ptr, ROUTE_PREFIX, ROUTE_PREFIX_LEN, ROUTE_SEPARATOR, ROUTE_SEPARATOR_LEN, and _str::s.
Referenced by build_dlg_ack().
Definition at line 752 of file t_msgbuilder.c.
References append_str, CRLF, CRLF_LEN, dlg::id, _str::len, dlg::rem_dname, dlg_id::rem_tag, dlg::rem_uri, _str::s, TO, cell::to, TO_LEN, TOTAG, and TOTAG_LEN.
Referenced by build_uac_req().
| static int process_routeset | ( | struct sip_msg * | msg, | |
| str * | contact, | |||
| struct rte ** | list, | |||
| str * | ruri, | |||
| str * | next_hop | |||
| ) | [inline, static] |
Definition at line 373 of file t_msgbuilder.c.
References free_rte_list(), HDR_RECORDROUTE_T, _str::len, LM_ERR, sip_uri::lr, rr::nameaddr, rr::next, rte::next, parse_rr(), parse_uri(), pkg_free, pkg_malloc, rte::ptr, sip_msg::record_route, _str::s, and name_addr::uri.
Referenced by build_dlg_ack().
| int t_calc_branch | ( | struct cell * | t, | |
| int | b, | |||
| char * | branch, | |||
| int * | branch_len | |||
| ) |
Definition at line 966 of file t_msgbuilder.c.
References branch_builder(), cell::hash_index, cell::label, cell::md5, and syn_branch.
Referenced by assemble_via(), build_dlg_ack(), build_local(), build_uac_cancel(), pre_print_uac_request(), and t_newtran().
1.5.6