aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ioam/export/node.c
diff options
context:
space:
mode:
authorAkshayaNadahalli <anadahal@cisco.com>2016-12-01 16:33:51 +0530
committerNeale Ranns <nranns@cisco.com>2017-02-13 08:36:59 +0000
commitfdd81af6afe6c782ad2c1a139210378badec626b (patch)
treeb562b391bded3afc0f5b4d0f83eceb20f2c8e772 /src/plugins/ioam/export/node.c
parentfed79e83910459ed700615d2a5a24024f835a66c (diff)
VPP-632 : InBand OAM Analyser
Refer to jira ticket for more details. Change-Id: I6facb9ef8553a21464f9a2e612706f152badbb68 Signed-off-by: AkshayaNadahalli <anadahal@cisco.com>
Diffstat (limited to 'src/plugins/ioam/export/node.c')
-rw-r--r--src/plugins/ioam/export/node.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/plugins/ioam/export/node.c b/src/plugins/ioam/export/node.c
index 19f143dfbf3..b32d7841690 100644
--- a/src/plugins/ioam/export/node.c
+++ b/src/plugins/ioam/export/node.c
@@ -17,8 +17,10 @@
#include <vnet/pg/pg.h>
#include <vppinfra/error.h>
#include <vnet/ip/ip.h>
+#include <vnet/ip/ip6_hop_by_hop.h>
#include <ioam/export-common/ioam_export.h>
+
typedef struct
{
u32 next_index;
@@ -119,6 +121,20 @@ copy3cachelines (void *dst, const void *src, size_t n)
#endif
}
+static void
+ip6_export_fixup_func (vlib_buffer_t * export_buf, vlib_buffer_t * pak_buf)
+{
+ ip6_header_t *ip6_temp =
+ (ip6_header_t *) (export_buf->data + export_buf->current_length);
+ u32 flow_label_temp =
+ clib_net_to_host_u32(ip6_temp->ip_version_traffic_class_and_flow_label)
+ & 0xFFF00000;
+ flow_label_temp |=
+ IOAM_MASK_DECAP_BIT((vnet_buffer(pak_buf)->l2_classify.opaque_index));
+ ip6_temp->ip_version_traffic_class_and_flow_label =
+ clib_host_to_net_u32(flow_label_temp);
+}
+
static uword
ip6_export_node_fn (vlib_main_t * vm,
vlib_node_runtime_t * node, vlib_frame_t * frame)
@@ -126,7 +142,7 @@ ip6_export_node_fn (vlib_main_t * vm,
ioam_export_main_t *em = &ioam_export_main;
ioam_export_node_common(em, vm, node, frame, ip6_header_t, payload_length,
ip_version_traffic_class_and_flow_label,
- EXPORT_NEXT_POP_HBYH);
+ EXPORT_NEXT_POP_HBYH, ip6_export_fixup_func);
return frame->n_vectors;
}