📄 nta_internal.h
字号:
nta_outgoing_t **re_t1; int re_length; outgoing_queue_t delayed[1]; outgoing_queue_t resolving[1]; outgoing_queue_t trying[1]; /* Timer F/E */ outgoing_queue_t completed[1]; /* Timer K */ outgoing_queue_t terminated[1]; /* Special queues (states) for outgoing INVITE transactions */ outgoing_queue_t inv_calling[1]; /* Timer B/A */ outgoing_queue_t inv_proceeding[1]; outgoing_queue_t inv_completed[1]; /* Timer D */ /* Temporary queue for transactions waiting to be freed */ outgoing_queue_t *free; } sa_out; /* Queues (states) for incoming server transactions */ struct { /** Queue for retrying server transactions */ nta_incoming_t *re_list; nta_incoming_t **re_t1; /**< Special place for T1 timer */ int re_length; incoming_queue_t proceeding[1]; /**< Request received */ incoming_queue_t preliminary[1]; /**< 100rel sent */ incoming_queue_t completed[1]; /**< Final answer sent (non-invite). */ incoming_queue_t inv_completed[1]; /**< Final answer sent (INVITE). */ incoming_queue_t inv_confirmed[1]; /**< Final answer sent, ACK recvd. */ incoming_queue_t terminated[1]; /**< Terminated, ready to free. */ incoming_queue_t final_failed[1]; } sa_in; /* Special task for freeing memory */ su_clone_r sa_terminator;};struct nta_leg_s{ su_home_t leg_home[1]; hash_value_t leg_hash; unsigned leg_dialog : 1; unsigned leg_stateless : 1; /**< Process requests statelessly */#ifdef NTA_STRICT_ROUTING unsigned leg_contact_set : 1;#else unsigned leg_loose_route : 1; /**< Topmost route in set is LR */#endif unsigned leg_local_is_to : 1; /**< Backwards-compatibility. */ unsigned:0; nta_request_f *leg_callback; nta_leg_magic_t *leg_magic; nta_agent_t *leg_agent; /** Leg URL. * * This is the URL used to match incoming requests. */ url_t const *leg_url; char const *leg_method; /**< Method for this dialog. */ uint32_t leg_seq; /**< Sequence number for next transaction */ uint32_t leg_rseq; /**< Remote sequence number */ sip_call_id_t *leg_id; /**< Call ID */ sip_from_t *leg_remote; /**< Remote address (To/From) */ sip_to_t *leg_local; /**< Local address (From/To) */ sip_route_t *leg_route; /**< Route for outgoing requests. */ sip_contact_t *leg_target; /**< Remote destination (from Contact). */};#define leg_has_id(leg) ((leg)->leg_id != NULL)struct nta_incoming_s{ su_home_t *irq_home; hash_value_t irq_hash; nta_agent_t *irq_agent; nta_ack_cancel_f *irq_callback; nta_incoming_magic_t *irq_magic; /* Timeout/state queue */ nta_incoming_t **irq_prev; nta_incoming_t *irq_next; incoming_queue_t *irq_queue; /* Retry queue */ nta_incoming_t **irq_rprev; nta_incoming_t *irq_rnext; sip_method_t irq_method; sip_request_t *irq_rq; sip_from_t *irq_from; sip_to_t *irq_to; char const *irq_tag; sip_cseq_t *irq_cseq; sip_call_id_t *irq_call_id; sip_via_t *irq_via; sip_record_route_t *irq_record_route; char const *irq_branch; uint32_t irq_rseq; sip_timestamp_t *irq_timestamp; su_time_t irq_received; su_duration_t irq_timeout; /**< Timer H, I, J */ su_duration_t irq_retry; /**< Timer G */ unsigned short irq_interval; /**< Next timer */ short irq_status; unsigned irq_retries : 8; unsigned irq_default : 1; /**< Default transaction */ unsigned irq_canceled : 1; /**< Transaction is canceled */ unsigned irq_completed : 1; /**< Transaction is completed */ unsigned irq_confirmed : 1; /**< Response has been acked */ unsigned irq_terminated :1; /**< Transaction is terminated */ unsigned irq_final_failed:1; /**< Sending final response failed */ unsigned irq_destroyed :1; /**< Transaction is destroyed */ unsigned irq_in_callback:1; /**< Callback is being invoked */ unsigned irq_reliable_tp:1; /**< Transport is reliable */ unsigned irq_sigcomp_zap:1; /**< Reset SigComp */ unsigned irq_must_100rel:1; /**< 100rel is required */ unsigned irq_tag_set:1; /**< Tag is not from request */ unsigned :0; tp_name_t irq_tpn[1]; tport_t *irq_tport; struct sigcomp_compartment *irq_cc; msg_t *irq_request; msg_t *irq_request2; /**< ACK/CANCEL */ msg_t *irq_response; nta_reliable_t *irq_reliable; /**< List of reliable responses */};struct nta_reliable_s{ nta_reliable_t *rel_next; nta_incoming_t *rel_irq; nta_prack_f *rel_callback; nta_reliable_magic_t *rel_magic; uint32_t rel_rseq; unsigned short rel_status; unsigned rel_pracked : 1; unsigned rel_precious : 1; msg_ref_t *rel_response; msg_t *rel_unsent;};typedef struct sipdns_resolver sipdns_resolver_t;struct nta_outgoing_s{ hash_value_t orq_hash; /**< Hash value */ nta_agent_t *orq_agent; nta_response_f *orq_callback; nta_outgoing_magic_t *orq_magic; /* Timeout/state queue */ nta_outgoing_t **orq_prev; nta_outgoing_t *orq_next; outgoing_queue_t *orq_queue; /* Retry queue */ nta_outgoing_t **orq_rprev; nta_outgoing_t *orq_rnext; sip_method_t orq_method; char const *orq_method_name; sip_from_t const *orq_from; sip_to_t const *orq_to; sip_cseq_t const *orq_cseq; sip_call_id_t const *orq_call_id; char const *orq_tag; /**< Tag from final response. */ su_time_t orq_sent; /**< When request was sent? */ unsigned orq_delay; /**< RTT estimate */ su_duration_t orq_retry; /**< Timer A, E */ su_duration_t orq_timeout; /**< Timer B, D, F, K */ unsigned short orq_interval; /**< Next timer A/E */ unsigned short orq_status; unsigned char orq_retries; /**< Number of tries this far */ unsigned orq_default : 1; /**< This is default transaction */ unsigned orq_inserted : 1; unsigned orq_resolved : 1; unsigned orq_prepared : 1; /**< outgoing_prepare() called */ unsigned orq_canceled : 1; unsigned orq_terminated : 1; unsigned orq_destroyed : 1; unsigned orq_completed : 1; unsigned orq_delayed : 1; unsigned orq_stripped_uri : 1; unsigned orq_try_tcp_instead : 1; unsigned orq_try_udp_instead : 1; unsigned orq_reliable : 1; /**< Transport is reliable */ unsigned orq_ack_error : 1; /**< ACK is sent by NTA */ /* Attributes */ unsigned orq_user_via : 1; unsigned orq_stateless : 1; unsigned orq_pass_100 : 1; unsigned orq_sigcomp_new:1; /**< Create compartment if needed */ unsigned orq_sigcomp_zap:1; /**< Reset SigComp after completing */ unsigned orq_must_100rel : 1; unsigned orq_timestamp : 1; /**< insert Timestamp header. */ unsigned : 0; /* pad */ uint32_t orq_rseq; /**< Latest incoming rseq */#if HAVE_SOFIA_SRESOLV sipdns_resolver_t *orq_resolver;#endif enum nta_res_order_e orq_res_order; /**< AAAA/A first? */ url_t *orq_route; /**< Route URL */ tp_name_t orq_tpn[1]; /**< Where to send request */ char const *orq_scheme; /**< Transport URL type */ tport_t *orq_tport; struct sigcomp_compartment *orq_cc; tagi_t *orq_tags; /**< Tport tag items */ int orq_pending; /**< Request is pending in tport */ char const *orq_branch; /**< Transaction branch */ char const *orq_via_branch; /**< Via branch */ url_t const *orq_url; /**< Original RequestURI */ msg_t *orq_request; msg_t *orq_response; nta_outgoing_t *orq_cancel; /**< CANCEL transaction */};/* Virtual function table for plugging in SigComp */typedef struct{ int ncv_size; char const *ncv_name; nta_compressor_t *(*ncv_init_agent)(nta_agent_t *sa, char const * const *options); void (*ncv_deinit_agent)(nta_agent_t *sa, nta_compressor_t *); struct sigcomp_compartment *(*ncv_compartment)(nta_agent_t *sa, tport_t *tport, nta_compressor_t *msc, tp_name_t const *tpn, char const * const *options, int new_if_needed); int (*ncv_accept_compressed)(nta_agent_t *sa, nta_compressor_t *msc, tport_compressor_t *sc, msg_t *msg, struct sigcomp_compartment *cc); int (*ncv_close_compressor)(nta_agent_t *sa, struct sigcomp_compartment *cc); int (*ncv_zap_compressor)(nta_agent_t *sa, struct sigcomp_compartment *cc); struct sigcomp_compartment *(*ncv_compartment_ref) (struct sigcomp_compartment *); void (*ncv_compartment_unref)(struct sigcomp_compartment *); } nta_compressor_vtable_t;extern nta_compressor_vtable_t *nta_compressor_vtable;SOFIAPUBFUN nta_compressor_t *nta_agent_init_sigcomp(nta_agent_t *sa);SOFIAPUBFUN void nta_agent_deinit_sigcomp(nta_agent_t *sa);/* ====================================================================== *//* Debug log settings */#define SU_LOG nta_log#ifdef SU_DEBUG_H#error <su_debug.h> included directly.#endif#include <sofia-sip/su_debug.h>SOFIAPUBVAR su_log_t nta_log[];SOFIA_END_DECLS#endif /* NTA_INTERNAL_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -