summaryrefslogtreecommitdiffstats
path: root/src/vnet/policer/policer_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/policer/policer_api.c')
-rw-r--r--src/vnet/policer/policer_api.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/vnet/policer/policer_api.c b/src/vnet/policer/policer_api.c
index fb66667504c..17ed73790cf 100644
--- a/src/vnet/policer/policer_api.c
+++ b/src/vnet/policer/policer_api.c
@@ -42,9 +42,10 @@
#include <vlibapi/api_helper_macros.h>
-#define foreach_vpe_api_msg \
-_(POLICER_ADD_DEL, policer_add_del) \
-_(POLICER_DUMP, policer_dump)
+#define foreach_vpe_api_msg \
+ _ (POLICER_ADD_DEL, policer_add_del) \
+ _ (POLICER_BIND, policer_bind) \
+ _ (POLICER_DUMP, policer_dump)
static void
vl_api_policer_add_del_t_handler (vl_api_policer_add_del_t * mp)
@@ -96,6 +97,26 @@ vl_api_policer_add_del_t_handler (vl_api_policer_add_del_t * mp)
}
static void
+vl_api_policer_bind_t_handler (vl_api_policer_bind_t *mp)
+{
+ vl_api_policer_bind_reply_t *rmp;
+ u8 *name;
+ u32 worker_index;
+ u8 bind_enable;
+ int rv;
+
+ name = format (0, "%s", mp->name);
+ vec_terminate_c_string (name);
+
+ worker_index = ntohl (mp->worker_index);
+ bind_enable = mp->bind_enable;
+
+ rv = policer_bind_worker (name, worker_index, bind_enable);
+ vec_free (name);
+ REPLY_MACRO (VL_API_POLICER_BIND_REPLY);
+}
+
+static void
send_policer_details (u8 *name, qos_pol_cfg_params_st *config,
policer_read_response_type_st *templ,
vl_api_registration_t *reg, u32 context)