summaryrefslogtreecommitdiffstats
path: root/vpp-api-test
diff options
context:
space:
mode:
authorSteve Shin <jonshin@cisco.com>2016-11-08 10:47:10 -0800
committerJohn Lo <loj@cisco.com>2016-11-16 02:29:44 +0000
commit25e26dc5136137c771715145dd5b2884060ff9eb (patch)
tree9279b106952a9a603060a185bda6b9f2e89ec8f4 /vpp-api-test
parent9c6ae5f43b1f3141d37d6d7b3963926302826f08 (diff)
VPP-521: Classify API enhancement to redirect traffic to pre-defined VRF
Ingress packets are punted to the “Input ACL node” where traffic is classified based on n-tuple keys. If no matched session is found from the classify tables, then it will be passed to “the lookup node” for normal packet forwarding. If a classify session is hit from one of classify tables, then packet vnet buffer field sw_if_index[VLIB_TX] will be updated to the new FIB index used for subsequent IP lookup for this packet. Change-Id: Ifdea63196ddb81c2d5c43b8c98e11ddbf5b11858 Signed-off-by: Steve Shin <jonshin@cisco.com>
Diffstat (limited to 'vpp-api-test')
-rw-r--r--vpp-api-test/vat/api_format.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/vpp-api-test/vat/api_format.c b/vpp-api-test/vat/api_format.c
index 65114ec2..b32c159d 100644
--- a/vpp-api-test/vat/api_format.c
+++ b/vpp-api-test/vat/api_format.c
@@ -8756,6 +8756,8 @@ api_classify_add_del_table (vat_main_t * vam)
u32 memory_size = 32 << 20;
u8 *mask = 0;
f64 timeout;
+ u32 current_data_flag = 0;
+ int current_data_offset = 0;
while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
{
@@ -8785,6 +8787,10 @@ api_classify_add_del_table (vat_main_t * vam)
else if (unformat (i, "acl-miss-next %U", unformat_acl_next_index,
&miss_next_index))
;
+ else if (unformat (i, "current-data-flag %d", &current_data_flag))
+ ;
+ else if (unformat (i, "current-data-offset %d", &current_data_offset))
+ ;
else
break;
}
@@ -8823,6 +8829,8 @@ api_classify_add_del_table (vat_main_t * vam)
mp->match_n_vectors = ntohl (match);
mp->next_table_index = ntohl (next_table_index);
mp->miss_next_index = ntohl (miss_next_index);
+ mp->current_data_flag = ntohl (current_data_flag);
+ mp->current_data_offset = ntohl (current_data_offset);
clib_memcpy (mp->mask, mask, vec_len (mask));
vec_free (mask);
@@ -9282,6 +9290,8 @@ api_classify_add_del_session (vat_main_t * vam)
f64 timeout;
u32 skip_n_vectors = 0;
u32 match_n_vectors = 0;
+ u32 action = 0;
+ u32 metadata = 0;
/*
* Warning: you have to supply skip_n and match_n
@@ -9319,6 +9329,14 @@ api_classify_add_del_session (vat_main_t * vam)
;
else if (unformat (i, "table-index %d", &table_index))
;
+ else if (unformat (i, "action set-ip4-fib-id %d", &metadata))
+ action = 1;
+ else if (unformat (i, "action set-ip6-fib-id %d", &metadata))
+ action = 2;
+ else if (unformat (i, "action %d", &action))
+ ;
+ else if (unformat (i, "metadata %d", &metadata))
+ ;
else
break;
}
@@ -9342,6 +9360,8 @@ api_classify_add_del_session (vat_main_t * vam)
mp->hit_next_index = ntohl (hit_next_index);
mp->opaque_index = ntohl (opaque_index);
mp->advance = ntohl (advance);
+ mp->action = action;
+ mp->metadata = ntohl (metadata);
clib_memcpy (mp->match, match, vec_len (match));
vec_free (match);
@@ -16641,12 +16661,14 @@ _(sr_multicast_map_add_del, \
"address [ip6 multicast address] sr-policy [policy name] [del]") \
_(classify_add_del_table, \
"buckets <nn> [skip <n>] [match <n>] [memory_size <nn-bytes>]\n" \
- "[del] mask <mask-value>\n" \
- " [l2-miss-next | miss-next | acl-miss-next] <name|nn>") \
+ " [del] mask <mask-value>\n" \
+ " [l2-miss-next | miss-next | acl-miss-next] <name|nn>\n" \
+ " [current-data-flag <n>] [current-data-offset <nn>] [table <nn>]") \
_(classify_add_del_session, \
"[hit-next|l2-hit-next|acl-hit-next|policer-hit-next] <name|nn>\n" \
" table-index <nn> skip_n <nn> match_n <nn> match [hex] [l2]\n" \
- " [l3 [ip4|ip6]]") \
+ " [l3 [ip4|ip6]] [action set-ip4-fib-id <nn>]\n" \
+ " [action set-ip6-fib-id <nn> | action <n> metadata <nn>] [del]") \
_(classify_set_interface_ip_table, \
"<intfc> | sw_if_index <nn> table <nn>") \
_(classify_set_interface_l2_tables, \