FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
dvr_dpo.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 #ifndef __DVR_DPO_H__
17 #define __DVR_DPO_H__
18 
19 #include <vnet/dpo/dpo.h>
20 
21 /**
22  * Control how the reinject is performed
23  */
24 typedef enum dvr_dpo_reinject_t_
25 {
28 } __clib_packed dvr_dpo_reinject_t;
29 
30 /**
31  * @brief
32  * The DVR DPO. Used as the resolving object for a DVR route.
33  * This is used, in place of the usual L3 Adjacency, to retransmit
34  * the packet with the original L2 header intact but also to run L3 features.
35  * After running L3 features the packet is re-injected back into the L2 path
36  * so it can pick up the necessary VLAN tags of the egress interface.
37  * This re-injection is done with an output feature.
38  */
39 typedef struct dvr_dpo_t_
40 {
41  /**
42  * The Software interface index that the packets will output on
43  */
45 
46  /**
47  * The protocol of packets using this DPO
48  */
50 
51  /**
52  * Control for how the re-inject is performed
53  */
55 
56  /**
57  * number of locks.
58  */
60 } dvr_dpo_t;
61 
62 /* 8 bytes is a factor of cache line size so this struct will never span */
64 
66  dpo_proto_t dproto,
67  dpo_id_t *dpo);
68 
69 extern void dvr_dpo_module_init(void);
70 
71 /**
72  * @brief pool of all interface DPOs
73  */
74 extern dvr_dpo_t *dvr_dpo_pool;
75 
76 static inline dvr_dpo_t *
78 {
80 }
81 
82 #endif
dvr_dpo_t_::dd_locks
u16 dd_locks
number of locks.
Definition: dvr_dpo.h:59
dvr_dpo_module_init
void dvr_dpo_module_init(void)
Definition: dvr_dpo.c:259
dpo_proto_t
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
pool_elt_at_index
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:553
dvr_dpo_add_or_lock
void dvr_dpo_add_or_lock(u32 sw_if_index, dpo_proto_t dproto, dpo_id_t *dpo)
Definition: dvr_dpo.c:91
dvr_dpo_reinject_t_
dvr_dpo_reinject_t_
Control how the reinject is performed.
Definition: dvr_dpo.h:24
u16
unsigned short u16
Definition: types.h:57
dvr_dpo_t
struct dvr_dpo_t_ dvr_dpo_t
The DVR DPO.
dpo.h
dvr_dpo_t_::dd_proto
dpo_proto_t dd_proto
The protocol of packets using this DPO.
Definition: dvr_dpo.h:49
dvr_dpo_get
static dvr_dpo_t * dvr_dpo_get(index_t index)
Definition: dvr_dpo.h:77
STATIC_ASSERT_SIZEOF
STATIC_ASSERT_SIZEOF(dvr_dpo_t, 8)
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
dvr_dpo_pool
dvr_dpo_t * dvr_dpo_pool
pool of all interface DPOs
Definition: dvr_dpo.c:23
dvr_dpo_t_::dd_reinject
dvr_dpo_reinject_t dd_reinject
Control for how the re-inject is performed.
Definition: dvr_dpo.h:54
DVR_REINJECT_L3
@ DVR_REINJECT_L3
Definition: dvr_dpo.h:27
index
u32 index
Definition: flow_types.api:221
u32
unsigned int u32
Definition: types.h:88
dvr_dpo_reinject_t
enum dvr_dpo_reinject_t_ dvr_dpo_reinject_t
Control how the reinject is performed.
dvr_dpo_t_::dd_sw_if_index
u32 dd_sw_if_index
The Software interface index that the packets will output on.
Definition: dvr_dpo.h:44
DVR_REINJECT_L2
@ DVR_REINJECT_L2
Definition: dvr_dpo.h:26
dvr_dpo_t_
The DVR DPO.
Definition: dvr_dpo.h:39
dpo_id_t_
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:172
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34