summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-11-09 08:51:34 +0000
committerBenny Prijono <bennylp@teluu.com>2009-11-09 08:51:34 +0000
commitd74a1707948d51e98826aa4507ff1dd1a6c02601 (patch)
tree6f9d6d852f0ad80e27ca3d2fde00befbf8c28b32 /pjsip
parent23363ea696574b1f6e40c3e8c800cb12e2c5ff57 (diff)
Ticket #950 and #957:
- added QoS options on PJLIB/PJLIB SSL/TLS socket/transport - added demo in Symbian ua.cpp git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2998 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/include/pjsip/sip_transport_tls.h29
-rw-r--r--pjsip/src/pjsip/sip_transport_tls.c8
2 files changed, 37 insertions, 0 deletions
diff --git a/pjsip/include/pjsip/sip_transport_tls.h b/pjsip/include/pjsip/sip_transport_tls.h
index dbf4b344..8c41e167 100644
--- a/pjsip/include/pjsip/sip_transport_tls.h
+++ b/pjsip/include/pjsip/sip_transport_tls.h
@@ -27,6 +27,7 @@
#include <pjsip/sip_transport.h>
#include <pj/string.h>
+#include <pj/sock_qos.h>
PJ_BEGIN_DECL
@@ -160,6 +161,32 @@ typedef struct pjsip_tls_setting
*/
pj_time_val timeout;
+ /**
+ * QoS traffic type to be set on this transport. When application wants
+ * to apply QoS tagging to the transport, it's preferable to set this
+ * field rather than \a qos_param fields since this is more portable.
+ *
+ * Default value is PJ_QOS_TYPE_BEST_EFFORT.
+ */
+ pj_qos_type qos_type;
+
+ /**
+ * Set the low level QoS parameters to the transport. This is a lower
+ * level operation than setting the \a qos_type field and may not be
+ * supported on all platforms.
+ *
+ * By default all settings in this structure are disabled.
+ */
+ pj_qos_params qos_params;
+
+ /**
+ * Specify if the transport should ignore any errors when setting the QoS
+ * traffic type/parameters.
+ *
+ * Default: PJ_TRUE
+ */
+ pj_bool_t qos_ignore_error;
+
} pjsip_tls_setting;
@@ -171,6 +198,8 @@ typedef struct pjsip_tls_setting
PJ_INLINE(void) pjsip_tls_setting_default(pjsip_tls_setting *tls_opt)
{
pj_memset(tls_opt, 0, sizeof(*tls_opt));
+ tls_opt->qos_type = PJ_QOS_TYPE_BEST_EFFORT;
+ tls_opt->qos_ignore_error = PJ_TRUE;
}
diff --git a/pjsip/src/pjsip/sip_transport_tls.c b/pjsip/src/pjsip/sip_transport_tls.c
index 4aec16c2..0748896b 100644
--- a/pjsip/src/pjsip/sip_transport_tls.c
+++ b/pjsip/src/pjsip/sip_transport_tls.c
@@ -250,6 +250,10 @@ PJ_DEF(pj_status_t) pjsip_tls_transport_start (pjsip_endpoint *endpt,
ssock_param.send_buffer_size = PJSIP_MAX_PKT_LEN;
if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN)
ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN;
+ ssock_param.qos_type = listener->tls_setting.qos_type;
+ ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error;
+ pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params,
+ sizeof(ssock_param.qos_params));
has_listener = PJ_FALSE;
@@ -797,6 +801,10 @@ static pj_status_t lis_create_transport(pjsip_tpfactory *factory,
ssock_param.send_buffer_size = PJSIP_MAX_PKT_LEN;
if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN)
ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN;
+ ssock_param.qos_type = listener->tls_setting.qos_type;
+ ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error;
+ pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params,
+ sizeof(ssock_param.qos_params));
switch(listener->tls_setting.method) {
case PJSIP_TLSV1_METHOD: