38 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 45 #define foreach_vpe_api_msg \ 46 _(POLICER_ADD_DEL, policer_add_del) \ 47 _(POLICER_DUMP, policer_dump) 62 memset (&cfg, 0,
sizeof (cfg));
81 rv = VNET_API_ERROR_UNSPECIFIED;
103 memset (mp, 0,
sizeof (*mp));
104 mp->_vl_msg_id = ntohs (VL_API_POLICER_DETAILS);
106 mp->
cir = htonl (config->
rb.
kbps.cir_kbps);
107 mp->
eir = htonl (config->
rb.
kbps.eir_kbps);
108 mp->
cb = clib_host_to_net_u64 (config->
rb.
kbps.cb_bytes);
109 mp->
eb = clib_host_to_net_u64 (config->
rb.
kbps.eb_bytes);
173 name = (u8 *) hp->key;
174 pool_index = hp->value[0];
175 config = pool_elt_at_index (pm->configs, pool_index);
176 templ = pool_elt_at_index (pm->policer_templates, pool_index);
177 send_policer_details(name, config, templ, q, mp->context);
190 #define vl_msg_name_crc_list 192 #undef vl_msg_name_crc_list 197 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 198 foreach_vl_msg_name_crc_policer;
208 vl_msg_api_set_handlers(VL_API_##N, #n, \ 209 vl_api_##n##_t_handler, \ 211 vl_api_##n##_t_endian, \ 212 vl_api_##n##_t_print, \ 213 sizeof(vl_api_##n##_t), 1);
Policer operational state response.
sse2_qos_pol_cfg_params_st * configs
static void vl_api_policer_add_del_t_handler(vl_api_policer_add_del_t *mp)
sse2_qos_pol_action_params_st conform_action
void vl_msg_api_send_shmem(unix_shared_memory_queue_t *q, u8 *elem)
union sse2_qos_pol_cfg_params_st_::@198 rb
uword * policer_config_by_name
#define REPLY_MACRO2(t, body)
unix_shared_memory_queue_t * vl_api_client_index_to_input_queue(u32 index)
u32 pir_tokens_per_period
u32 pir_tokens_per_period
#define foreach_vpe_api_msg
struct sse2_qos_pol_cfg_params_st_::@198::@199 kbps
Add/del policer response.
u32 cir_tokens_per_period
static void setup_message_id_table(api_main_t *am)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
sse2_qos_pol_action_params_st violate_action
static clib_error_t * policer_api_hookup(vlib_main_t *vm)
sse2_qos_pol_action_params_st exceed_action
void * vl_msg_api_alloc(int nbytes)
static void vl_api_policer_dump_t_handler(vl_api_policer_dump_t *mp)
static void send_policer_details(u8 *name, sse2_qos_pol_cfg_params_st *config, policer_read_response_type_st *templ, unix_shared_memory_queue_t *q, u32 context)
u32 cir_tokens_per_period
clib_error_t * policer_add_del(vlib_main_t *vm, u8 *name, sse2_qos_pol_cfg_params_st *cfg, u32 *policer_index, u8 is_add)
VLIB_API_INIT_FUNCTION(policer_api_hookup)
static vlib_main_t * vlib_get_main(void)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
#define hash_get_mem(h, key)
policer_read_response_type_st * policer_templates
vnet_policer_main_t vnet_policer_main
struct _unix_shared_memory_queue unix_shared_memory_queue_t