nta: new tag NTATAG_TLS_RPORT()

darcs-hash:20081112173028-d4cb1-e0c083362bfb2e78dcdab34599d91d463b5ecc4f.gz
parent 8492c2de
......@@ -361,6 +361,7 @@ su_log_t nta_log[] = { SU_LOG_INIT("nta", "NTA_DEBUG", SU_DEBUG) };
* NTATAG_SIP_T1X64(), NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4(),
* NTATAG_STATELESS(),
* NTATAG_TAG_3261(), NTATAG_TCP_RPORT(), NTATAG_TIMEOUT_408(),
* NTATAG_TLS_RPORT(),
* NTATAG_TIMER_C(), NTATAG_MAX_PROCEEDING(),
* NTATAG_UA(), NTATAG_UDP_MTU(), NTATAG_USER_VIA(),
* NTATAG_USE_NAPTR(), NTATAG_USE_SRV() and NTATAG_USE_TIMESTAMP().
......@@ -935,6 +936,7 @@ void agent_kill_terminator(nta_agent_t *agent)
* NTATAG_SIP_T1X64(), NTATAG_SIP_T1(), NTATAG_SIP_T2(), NTATAG_SIP_T4(),
* NTATAG_STATELESS(),
* NTATAG_TAG_3261(), NTATAG_TCP_RPORT(), NTATAG_TIMEOUT_408(),
* NTATAG_TLS_RPORT(),
* NTATAG_TIMER_C(), NTATAG_MAX_PROCEEDING(),
* NTATAG_UA(), NTATAG_UDP_MTU(), NTATAG_USER_VIA(),
* NTATAG_USE_NAPTR(), NTATAG_USE_SRV() and NTATAG_USE_TIMESTAMP().
......@@ -999,6 +1001,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
int rport = agent->sa_rport;
int server_rport = agent->sa_server_rport;
int tcp_rport = agent->sa_tcp_rport;
int tls_rport = agent->sa_tls_rport;
unsigned preload = agent->sa_preload;
unsigned threadpool = agent->sa_tport_threadpool;
char const *sigcomp = agent->sa_sigcomp_options;
......@@ -1045,6 +1048,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
#endif
NTATAG_STATELESS_REF(stateless),
NTATAG_TCP_RPORT_REF(tcp_rport),
NTATAG_TLS_RPORT_REF(tls_rport),
NTATAG_TIMEOUT_408_REF(timeout_408),
NTATAG_UA_REF(ua),
NTATAG_UDP_MTU_REF(udp_mtu),
......@@ -1214,6 +1218,7 @@ int agent_set_params(nta_agent_t *agent, tagi_t *tags)
agent->sa_flags = flags & MSG_FLG_USERMASK;
agent->sa_rport = rport != 0;
agent->sa_tcp_rport = tcp_rport != 0;
agent->sa_tls_rport = tls_rport != 0;
agent->sa_preload = preload;
agent->sa_tport_threadpool = threadpool;
......@@ -2064,7 +2069,8 @@ int outgoing_insert_via(nta_outgoing_t *orq,
if (!v->v_rport &&
((self->sa_rport && v->v_protocol == sip_transport_udp) ||
(self->sa_tcp_rport && v->v_protocol == sip_transport_tcp)))
(self->sa_tcp_rport && v->v_protocol == sip_transport_tcp) ||
(self->sa_tls_rport && v->v_protocol == sip_transport_tls)))
msg_header_add_param(msg_home(msg), v->v_common, "rport");
if (!orq->orq_tpn->tpn_comp)
......
......@@ -229,6 +229,8 @@ struct nta_agent_s
unsigned sa_server_rport:2;
/** If true, use rport with tcp, too */
unsigned sa_tcp_rport:1;
/** If true, use rport with tls, too */
unsigned sa_tls_rport:1;
/** If true, automatically create compartments */
unsigned sa_auto_comp:1;
......
......@@ -1298,7 +1298,7 @@ tag_typedef_t ntatag_sipflags = UINTTAG_TYPEDEF(sipflags);
*
* @note The NTATAG_RPORT() is a synonym for this.
*
* @sa @RFC3581, NTATAG_SERVER_RPORT(), NTATAG_TCP_RPORT(), @Via
* @sa @RFC3581, NTATAG_SERVER_RPORT(), NTATAG_TCP_RPORT(), NTATAG_TLS_RPORT(), @Via
*/
tag_typedef_t ntatag_client_rport = BOOLTAG_TYPEDEF(client_rport);
......@@ -1333,7 +1333,7 @@ tag_typedef_t ntatag_client_rport = BOOLTAG_TYPEDEF(client_rport);
* - 1 - use "rport" parameter (default)
* - 0 - do not use "rport" parameter
*
* @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), @Via
* @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_TCP_RPORT(), NTATAG_TLS_RPORT(), @Via
*/
tag_typedef_t ntatag_server_rport = INTTAG_TYPEDEF(server_rport);
......@@ -1358,6 +1358,27 @@ tag_typedef_t ntatag_server_rport = INTTAG_TYPEDEF(server_rport);
*/
tag_typedef_t ntatag_tcp_rport = BOOLTAG_TYPEDEF(tcp_rport);
/**@def NTATAG_TLS_RPORT(x)
*
* Use rport with TLS, too.
*
* @par Used with
* nua_create(), nua_set_params(),
* nta_agent_create(), nta_agent_set_params()
*
* @par Parameter type
* boolean: true (non-zero or non-NULL pointer)
* or false (zero or NULL pointer)
*
* @par Values
* - true - include rport parameter in the TLS via line on client side
* - false - do not include rport parameter in the TLS via line
* on client side
*
* @sa @RFC3581, NTATAG_CLIENT_RPORT(), NTATAG_SERVER_RPORT(), @Via
*/
tag_typedef_t ntatag_tls_rport = BOOLTAG_TYPEDEF(tls_rport);
/**@def NTATAG_PRELOAD(x)
*
* Preload by N bytes.
......
......@@ -369,6 +369,12 @@ NTA_DLL extern tag_typedef_t ntatag_tcp_rport;
NTA_DLL extern tag_typedef_t ntatag_tcp_rport_ref;
#define NTATAG_TCP_RPORT_REF(x) ntatag_tcp_rport_ref, tag_bool_vr(&(x))
NTA_DLL extern tag_typedef_t ntatag_tls_rport;
#define NTATAG_TLS_RPORT(x) ntatag_tls_rport, tag_bool_v((x))
NTA_DLL extern tag_typedef_t ntatag_tls_rport_ref;
#define NTATAG_TLS_RPORT_REF(x) ntatag_tls_rport_ref, tag_bool_vr(&(x))
NTA_DLL extern tag_typedef_t ntatag_preload;
#define NTATAG_PRELOAD(x) ntatag_preload, tag_uint_v((x))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment