aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
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/vnet
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/vnet')
-rw-r--r--src/vnet/ip/ip6.h3
-rw-r--r--src/vnet/ip/ip6_forward.c3
-rw-r--r--src/vnet/ip/ip6_hop_by_hop.c26
-rw-r--r--src/vnet/ip/ip6_hop_by_hop.h28
-rw-r--r--src/vnet/ip/ip6_hop_by_hop_packet.h10
5 files changed, 29 insertions, 41 deletions
diff --git a/src/vnet/ip/ip6.h b/src/vnet/ip/ip6.h
index 152698733e8..1844d727cc0 100644
--- a/src/vnet/ip/ip6.h
+++ b/src/vnet/ip/ip6.h
@@ -492,9 +492,6 @@ int ip6_hbh_register_option (u8 option,
int ip6_hbh_unregister_option (u8 option);
void ip6_hbh_set_next_override (uword next);
-/* Flag used by IOAM code. Classifier sets it pop-hop-by-hop checks it */
-#define OI_DECAP 0x80000000
-
#endif /* included_ip_ip6_h */
/*
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index 06c20bbaa12..ae5c19b6966 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -49,6 +49,9 @@
#include <vppinfra/bihash_template.c>
+/* Flag used by IOAM code. Classifier sets it pop-hop-by-hop checks it */
+#define OI_DECAP 0x80000000
+
/**
* @file
* @brief IPv6 Forwarding.
diff --git a/src/vnet/ip/ip6_hop_by_hop.c b/src/vnet/ip/ip6_hop_by_hop.c
index 3a820b3cefc..df2a932e00d 100644
--- a/src/vnet/ip/ip6_hop_by_hop.c
+++ b/src/vnet/ip/ip6_hop_by_hop.c
@@ -56,32 +56,6 @@ typedef enum
IP6_HBYH_IOAM_INPUT_N_NEXT,
} ip6_hbyh_ioam_input_next_t;
-
-u32
-ioam_flow_add (u8 encap, u8 * flow_name)
-{
- ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main;
- flow_data_t *flow = 0;
- u32 index = 0;
- u8 i;
-
- pool_get (hm->flows, flow);
- memset (flow, 0, sizeof (flow_data_t));
-
- index = flow - hm->flows;
- strncpy ((char *) flow->flow_name, (char *) flow_name, 31);
-
- if (!encap)
- IOAM_SET_DECAP (index);
-
- for (i = 0; i < 255; i++)
- {
- if (hm->flow_handler[i])
- flow->ctx[i] = hm->flow_handler[i] (index, 1);
- }
- return (index);
-}
-
static uword
unformat_opaque_ioam (unformat_input_t * input, va_list * args)
{
diff --git a/src/vnet/ip/ip6_hop_by_hop.h b/src/vnet/ip/ip6_hop_by_hop.h
index acfaa37ed2f..9574f0a5ecc 100644
--- a/src/vnet/ip/ip6_hop_by_hop.h
+++ b/src/vnet/ip/ip6_hop_by_hop.h
@@ -92,8 +92,6 @@ typedef struct
extern ip6_hop_by_hop_ioam_main_t ip6_hop_by_hop_ioam_main;
-extern u8 *format_path_map (u8 * s, va_list * args);
-
extern clib_error_t *ip6_ioam_enable (int has_trace_option,
int has_pot_option,
int has_seqno_option,
@@ -206,6 +204,32 @@ is_seqno_enabled (void)
}
int ip6_trace_profile_setup ();
+
+static inline u32
+ioam_flow_add (u8 encap, u8 * flow_name)
+{
+ ip6_hop_by_hop_ioam_main_t *hm = &ip6_hop_by_hop_ioam_main;
+ flow_data_t *flow = 0;
+ u32 index = 0;
+ u8 i;
+
+ pool_get (hm->flows, flow);
+ memset (flow, 0, sizeof (flow_data_t));
+
+ index = flow - hm->flows;
+ strncpy ((char *) flow->flow_name, (char *) flow_name, 31);
+
+ if (!encap)
+ IOAM_SET_DECAP (index);
+
+ for (i = 0; i < 255; i++)
+ {
+ if (hm->flow_handler[i])
+ flow->ctx[i] = hm->flow_handler[i] (index, 1);
+ }
+ return (index);
+}
+
#endif /* __included_ip6_hop_by_hop_ioam_h__ */
/*
diff --git a/src/vnet/ip/ip6_hop_by_hop_packet.h b/src/vnet/ip/ip6_hop_by_hop_packet.h
index 543ba8b0533..dd8c7d5e505 100644
--- a/src/vnet/ip/ip6_hop_by_hop_packet.h
+++ b/src/vnet/ip/ip6_hop_by_hop_packet.h
@@ -45,16 +45,6 @@ typedef struct
#define HBH_OPTION_TYPE_IOAM_PROOF_OF_TRANSIT 60 /* Third highest bit set (change en-route) */
#define HBH_OPTION_TYPE_IOAM_EDGE_TO_EDGE 29
-
-/* *INDENT-OFF* */
-typedef CLIB_PACKED(struct {
- ip6_hop_by_hop_option_t hdr;
- u8 e2e_type;
- u8 reserved;
- u32 e2e_data;
-}) ioam_e2e_option_t;
-/* *INDENT-ON* */
-
#endif /* __included_ip6_hop_by_hop_packet_h__ */
/*