📄 nta_internal.h
字号:
/* * This file is part of the Sofia-SIP package * * Copyright (C) 2005 Nokia Corporation. * * Contact: Pekka Pessi <pekka.pessi@nokia.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA * 02110-1301 USA * */#ifndef NTA_INTERNAL_H/** Defined when <nta_internal.h> has been included. */#define NTA_INTERNAL_H /**@IFILE nta_internal.h * @brief Internals of NTA objects. * * @author Pekka Pessi <Pekka.Pessi@nokia.com> * * @date Created: Tue Jul 18 09:18:32 2000 ppessi *//* Resolver context type */#define SRES_CONTEXT_T nta_outgoing_t/* We are customer of tport_t */#define TP_AGENT_T nta_agent_t#define TP_MAGIC_T sip_via_t #define TP_CLIENT_T nta_outgoing_t#include <sofia-sip/nta.h>#include <sofia-sip/nta_tport.h>#include <sofia-sip/tport.h>#if HAVE_SOFIA_SRESOLV#include <sofia-sip/sresolv.h>#endif#include <sofia-sip/htable.h>#if HAVE_SMIME#include "smimec.h"#endifSOFIA_BEGIN_DECLS/** A sip_flag telling that this message is internally generated. */#define NTA_INTERNAL_MSG (1<<15)/** Resolving order */enum nta_res_order_e{ nta_res_ip6_ip4, nta_res_ip4_ip6, nta_res_ip6_only, nta_res_ip4_only};HTABLE_DECLARE(leg_htable, lht, nta_leg_t);HTABLE_DECLARE(outgoing_htable, oht, nta_outgoing_t);HTABLE_DECLARE(incoming_htable, iht, nta_incoming_t);typedef struct outgoing_queue_t { nta_outgoing_t **q_tail; nta_outgoing_t *q_head; unsigned q_length; unsigned q_timeout;} outgoing_queue_t;typedef struct incoming_queue_t { nta_incoming_t **q_tail; nta_incoming_t *q_head; unsigned q_length; unsigned q_timeout;} incoming_queue_t;typedef struct nta_compressor nta_compressor_t;struct nta_agent_s{ su_home_t sa_home[1]; su_root_t *sa_root; su_timer_t *sa_timer; nta_agent_magic_t *sa_magic; nta_message_f *sa_callback; nta_update_magic_t*sa_update_magic; nta_update_tport_f*sa_update_tport; su_time_t sa_now; /**< Timestamp in microsecond resolution. */ uint32_t sa_millisec; /**< Timestamp in milliseconds resolution. */ uint32_t sa_flags; /**< Message flags */ msg_mclass_t *sa_mclass; sip_contact_t *sa_contact; sip_via_t *sa_vias; /**< Via headers for all transports */ sip_via_t *sa_public_vias; /**< Vias for public transports */ sip_contact_t *sa_aliases;/**< List of aliases for agent */ uint64_t sa_branch; /**< Counter for generating branch parameter */ uint64_t sa_tags; /**< Counter for generating tag parameters */ char const *sa_2543_tag; /**< Fixed tag added to To when responding */#if HAVE_SOFIA_SRESOLV sres_resolver_t *sa_resolver; /**< DNS resolver */#endif tport_t *sa_tports; /* Default outbound proxy */ url_t *sa_default_proxy;#if HAVE_SMIME sm_object_t *sa_smime;#else void *sa_smime;#endif /** Request error mask */ unsigned short sa_bad_req_mask; /** Response error mask */ unsigned short sa_bad_resp_mask; /** Maximum size of incoming messages */ unsigned sa_maxsize; /** Maximum size of outgoing UDP requests */ unsigned sa_udp_mtu; /** SIP T1 - initial interval of retransmissions (500 ms) */ unsigned sa_t1; /** SIP T2 - maximum interval of retransmissions (4000 ms) */ unsigned sa_t2; /** SIP T4 - clear message time (5000 ms) */ unsigned sa_t4; /** SIP T1X64 - transaction lifetime (32 s) */ unsigned sa_t1x64; /** Progress timer - interval between provisional responses sent */ unsigned sa_progress; /** Blacklisting period */ unsigned sa_blacklist;#define sa_retry_timer_ini sa_t1#define sa_retry_timer_max sa_t2#define sa_linger_timer sa_t4 /** NTA is used to test packet drop */ unsigned sa_drop_prob : 10; /** NTA is acting as an User agent server */ unsigned sa_is_a_uas : 1; /** Process requests outside dialog statelessly */ unsigned sa_is_stateless : 1; /** Let application provide Via headers */ unsigned sa_user_via:1; /** Respond with "100 Trying" if application has not responded. */ unsigned sa_extra_100:1; /** The "100 Trying" provisional answers are passed to the application */ unsigned sa_pass_100:1; /** If true, a "408 Request Timeout" message is generated when outgoing request expires. */ unsigned sa_timeout_408:1; /** If true, a "408 Request Timeout" responses are passed to client. */ unsigned sa_pass_408:1; /** If true, a "482 Request Merged" response is sent to merged requests. */ unsigned sa_merge_482 : 1; /** If true, send a CANCEL to an INVITE without an provisional response. */ unsigned sa_cancel_2543 : 1; /** If true, reply with 487 response when a CANCEL is received. */ unsigned sa_cancel_487 : 1; /** If true, use unique tags. */ unsigned sa_tag_3261 : 1; /** If true, include 100rel in INVITE requests. */ unsigned sa_invite_100rel : 1; /** If true, insert Timestamp in requests. */ unsigned sa_timestamp : 1; /** If true, transports support IPv4. */ unsigned sa_tport_ip4 : 1; /** If true, transports support IPv6. */ unsigned sa_tport_ip6 : 1; /** If true, transports support UDP. */ unsigned sa_tport_udp : 1; /** If true, transports support TCP. */ unsigned sa_tport_tcp : 1; /** If true, transports support SCTP. */ unsigned sa_tport_sctp : 1; /** If true, transports support TLS. */ unsigned sa_tport_tls : 1; /** If true, use NAPTR lookup */ unsigned sa_use_naptr : 1; /** If true, use SRV lookup */ unsigned sa_use_srv : 1; /** If true, trasnports use threadpool */ unsigned sa_tport_threadpool : 1; /** If true, use rport at client */ unsigned sa_rport:1; /** If true, use rport at server */ unsigned sa_server_rport:1; /** If true, use rport with tcp, too */ unsigned sa_tcp_rport:1; /** If true, automatically create compartments */ unsigned sa_auto_comp:1; unsigned :0; /** Messages memory preload. */ unsigned sa_preload; /** Name of SigComp algorithm */ char const *sa_algorithm; /** Options for SigComp. */ char const *sa_sigcomp_options; char const* const *sa_sigcomp_option_list; char const *sa_sigcomp_option_free; nta_compressor_t *sa_compressor; /** Resolving order (AAAA/A) */ enum nta_res_order_e sa_res_order; /** Max-Forwards */ sip_max_forwards_t sa_max_forwards[1]; /* Statistics */ struct { uint32_t as_recv_msg; uint32_t as_recv_request; uint32_t as_recv_response; uint32_t as_bad_message; uint32_t as_bad_request; uint32_t as_bad_response; uint32_t as_drop_request; uint32_t as_drop_response; uint32_t as_client_tr; uint32_t as_server_tr; uint32_t as_dialog_tr; uint32_t as_acked_tr; uint32_t as_canceled_tr; uint32_t as_trless_request; uint32_t as_trless_to_tr; uint32_t as_trless_response; uint32_t as_trless_200; uint32_t as_merged_request; uint32_t as_sent_msg; uint32_t as_sent_request; uint32_t as_sent_response; uint32_t as_retry_request; uint32_t as_retry_response; uint32_t as_recv_retry; uint32_t as_tout_request; uint32_t as_tout_response; } sa_stats[1]; /** Hash of dialogs. */ leg_htable_t sa_dialogs[1]; /** Default leg */ nta_leg_t *sa_default_leg; /** Hash of legs without dialogs. */ leg_htable_t sa_defaults[1]; /** Hash table for outgoing transactions */ outgoing_htable_t sa_outgoing[1]; nta_outgoing_t *sa_default_outgoing; /** Hash table for incoming transactions */ incoming_htable_t sa_incoming[1]; nta_incoming_t *sa_default_incoming; /* Queues (states) for outgoing client transactions */ struct { /** List for retrying client transactions */ nta_outgoing_t *re_list;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -