38 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 46 #define foreach_qos_api_msg \ 47 _(QOS_RECORD_ENABLE_DISABLE, qos_record_enable_disable) \ 48 _(QOS_RECORD_DUMP, qos_record_dump) \ 49 _(QOS_STORE_ENABLE_DISABLE, qos_store_enable_disable) \ 50 _(QOS_STORE_DUMP, qos_store_dump) \ 51 _(QOS_EGRESS_MAP_DELETE, qos_egress_map_delete) \ 52 _(QOS_EGRESS_MAP_UPDATE, qos_egress_map_update) \ 53 _(QOS_EGRESS_MAP_DUMP, qos_egress_map_dump) \ 54 _(QOS_MARK_ENABLE_DISABLE, qos_mark_enable_disable) \ 55 _(QOS_MARK_DUMP, qos_mark_dump) 76 return (VNET_API_ERROR_INVALID_VALUE);
79 static vl_api_qos_source_t
82 return ((vl_api_qos_source_t) q);
89 vl_api_qos_record_enable_disable_reply_t *rmp;
106 REPLY_MACRO (VL_API_QOS_RECORD_ENABLE_DISABLE_REPLY);
124 mp->_vl_msg_id = ntohs (VL_API_QOS_RECORD_DETAILS);
126 mp->
record.sw_if_index = htonl (sw_if_index);
154 vl_api_qos_store_enable_disable_reply_t *rmp;
172 REPLY_MACRO (VL_API_QOS_STORE_ENABLE_DISABLE_REPLY);
191 mp->_vl_msg_id = ntohs (VL_API_QOS_STORE_DETAILS);
193 mp->
store.sw_if_index = htonl (sw_if_index);
221 vl_api_qos_egress_map_update_reply_t *rmp;
228 &mp->
map.rows[qs].outputs[0]);
237 vl_api_qos_egress_map_delete_reply_t *rmp;
262 mp->_vl_msg_id = ntohs (VL_API_QOS_EGRESS_MAP_DETAILS);
264 mp->
map.id = htonl (
id);
266 for (ii = 0; ii < 4; ii++)
294 vl_api_qos_mark_enable_disable_reply_t *rmp;
304 qs, ntohl (mp->
mark.map_id));
309 REPLY_MACRO (VL_API_QOS_MARK_ENABLE_DISABLE_REPLY);
328 mp->_vl_msg_id = ntohs (VL_API_QOS_MARK_DETAILS);
330 mp->
mark.sw_if_index = htonl (sw_if_index);
332 mp->
mark.map_id = htonl (map_id);
355 #define vl_msg_name_crc_list 356 #include <vnet/qos/qos.api.h> 357 #undef vl_msg_name_crc_list 362 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 363 foreach_vl_msg_name_crc_qos;
373 vl_msg_api_set_handlers(VL_API_##N, #n, \ 374 vl_api_##n##_t_handler, \ 376 vl_api_##n##_t_endian, \ 377 vl_api_##n##_t_print, \ 378 sizeof(vl_api_##n##_t), 1);
static int qos_source_decode(vl_api_qos_source_t v, qos_source_t *q)
vl_api_qos_source_t output_source
void qos_record_walk(qos_record_walk_cb_t fn, void *c)
static void vl_api_qos_store_dump_t_handler(vl_api_qos_store_dump_t *mp)
bool enable[default=true]
static clib_error_t * qos_api_hookup(vlib_main_t *vm)
void qos_egress_map_walk(qos_egress_map_walk_cb_t fn, void *c)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
void vl_api_qos_egress_map_update_t_handler(vl_api_qos_egress_map_update_t *mp)
vl_api_qos_record_t record
void vl_api_qos_egress_map_delete_t_handler(vl_api_qos_egress_map_delete_t *mp)
void * vl_msg_api_alloc_zero(int nbytes)
static walk_rc_t send_qos_egress_map_details(qos_egress_map_id_t id, const qos_egress_map_t *m, void *c)
void qos_egress_map_delete(qos_egress_map_id_t mid)
int qos_mark_disable(u32 sw_if_index, qos_source_t output_source)
#define clib_memcpy(d, s, n)
static void setup_message_id_table(api_main_t *am)
Some external source, e.g.
Dump the QoS egress maps.
enum walk_rc_t_ walk_rc_t
Walk return code.
vl_api_registration_t * reg
static void vl_api_qos_egress_map_dump_t_handler(vl_api_qos_egress_map_dump_t *mp)
vl_api_interface_index_t sw_if_index
VLIB_API_INIT_FUNCTION(qos_api_hookup)
vl_api_registration_t * reg
int qos_mark_enable(u32 sw_if_index, qos_source_t output_source, qos_egress_map_id_t mid)
enable QoS marking by associating a MAP with an interface.
#define FOR_EACH_QOS_SOURCE(_src)
void qos_store_walk(qos_store_walk_cb_t fn, void *c)
vl_api_qos_source_t input_source
#define foreach_qos_api_msg
void qos_egress_map_update(qos_egress_map_id_t mid, qos_source_t input_source, qos_bits_t *values)
Add a qos-egress map to an interface.
static vl_api_qos_source_t qos_source_encode(qos_source_t q)
bool enable[default=true]
static walk_rc_t send_qos_mark_details(u32 sw_if_index, u32 map_id, qos_source_t output_source, void *c)
static void vl_api_qos_record_dump_t_handler(vl_api_qos_record_dump_t *mp)
vl_api_registration_t * reg
struct qos_record_send_walk_ctx_t_ qos_record_send_walk_ctx_t
Enable/Disable QoS recording The QoS bits from the packet at the specified input layer are copied int...
vl_api_registration_t * reg
API main structure, used by both vpp and binary API clients.
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
enum qos_source_t_ qos_source_t
QoS types.
Dump QoS marking configs.
static walk_rc_t send_qos_record_details(u32 sw_if_index, qos_source_t input_source, void *c)
struct qos_egress_map_send_walk_ctx_t_ qos_egress_map_send_walk_ctx_t
vl_api_qos_egress_map_t map
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
struct qos_store_send_walk_ctx_t_ qos_store_send_walk_ctx_t
For a given output source a table maps each value of every input source.
Enable/Disable QoS storing The QoS bits from the packet at the specified input layer are copied into ...
Dump the QoS record configs.
Details of QoS recording configs.
struct qos_mark_send_walk_ctx_t_ qos_mark_send_walk_ctx_t
vl_api_qos_record_t record
int qos_record_disable(u32 sw_if_index, qos_source_t input_source)
vl_api_qos_egress_map_t map
int qos_store_disable(u32 sw_if_index, qos_source_t input_source)
Enable/Disable QoS marking.
void vl_api_qos_mark_enable_disable_t_handler(vl_api_qos_mark_enable_disable_t *mp)
static walk_rc_t send_qos_store_details(u32 sw_if_index, qos_source_t input_source, qos_bits_t value, void *c)
Update a QoS Map A QoS map, translates from the QoS value in the packet set by the 'record' feature...
static api_main_t * vlibapi_get_main(void)
static void vl_api_qos_mark_dump_t_handler(vl_api_qos_mark_dump_t *mp)
void qos_mark_walk(qos_mark_walk_cb_t fn, void *c)
int qos_record_enable(u32 sw_if_index, qos_source_t input_source)
void vl_api_qos_store_enable_disable_t_handler(vl_api_qos_store_enable_disable_t *mp)
int qos_store_enable(u32 sw_if_index, qos_source_t input_source, qos_bits_t value)
Dump the QoS store configs.
qos_bits_t qem_output[QOS_N_SOURCES][256]
The array of output mapped values; output = eq_qos[input-source][input-value].
u8 qos_bits_t
Type, er, safety for us water based entities.
bool enable[default=true]
u32 qos_egress_map_id_t
A QOS egress map translates from the COS bits stored in the packet's meta-data into a per-protocol CO...
#define VALIDATE_SW_IF_INDEX(mp)
void vl_api_qos_record_enable_disable_t_handler(vl_api_qos_record_enable_disable_t *mp)
Details of QoS recording configs.