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 * Midchain Adjacency sub-type. These adjs represent an L3 peer on a
17 * tunnel interface. The tunnel's adjacency is thus not the end of the chain,
18 * and needs to stack on/link to another chain (or portion of the graph) to
19 * reach the tunnel's destination.
22 #ifndef __ADJ_MIDCHAIN_H__
23 #define __ADJ_MIDCHAIN_H__
25 #include <vnet/adj/adj.h>
29 * Convert an existing neighbour adjacency into a midchain
32 * The index of the neighbour adjacency.
34 * @param post_rewrite_node
35 * The VLIB graph node that provides the post-encap fixup.
36 * where 'fixup' is e.g., correcting chksum, length, etc.
41 extern void adj_nbr_midchain_update_rewrite(adj_index_t adj_index,
42 u32 post_rewrite_node,
47 * [re]stack a midchain. 'Stacking' is the act of forming parent-child
48 * relationships in the data-plane graph.
51 * The index of the midchain to stack
54 * The parent DPO to stack onto (i.e. become a child of).
56 extern void adj_nbr_midchain_stack(adj_index_t adj_index,
61 * Module initialisation
63 extern void adj_midchain_module_init(void);
67 * Format a midchain adjacency
69 extern u8* format_adj_midchain(u8* s, va_list *ap);