Repair Doxygen build infrastructure
[vpp.git] / plugins / ioam-plugin / ioam / encap / ip6_ioam_seqno.h
1 /*
2  * Copyright (c) 2016 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:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
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.
14  */
15
16 #ifndef __included_ip6_ioam_seqno_h__
17 #define __included_ip6_ioam_seqno_h__
18
19 #include <vnet/ip/ip6_packet.h>
20 #include <vnet/ip/ip6_hop_by_hop.h>
21
22 #define SEQ_CHECK_VALUE 0x80000000 /* for seq number wraparound detection */
23
24 #define SEQNO_WINDOW_SIZE 2048
25 #define SEQNO_WINDOW_ARRAY_SIZE 64
26
27 typedef struct seqno_bitmap_ {
28   u32 window_size;
29   u32 array_size;
30   u32 mask;
31   u32 pad;
32   u64 highest;
33   u64 array[SEQNO_WINDOW_ARRAY_SIZE];    /* Will be alloc to array_size */
34 } seqno_bitmap;
35
36 typedef struct seqno_rx_info_ {
37   u64 rx_packets;
38   u64 lost_packets;
39   u64 reordered_packets;
40   u64 dup_packets;
41   seqno_bitmap bitmap;
42 } seqno_rx_info;
43
44 /* This structure is 64-byte aligned */
45 typedef struct ioam_seqno_data_ {
46   union {
47     u32 seq_num; /* Useful only for encap node */
48     seqno_rx_info seqno_rx;
49   };
50 } ioam_seqno_data;
51
52 typedef struct ioam_seqno_data_main_t_ {
53   ioam_seqno_data *seqno_data;
54 } ioam_seqno_data_main_t;
55
56 void ioam_seqno_init_bitmap(ioam_seqno_data *data);
57
58 int ioam_seqno_encap_handler(vlib_buffer_t *b, ip6_header_t *ip,
59                              ip6_hop_by_hop_option_t *opt);
60
61 int
62 ioam_seqno_decap_handler(vlib_buffer_t *b, ip6_header_t *ip,
63                          ip6_hop_by_hop_option_t *opt);
64
65 void ioam_analyze_seqno(seqno_rx_info *ppc_rx, u64 seqno);
66
67 u8 *
68 show_ioam_seqno_cmd_fn(u8 *s, ioam_seqno_data *seqno_data, u8 enc);
69
70 #endif