- Timestamp:
- Oct 25, 2009 10:50:17 AM (15 years ago)
- Location:
- pjproject/trunk/pjlib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/sock_qos.h
r2966 r2967 32 32 33 33 /** 34 * @defgroup socket_qos Socket Quality of Service (QoS) API 34 * @defgroup socket_qos Socket Quality of Service (QoS) API: TOS, DSCP, WMM, IEEE 802.1p 35 35 * @ingroup PJ_SOCK 36 36 * @{ … … 64 64 At the Internet layer, you can use Differentiated Services/Diffserv and 65 65 set the value of the Differentiated Services Code Point (DSCP) in the 66 IP header. As defined in RFC 247 2, the DSCP value is the high-order 6 bits66 IP header. As defined in RFC 2474, the DSCP value is the high-order 6 bits 67 67 of the IP version 4 (IPv4) TOS field and the IP version 6 (IPv6) Traffic 68 68 Class field. … … 180 180 { 181 181 PJ_QOS_PARAM_HAS_DSCP = 1, 182 PJ_QOS_PARAM_HAS_ 802_1_P= 2,182 PJ_QOS_PARAM_HAS_SO_PRIO = 2, 183 183 PJ_QOS_PARAM_HAS_WMM = 4 184 184 } pj_qos_flag; … … 196 196 pj_uint8_t flags; // Determines which values to 197 197 // set, bitmask of pj_qos_flag 198 pj_uint8_t dscp_val; // DSCP value to set198 pj_uint8_t dscp_val; // The 6 bits DSCP value to set 199 199 pj_uint8_t so_prio; // SO_PRIORITY value 200 200 pj_qos_wmm_prio wmm_prio; // WMM priority value … … 249 249 { 250 250 PJ_QOS_PARAM_HAS_DSCP = 1, /**< DSCP field is set. */ 251 PJ_QOS_PARAM_HAS_ 802_1_P = 2, /**< IEEE 802.1p field is set*/251 PJ_QOS_PARAM_HAS_SO_PRIO = 2, /**< Socket SO_PRIORITY */ 252 252 PJ_QOS_PARAM_HAS_WMM = 4 /**< WMM field is set. */ 253 253 } pj_qos_flag; … … 273 273 pj_uint8_t flags; /**< Determines which values to 274 274 set, bitmask of pj_qos_flag */ 275 pj_uint8_t dscp_val; /**< DSCP value to set*/275 pj_uint8_t dscp_val; /**< The 6 bits DSCP value to set */ 276 276 pj_uint8_t so_prio; /**< SO_PRIORITY value */ 277 277 pj_qos_wmm_prio wmm_prio; /**< WMM priority value */ -
pjproject/trunk/pjlib/src/pj/sock_qos_bsd.c
r2966 r2967 42 42 /* Set TOS/DSCP */ 43 43 if (param->flags & PJ_QOS_PARAM_HAS_DSCP) { 44 int val = param->dscp_val; 44 /* Value is dscp_val << 2 */ 45 int val = (param->dscp_val << 2); 45 46 status = pj_sock_setsockopt(sock, pj_SOL_IP(), pj_IP_TOS(), 46 47 &val, sizeof(val)); … … 52 53 53 54 /* Set SO_PRIORITY */ 54 if (param->flags & PJ_QOS_PARAM_HAS_ 802_1_P) {55 if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) { 55 56 int val = param->so_prio; 56 57 status = pj_sock_setsockopt(sock, pj_SOL_SOCKET(), pj_SO_PRIORITY(), 57 58 &val, sizeof(val)); 58 59 if (status != PJ_SUCCESS) { 59 param->flags &= ~(PJ_QOS_PARAM_HAS_ 802_1_P);60 param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO); 60 61 last_err = status; 61 62 } … … 94 95 if (status == PJ_SUCCESS) { 95 96 p_param->flags |= PJ_QOS_PARAM_HAS_DSCP; 96 p_param->dscp_val = (pj_uint8_t) val;97 p_param->dscp_val = (pj_uint8_t)(val >> 2); 97 98 } else { 98 99 last_err = status; … … 104 105 &val, &optlen); 105 106 if (status == PJ_SUCCESS) { 106 p_param->flags |= PJ_QOS_PARAM_HAS_ 802_1_P;107 p_param->flags |= PJ_QOS_PARAM_HAS_SO_PRIO; 107 108 p_param->so_prio = (pj_uint8_t)val; 108 109 } else { … … 129 130 130 131 #endif /* PJ_QOS_IMPLEMENTATION */ 132 -
pjproject/trunk/pjlib/src/pj/sock_qos_common.c
r2966 r2967 24 24 25 25 #define THIS_FILE "sock_qos_common.c" 26 #define ALL_FLAGS (PJ_QOS_PARAM_HAS_DSCP | PJ_QOS_PARAM_HAS_ 802_1_P| \26 #define ALL_FLAGS (PJ_QOS_PARAM_HAS_DSCP | PJ_QOS_PARAM_HAS_SO_PRIO | \ 27 27 PJ_QOS_PARAM_HAS_WMM) 28 28 … … 67 67 } 68 68 69 if (param->flags & PJ_QOS_PARAM_HAS_ 802_1_P) {69 if (param->flags & PJ_QOS_PARAM_HAS_SO_PRIO) { 70 70 for (i=0; i<=PJ_QOS_TYPE_CONTROL; ++i) { 71 71 if (param->so_prio >= qos_map[i].so_prio) -
pjproject/trunk/pjlib/src/pj/sock_qos_symbian.cpp
r2966 r2967 28 28 29 29 /* SO_PRIORITY and WMM are not supported */ 30 param->flags &= ~(PJ_QOS_PARAM_HAS_ 802_1_P| PJ_QOS_PARAM_HAS_WMM);30 param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO | PJ_QOS_PARAM_HAS_WMM); 31 31 32 32 if (param->flags & PJ_QOS_PARAM_HAS_DSCP) {
Note: See TracChangeset
for help on using the changeset viewer.