diff options
author | Benoît Ganne <bganne@cisco.com> | 2021-10-13 19:16:07 +0200 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2022-03-08 18:16:03 +0000 |
commit | 7fc0ee7f65fbbced6e987f8bfd927a595b7ff7ee (patch) | |
tree | 1625e1e5e289184748caa481bceffa586ef270ef /src/vnet/classify/classify_api.c | |
parent | 26fec718f2fa7913a484008fca7b1bc015c6efb5 (diff) |
classify: add API to retrieve punt ACL tables
Type: feature
Change-Id: Ica3e60836c0f26518ba2c238a8c03ce3648ea69b
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/classify/classify_api.c')
-rw-r--r-- | src/vnet/classify/classify_api.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vnet/classify/classify_api.c b/src/vnet/classify/classify_api.c index 3e8dc511479..0f9243c0365 100644 --- a/src/vnet/classify/classify_api.c +++ b/src/vnet/classify/classify_api.c @@ -912,6 +912,27 @@ vl_api_punt_acl_add_del_t_handler (vl_api_punt_acl_add_del_t *mp) REPLY_MACRO (VL_API_PUNT_ACL_ADD_DEL_REPLY); } +static void +vl_api_punt_acl_get_t_handler (vl_api_punt_acl_get_t *mp) +{ + vl_api_punt_acl_get_reply_t *rmp; + int rv = 0; + + const in_out_acl_main_t *am = &in_out_acl_main; + + u32 *const *tables = + am->classify_table_index_by_sw_if_index[IN_OUT_ACL_INPUT_TABLE_GROUP]; + const u32 *ip4_table = tables[IN_OUT_ACL_TABLE_IP4_PUNT]; + const u32 *ip6_table = tables[IN_OUT_ACL_TABLE_IP6_PUNT]; + const u32 ip4_table_index = vec_len (ip4_table) ? ip4_table[0] : ~0; + const u32 ip6_table_index = vec_len (ip6_table) ? ip6_table[0] : ~0; + + REPLY_MACRO2 (VL_API_PUNT_ACL_GET_REPLY, ({ + rmp->ip4_table_index = ntohl (ip4_table_index); + rmp->ip6_table_index = ntohl (ip6_table_index); + })); +} + static void vl_api_output_acl_set_interface_t_handler (vl_api_output_acl_set_interface_t * mp) { |