From 1b563527c143903b6e7e79b5978af5310372f605 Mon Sep 17 00:00:00 2001 From: AkshayaNadahalli Date: Mon, 23 Jan 2017 22:05:35 +0530 Subject: In-band OAM active probe (VPP-471) Change-Id: Icf0ddf76ba1c8b588c79387284cd0349ebc6e45f Signed-off-by: AkshayaNadahalli --- src/plugins/ioam/lib-trace/trace_util.h | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'src/plugins/ioam/lib-trace') 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); -- cgit 1.2.3-korg