FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
adj_midchain.h
Go to the documentation of this file.
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  * 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.
20  */
21 
22 #ifndef __ADJ_MIDCHAIN_H__
23 #define __ADJ_MIDCHAIN_H__
24 
25 #include <vnet/adj/adj.h>
26 
27 /**
28  * @brief Flags controlling the midchain adjacency
29  */
31 {
32  /**
33  * No flags
34  */
36 
37  /**
38  * Packets TX through the midchain do not increment the interface
39  * counters. This should be used when the adj is associated with an L2
40  * interface and that L2 interface is in a bridege domain. In that case
41  * the packet will have traversed the interface's TX node, and hence have
42  * been counted, before it traverses ths midchain
43  */
46 
47 /**
48  * @brief
49  * Convert an existing neighbour adjacency into a midchain
50  *
51  * @param adj_index
52  * The index of the neighbour adjacency.
53  *
54  * @param post_rewrite_node
55  * The VLIB graph node that provides the post-encap fixup.
56  * where 'fixup' is e.g., correcting chksum, length, etc.
57  *
58  * @param rewrite
59  * The rewrite.
60  */
61 extern void adj_nbr_midchain_update_rewrite(adj_index_t adj_index,
64  u8 *rewrite);
65 
66 /**
67  * @brief
68  * [re]stack a midchain. 'Stacking' is the act of forming parent-child
69  * relationships in the data-plane graph.
70  *
71  * @param adj_index
72  * The index of the midchain to stack
73  *
74  * @param dpo
75  * The parent DPO to stack onto (i.e. become a child of).
76  */
77 extern void adj_nbr_midchain_stack(adj_index_t adj_index,
78  const dpo_id_t *dpo);
79 
80 /**
81  * @brief
82  * unstack a midchain. This will break the chain between the midchain and
83  * the next graph section. This is a implemented as stack-on-drop
84  *
85  * @param adj_index
86  * The index of the midchain to stack
87  */
88 extern void adj_nbr_midchain_unstack(adj_index_t adj_index);
89 
90 /**
91  * @brief
92  * Module initialisation
93  */
94 extern void adj_midchain_module_init(void);
95 
96 /**
97  * @brief
98  * Format a midchain adjacency
99  */
100 extern u8* format_adj_midchain(u8* s, va_list *ap);
101 
102 #endif
void adj_nbr_midchain_unstack(adj_index_t adj_index)
unstack a midchain.
Definition: adj_midchain.c:471
adj_midchain_flag_t_
Midchain Adjacency sub-type.
Definition: adj_midchain.h:30
u8 * format_adj_midchain(u8 *s, va_list *ap)
Format a midchain adjacency.
Definition: adj_midchain.c:511
void adj_nbr_midchain_stack(adj_index_t adj_index, const dpo_id_t *dpo)
[re]stack a midchain.
Definition: adj_midchain.c:494
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:138
Packets TX through the midchain do not increment the interface counters.
Definition: adj_midchain.h:44
u32 adj_index_t
An index for adjacencies.
Definition: adj_types.h:30
void adj_nbr_midchain_update_rewrite(adj_index_t adj_index, adj_midchain_fixup_t fixup, adj_midchain_flag_t flags, u8 *rewrite)
Convert an existing neighbour adjacency into a midchain.
Definition: adj_midchain.c:371
void(* adj_midchain_fixup_t)(vlib_main_t *vm, struct ip_adjacency_t_ *adj, vlib_buffer_t *b0)
A function type for post-rewrite fixups on midchain adjacency.
Definition: lookup.h:167
enum adj_midchain_flag_t_ adj_midchain_flag_t
Midchain Adjacency sub-type.
unsigned char u8
Definition: types.h:56
void adj_midchain_module_init(void)
Module initialisation.
Definition: adj_midchain.c:587
u32 flags
Definition: vhost-user.h:75