|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
28 #include <vnet/policer/policer.api_enum.h>
29 #include <vnet/policer/policer.api_types.h>
31 #define REPLY_MSG_ID_BASE vnet_policer_main.msg_id_base
54 cfg.
rb.
kbps.cb_bytes = clib_net_to_host_u64 (mp->
cb);
55 cfg.
rb.
kbps.eb_bytes = clib_net_to_host_u64 (mp->
eb);
70 rv = VNET_API_ERROR_UNSPECIFIED;
86 vl_api_policer_bind_reply_t *rmp;
106 vl_api_policer_bind_reply_t *rmp;
138 mp->
cir = htonl (config->
rb.
kbps.cir_kbps);
139 mp->
eir = htonl (config->
rb.
kbps.eir_kbps);
140 mp->
cb = clib_host_to_net_u64 (config->
rb.
kbps.cb_bytes);
141 mp->
eb = clib_host_to_net_u64 (config->
rb.
kbps.eb_bytes);
144 mp->
type = (vl_api_sse2_qos_policer_type_t) config->
rfc;
209 name = (u8 *) hp->key;
210 pool_index = hp->value[0];
211 config = pool_elt_at_index (pm->configs, pool_index);
212 templ = pool_elt_at_index (pm->policer_templates, pool_index);
213 send_policer_details(name, config, templ, reg, mp->context);
219 #include <vnet/policer/policer.api.c>
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 hash_foreach_pair(p, v, body)
Iterate over hash pairs.
#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)
static void vl_api_policer_add_del_t_handler(vl_api_policer_add_del_t *mp)
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)
An API client registration, only in vpp/vlib.
static void setup_message_id_table(api_main_t *am)
static void vl_api_policer_dump_t_handler(vl_api_policer_dump_t *mp)
#define REPLY_MSG_ID_BASE
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
enum qos_policer_type_en_ qos_policer_type_en
#define BAD_SW_IF_INDEX_LABEL
policer_t * policer_templates
#define hash_get_mem(h, key)
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
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)
union qos_pol_cfg_params_st_::@496 rb
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.
qos_action_type_en action_type
struct qos_pol_cfg_params_st_::@496::@497 kbps
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)