summaryrefslogtreecommitdiffstats
path: root/src/vnet/policer/policer.h
diff options
context:
space:
mode:
authorMaxime Peim <mpeim@cisco.com>2023-01-06 11:57:38 +0000
committerNeale Ranns <neale@graphiant.com>2023-02-02 00:22:06 +0000
commit2d1a62bfddbba92a0aeec5c68e9b0a7903b178da (patch)
treeb5a8306e9d345c18bb45a55b0cfa5786c02258f0 /src/vnet/policer/policer.h
parent3220d9f16b3db05fe9ea8d756395cd8aa7755863 (diff)
policer: API policer selection by index
Policer API calls were only by policer name. It is now possible to select a policer by its index. Some functionalities are also added to allow updating a policer configuration and to refill its token buckets. Some dead codes are being removed, and small fixes made. Type: improvement Signed-off-by: Maxime Peim <mpeim@cisco.com> Change-Id: I4cc8fda0fc7c635a4110da3e757356b150f9b606
Diffstat (limited to 'src/vnet/policer/policer.h')
-rw-r--r--src/vnet/policer/policer.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/vnet/policer/policer.h b/src/vnet/policer/policer.h
index f5b6c0d3b31..7ce7fc79d47 100644
--- a/src/vnet/policer/policer.h
+++ b/src/vnet/policer/policer.h
@@ -32,7 +32,7 @@ typedef struct
qos_pol_cfg_params_st *configs;
policer_t *policer_templates;
- /* Config by name hash */
+ /* Config by policer name hash */
uword *policer_config_by_name;
/* Policer by name hash */
@@ -68,11 +68,16 @@ typedef enum
} vnet_policer_next_t;
u8 *format_policer_instance (u8 * s, va_list * va);
-clib_error_t *policer_add_del (vlib_main_t *vm, u8 *name,
- qos_pol_cfg_params_st *cfg, u32 *policer_index,
- u8 is_add);
-int policer_bind_worker (u8 *name, u32 worker, bool bind);
-int policer_input (u8 *name, u32 sw_if_index, vlib_dir_t dir, bool apply);
+int policer_add (vlib_main_t *vm, const u8 *name,
+ const qos_pol_cfg_params_st *cfg, u32 *policer_index);
+
+int policer_update (vlib_main_t *vm, u32 policer_index,
+ const qos_pol_cfg_params_st *cfg);
+int policer_del (vlib_main_t *vm, u32 policer_index);
+int policer_reset (vlib_main_t *vm, u32 policer_index);
+int policer_bind_worker (u32 policer_index, u32 worker, bool bind);
+int policer_input (u32 policer_index, u32 sw_if_index, vlib_dir_t dir,
+ bool apply);
#endif /* __included_policer_h__ */