aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/vnet/classify/vnet_classify.h
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 /vnet/vnet/classify/vnet_classify.h
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 'vnet/vnet/classify/vnet_classify.h')
-rw-r--r--vnet/vnet/classify/vnet_classify.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/vnet/vnet/classify/vnet_classify.h b/vnet/vnet/classify/vnet_classify.h
index f609aaa49d6..ed8442b3dce 100644
--- a/vnet/vnet/classify/vnet_classify.h
+++ b/vnet/vnet/classify/vnet_classify.h
@@ -46,6 +46,25 @@ extern vlib_node_registration_t ip6_classify_node;
#define U32X4_ALIGNED(p) PREDICT_TRUE((((intptr_t)p) & 0xf) == 0)
+/*
+ * Classify table option to process packets
+ * CLASSIFY_FLAG_USE_CURR_DATA:
+ * - classify packets starting from VPP node’s current data pointer
+ */
+#define CLASSIFY_FLAG_USE_CURR_DATA 1
+
+/*
+ * Classify session action
+ * CLASSIFY_ACTION_SET_IP4_FIB_INDEX:
+ * - Classified IP packets will be looked up
+ * from the specified ipv4 fib table
+ * CLASSIFY_ACTION_SET_IP6_FIB_INDEX:
+ * - Classified IP packets will be looked up
+ * from the specified ipv6 fib table
+ */
+#define CLASSIFY_ACTION_SET_IP4_FIB_INDEX 1
+#define CLASSIFY_ACTION_SET_IP6_FIB_INDEX 2
+
struct _vnet_classify_main;
typedef struct _vnet_classify_main vnet_classify_main_t;
@@ -71,9 +90,12 @@ typedef CLIB_PACKED(struct _vnet_classify_entry {
};
/* Really only need 1 bit */
- u32 flags;
+ u8 flags;
#define VNET_CLASSIFY_ENTRY_FREE (1<<0)
+ u8 action;
+ u16 metadata;
+
/* Hit counter, last heard time */
union {
u64 hits;
@@ -131,6 +153,9 @@ typedef struct {
u32 log2_nbuckets;
int entries_per_page;
u32 active_elements;
+ u32 current_data_flag;
+ int current_data_offset;
+ u32 data_offset;
/* Index of next table to try */
u32 next_table_index;
@@ -449,6 +474,8 @@ int vnet_classify_add_del_session (vnet_classify_main_t * cm,
u32 hit_next_index,
u32 opaque_index,
i32 advance,
+ u8 action,
+ u32 metadata,
int is_add);
int vnet_classify_add_del_table (vnet_classify_main_t * cm,
@@ -460,6 +487,8 @@ int vnet_classify_add_del_table (vnet_classify_main_t * cm,
u32 next_table_index,
u32 miss_next_index,
u32 * table_index,
+ u8 current_data_flag,
+ i16 current_data_offset,
int is_add);
unformat_function_t unformat_ip4_mask;