#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <string.h>#include <ctype.h>#include <errno.h>#include <time.h>#include <sys/types.h>#include <arpa/inet.h>#include "../../sr_module.h"#include "../../mem/shm_mem.h"#include "../../mem/mem.h"#include "../../lock_ops.h"#include "../../dprint.h"#include "../../str.h"#include "../../pvar.h"#include "../../error.h"#include "../../timer.h"#include "../../resolve.h"#include "../../data_lump.h"#include "../../mod_fix.h"#include "../../script_cb.h"#include "../../parser/msg_parser.h"#include "../../parser/parse_from.h"#include "../../parser/parse_uri.h"#include "../../parser/parse_expires.h"#include "../../parser/contact/parse_contact.h"#include "../dialog/dlg_load.h"#include "../tm/tm_load.h"#include "../sl/sl_cb.h"

Go to the source code of this file.
Data Structures | |
| struct | Dialog_Param |
| struct | HashSlot |
| struct | HashTable |
| struct | Keepalive_Params |
| struct | NAT_Contact |
| struct | NatTest |
| struct | NetInfo |
| struct | SIP_Dialog |
Defines | |
| #define | False 0 |
| #define | FROM_PREFIX "sip:keepalive@" |
| #define | HASH(table, key) (hash_string(key) % (table)->size) |
| #define | HASH_SIZE 512 |
| #define | INLINE inline |
| #define | is_private_address(x) (rfc1918address(x)==1 ? 1 : 0) |
| #define | max(a, b) ((a)>(b) ? (a) : (b)) |
| #define | min(a, b) ((a)<(b) ? (a) : (b)) |
| #define | STATE_FILE_HEADER "# Automatically generated file from internal keepalive state. Do NOT modify!\n" |
| #define | STR_HAS_IPREFIX(str, prefix) ((str).len>(prefix).len && strncasecmp((prefix).s, (str).s, (prefix).len)==0) |
| #define | STR_HAS_PREFIX(str, prefix) ((str).len>(prefix).len && memcmp((prefix).s, (str).s, (prefix).len)==0) |
| #define | STR_IMATCH(str, buf) ((str).len==strlen(buf) && strncasecmp(buf, (str).s, (str).len)==0) |
| #define | STR_IMATCH_STR(str, str2) ((str).len==(str2).len && strncasecmp((str).s, (str2).s, (str).len)==0) |
| #define | STR_MATCH(str, buf) ((str).len==strlen(buf) && memcmp(buf, (str).s, (str).len)==0) |
| #define | STR_MATCH_STR(str, str2) ((str).len==(str2).len && memcmp((str).s, (str2).s, (str).len)==0) |
| #define | True 1 |
| #define | URI_LIST_INITIAL_SIZE 8 |
| #define | URI_LIST_RESIZE_INCREMENT 8 |
Typedefs | |
| typedef int | Bool |
| typedef Bool(* | NatTestFunction )(struct sip_msg *msg) |
Enumerations | |
| enum | NatTestType { NTNone = 0, NTPrivateContact = 1, NTSourceAddress = 2, NTPrivateVia = 4 } |
Functions | |
| static void | __dialog_confirmed (struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) |
| static void | __dialog_created (struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) |
| static void | __dialog_destroy (struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) |
| static void | __dialog_early (struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) |
| static void | __sl_reply_out (unsigned int types, struct sip_msg *request, struct sl_cb_param *param) |
| static void | __tm_reply_in (struct cell *trans, int type, struct tmcb_params *param) |
| static int | ClientNatTest (struct sip_msg *msg, unsigned int tests) |
| static Bool | Dialog_Param_add_candidate (Dialog_Param *param, char *candidate) |
| static void | Dialog_Param_del (Dialog_Param *param) |
| static Bool | Dialog_Param_has_candidate (Dialog_Param *param, char *candidate) |
| static Dialog_Param * | Dialog_Param_new (void) |
| static int | FixContact (struct sip_msg *msg) |
| static Bool | get_contact_uri (struct sip_msg *msg, struct sip_uri *uri, contact_t **_c) |
| static int | get_expires (struct sip_msg *msg) |
| static time_t | get_register_expire (struct sip_msg *request, struct sip_msg *reply) |
| static char * | get_source_uri (struct sip_msg *msg) |
| static INLINE unsigned | hash_string (const char *key) |
| static void | HashTable_del (HashTable *table) |
| static HashTable * | HashTable_new (void) |
| static NAT_Contact * | HashTable_search (HashTable *table, char *uri, unsigned slot) |
| static void | keepalive_registration (struct sip_msg *request, time_t expire) |
| static void | keepalive_subscription (struct sip_msg *request, time_t expire) |
| static void | keepalive_timer (unsigned int ticks, void *data) |
| static INLINE void | ltrim (str *string) |
| static void | mod_destroy (void) |
| static int | mod_init (void) |
| static void | NAT_Contact_del (NAT_Contact *contact) |
| static SIP_Dialog * | NAT_Contact_get_dialog (NAT_Contact *contact, struct dlg_cell *dlg) |
| static Bool | NAT_Contact_match (NAT_Contact *contact, const char *uri) |
| static NAT_Contact * | NAT_Contact_new (char *uri, struct socket_info *socket) |
| static NAT_Contact * | NAT_Contact_purge_expired (NAT_Contact *contact, time_t now) |
| static int | NAT_Keepalive (struct sip_msg *msg) |
| static int | preprocess_request (struct sip_msg *msg, void *param) |
| static int | pv_get_keepalive_socket (struct sip_msg *msg, pv_param_t *param, pv_value_t *res) |
| static int | pv_get_source_uri (struct sip_msg *msg, pv_param_t *param, pv_value_t *res) |
| static int | pv_parse_nat_contact_name (pv_spec_p sp, str *in) |
| static int | reply_filter (struct sip_msg *reply) |
| static void | restore_keepalive_state (void) |
| static INLINE int | rfc1918address (str *address) |
| static INLINE void | rtrim (str *string) |
| static void | save_keepalive_state (void) |
| static void | send_keepalive (NAT_Contact *contact) |
| static INLINE char * | shm_strdup (char *source) |
| static void | SIP_Dialog_del (SIP_Dialog *dialog) |
| static INLINE void | SIP_Dialog_end (SIP_Dialog *dialog) |
| static SIP_Dialog * | SIP_Dialog_new (struct dlg_cell *dlg, time_t expire) |
| static SIP_Dialog * | SIP_Dialog_purge_expired (SIP_Dialog *dialog, time_t now) |
| static INLINE void | SIP_Registration_expire (NAT_Contact *contact, time_t now) |
| static INLINE void | SIP_Registration_update (NAT_Contact *contact, time_t expire) |
| static INLINE void | SIP_Subscription_expire (NAT_Contact *contact, time_t now) |
| static INLINE void | SIP_Subscription_update (NAT_Contact *contact, time_t expire) |
| static Bool | test_private_contact (struct sip_msg *msg) |
| static Bool | test_private_via (struct sip_msg *msg) |
| static Bool | test_source_address (struct sip_msg *msg) |
| static INLINE void | trim (str *string) |
Variables | |
| static cmd_export_t | commands [] |
| static unsigned | dialog_default_timeout = 12*3600 |
| stat_var * | dialog_endpoints = 0 |
| static int | dialog_flag = -1 |
| struct dlg_binds | dlg_api |
| struct module_exports | exports |
| Bool | have_dlg_api = False |
| static Bool | keepalive_disabled = False |
| stat_var * | keepalive_endpoints = 0 |
| static unsigned int | keepalive_interval = 60 |
| static Keepalive_Params | keepalive_params = {"NOTIFY", NULL, "", "", 0, 0, ""} |
| static char * | keepalive_state_file = "keepalive_state" |
| static HashTable * | nat_table = NULL |
| static NatTest | NAT_Tests [] |
| static param_export_t | parameters [] |
| static pv_export_t | pvars [] |
| stat_var * | registered_endpoints = 0 |
| static NetInfo | rfc1918nets [] |
| static stat_export_t | statistics [] |
| stat_var * | subscribed_endpoints = 0 |
| struct tm_binds | tm_api |
| #define False 0 |
Definition at line 84 of file nat_traversal.c.
| #define FROM_PREFIX "sip:keepalive@" |
Definition at line 1483 of file nat_traversal.c.
Definition at line 495 of file nat_traversal.c.
Referenced by __dialog_confirmed(), __dialog_created(), __dialog_destroy(), __dialog_early(), calc_HA1(), calc_response(), keepalive_registration(), keepalive_subscription(), uac_calc_HA1(), uac_calc_HA2(), and uac_calc_response().
| #define HASH_SIZE 512 |
Definition at line 66 of file nat_traversal.c.
Referenced by db_update(), destroy_htable(), executeInterprocessBufferCmd(), get_record_id(), hashT_clean(), HashTable_new(), initInterprocessBuffers(), insert_htable(), is_dialog(), mod_init(), new_htable(), openserSIPRegUserLookupTable_set_action(), publ_cback_func(), send_publish(), send_subscribe(), subs_cback_func(), update_contact(), and updateUser().
| #define INLINE inline |
Definition at line 60 of file nat_traversal.c.
| #define is_private_address | ( | x | ) | (rfc1918address(x)==1 ? 1 : 0) |
Definition at line 779 of file nat_traversal.c.
Referenced by test_private_contact(), and test_private_via().
| #define max | ( | a, | |||
| b | ) | ((a)>(b) ? (a) : (b)) |
Definition at line 69 of file nat_traversal.c.
Referenced by get_redirect(), get_register_expire(), mi_usrloc_dump(), parse_method(), print_udomain(), and w_get_redirect2().
| #define min | ( | a, | |||
| b | ) | ((a)<(b) ? (a) : (b)) |
| #define STATE_FILE_HEADER "# Automatically generated file from internal keepalive state. Do NOT modify!\n" |
Definition at line 1584 of file nat_traversal.c.
| #define STR_HAS_IPREFIX | ( | str, | |||
| prefix | ) | ((str).len>(prefix).len && strncasecmp((prefix).s, (str).s, (prefix).len)==0) |
Definition at line 79 of file nat_traversal.c.
| #define STR_HAS_PREFIX | ( | str, | |||
| prefix | ) | ((str).len>(prefix).len && memcmp((prefix).s, (str).s, (prefix).len)==0) |
Definition at line 78 of file nat_traversal.c.
Definition at line 73 of file nat_traversal.c.
| #define STR_IMATCH_STR | ( | str, | |||
| str2 | ) | ((str).len==(str2).len && strncasecmp((str).s, (str2).s, (str).len)==0) |
Definition at line 76 of file nat_traversal.c.
Definition at line 72 of file nat_traversal.c.
| #define True 1 |
Definition at line 83 of file nat_traversal.c.
| #define URI_LIST_INITIAL_SIZE 8 |
| #define URI_LIST_RESIZE_INCREMENT 8 |
| typedef int Bool |
Definition at line 82 of file nat_traversal.c.
| typedef Bool(* NatTestFunction)(struct sip_msg *msg) |
Definition at line 87 of file nat_traversal.c.
| enum NatTestType |
Definition at line 89 of file nat_traversal.c.
| static void __dialog_confirmed | ( | struct dlg_cell * | dlg, | |
| int | type, | |||
| struct dlg_cb_params * | _params | |||
| ) | [static] |
Definition at line 1059 of file nat_traversal.c.
References Dialog_Param::callee_candidates, Dialog_Param::callee_uri, Dialog_Param::confirmed, Dialog_Param::count, Dialog_Param::expire, get_source_uri(), HASH, HashTable_search(), LM_ERR, HashSlot::lock, Dialog_Param::lock, dlg_cb_params::msg, NAT_Contact_get_dialog(), NULL, dlg_cb_params::param, shm_free, shm_strdup(), SIP_Dialog_end(), SIP_Dialog_new(), HashTable::slots, True, and Dialog_Param::uri.
Referenced by __dialog_created().
| static void __dialog_created | ( | struct dlg_cell * | dlg, | |
| int | type, | |||
| struct dlg_cb_params * | _params | |||
| ) | [static] |
Definition at line 1215 of file nat_traversal.c.
References __dialog_confirmed(), __dialog_destroy(), __dialog_early(), receive_info::bind_address, Dialog_Param::caller_uri, Dialog_Param_del(), Dialog_Param_new(), NAT_Contact::dialogs, dlg_api, DLGCB_CONFIRMED, DLGCB_DESTROY, DLGCB_EARLY, Dialog_Param::expire, FL_DO_KEEPALIVE, get_source_uri(), HASH, HashTable_search(), HashSlot::head, LM_ERR, HashSlot::lock, METHOD_INVITE, dlg_cb_params::msg, sip_msg::msg_flags, NAT_Contact_del(), NAT_Contact_new(), NAT_Contact::next, SIP_Dialog::next, NULL, sip_msg::rcv, dlg_binds::register_dlgcb, request(), shm_strdup(), SIP_Dialog_new(), and HashTable::slots.
| static void __dialog_destroy | ( | struct dlg_cell * | dlg, | |
| int | type, | |||
| struct dlg_cb_params * | _params | |||
| ) | [static] |
Definition at line 1132 of file nat_traversal.c.
References Dialog_Param::callee_candidates, Dialog_Param::callee_uri, Dialog_Param::caller_uri, Dialog_Param::count, Dialog_Param_del(), HASH, HashTable_search(), Dialog_Param::lock, HashSlot::lock, NAT_Contact_get_dialog(), NULL, dlg_cb_params::param, shm_free, SIP_Dialog_end(), HashTable::slots, and Dialog_Param::uri.
Referenced by __dialog_created().
| static void __dialog_early | ( | struct dlg_cell * | dlg, | |
| int | type, | |||
| struct dlg_cb_params * | _params | |||
| ) | [static] |
Definition at line 1012 of file nat_traversal.c.
References Dialog_Param::confirmed, Dialog_Param_add_candidate(), Dialog_Param_has_candidate(), Dialog_Param::expire, get_source_uri(), HASH, HashTable_search(), LM_ERR, HashSlot::lock, Dialog_Param::lock, dlg_cb_params::msg, NAT_Contact_get_dialog(), dlg_cb_params::param, SIP_Dialog_new(), and HashTable::slots.
Referenced by __dialog_created().
| static void __sl_reply_out | ( | unsigned int | types, | |
| struct sip_msg * | request, | |||
| struct sl_cb_param * | param | |||
| ) | [static] |
Definition at line 1289 of file nat_traversal.c.
References sip_msg::buf, sl_cb_param::buffer, sl_cb_param::code, FL_DO_KEEPALIVE, free_sip_msg(), get_expires(), get_register_expire(), keepalive_registration(), keepalive_subscription(), _str::len, sip_msg::len, LM_ERR, METHOD_INVITE, METHOD_REGISTER, METHOD_SUBSCRIBE, sip_msg::msg_flags, parse_msg(), and _str::s.
| static void __tm_reply_in | ( | struct cell * | trans, | |
| int | type, | |||
| struct tmcb_params * | param | |||
| ) | [static] |
Definition at line 1334 of file nat_traversal.c.
References tmcb_params::code, get_expires(), get_register_expire(), keepalive_registration(), keepalive_subscription(), METHOD_REGISTER, METHOD_SUBSCRIBE, NULL, tmcb_params::req, and tmcb_params::rpl.
Referenced by NAT_Keepalive().
| static int ClientNatTest | ( | struct sip_msg * | msg, | |
| unsigned int | tests | |||
| ) | [static] |
| static Bool Dialog_Param_add_candidate | ( | Dialog_Param * | param, | |
| char * | candidate | |||
| ) | [static] |
Definition at line 670 of file nat_traversal.c.
References Dialog_Param::callee_candidates, Dialog_Param::count, False, LM_DBG, LM_ERR, shm_realloc(), shm_strdup(), Dialog_Param::size, True, Dialog_Param::uri, and URI_LIST_RESIZE_INCREMENT.
Referenced by __dialog_early().
| static void Dialog_Param_del | ( | Dialog_Param * | param | ) | [static] |
Definition at line 630 of file nat_traversal.c.
References Dialog_Param::callee_candidates, Dialog_Param::callee_uri, Dialog_Param::caller_uri, Dialog_Param::count, Dialog_Param::lock, shm_free, and Dialog_Param::uri.
Referenced by __dialog_created(), and __dialog_destroy().
| static Bool Dialog_Param_has_candidate | ( | Dialog_Param * | param, | |
| char * | candidate | |||
| ) | [static] |
Definition at line 653 of file nat_traversal.c.
References Dialog_Param::callee_candidates, Dialog_Param::count, False, True, and Dialog_Param::uri.
Referenced by __dialog_early().
| static Dialog_Param* Dialog_Param_new | ( | void | ) | [static] |
Definition at line 596 of file nat_traversal.c.
References Dialog_Param::callee_candidates, dialog_default_timeout, Dialog_Param::expire, LM_ERR, Dialog_Param::lock, NULL, shm_free, shm_malloc(), Dialog_Param::size, Dialog_Param::uri, and URI_LIST_INITIAL_SIZE.
Referenced by __dialog_created().
| static int FixContact | ( | struct sip_msg * | msg | ) | [static] |
Definition at line 1407 of file nat_traversal.c.
References sip_msg::buf, buf, del_lump(), get_contact_uri(), HDR_CONTACT_F, sip_uri::host, insert_new_lump_after(), ip_addr2a(), _str::len, len, LM_ERR, NULL, pkg_free, pkg_malloc, sip_uri::port, sip_msg::rcv, _str::s, receive_info::src_ip, receive_info::src_port, and contact::uri.
| static Bool get_contact_uri | ( | struct sip_msg * | msg, | |
| struct sip_uri * | uri, | |||
| contact_t ** | _c | |||
| ) | [static] |
Definition at line 753 of file nat_traversal.c.
References sip_msg::contact, False, HDR_CONTACT_F, sip_uri::host, _str::len, LM_ERR, NULL, parse_contact(), parse_headers(), parse_uri(), hdr_field::parsed, and True.
| static int get_expires | ( | struct sip_msg * | msg | ) | [static] |
Definition at line 844 of file nat_traversal.c.
References sip_msg::expires, HDR_EXPIRES_F, LM_ERR, NULL, parse_expires(), parse_headers(), hdr_field::parsed, exp_body::val, and exp_body::valid.
Referenced by __sl_reply_out(), and __tm_reply_in().
Definition at line 868 of file nat_traversal.c.
References param::body, clean_hdr_field(), sip_msg::contact, contact_body::contacts, contact::expires, False, HDR_EOH_F, _str::len, LM_DBG, LM_ERR, max, contact::next, NULL, parse_contact(), parse_headers(), hdr_field::parsed, hdr_field::sibling, contact_body::star, str2int(), STR_MATCH_STR, True, and contact::uri.
Referenced by __sl_reply_out(), and __tm_reply_in().
| static char* get_source_uri | ( | struct sip_msg * | msg | ) | [static] |
Definition at line 943 of file nat_traversal.c.
References ip_addr2a(), sip_msg::rcv, snprintf, receive_info::src_ip, and receive_info::src_port.
| static INLINE unsigned hash_string | ( | const char * | key | ) | [static] |
Definition at line 498 of file nat_traversal.c.
| static void HashTable_del | ( | HashTable * | table | ) | [static] |
Definition at line 551 of file nat_traversal.c.
References HashSlot::head, HashSlot::lock, NAT_Contact_del(), NAT_Contact::next, NULL, shm_free, HashTable::size, and HashTable::slots.
| static HashTable* HashTable_new | ( | void | ) | [static] |
Definition at line 513 of file nat_traversal.c.
References HASH_SIZE, LM_ERR, HashSlot::lock, NULL, shm_free, shm_malloc(), HashTable::size, HashTable::slots, and table.
| static NAT_Contact* HashTable_search | ( | HashTable * | table, | |
| char * | uri, | |||
| unsigned | slot | |||
| ) | [static] |
Definition at line 576 of file nat_traversal.c.
References HashSlot::head, NAT_Contact_match(), NAT_Contact::next, and HashTable::slots.
Referenced by __dialog_confirmed(), __dialog_created(), __dialog_destroy(), __dialog_early(), keepalive_registration(), and keepalive_subscription().
| static void keepalive_registration | ( | struct sip_msg * | request, | |
| time_t | expire | |||
| ) | [static] |
Definition at line 952 of file nat_traversal.c.
References receive_info::bind_address, get_source_uri(), HASH, HashTable_search(), HashSlot::head, LM_ERR, HashSlot::lock, NAT_Contact_new(), NAT_Contact::next, sip_msg::rcv, SIP_Registration_update(), and HashTable::slots.
Referenced by __sl_reply_out(), and __tm_reply_in().
| static void keepalive_subscription | ( | struct sip_msg * | request, | |
| time_t | expire | |||
| ) | [static] |
Definition at line 982 of file nat_traversal.c.
References receive_info::bind_address, get_source_uri(), HASH, HashTable_search(), HashSlot::head, LM_ERR, HashSlot::lock, NAT_Contact_new(), NAT_Contact::next, sip_msg::rcv, SIP_Subscription_update(), and HashTable::slots.
Referenced by __sl_reply_out(), and __tm_reply_in().
| static void keepalive_timer | ( | unsigned int | ticks, | |
| void * | data | |||
| ) | [static] |
Definition at line 1546 of file nat_traversal.c.
| static INLINE void ltrim | ( | str * | string | ) | [static] |
| static void mod_destroy | ( | void | ) | [static] |
| static int mod_init | ( | void | ) | [static] |
Definition at line 1691 of file nat_traversal.c.
| static void NAT_Contact_del | ( | NAT_Contact * | contact | ) | [static] |
Definition at line 419 of file nat_traversal.c.
References NAT_Contact::dialogs, SIP_Dialog::next, NAT_Contact::registration_expire, shm_free, SIP_Dialog_del(), NAT_Contact::subscription_expire, update_stat, and NAT_Contact::uri.
Referenced by __dialog_created(), HashTable_del(), and NAT_Contact_purge_expired().
| static SIP_Dialog* NAT_Contact_get_dialog | ( | NAT_Contact * | contact, | |
| struct dlg_cell * | dlg | |||
| ) | [static] |
Definition at line 452 of file nat_traversal.c.
References NAT_Contact::dialogs, SIP_Dialog::dlg, and SIP_Dialog::next.
Referenced by __dialog_confirmed(), __dialog_destroy(), and __dialog_early().
| static Bool NAT_Contact_match | ( | NAT_Contact * | contact, | |
| const char * | uri | |||
| ) | [static] |
Definition at line 445 of file nat_traversal.c.
References NAT_Contact::uri.
Referenced by HashTable_search().
| static NAT_Contact* NAT_Contact_new | ( | char * | uri, | |
| struct socket_info * | socket | |||
| ) | [static] |
Definition at line 393 of file nat_traversal.c.
References LM_ERR, NULL, shm_free, shm_malloc(), shm_strdup(), NAT_Contact::socket, update_stat, and NAT_Contact::uri.
Referenced by __dialog_created(), keepalive_registration(), and keepalive_subscription().
| static NAT_Contact* NAT_Contact_purge_expired | ( | NAT_Contact * | contact, | |
| time_t | now | |||
| ) | [static] |
Definition at line 469 of file nat_traversal.c.
References NAT_Contact::dialogs, NAT_Contact_del(), NAT_Contact::next, NULL, NAT_Contact::registration_expire, SIP_Dialog_purge_expired(), SIP_Registration_expire(), SIP_Subscription_expire(), and NAT_Contact::subscription_expire.
| static int NAT_Keepalive | ( | struct sip_msg * | msg | ) | [static] |
Definition at line 1361 of file nat_traversal.c.
References __tm_reply_in(), dialog_flag, FL_DO_KEEPALIVE, have_dlg_api, HDR_EOH_F, keepalive_disabled, LM_ERR, METHOD_INVITE, METHOD_REGISTER, METHOD_SUBSCRIBE, sip_msg::msg_flags, parse_headers(), receive_info::proto, PROTO_UDP, sip_msg::rcv, tm_binds::register_tmcb, setflag(), tm_api, and TMCB_RESPONSE_IN.
| static int preprocess_request | ( | struct sip_msg * | msg, | |
| void * | param | |||
| ) | [static] |
Definition at line 1815 of file nat_traversal.c.
References sip_msg::callid, sip_msg::cseq, HDR_CALLID_F, HDR_CSEQ_F, HDR_VIA2_F, LM_ERR, Keepalive_Params::method, cseq_body::method, NULL, parse_headers(), hdr_field::parsed, prefix, STR_MATCH, and sip_msg::via2.
| static int pv_get_keepalive_socket | ( | struct sip_msg * | msg, | |
| pv_param_t * | param, | |||
| pv_value_t * | res | |||
| ) | [static] |
Definition at line 1925 of file nat_traversal.c.
| static int pv_get_source_uri | ( | struct sip_msg * | msg, | |
| pv_param_t * | param, | |||
| pv_value_t * | res | |||
| ) | [static] |
Definition at line 1967 of file nat_traversal.c.
Definition at line 1890 of file nat_traversal.c.
| static int reply_filter | ( | struct sip_msg * | reply | ) | [static] |
Definition at line 1842 of file nat_traversal.c.
| static void restore_keepalive_state | ( | void | ) | [static] |
Definition at line 1624 of file nat_traversal.c.
| static INLINE int rfc1918address | ( | str * | address | ) | [static] |
Definition at line 783 of file nat_traversal.c.
References ip_addr::addr32, mask, NetInfo::name, netaddr, NULL, str2ip(), and ip_addr::u.
| static INLINE void rtrim | ( | str * | string | ) | [static] |
| static void save_keepalive_state | ( | void | ) | [static] |
Definition at line 1587 of file nat_traversal.c.
| static void send_keepalive | ( | NAT_Contact * | contact | ) | [static] |
| static INLINE char * shm_strdup | ( | char * | source | ) | [static] |
Definition at line 736 of file nat_traversal.c.
References NULL, and shm_malloc().
Referenced by __dialog_confirmed(), __dialog_created(), Dialog_Param_add_candidate(), NAT_Contact_new(), purple_send_message_cmd(), purple_send_publish_cmd(), purple_send_subscribe_cmd(), and xmpp_send_pipe_cmd().
| static void SIP_Dialog_del | ( | SIP_Dialog * | dialog | ) | [static] |
Definition at line 305 of file nat_traversal.c.
References SIP_Dialog::expire, shm_free, and update_stat.
Referenced by NAT_Contact_del(), and SIP_Dialog_purge_expired().
| static INLINE void SIP_Dialog_end | ( | SIP_Dialog * | dialog | ) | [static] |
Definition at line 339 of file nat_traversal.c.
References SIP_Dialog::expire, and update_stat.
Referenced by __dialog_confirmed(), and __dialog_destroy().
| static SIP_Dialog* SIP_Dialog_new | ( | struct dlg_cell * | dlg, | |
| time_t | expire | |||
| ) | [static] |
Definition at line 284 of file nat_traversal.c.
References SIP_Dialog::dlg, SIP_Dialog::expire, LM_ERR, SIP_Dialog::next, NULL, shm_malloc(), and update_stat.
Referenced by __dialog_confirmed(), __dialog_created(), and __dialog_early().
| static SIP_Dialog* SIP_Dialog_purge_expired | ( | SIP_Dialog * | dialog, | |
| time_t | now | |||
| ) | [static] |
Definition at line 319 of file nat_traversal.c.
References SIP_Dialog::expire, SIP_Dialog::next, NULL, and SIP_Dialog_del().
Referenced by NAT_Contact_purge_expired().
| static INLINE void SIP_Registration_expire | ( | NAT_Contact * | contact, | |
| time_t | now | |||
| ) | [static] |
Definition at line 361 of file nat_traversal.c.
References NAT_Contact::registration_expire, and update_stat.
Referenced by NAT_Contact_purge_expired().
| static INLINE void SIP_Registration_update | ( | NAT_Contact * | contact, | |
| time_t | expire | |||
| ) | [static] |
Definition at line 351 of file nat_traversal.c.
References NAT_Contact::registration_expire, and update_stat.
Referenced by keepalive_registration().
| static INLINE void SIP_Subscription_expire | ( | NAT_Contact * | contact, | |
| time_t | now | |||
| ) | [static] |
Definition at line 380 of file nat_traversal.c.
References NAT_Contact::subscription_expire, and update_stat.
Referenced by NAT_Contact_purge_expired().
| static INLINE void SIP_Subscription_update | ( | NAT_Contact * | contact, | |
| time_t | expire | |||
| ) | [static] |
Definition at line 370 of file nat_traversal.c.
References NAT_Contact::subscription_expire, and update_stat.
Referenced by keepalive_subscription().
Definition at line 822 of file nat_traversal.c.
References False, get_contact_uri(), sip_uri::host, and is_private_address.
Definition at line 836 of file nat_traversal.c.
References via_body::host, is_private_address, and sip_msg::via1.
Definition at line 807 of file nat_traversal.c.
References via_body::port, sip_msg::rcv, received_test(), SIP_PORT, receive_info::src_port, and sip_msg::via1.
| static INLINE void trim | ( | str * | string | ) | [static] |
cmd_export_t commands[] [static] |
Definition at line 233 of file nat_traversal.c.
unsigned dialog_default_timeout = 12*3600 [static] |
| stat_var* dialog_endpoints = 0 |
Definition at line 216 of file nat_traversal.c.
int dialog_flag = -1 [static] |
Definition at line 210 of file nat_traversal.c.
Definition at line 207 of file nat_traversal.c.
| struct module_exports exports |
Definition at line 263 of file nat_traversal.c.
| Bool have_dlg_api = False |
Definition at line 208 of file nat_traversal.c.
Bool keepalive_disabled = False [static] |
Definition at line 213 of file nat_traversal.c.
unsigned int keepalive_interval = 60 [static] |
Definition at line 200 of file nat_traversal.c.
Keepalive_Params keepalive_params = {"NOTIFY", NULL, "", "", 0, 0, ""} [static] |
Definition at line 204 of file nat_traversal.c.
char* keepalive_state_file = "keepalive_state" [static] |
Definition at line 202 of file nat_traversal.c.
Definition at line 196 of file nat_traversal.c.
Definition at line 225 of file nat_traversal.c.
param_export_t parameters[] [static] |
Definition at line 240 of file nat_traversal.c.
pv_export_t pvars[] [static] |
Initial value:
{
{str_init("keepalive.socket"), PVT_OTHER, pv_get_keepalive_socket, NULL, pv_parse_nat_contact_name, NULL, NULL, 0},
{str_init("source_uri"), PVT_OTHER, pv_get_source_uri, NULL, NULL, NULL, NULL, 0},
{{0, 0}, 0, 0, 0, 0, 0, 0, 0}
}
Definition at line 249 of file nat_traversal.c.
Definition at line 214 of file nat_traversal.c.
NetInfo rfc1918nets[] [static] |
Definition at line 218 of file nat_traversal.c.
stat_export_t statistics[] [static] |
Definition at line 255 of file nat_traversal.c.
Definition at line 215 of file nat_traversal.c.
1.5.6