|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
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_BIND, policer_bind) \
48 _ (POLICER_INPUT, policer_input) \
49 _ (POLICER_DUMP, policer_dump)
71 cfg.
rb.
kbps.cb_bytes = clib_net_to_host_u64 (mp->
cb);
72 cfg.
rb.
kbps.eb_bytes = clib_net_to_host_u64 (mp->
eb);
87 rv = VNET_API_ERROR_UNSPECIFIED;
103 vl_api_policer_bind_reply_t *rmp;
123 vl_api_policer_bind_reply_t *rmp;
153 mp->_vl_msg_id =
ntohs (VL_API_POLICER_DETAILS);
155 mp->
cir = htonl (config->
rb.
kbps.cir_kbps);
156 mp->
eir = htonl (config->
rb.
kbps.eir_kbps);
157 mp->
cb = clib_host_to_net_u64 (config->
rb.
kbps.cb_bytes);
158 mp->
eb = clib_host_to_net_u64 (config->
rb.
kbps.eb_bytes);
161 mp->
type = (vl_api_sse2_qos_policer_type_t) config->
rfc;
226 name = (u8 *) hp->key;
227 pool_index = hp->value[0];
228 config = pool_elt_at_index (pm->configs, pool_index);
229 templ = pool_elt_at_index (pm->policer_templates, pool_index);
230 send_policer_details(name, config, templ, reg, mp->context);
243 #define vl_msg_name_crc_list
245 #undef vl_msg_name_crc_list
250 #define _(id,n,crc) vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id);
251 foreach_vl_msg_name_crc_policer;
261 vl_msg_api_set_handlers(VL_API_##N, #n, \
262 vl_api_##n##_t_handler, \
264 vl_api_##n##_t_endian, \
265 vl_api_##n##_t_print, \
266 sizeof(vl_api_##n##_t), 1);
Add/del policer response.
qos_pol_cfg_params_st * configs
vl_api_sse2_qos_rate_type_t rate_type
#define VALIDATE_SW_IF_INDEX(mp)
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
uword * policer_config_by_name
int policer_input(u8 *name, u32 sw_if_index, bool apply)
vl_api_sse2_qos_action_t conform_action
vl_api_sse2_qos_action_t violate_action
#define REPLY_MACRO2(t, body)
vnet_policer_main_t vnet_policer_main
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vl_api_sse2_qos_round_type_t round_type
vl_api_sse2_qos_action_t exceed_action
vl_api_sse2_qos_action_t violate_action
vl_api_sse2_qos_policer_type_t type
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
vl_api_sse2_qos_policer_type_t type
qos_pol_action_params_st conform_action
static void send_policer_details(u8 *name, qos_pol_cfg_params_st *config, policer_t *templ, vl_api_registration_t *reg, u32 context)
#define foreach_vpe_api_msg
static void vl_api_policer_add_del_t_handler(vl_api_policer_add_del_t *mp)
#define hash_foreach_pair(p, v, body)
Iterate over hash pairs.
u32 cir_tokens_per_period
vl_api_sse2_qos_action_t conform_action
u32 pir_tokens_per_period
u32 pir_tokens_per_period
clib_error_t * policer_add_del(vlib_main_t *vm, u8 *name, qos_pol_cfg_params_st *cfg, u32 *policer_index, u8 is_add)
static void vl_api_policer_input_t_handler(vl_api_policer_input_t *mp)
static void setup_message_id_table(api_main_t *am)
An API client registration, only in vpp/vlib.
static api_main_t * vlibapi_get_main(void)
static void vl_api_policer_dump_t_handler(vl_api_policer_dump_t *mp)
vl_api_sse2_qos_rate_type_t rate_type
policer bind: Associate/disassociate a policer with a worker thread.
static int apply(phash_main_t *pm, u32 tail, u32 rollback)
qos_pol_action_params_st exceed_action
union qos_pol_cfg_params_st_::@490 rb
enum qos_policer_type_en_ qos_policer_type_en
#define BAD_SW_IF_INDEX_LABEL
API main structure, used by both vpp and binary API clients.
policer_t * policer_templates
qos_round_type_en rnd_type
#define vec_free(V)
Free vector's memory (no header).
Policer operational state response.
qos_pol_action_params_st violate_action
vl_api_sse2_qos_round_type_t round_type
#define hash_get_mem(h, key)
static clib_error_t * policer_api_hookup(vlib_main_t *vm)
description fragment has unexpected format
qos_rate_type_en rate_type
vl_api_sse2_qos_action_t exceed_action
int policer_bind_worker(u8 *name, u32 worker, bool bind)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static vlib_main_t * vlib_get_main(void)
VLIB_API_INIT_FUNCTION(policer_api_hookup)
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
struct qos_pol_cfg_params_st_::@490::@491 kbps
qos_action_type_en action_type
vl_api_interface_index_t sw_if_index
static void vl_api_policer_bind_t_handler(vl_api_policer_bind_t *mp)
u32 cir_tokens_per_period
void * vl_msg_api_alloc(int nbytes)