aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ioam/encap/ip6_ioam_pot.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/encap/ip6_ioam_pot.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/encap/ip6_ioam_pot.c')
-rw-r--r--src/plugins/ioam/encap/ip6_ioam_pot.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/plugins/ioam/encap/ip6_ioam_pot.c b/src/plugins/ioam/encap/ip6_ioam_pot.c
index 05f42c91d0f..9a76123330d 100644
--- a/src/plugins/ioam/encap/ip6_ioam_pot.c
+++ b/src/plugins/ioam/encap/ip6_ioam_pot.c
@@ -16,26 +16,15 @@
#include <vnet/vnet.h>
#include <vnet/pg/pg.h>
#include <vppinfra/error.h>
-
#include <vnet/ip/ip6.h>
-#include <vnet/ip/ip6_hop_by_hop.h>
-#include <vnet/ip/ip6_hop_by_hop_packet.h>
#include <vppinfra/hash.h>
#include <vppinfra/error.h>
#include <vppinfra/elog.h>
+#include <ioam/encap/ip6_ioam_pot.h>
#include <ioam/lib-pot/pot_util.h>
-typedef CLIB_PACKED(struct {
- ip6_hop_by_hop_option_t hdr;
- u8 pot_type;
-#define PROFILE_ID_MASK 0xF
- u8 reserved_profile_id; /* 4 bits reserved, 4 bits to carry profile id */
- u64 random;
- u64 cumulative;
-}) ioam_pot_option_t;
-
#define foreach_ip6_hop_by_hop_ioam_pot_stats \
_(PROCESSED, "Pkts with ip6 hop-by-hop pot options") \
_(PROFILE_MISS, "Pkts with ip6 hop-by-hop pot options but no profile set") \
@@ -180,19 +169,19 @@ ip6_hbh_ioam_proof_of_transit_pop_handler (vlib_buffer_t *b, ip6_header_t *ip,
int rv = 0;
pot_profile *pot_profile = 0;
u8 result = 0;
-
+
pot0 = (ioam_pot_option_t *) opt0;
random = clib_net_to_host_u64(pot0->random);
cumulative = clib_net_to_host_u64(pot0->cumulative);
pot_profile = pot_profile_get_active();
result = pot_validate (pot_profile,
cumulative, random);
-
- if (result == 1)
+
+ if (result == 1)
{
ip6_ioam_stats_increment_counter (IP6_IOAM_POT_PASSED, 1);
}
- else
+ else
{
ip6_ioam_stats_increment_counter (IP6_IOAM_POT_FAILED, 1);
}