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:
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 #ifndef __included_ip6_ioam_seqno_h__
17 #define __included_ip6_ioam_seqno_h__
19 #include <vnet/ip/ip6_packet.h>
20 #include <vnet/ip/ip6_hop_by_hop.h>
22 #define SEQ_CHECK_VALUE 0x80000000 /* for seq number wraparound detection */
24 #define SEQNO_WINDOW_SIZE 2048
25 #define SEQNO_WINDOW_ARRAY_SIZE 64
27 typedef struct seqno_bitmap_ {
33 u64 array[SEQNO_WINDOW_ARRAY_SIZE]; /* Will be alloc to array_size */
36 typedef struct seqno_rx_info_ {
39 u64 reordered_packets;
44 /* This structure is 64-byte aligned */
45 typedef struct ioam_seqno_data_ {
47 u32 seq_num; /* Useful only for encap node */
48 seqno_rx_info seqno_rx;
52 typedef struct ioam_seqno_data_main_t_ {
53 ioam_seqno_data *seqno_data;
54 } ioam_seqno_data_main_t;
56 void ioam_seqno_init_bitmap(ioam_seqno_data *data);
58 int ioam_seqno_encap_handler(vlib_buffer_t *b, ip6_header_t *ip,
59 ip6_hop_by_hop_option_t *opt);
62 ioam_seqno_decap_handler(vlib_buffer_t *b, ip6_header_t *ip,
63 ip6_hop_by_hop_option_t *opt);
65 void ioam_analyze_seqno(seqno_rx_info *ppc_rx, u64 seqno);
68 show_ioam_seqno_cmd_fn(u8 *s, ioam_seqno_data *seqno_data, u8 enc);