Changeset 2998
- Timestamp:
- Nov 9, 2009 8:51:34 AM (15 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/ssl_sock.h
r2970 r2998 27 27 #include <pj/ioqueue.h> 28 28 #include <pj/sock.h> 29 #include <pj/sock_qos.h> 29 30 30 31 … … 532 533 */ 533 534 pj_str_t server_name; 534 535 536 /** 537 * QoS traffic type to be set on this transport. When application wants 538 * to apply QoS tagging to the transport, it's preferable to set this 539 * field rather than \a qos_param fields since this is more portable. 540 * 541 * Default value is PJ_QOS_TYPE_BEST_EFFORT. 542 */ 543 pj_qos_type qos_type; 544 545 /** 546 * Set the low level QoS parameters to the transport. This is a lower 547 * level operation than setting the \a qos_type field and may not be 548 * supported on all platforms. 549 * 550 * By default all settings in this structure are disabled. 551 */ 552 pj_qos_params qos_params; 553 554 /** 555 * Specify if the transport should ignore any errors when setting the QoS 556 * traffic type/parameters. 557 * 558 * Default: PJ_TRUE 559 */ 560 pj_bool_t qos_ignore_error; 561 562 535 563 } pj_ssl_sock_param; 536 564 -
pjproject/trunk/pjlib/src/pj/sock_qos_symbian.cpp
r2967 r2998 23 23 pj_qos_params *param) 24 24 { 25 PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL); 26 25 27 CPjSocket *pjsock = (CPjSocket*)sock; 26 28 RSocket & rsock = pjsock->Socket(); … … 61 63 pj_qos_params *p_param) 62 64 { 65 PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL); 66 63 67 CPjSocket *pjsock = (CPjSocket*)sock; 64 68 RSocket & rsock = pjsock->Socket(); -
pjproject/trunk/pjlib/src/pj/ssl_sock_common.c
r2950 r2998 121 121 param->read_buffer_size = 1500; 122 122 #endif 123 param->qos_type = PJ_QOS_TYPE_BEST_EFFORT; 124 param->qos_ignore_error = PJ_TRUE; 123 125 124 126 /* Security config */ -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r2994 r2998 1207 1207 goto on_return; 1208 1208 } 1209 1210 /* Apply QoS, if specified */ 1211 status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, 1212 &ssock->param.qos_params, 1, 1213 ssock->pool->obj_name, NULL); 1214 if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) 1215 goto on_return; 1209 1216 1210 1217 /* Update local address */ … … 1954 1961 goto on_error; 1955 1962 1963 /* Apply QoS, if specified */ 1964 status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, 1965 &ssock->param.qos_params, 2, 1966 ssock->pool->obj_name, NULL); 1967 if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) 1968 goto on_error; 1969 1956 1970 /* Bind socket */ 1957 1971 status = pj_sock_bind(ssock->sock, localaddr, addr_len); … … 2029 2043 goto on_error; 2030 2044 2045 /* Apply QoS, if specified */ 2046 status = pj_sock_apply_qos2(ssock->sock, ssock->param.qos_type, 2047 &ssock->param.qos_params, 2, 2048 ssock->pool->obj_name, NULL); 2049 if (status != PJ_SUCCESS && !ssock->param.qos_ignore_error) 2050 goto on_error; 2051 2031 2052 /* Bind socket */ 2032 2053 status = pj_sock_bind(ssock->sock, localaddr, addr_len); -
pjproject/trunk/pjlib/src/pj/ssl_sock_symbian.cpp
r2990 r2998 98 98 }; 99 99 100 static CPjSSLSocket *NewL(const TDesC8 &ssl_proto) { 101 CPjSSLSocket *self = new (ELeave) CPjSSLSocket(); 100 static CPjSSLSocket *NewL(const TDesC8 &ssl_proto, 101 pj_qos_type qos_type, 102 const pj_qos_params &qos_params) 103 { 104 CPjSSLSocket *self = new (ELeave) CPjSSLSocket(qos_type, qos_params); 102 105 CleanupStack::PushL(self); 103 106 self->ConstructL(ssl_proto); … … 131 134 CSecureSocket *securesock_; 132 135 bool is_connected_; 136 137 pj_qos_type qos_type_; 138 pj_qos_params qos_params_; 139 133 140 CPjSSLSocketReader *reader_; 134 141 TBuf<32> ssl_proto_; … … 144 151 void RunL(); 145 152 146 CPjSSLSocket( ) :153 CPjSSLSocket(pj_qos_type qos_type, const pj_qos_params &qos_params) : 147 154 CActive(0), state_(SSL_STATE_NULL), sock_(PJ_INVALID_SOCKET), 148 securesock_(NULL), 149 is_connected_(false), reader_(NULL),150 cb_(NULL), key_(NULL)155 securesock_(NULL), is_connected_(false), 156 qos_type_(qos_type), qos_params_(qos_params), 157 reader_(NULL), cb_(NULL), key_(NULL) 151 158 {} 152 159 … … 165 172 } 166 173 if (sock_ != PJ_INVALID_SOCKET) { 167 delete (CPjSocket*)sock_;174 pj_sock_close(sock_); 168 175 sock_ = PJ_INVALID_SOCKET; 169 176 } … … 184 191 return status; 185 192 193 // Apply QoS 194 status = pj_sock_apply_qos2(sock_, qos_type_, &qos_params_, 195 2, THIS_FILE, NULL); 196 186 197 RSocket &rSock = ((CPjSocket*)sock_)->Socket(); 187 198 … … 412 423 pj_sockaddr local_addr; 413 424 pj_sockaddr rem_addr; 425 426 /* QoS settings */ 427 pj_qos_type qos_type; 428 pj_qos_params qos_params; 429 pj_bool_t qos_ignore_error; 430 414 431 415 432 pj_ssl_sock_proto proto; … … 502 519 } 503 520 pj_strdup_with_null(pool, &ssock->servername, ¶m->server_name); 521 522 ssock->qos_type = param->qos_type; 523 ssock->qos_ignore_error = param->qos_ignore_error; 524 pj_memcpy(&ssock->qos_params, ¶m->qos_params, 525 sizeof(param->qos_params)); 504 526 505 527 /* Finally */ … … 1062 1084 1063 1085 /* Init SSL engine */ 1064 TRAPD(err, sock = CPjSSLSocket::NewL(proto)); 1086 TRAPD(err, sock = CPjSSLSocket::NewL(proto, ssock->qos_type, 1087 ssock->qos_params)); 1065 1088 if (err != KErrNone) 1066 1089 return PJ_ENOMEM; -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2968 r2998 4601 4601 pjsua_acc_id acc_id; 4602 4602 4603 /* Copy the QoS settings */ 4604 tcp_cfg.tls_setting.qos_type = tcp_cfg.qos_type; 4605 pj_memcpy(&tcp_cfg.tls_setting.qos_params, &tcp_cfg.qos_params, 4606 sizeof(tcp_cfg.qos_params)); 4607 4603 4608 /* Set TLS port as TCP port+1 */ 4604 4609 tcp_cfg.port++; -
pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp
r2913 r2998 93 93 94 94 // 95 // Set QoS on transports? Yes! 96 // As an example, we set SIP transports DSCP value to CS3 (DSCP 97 // value 24 or 0x18), for no reason, and tag RTP/RTCP packets 98 // with VOICE type. 99 // 100 #define SIP_QOS_DSCP 0x18 101 #define RTP_QOS_TYPE PJ_QOS_TYPE_VOICE 102 103 104 // 95 105 // Globals 96 106 // … … 385 395 pjsua_transport_config_default(&tcfg); 386 396 tcfg.port = SIP_PORT; 397 if (SIP_QOS_DSCP) { 398 tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; 399 tcfg.qos_params.dscp_val = SIP_QOS_DSCP; 400 } 387 401 status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, &tcfg, &tid); 388 402 if (status != PJ_SUCCESS) { … … 397 411 pjsua_transport_config_default(&tcfg); 398 412 tcfg.port = SIP_PORT; 413 if (SIP_QOS_DSCP) { 414 tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; 415 tcfg.qos_params.dscp_val = SIP_QOS_DSCP; 416 } 399 417 status = pjsua_transport_create(PJSIP_TRANSPORT_TCP, &tcfg, &tid); 400 418 if (status != PJ_SUCCESS) { … … 409 427 pjsua_transport_config_default(&tcfg); 410 428 tcfg.port = SIP_PORT + 1; 429 if (SIP_QOS_DSCP) { 430 tcfg.qos_params.flags |= PJ_QOS_PARAM_HAS_DSCP; 431 tcfg.qos_params.dscp_val = SIP_QOS_DSCP; 432 tcfg.tls_setting.qos_params = tcfg.qos_params; 433 } 411 434 status = pjsua_transport_create(PJSIP_TRANSPORT_TLS, &tcfg, &tid); 412 435 if (status != PJ_SUCCESS) { … … 420 443 pjsua_acc_add_local(tid, PJ_TRUE, &g_acc_id); 421 444 422 445 /* Create media transports */ 446 pjsua_transport_config mtcfg; 447 pjsua_transport_config_default(&mtcfg); 448 mtcfg.port = 4000; 449 mtcfg.qos_type = RTP_QOS_TYPE; 450 status = pjsua_media_transports_create(&mtcfg); 451 if (status != PJ_SUCCESS) { 452 pjsua_perror(THIS_FILE, "Error creating media transports", status); 453 pjsua_destroy(); 454 return status; 455 } 456 423 457 /* Initialization is done, now start pjsua */ 424 458 status = pjsua_start(); -
pjproject/trunk/pjsip/include/pjsip/sip_transport_tls.h
r2394 r2998 28 28 #include <pjsip/sip_transport.h> 29 29 #include <pj/string.h> 30 #include <pj/sock_qos.h> 30 31 31 32 … … 161 162 pj_time_val timeout; 162 163 164 /** 165 * QoS traffic type to be set on this transport. When application wants 166 * to apply QoS tagging to the transport, it's preferable to set this 167 * field rather than \a qos_param fields since this is more portable. 168 * 169 * Default value is PJ_QOS_TYPE_BEST_EFFORT. 170 */ 171 pj_qos_type qos_type; 172 173 /** 174 * Set the low level QoS parameters to the transport. This is a lower 175 * level operation than setting the \a qos_type field and may not be 176 * supported on all platforms. 177 * 178 * By default all settings in this structure are disabled. 179 */ 180 pj_qos_params qos_params; 181 182 /** 183 * Specify if the transport should ignore any errors when setting the QoS 184 * traffic type/parameters. 185 * 186 * Default: PJ_TRUE 187 */ 188 pj_bool_t qos_ignore_error; 189 163 190 } pjsip_tls_setting; 164 191 … … 172 199 { 173 200 pj_memset(tls_opt, 0, sizeof(*tls_opt)); 201 tls_opt->qos_type = PJ_QOS_TYPE_BEST_EFFORT; 202 tls_opt->qos_ignore_error = PJ_TRUE; 174 203 } 175 204 -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls.c
r2970 r2998 251 251 if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN) 252 252 ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN; 253 ssock_param.qos_type = listener->tls_setting.qos_type; 254 ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error; 255 pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params, 256 sizeof(ssock_param.qos_params)); 253 257 254 258 has_listener = PJ_FALSE; … … 798 802 if (ssock_param.read_buffer_size < PJSIP_MAX_PKT_LEN) 799 803 ssock_param.read_buffer_size = PJSIP_MAX_PKT_LEN; 804 ssock_param.qos_type = listener->tls_setting.qos_type; 805 ssock_param.qos_ignore_error = listener->tls_setting.qos_ignore_error; 806 pj_memcpy(&ssock_param.qos_params, &listener->tls_setting.qos_params, 807 sizeof(ssock_param.qos_params)); 800 808 801 809 switch(listener->tls_setting.method) {
Note: See TracChangeset
for help on using the changeset viewer.