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);
82 rv = VNET_API_ERROR_UNSPECIFIED;
105 mp->_vl_msg_id = ntohs (VL_API_POLICER_DETAILS);
107 mp->
cir = htonl (config->
rb.
kbps.cir_kbps);
108 mp->
eir = htonl (config->
rb.
kbps.eir_kbps);
109 mp->
cb = clib_host_to_net_u64 (config->
rb.
kbps.cb_bytes);
110 mp->
eb = clib_host_to_net_u64 (config->
rb.
kbps.eb_bytes);
175 name = (u8 *) hp->key;
176 pool_index = hp->value[0];
177 config = pool_elt_at_index (pm->configs, pool_index);
178 templ = pool_elt_at_index (pm->policer_templates, pool_index);
179 send_policer_details(name, config, templ, reg, mp->context);
192 #define vl_msg_name_crc_list 194 #undef vl_msg_name_crc_list 199 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id); 200 foreach_vl_msg_name_crc_policer;
210 vl_msg_api_set_handlers(VL_API_##N, #n, \ 211 vl_api_##n##_t_handler, \ 213 vl_api_##n##_t_endian, \ 214 vl_api_##n##_t_print, \ 215 sizeof(vl_api_##n##_t), 1);
Policer operational state response.
union sse2_qos_pol_cfg_params_st_::@312 rb
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
#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)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
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)
#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.
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
struct sse2_qos_pol_cfg_params_st_::@312::@313 kbps
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)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
#define hash_get_mem(h, key)
policer_read_response_type_st * policer_templates