Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

forward.c File Reference

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "forward.h"
#include "hash_func.h"
#include "config.h"
#include "parser/msg_parser.h"
#include "route.h"
#include "dprint.h"
#include "globals.h"
#include "cfg_core.h"
#include "data_lump.h"
#include "ut.h"
#include "mem/mem.h"
#include "msg_translator.h"
#include "sr_module.h"
#include "ip_addr.h"
#include "resolve.h"
#include "name_alias.h"
#include "socket_info.h"
#include "onsend.h"
#include "compiler_opt.h"

Go to the source code of this file.

Functions

socket_infoget_out_socket (union sockaddr_union *to, int proto)
socket_infoget_send_socket (struct sip_msg *msg, union sockaddr_union *to, int proto)
int check_self (str *host, unsigned short port, unsigned short proto)
int check_self_port (unsigned short port, unsigned short proto)
int forward_request (struct sip_msg *msg, str *dst, unsigned short port, struct dest_info *send_info)
int update_sock_struct_from_via (union sockaddr_union *to, struct sip_msg *msg, struct via_body *via)
int forward_reply (struct sip_msg *msg)


Function Documentation

int check_self str host,
unsigned short  port,
unsigned short  proto
 

Definition at line 293 of file forward.c.

References DBG, grep_aliases(), grep_sock_info(), _str::len, _str::s, and str.

Referenced by check_self_op(), forward_reply(), get_direction(), is_myself(), ospGetNextHop(), and ospGetRouteParameters().

int check_self_port unsigned short  port,
unsigned short  proto
 

Definition at line 309 of file forward.c.

References grep_sock_info_by_port().

Referenced by is_myself().

int forward_reply struct sip_msg msg  ) 
 

Definition at line 595 of file forward.c.

References build_res_buf_from_sip_res(), check_self(), DBG, via_body::error, sip_msg::first_line, HDR_VIA2_F, via_body::host, via_body::i, dest_info::id, init_dest_info, L_ERR, L_NOTICE, _str::len, len, LOG, mod_response_cbks, msg_send(), parse_headers(), pkg_free, via_body::port, via_body::proto, dest_info::proto, PROTO_SCTP, PROTO_TCP, PROTO_TLS, msg_start::reply, reverse_hex2int(), _str::s, s, SIP_PORT, STATS_TX_RESPONSE, msg_start::statuscode, dest_info::to, msg_start::u, update_sock_struct_from_via(), via_param::value, sip_msg::via1, sip_msg::via2, and ZSW.

Referenced by receive_msg().

int forward_request struct sip_msg msg,
str dst,
unsigned short  port,
struct dest_info send_info
 

Definition at line 336 of file forward.c.

References sip_msg::add_to_branch_len, sip_msg::add_to_branch_s, BLST_ERR_SEND, hdr_field::body, branch_builder(), buf, build_req_buf_from_sip_req(), sip_msg::callid, cfg_get, char_msg_val(), core_cfg, DBG, dns_sip_resolve2su(), dns_srv_handle_init(), dns_srv_handle_next(), dns_srv_handle_put(), dns_strerror(), dst_blacklist_add, dst_is_blacklisted(), sip_msg::first_line, get_cseq, get_send_socket(), hash, sip_msg::hash_index, ip_addr2a(), L_DBG, L_ERR, L_INFO, _str::len, len, sip_msg::len, LOG, msg_start::method_value, msg_send(), pkg_free, dest_info::proto, msg_start::request, run_onsend(), _str::s, sockaddr_union::s, dest_info::send_sock, ser_error, sip_hostport2su(), STATS_TX_REQUEST, str, su2ip_addr(), su_getport(), dest_info::to, msg_start::u, and ZSW.

Referenced by do_action(), t_forward_cancel(), and t_relay_to().

struct socket_info* get_out_socket union sockaddr_union to,
int  proto
 

Definition at line 110 of file forward.c.

References DBG, find_si(), L_CRIT, L_ERR, len, LOG, sockaddr_union::s, si, sockaddru_len, and su2ip_addr().

Referenced by get_send_socket().

struct socket_info* get_send_socket struct sip_msg msg,
union sockaddr_union to,
int  proto
 

Definition at line 159 of file forward.c.

References socket_info::address, ip_addr::af, bind_address, DBG, find_si(), sip_msg::force_send_socket, get_out_socket(), L_CRIT, L_ERR, L_WARN, likely, LOG, mhomed, socket_info::port_no, socket_info::proto, PROTO_SCTP, PROTO_TCP, PROTO_TLS, PROTO_UDP, sockaddr_union::s, SI_IS_MCAST, socket_info::socket, and unlikely.

Referenced by add_uac(), build_req_buf_from_sip_req(), do_action(), forward_request(), msg_send(), natping_contact(), pingClients(), select_next_hop_src_ip(), and uri2dst().

int update_sock_struct_from_via union sockaddr_union to,
struct sip_msg msg,
struct via_body via
 

Definition at line 527 of file forward.c.

References DBG, via_body::host, hostent2su(), L_NOTICE, _str::len, LOG, sip_msg::msg_flags, via_body::port, via_body::proto, sip_msg::rcv, via_body::received, via_body::rport, _str::s, sip_resolvehost, receive_info::src_port, str, str2s(), via_param::value, and sip_msg::via1.

Referenced by forward_reply(), init_rb(), and sl_send_reply().


Generated on Thu Jul 29 04:15:54 2010 for SIPExpressRouter by  doxygen 1.3.9.1