#include "parser/msg_parser.h"
#include "ip_addr.h"


Go to the source code of this file.
Data Structures | |
| struct | bookmark |
| point to some remarkable positions in a SIP message More... | |
| struct | hostport |
| used by via_builder() More... | |
Defines | |
| #define | BRANCH_SEPARATOR '.' |
| #define | MSG_TRANS_NOVIA_FLAG (1<<1) |
| #define | MSG_TRANS_SHM_FLAG (1<<0) |
| #define | MY_HF_SEP ": " |
| #define | MY_HF_SEP_LEN 2 |
| #define | set_hostport(hp, msg) |
| #define | WARNING "Warning: 392 " |
| #define | WARNING_LEN (sizeof(WARNING)-1) |
| #define | WARNING_PHRASE " \"Noisy feedback tells: " |
| #define | WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1) |
Functions | |
| int | branch_builder (unsigned int hash_index, unsigned int label, char *char_v, int branch, char *branch_str, int *len) |
| return number of chars printed or 0 if space exceeded; assumes buffer size of at least MAX_BRANCH_PARAM_LEN | |
| char * | build_req_buf_from_sip_req (struct sip_msg *msg, unsigned int *returned_len, struct socket_info *send_sock, int proto, unsigned int flags) |
| char * | build_res_buf_from_sip_req (unsigned int code, str *text, str *new_tag, struct sip_msg *msg, unsigned int *returned_len, struct bookmark *bmark) |
| char * | build_res_buf_from_sip_res (struct sip_msg *msg, unsigned int *returned_len) |
| int | received_test (struct sip_msg *msg) |
| check if IP address in Via != source IP address of signaling | |
| char * | via_builder (unsigned int *len, struct socket_info *send_sock, str *branch, str *extra_params, int proto, struct hostport *hp) |
Definition in file msg_translator.h.
| #define BRANCH_SEPARATOR '.' |
Definition at line 42 of file msg_translator.h.
Referenced by branch_builder(), and t_reply_matching().
| #define MSG_TRANS_NOVIA_FLAG (1<<1) |
Definition at line 49 of file msg_translator.h.
Referenced by build_req_buf_from_sip_req(), and t_uac().
| #define MSG_TRANS_SHM_FLAG (1<<0) |
Definition at line 48 of file msg_translator.h.
Referenced by build_req_buf_from_sip_req(), print_uac_request(), and t_uac().
| #define MY_HF_SEP ": " |
Definition at line 39 of file msg_translator.h.
| #define MY_HF_SEP_LEN 2 |
Definition at line 40 of file msg_translator.h.
| #define set_hostport | ( | hp, | |||
| msg | ) |
Definition at line 69 of file msg_translator.h.
Referenced by assemble_via(), build_dlg_ack(), build_local(), build_req_buf_from_sip_req(), and build_uac_cancel().
| #define WARNING "Warning: 392 " |
| #define WARNING_LEN (sizeof(WARNING)-1) |
| #define WARNING_PHRASE " \"Noisy feedback tells: " |
| #define WARNING_PHRASE_LEN (sizeof(WARNING_PHRASE)-1) |
| int branch_builder | ( | unsigned int | hash_index, | |
| unsigned int | label, | |||
| char * | char_v, | |||
| int | branch, | |||
| char * | branch_str, | |||
| int * | len | |||
| ) |
return number of chars printed or 0 if space exceeded; assumes buffer size of at least MAX_BRANCH_PARAM_LEN
Definition at line 1855 of file msg_translator.c.
References BRANCH_SEPARATOR, int2reverse_hex(), MAX_BRANCH_PARAM_LEN, MCOOKIE, MCOOKIE_LEN, and MD5_LEN.
Referenced by t_calc_branch().
| char* build_req_buf_from_sip_req | ( | struct sip_msg * | msg, | |
| unsigned int * | returned_len, | |||
| struct socket_info * | send_sock, | |||
| int | proto, | |||
| unsigned int | flags | |||
| ) |
Definition at line 1275 of file msg_translator.c.
References sip_msg::add_rm, sip_msg::add_to_branch_len, sip_msg::add_to_branch_s, adjust_clen(), anchor_lump(), sip_msg::body_lumps, sip_msg::buf, buf, del_lump(), E_OUT_OF_MEM, sip_msg::first_line, FL_FORCE_LOCAL_RPORT, FL_FORCE_RPORT, via_body::hdr, HDR_VIA_T, via_body::host, id_builder(), insert_new_lump_after(), insert_new_lump_before(), insert_path_as_route(), sip_msg::len, _str::len, len, LM_DBG, LM_ERR, lumps_len(), sip_msg::msg_flags, MSG_TRANS_NOVIA_FLAG, MSG_TRANS_SHM_FLAG, sip_msg::new_uri, via_body::params, sip_msg::path_vec, pkg_free, pkg_malloc, via_body::port, via_body::port_str, process_lumps(), receive_info::proto, PROTO_TCP, PROTO_TLS, sip_msg::rcv, via_body::received, received_builder(), received_test(), msg_start::request, via_body::rport, RPORT, rport_builder(), RPORT_LEN, _str::s, ser_error, set_hostport, shm_malloc(), via_param::size, via_param::start, msg_start::u, sip_msg::via1, via_builder(), and via_len.
Referenced by forward_request(), print_uac_request(), and t_uac().
| char* build_res_buf_from_sip_req | ( | unsigned int | code, | |
| str * | text, | |||
| str * | new_tag, | |||
| struct sip_msg * | msg, | |||
| unsigned int * | returned_len, | |||
| struct bookmark * | bmark | |||
| ) |
Definition at line 1579 of file msg_translator.c.
References append_str, hdr_field::body, buf, CONTENT_LENGTH, CONTENT_LENGTH_LEN, CRLF, CRLF_LEN, FL_FORCE_RPORT, lump_rpl::flags, get_to, sip_msg::h_via1, HDR_CALLID_T, HDR_CSEQ_T, HDR_EOH_F, HDR_FROM_T, HDR_RECORDROUTE_T, HDR_TO_T, HDR_VIA_T, sip_msg::headers, int2str(), hdr_field::len, _str::len, len, LM_CRIT, LM_ERR, LM_WARN, LUMP_RPL_BODY, LUMP_RPL_HDR, sip_msg::msg_flags, hdr_field::name, lump_rpl::next, hdr_field::next, NULL, parse_headers(), hdr_field::parsed, pkg_free, pkg_malloc, received_builder(), received_test(), sip_msg::reply_lump, via_body::rport, rport_builder(), _str::s, server_header, server_signature, SIP_VERSION, SIP_VERSION_LEN, sip_warning, via_param::size, via_param::start, to_body::tag_value, lump_rpl::text, bookmark::to_tag_val, TOTAG_TOKEN, TOTAG_TOKEN_LEN, hdr_field::type, sip_msg::via1, and warning_builder().
Referenced by _reply(), relay_reply(), sl_send_reply_helper(), and t_reply_with_body().
| char* build_res_buf_from_sip_res | ( | struct sip_msg * | msg, | |
| unsigned int * | returned_len | |||
| ) |
Definition at line 1510 of file msg_translator.c.
References sip_msg::add_rm, adjust_clen(), hdr_field::body, sip_msg::body_lumps, via_body::bsize, sip_msg::buf, buf, del_lump(), sip_msg::first_line, sip_msg::h_via1, HDR_VIA_T, hdr_field::len, sip_msg::len, len, LM_DBG, LM_ERR, lumps_len(), hdr_field::name, via_body::next, pkg_malloc, process_lumps(), via_body::proto, PROTO_UDP, msg_start::reply, _str::s, msg_start::u, sip_msg::via1, sip_msg::via2, and via_len.
Referenced by forward_reply(), and relay_reply().
| int received_test | ( | struct sip_msg * | msg | ) |
check if IP address in Via != source IP address of signaling
Definition at line 209 of file msg_translator.c.
References check_via_address(), via_body::host, via_body::maddr, NULL, via_body::port, via_body::proto, sip_msg::rcv, via_body::received, received_dns, receive_info::src_ip, via_param::value, and sip_msg::via1.
Referenced by build_req_buf_from_sip_req(), build_res_buf_from_sip_req(), nat_uac_test_f(), and test_source_address().
| char* via_builder | ( | unsigned int * | len, | |
| struct socket_info * | send_sock, | |||
| str * | branch, | |||
| str * | extra_params, | |||
| int | proto, | |||
| struct hostport * | hp | |||
| ) |
Definition at line 1905 of file msg_translator.c.
References socket_info::address_str, CRLF, CRLF_LEN, E_OUT_OF_MEM, hostport::host, _str::len, LM_CRIT, LM_ERR, MY_BRANCH, MY_BRANCH_LEN, MY_VIA, MY_VIA_LEN, pkg_malloc, hostport::port, socket_info::port_no, socket_info::port_no_str, PROTO_SCTP, PROTO_TCP, PROTO_TLS, PROTO_UDP, _str::s, ser_error, SIP_PORT, and via_len.
Referenced by assemble_via(), build_dlg_ack(), build_local(), build_req_buf_from_sip_req(), and build_uac_cancel().
1.5.6