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) 69 cfg.
rb.
kbps.cb_bytes = clib_net_to_host_u64 (mp->
cb);
70 cfg.
rb.
kbps.eb_bytes = clib_net_to_host_u64 (mp->
eb);
86 rv = VNET_API_ERROR_UNSPECIFIED;
109 mp->_vl_msg_id =
ntohs (VL_API_POLICER_DETAILS);
111 mp->
cir = htonl (config->
rb.
kbps.cir_kbps);
112 mp->
eir = htonl (config->
rb.
kbps.eir_kbps);
113 mp->
cb = clib_host_to_net_u64 (config->
rb.
kbps.cb_bytes);
114 mp->
eb = clib_host_to_net_u64 (config->
rb.
kbps.eb_bytes);
182 name = (u8 *) hp->key;
183 pool_index = hp->value[0];
184 config = pool_elt_at_index (pm->configs, pool_index);
185 templ = pool_elt_at_index (pm->policer_templates, pool_index);
186 send_policer_details(name, config, templ, reg, mp->context);
199 #define vl_msg_name_crc_list 201 #undef vl_msg_name_crc_list 206 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 207 foreach_vl_msg_name_crc_policer;
217 vl_msg_api_set_handlers(VL_API_##N, #n, \ 218 vl_api_##n##_t_handler, \ 220 vl_api_##n##_t_endian, \ 221 vl_api_##n##_t_print, \ 222 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
uword * policer_config_by_name
vl_api_sse2_qos_policer_type_t type
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
vl_api_sse2_qos_rate_type_t rate_type
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
struct sse2_qos_pol_cfg_params_st_::@498::@499 kbps
u32 pir_tokens_per_period
u32 pir_tokens_per_period
#define foreach_vpe_api_msg
void * vl_msg_api_alloc(int nbytes)
Add/del policer response.
u32 cir_tokens_per_period
vnet_policer_main_t vnet_policer_main
static void setup_message_id_table(api_main_t *am)
vl_api_sse2_qos_action_t exceed_action
description fragment has unexpected format
vl_api_sse2_qos_policer_type_t type
#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)
API main structure, used by both vpp and binary API clients.
sse2_qos_pol_action_params_st exceed_action
An API client registration, only in vpp/vlib.
union sse2_qos_pol_cfg_params_st_::@498 rb
vl_api_sse2_qos_action_t violate_action
vl_api_sse2_qos_action_t conform_action
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
static void vl_api_policer_dump_t_handler(vl_api_policer_dump_t *mp)
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)
static void send_policer_details(u8 *name, sse2_qos_pol_cfg_params_st *config, policer_read_response_type_st *templ, vl_api_registration_t *reg, u32 context)
VLIB_API_INIT_FUNCTION(policer_api_hookup)
static vlib_main_t * vlib_get_main(void)
vl_api_sse2_qos_round_type_t round_type
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
vl_api_sse2_qos_rate_type_t rate_type
#define hash_get_mem(h, key)
static api_main_t * vlibapi_get_main(void)
policer_read_response_type_st * policer_templates
vl_api_sse2_qos_action_t exceed_action
vl_api_sse2_qos_action_t violate_action
vl_api_sse2_qos_action_t conform_action
vl_api_sse2_qos_round_type_t round_type