aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ioam/lib-trace
diff options
context:
space:
mode:
authorAkshayaNadahalli <anadahal@cisco.com>2017-01-23 22:05:35 +0530
committerAkshayaNadahalli <anadahal@cisco.com>2017-03-07 14:08:22 +0000
commit1b563527c143903b6e7e79b5978af5310372f605 (patch)
tree7b673272cb930e03b77dd376f581d903c219a566 /src/plugins/ioam/lib-trace
parent066f034b903bda6e938bec1b12f01edef65ee9c4 (diff)
In-band OAM active probe (VPP-471)
Change-Id: Icf0ddf76ba1c8b588c79387284cd0349ebc6e45f Signed-off-by: AkshayaNadahalli <anadahal@cisco.com>
Diffstat (limited to 'src/plugins/ioam/lib-trace')
-rw-r--r--src/plugins/ioam/lib-trace/trace_util.h28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/plugins/ioam/lib-trace/trace_util.h b/src/plugins/ioam/lib-trace/trace_util.h
index 7065b41e9c9..c8b504701e4 100644
--- a/src/plugins/ioam/lib-trace/trace_util.h
+++ b/src/plugins/ioam/lib-trace/trace_util.h
@@ -103,7 +103,11 @@ typedef CLIB_PACKED (struct
#define BIT_EGR_INTERFACE (1<<2)
#define BIT_TIMESTAMP (1<<3)
#define BIT_APPDATA (1<<4)
-#define TRACE_TYPE_MASK 0x1F /* Mask of all above bits */
+#define BIT_LOOPBACK (1<<5)
+#define BIT_LOOPBACK_REPLY (1<<6)
+#define TRACE_TYPE_MASK 0x7F /* Mask of all above bits */
+
+#define TRACE_TYPE_IF_TS_APP_LOOP 0x3F
/*
0x00011111 iOAM-trace-type is 0x00011111 then the format of node
@@ -218,20 +222,32 @@ fetch_trace_data_size (u8 trace_type)
{
u8 trace_data_size = 0;
- if (trace_type == TRACE_TYPE_IF_TS_APP)
+ if ((trace_type & TRACE_TYPE_IF_TS_APP) == TRACE_TYPE_IF_TS_APP)
trace_data_size = sizeof (ioam_trace_if_ts_app_t);
- else if (trace_type == TRACE_TYPE_IF)
+ else if ((trace_type & TRACE_TYPE_IF) == TRACE_TYPE_IF)
trace_data_size = sizeof (ioam_trace_if_t);
- else if (trace_type == TRACE_TYPE_TS)
+ else if ((trace_type & TRACE_TYPE_TS) == TRACE_TYPE_TS)
trace_data_size = sizeof (ioam_trace_ts_t);
- else if (trace_type == TRACE_TYPE_APP)
+ else if ((trace_type & TRACE_TYPE_APP) == TRACE_TYPE_APP)
trace_data_size = sizeof (ioam_trace_app_t);
- else if (trace_type == TRACE_TYPE_TS_APP)
+ else if ((trace_type & TRACE_TYPE_TS_APP) == TRACE_TYPE_TS_APP)
trace_data_size = sizeof (ioam_trace_ts_app_t);
return trace_data_size;
}
+always_inline void
+ioam_trace_set_bit (ioam_trace_hdr_t * trace_hdr, u8 trace_bit)
+{
+ trace_hdr->ioam_trace_type |= trace_bit;
+}
+
+always_inline void
+ioam_trace_reset_bit (ioam_trace_hdr_t * trace_hdr, u8 trace_bit)
+{
+ trace_hdr->ioam_trace_type &= (~trace_bit);
+}
+
int ioam_trace_get_sizeof_handler (u32 * result);
int ip6_trace_profile_setup (void);
int ip6_trace_profile_cleanup (void);