FD.io VPP  v20.09-64-g4f7b92f0a
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 {
79  return (pool_elt_at_index(dvr_dpo_pool, index));
80 }
81 
82 #endif
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:41
static dvr_dpo_t * dvr_dpo_get(index_t index)
Definition: dvr_dpo.h:77
u16 dd_locks
number of locks.
Definition: dvr_dpo.h:59
STATIC_ASSERT_SIZEOF(dvr_dpo_t, 8)
enum dvr_dpo_reinject_t_ dvr_dpo_reinject_t
Control how the reinject is performed.
void dvr_dpo_add_or_lock(u32 sw_if_index, dpo_proto_t dproto, dpo_id_t *dpo)
Definition: dvr_dpo.c:91
unsigned int u32
Definition: types.h:88
enum dpo_proto_t_ dpo_proto_t
Data path protocol.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
Definition: dpo.h:170
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
Definition: pool.h:534
unsigned short u16
Definition: types.h:57
struct dvr_dpo_t_ dvr_dpo_t
The DVR DPO.
dpo_proto_t dd_proto
The protocol of packets using this DPO.
Definition: dvr_dpo.h:49
u32 dd_sw_if_index
The Software interface index that the packets will output on.
Definition: dvr_dpo.h:44
void dvr_dpo_module_init(void)
Definition: dvr_dpo.c:258
dvr_dpo_t * dvr_dpo_pool
pool of all interface DPOs
Definition: dvr_dpo.c:23
dvr_dpo_reinject_t dd_reinject
Control for how the re-inject is performed.
Definition: dvr_dpo.h:54
The DVR DPO.
Definition: dvr_dpo.h:39
u32 index
Definition: flow_types.api:221
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:33
dvr_dpo_reinject_t_
Control how the reinject is performed.
Definition: dvr_dpo.h:24