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.
15 #ifndef __included_nsh_md2_ioam_h__
16 #define __included_nsh_md2_ioam_h__
19 #include <nsh/nsh_packet.h>
20 #include <vnet/ip/ip.h>
21 #include <vnet/ip/ip4_packet.h>
22 #include <vnet/ip/ip6_packet.h>
25 typedef struct nsh_md2_ioam_sw_interface_
28 } nsh_md2_ioam_sw_interface_t;
30 typedef struct nsh_md2_ioam_dest_tunnels_
32 ip46_address_t dst_addr;
35 fib_node_index_t fib_entry_index;
37 } nsh_md2_ioam_dest_tunnels_t;
39 typedef struct nsh_md2_ioam_main_
42 * Linkage into the FIB object graph
46 /* time scale transform. Joy. */
63 #define TSP_MILLISECONDS 1
64 #define TSP_MICROSECONDS 2
65 #define TSP_NANOSECONDS 3
68 /* API message ID base */
71 /* Override to export for iOAM */
72 uword decap_v4_next_override;
73 uword decap_v6_next_override;
75 /* sequence of node graph for encap */
76 uword encap_v4_next_node;
77 uword encap_v6_next_node;
79 /* Software interfaces. */
80 nsh_md2_ioam_sw_interface_t *sw_interfaces;
82 /* hash ip4/ip6 -> list of destinations for doing transit iOAM operation */
83 nsh_md2_ioam_dest_tunnels_t *dst_tunnels;
87 /** per sw_if_index, to maintain bitmap */
88 u8 *bool_ref_by_sw_if_index;
89 fib_node_type_t fib_entry_type;
92 } nsh_md2_ioam_main_t;
93 extern nsh_md2_ioam_main_t nsh_md2_ioam_main;
96 * Primary h-b-h handler trace support
106 clib_error_t *nsh_md2_ioam_enable_disable (int has_trace_option,
112 int nsh_md2_ioam_trace_profile_setup (void);
114 int nsh_md2_ioam_trace_profile_cleanup (void);
115 extern void nsh_md2_ioam_interface_init (void);