diff options
author | Alexander Chernavin <achernavin@netgate.com> | 2022-05-06 11:35:59 +0000 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2022-05-13 07:34:41 +0000 |
commit | 6f5ddf3461906bbc88f679882744afc74a81cae1 (patch) | |
tree | 27a3f0686ddf0fb7efdfd3ac1aa2cefb5fa86153 /src/plugins/flowprobe/flowprobe.h | |
parent | 0891b6aa449cca525b61d0cc23759b2efcd158dc (diff) |
flowprobe: add support for reporting on inbound packets
Type: feature
Currently, the plugin supports only IPFIX flow record generation for
outbound packets.
With this change:
- add a new API message for enabling the feature on an interface that
accepts direction (rx, tx, both);
- update existing debug command for feature enabling to accept
direction;
- update existing debug command for showing currently enabled feature
on interfaces to display direction;
- update templates to include a direction field;
- generate flow records on the specified direction and data path;
- report direction in flow data;
- update tests to use the new API;
- add tests for inbound flows.
Change-Id: I121fd904b38408641036ebeea848df7a4e5e0b30
Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src/plugins/flowprobe/flowprobe.h')
-rw-r--r-- | src/plugins/flowprobe/flowprobe.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/plugins/flowprobe/flowprobe.h b/src/plugins/flowprobe/flowprobe.h index 2d28c81de33..3174a844c2a 100644 --- a/src/plugins/flowprobe/flowprobe.h +++ b/src/plugins/flowprobe/flowprobe.h @@ -45,13 +45,20 @@ typedef enum /* *INDENT-OFF* */ typedef enum __attribute__ ((__packed__)) { - FLOW_VARIANT_IP4, + FLOW_VARIANT_IP4 = 0, FLOW_VARIANT_IP6, FLOW_VARIANT_L2, FLOW_VARIANT_L2_IP4, FLOW_VARIANT_L2_IP6, FLOW_N_VARIANTS, } flowprobe_variant_t; + +typedef enum __attribute__ ((__packed__)) +{ + FLOW_DIRECTION_RX = 0, + FLOW_DIRECTION_TX, + FLOW_DIRECTION_BOTH, +} flowprobe_direction_t; /* *INDENT-ON* */ STATIC_ASSERT (sizeof (flowprobe_variant_t) == 1, @@ -85,6 +92,7 @@ typedef struct __attribute__ ((aligned (8))) { u16 src_port; u16 dst_port; flowprobe_variant_t which; + flowprobe_direction_t direction; } flowprobe_key_t; /* *INDENT-ON* */ @@ -149,6 +157,7 @@ typedef struct u16 template_per_flow[FLOW_N_VARIANTS]; u8 *flow_per_interface; + u8 *direction_per_interface; /** convenience vlib_main_t pointer */ vlib_main_t *vlib_main; |