2 * Copyright (c) 2017 Cisco and/or its affiliates.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at:
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 #include <vlib/vlib.h>
17 #include <vnet/vnet.h>
18 #include <ioam/lib-e2e/ioam_seqno_lib.h>
21 show_ioam_seqno_cmd_fn (u8 * s, ioam_seqno_data * seqno_data, u8 enc)
25 s = format (s, "SeqNo Data:\n");
28 s = format (s, " Current Seq. Number : %llu\n", seqno_data->seq_num);
32 rx = &seqno_data->seqno_rx;
33 s = show_ioam_seqno_analyse_data_fn (s, rx);
41 show_ioam_seqno_analyse_data_fn (u8 * s, seqno_rx_info * rx)
43 s = format (s, " Highest Seq. Number : %llu\n", rx->bitmap.highest);
44 s = format (s, " Packets received : %llu\n", rx->rx_packets);
45 s = format (s, " Lost packets : %llu\n", rx->lost_packets);
46 s = format (s, " Reordered packets : %llu\n", rx->reordered_packets);
47 s = format (s, " Duplicate packets : %llu\n", rx->dup_packets);
54 ioam_seqno_init_data (ioam_seqno_data * data)
57 ioam_seqno_init_rx_info (&data->seqno_rx);
62 ioam_seqno_init_rx_info (seqno_rx_info * data)
64 seqno_bitmap *bitmap = &data->bitmap;
65 bitmap->window_size = SEQNO_WINDOW_SIZE;
66 bitmap->array_size = SEQNO_WINDOW_ARRAY_SIZE;
67 bitmap->mask = 32 * SEQNO_WINDOW_ARRAY_SIZE - 1;
68 bitmap->array[0] = 0x00000000; /* pretend we haven seen sequence numbers 0 */
71 data->dup_packets = 0;
72 data->lost_packets = 0;
73 data->reordered_packets = 0;
79 * fd.io coding-style-patch-verification: ON
82 * eval: (c-set-style "gnu")