70 | | || PJLIB Traffic Type || IP DSCP || WMM* || 802.1p || |
71 | | || BEST_EFFORT || 0x00 || BE || 0 || |
72 | | || BACKGROUND || 0x08 || BK || 2 || |
73 | | || VIDEO || 0x28 || VI || 5 || |
74 | | || VOICE || 0x30 || VO || 6 || |
75 | | || CONTROL || 0x38 || VO || 7 || |
| 70 | || PJLIB Traffic Type || IP DSCP || WMM || 802.1p || |
| 71 | || BEST_EFFORT || 0x00 || BE (Bulk Effort) || 0 || |
| 72 | || BACKGROUND || 0x08 || BK (Bulk) || 2 || |
| 73 | || VIDEO || 0x28 || VI (Video) || 5 || |
| 74 | || VOICE || 0x30 || VO (Voice) || 6 || |
| 75 | || CONTROL || 0x38 || VO (Voice) || 7 || |
| 90 | |
| 91 | The API above is the recommended use of QoS, since it is the most portable across all platforms. |
| 92 | |
| 93 | The second set of API is intended for application that wants to fine tune the QoS parameters. |
| 94 | |
| 95 | The Layer 2 and 3 QoS parameters are stored in {{{pj_qos_params}}} structure: |
| 96 | |
| 97 | {{{ |
| 98 | typedef enum pj_qos_flag |
| 99 | { |
| 100 | PJ_QOS_PARAM_HAS_DSCP = 1, |
| 101 | PJ_QOS_PARAM_HAS_802_1_P = 2, |
| 102 | PJ_QOS_PARAM_HAS_WMM = 4 |
| 103 | } pj_qos_flag; |
| 104 | |
| 105 | typedef enum pj_qos_wmm_prio |
| 106 | { |
| 107 | PJ_QOS_WMM_TYPE_BULK_EFFORT_PRIO, |
| 108 | PJ_QOS_WMM_TYPE_BULK_PRIO, |
| 109 | PJ_QOS_WMM_TYPE_VIDEO_PRIO, |
| 110 | PJ_QOS_WMM_TYPE_VOICE_PRIO |
| 111 | } pj_qos_wmm_prio; |
| 112 | |
| 113 | typedef struct pj_qos_params |
| 114 | { |
| 115 | pj_uint8_t flags; // Determines which values to |
| 116 | // set, bitmask of pj_qos_flag |
| 117 | pj_uint8_t dscp_val; // DSCP value to set |
| 118 | pj_uint8_t so_prio; // SO_PRIORITY value |
| 119 | pj_qos_wmm_prio wmm_prio; // WMM priority value |
| 120 | } pj_qos_params; |
| 121 | }}} |
| 122 | |
| 123 | The second set of API with more fine-grained control over the parameters are: |
| 124 | |
| 125 | {{{ |
| 126 | // Retrieve QoS params for the specified traffic type |
| 127 | PJ_DECL(pj_status_t) pj_qos_get_params(pj_qos_type type, |
| 128 | pj_qos_params *p); |
| 129 | |
| 130 | // Set QoS parameters to the socket |
| 131 | PJ_DECL(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock, |
| 132 | const pj_qos_params *p); |
| 133 | |
| 134 | // Get QoS parameters from the socket |
| 135 | PJ_DECL(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock, |
| 136 | pj_qos_params *p); |
| 137 | |
| 138 | }}} |
| 139 | |
| 140 | '''Important:''' |
| 141 | |
| 142 | The {{{pj_sock_set_qos_params()}}} API is not portable, and it's probably only going to be implemented on Linux. Application should always try to use {{{pj_sock_set_qos_type()}}} instead. |
| 143 | |
| 144 | |