summaryrefslogtreecommitdiffstats
path: root/src/plugins/ioam/encap/ip6_ioam_seqno.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_seqno.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_seqno.c')
-rw-r--r--src/plugins/ioam/encap/ip6_ioam_seqno.c43
1 files changed, 3 insertions, 40 deletions
diff --git a/src/plugins/ioam/encap/ip6_ioam_seqno.c b/src/plugins/ioam/encap/ip6_ioam_seqno.c
index 0b4d4192975..019771232b4 100644
--- a/src/plugins/ioam/encap/ip6_ioam_seqno.c
+++ b/src/plugins/ioam/encap/ip6_ioam_seqno.c
@@ -28,20 +28,6 @@
#include "ip6_ioam_seqno.h"
#include "ip6_ioam_e2e.h"
-ioam_seqno_data_main_t ioam_seqno_main;
-
-void ioam_seqno_init_bitmap (ioam_seqno_data *data)
-{
- seqno_bitmap *bitmap = &data->seqno_rx.bitmap;
- bitmap->window_size = SEQNO_WINDOW_SIZE;
- bitmap->array_size = SEQNO_WINDOW_ARRAY_SIZE;
- bitmap->mask = 32 * SEQNO_WINDOW_ARRAY_SIZE - 1;
- bitmap->array[0] = 0x00000000;/* pretend we haven seen sequence numbers 0*/
- bitmap->highest = 0;
-
- data->seq_num = 0;
- return ;
-}
/*
* This Routine gets called from IPv6 hop-by-hop option handling.
@@ -60,7 +46,7 @@ ioam_seqno_encap_handler (vlib_buffer_t *b, ip6_header_t *ip,
data = ioam_e2ec_get_seqno_data_from_flow_ctx(opaque_index);
e2e = (ioam_e2e_option_t *) opt;
- e2e->e2e_data = clib_host_to_net_u32(++data->seq_num);
+ e2e->e2e_hdr.e2e_data = clib_host_to_net_u32(++data->seq_num);
return (rv);
}
@@ -79,31 +65,8 @@ ioam_seqno_decap_handler (vlib_buffer_t *b, ip6_header_t *ip,
data = ioam_e2ec_get_seqno_data_from_flow_ctx(opaque_index);
e2e = (ioam_e2e_option_t *) opt;
- ioam_analyze_seqno(&data->seqno_rx, (u64) clib_net_to_host_u32(e2e->e2e_data));
+ ioam_analyze_seqno(&data->seqno_rx,
+ (u64) clib_net_to_host_u32(e2e->e2e_hdr.e2e_data));
return (rv);
}
-
-u8 *
-show_ioam_seqno_cmd_fn (u8 *s, ioam_seqno_data *seqno_data, u8 enc)
-{
- seqno_rx_info *rx;
-
- s = format(s, "SeqNo Data:\n");
- if (enc)
- {
- s = format(s, " Current Seq. Number : %llu\n", seqno_data->seq_num);
- }
- else
- {
- rx = &seqno_data->seqno_rx;
- s = format(s, " Highest Seq. Number : %llu\n", rx->bitmap.highest);
- s = format(s, " Packets received : %llu\n", rx->rx_packets);
- s = format(s, " Lost packets : %llu\n", rx->lost_packets);
- s = format(s, " Reordered packets : %llu\n", rx->reordered_packets);
- s = format(s, " Duplicate packets : %llu\n", rx->dup_packets);
- }
-
- format(s, "\n");
- return s;
-}