aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/classify/classify_api.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-08-27 10:16:44 +0200
committerOle Trøan <otroan@employees.org>2019-12-03 14:53:47 +0000
commit692bfc85f2c41c6e25e73931a7b6fe6a1c5dd6c6 (patch)
treee4d564fdea62d8125a158a19dde0c1a938b0dfa4 /src/vnet/classify/classify_api.c
parente2ccdf0316243a1486109743e3de532cae5f3254 (diff)
classify: API cleanup
Use consistent API types. Type: fix Change-Id: Ib5b1efa76f0a9cecc0bc146f8f8a47c2442fc1db Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vnet/classify/classify_api.c')
-rw-r--r--src/vnet/classify/classify_api.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/vnet/classify/classify_api.c b/src/vnet/classify/classify_api.c
index 98f4366bf9e..0725a9c0635 100644
--- a/src/vnet/classify/classify_api.c
+++ b/src/vnet/classify/classify_api.c
@@ -71,8 +71,6 @@ _(skip_n_vectors) \
_(match_n_vectors) \
_(next_table_index) \
_(miss_next_index) \
-_(current_data_flag) \
-_(current_data_offset) \
_(mask_len)
static void vl_api_classify_add_del_table_t_handler
@@ -112,6 +110,9 @@ static void vl_api_classify_add_del_table_t_handler
table_index = ~0;
}
+ u8 current_data_flag = mp->current_data_flag;
+ i16 current_data_offset = clib_net_to_host_i16 (mp->current_data_offset);
+
rv = vnet_classify_add_del_table
(cm, mp->mask, nbuckets, memory_size,
skip_n_vectors, match_n_vectors,
@@ -125,9 +126,9 @@ out:
if (rv == 0 && mp->is_add)
{
t = pool_elt_at_index (cm->tables, table_index);
- rmp->skip_n_vectors = ntohl(t->skip_n_vectors);
- rmp->match_n_vectors = ntohl(t->match_n_vectors);
- rmp->new_table_index = ntohl(table_index);
+ rmp->skip_n_vectors = htonl(t->skip_n_vectors);
+ rmp->match_n_vectors = htonl(t->match_n_vectors);
+ rmp->new_table_index = htonl(table_index);
}
else
{
@@ -229,12 +230,18 @@ vl_api_policer_classify_dump_t_handler (vl_api_policer_classify_dump_t * mp)
policer_classify_main_t *pcm = &policer_classify_main;
u32 *vec_tbl;
int i;
+ u32 filter_sw_if_index;
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
- vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
+ filter_sw_if_index = ntohl (mp->sw_if_index);
+ if (filter_sw_if_index != ~0)
+ vec_tbl =
+ &pcm->classify_table_index_by_sw_if_index[mp->type][filter_sw_if_index];
+ else
+ vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
if (vec_len (vec_tbl))
{
@@ -505,12 +512,18 @@ vl_api_flow_classify_dump_t_handler (vl_api_flow_classify_dump_t * mp)
flow_classify_main_t *pcm = &flow_classify_main;
u32 *vec_tbl;
int i;
+ u32 filter_sw_if_index;
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
- vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
+ filter_sw_if_index = ntohl (mp->sw_if_index);
+ if (filter_sw_if_index != ~0)
+ vec_tbl =
+ &pcm->classify_table_index_by_sw_if_index[mp->type][filter_sw_if_index];
+ else
+ vec_tbl = pcm->classify_table_index_by_sw_if_index[mp->type];
if (vec_len (vec_tbl))
{