Add L2 flow-record generation

Change-Id: I32a9513f2b66d35e0abe2aeb6eb86a4729ba7f74
Signed-off-by: Dave Barach <dave@barachs.net>
This commit is contained in:
Dave Barach
2016-12-20 17:59:27 -05:00
committed by Damjan Marion
parent abea966498
commit 504b83009a
7 changed files with 879 additions and 159 deletions

View File

@@ -24,6 +24,7 @@ vppplugins_LTLIBRARIES = flowperpkt_plugin.la
vppapitestplugins_LTLIBRARIES = flowperpkt_test_plugin.la
flowperpkt_plugin_la_SOURCES = flowperpkt/flowperpkt.c \
flowperpkt/l2_node.c \
flowperpkt/node.c \
flowperpkt/flowperpkt_plugin.api.h
flowperpkt_plugin_la_LDFLAGS = -module

View File

@@ -22,7 +22,7 @@ manual_print define flowperpkt_tx_interface_add_del
/* Enable / disable the feature */
u8 is_add;
u8 is_ipv6;
u8 which; /* 0 = ipv4, 1 = l2, 2 = ipv6 (not yet implemented) */
/* Interface handle */
u32 sw_if_index;

File diff suppressed because it is too large Load Diff

View File

@@ -35,15 +35,25 @@ typedef struct
/** API message ID base */
u16 msg_id_base;
/** Has the report been created? */
int report_created;
/** Have the reports [templates] been created? */
int ipv4_report_created;
int l2_report_created;
/** stream/template IDs */
u16 ipv4_report_id;
u16 l2_report_id;
/** ipfix buffers under construction, per-worker thread */
vlib_buffer_t **buffers_per_worker;
vlib_buffer_t **ipv4_buffers_per_worker;
vlib_buffer_t **l2_buffers_per_worker;
/** frames containing ipfix buffers, per-worker thread */
vlib_frame_t **frames_per_worker;
vlib_frame_t **ipv4_frames_per_worker;
vlib_frame_t **l2_frames_per_worker;
/** next record offset, per worker thread */
u16 *next_record_offset_per_worker;
u16 *ipv4_next_record_offset_per_worker;
u16 *l2_next_record_offset_per_worker;
/** Time reference pair */
u64 nanosecond_time_0;
@@ -55,11 +65,19 @@ typedef struct
vnet_main_t *vnet_main;
} flowperpkt_main_t;
typedef enum
{
FLOW_VARIANT_IPV4,
FLOW_VARIANT_L2,
FLOW_N_VARIANTS,
} flowperpkt_variant_t;
extern flowperpkt_main_t flowperpkt_main;
vlib_node_registration_t flowperpkt_node;
extern vlib_node_registration_t flowperpkt_ipv4_node;
void flowperpkt_flush_callback (void);
void flowperpkt_flush_callback_ipv4 (void);
void flowperpkt_flush_callback_l2 (void);
#endif /* __included_flowperpkt_h__ */

View File

@@ -132,6 +132,7 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam)
unformat_input_t *i = vam->input;
f64 timeout;
int enable_disable = 1;
u8 which = 0; /* ipv4 by default */
u32 sw_if_index = ~0;
vl_api_flowperpkt_tx_interface_add_del_t *mp;
@@ -144,6 +145,8 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam)
;
else if (unformat (i, "disable"))
enable_disable = 0;
else if (unformat (i, "l2"))
which = 1;
else
break;
}
@@ -158,7 +161,7 @@ api_flowperpkt_tx_interface_add_del (vat_main_t * vam)
M (FLOWPERPKT_TX_INTERFACE_ADD_DEL, flowperpkt_tx_interface_add_del);
mp->sw_if_index = ntohl (sw_if_index);
mp->is_add = enable_disable;
mp->is_ipv6 = 0; /* $$$$ */
mp->which = which;
/* send it... */
S;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff