FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ila.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 ILA_H
17 #define ILA_H
18 
19 #include <vnet/vnet.h>
20 #include <vnet/ip/ip.h>
21 #include <vnet/fib/fib_node.h>
22 
23 #include <vppinfra/bihash_24_8.h>
25 
26 #define ila_foreach_type \
27  _(IID, 0, "iid") \
28  _(LUID, 1, "luid") \
29  _(VNID4, 2, "vnid-ip4") \
30  _(VNID6, 3, "vnid-ip6") \
31  _(VNIDM, 4, "vnid-multicast")
32 
33 typedef enum {
34 #define _(i,n,s) ILA_TYPE_##i = n,
36 #undef _
37 } ila_type_t;
38 
39 #define ila_csum_foreach_type \
40 _(NO_ACTION, 0, "no-action") \
41 _(NEUTRAL_MAP, 1, "neutral-map") \
42 _(ADJUST_TRANSPORT, 2, "adjust-transport")
43 
44 typedef enum {
45 #define _(i,n,s) ILA_CSUM_MODE_##i = n,
47 #undef _
50 
51 #define ila_foreach_direction \
52 _(BIDIR, 0, "bidir") \
53 _(SIR2ILA, 1, "sir2ila") \
54 _(ILA2SIR, 2, "ila2sir")
55 
56 typedef enum {
57 #define _(i,n,s) ILA_DIR_##i = n,
59 #undef _
61 
62 typedef struct {
63  /**
64  * Fib Node base class
65  */
68  ip6_address_t sir_address;
69  ip6_address_t ila_address;
70  ip6_address_t next_hop;
73 
74  /**
75  * The FIB entry index for the next-hop
76  */
78 
79  /**
80  * The child index on the FIB entry
81  */
83 
84  /**
85  * The next DPO in the graph to follow
86  */
88 } ila_entry_t;
89 
90 typedef struct {
91  ila_entry_t *entries; //Pool of ILA entries
92 
95  clib_bihash_24_8_t id_to_entry_table;
96 
98 } ila_main_t;
99 
100 
101 typedef struct {
103  ip6_address_t sir_address;
104  ip6_address_t next_hop_address;
112 
114 int ila_interface (u32 sw_if_index, u8 disable);
115 
116 #endif //ILA_H
bihash_24_8.h
ila_foreach_type
#define ila_foreach_type
Definition: ila.h:26
ila_entry_t::ila_dpo
dpo_id_t ila_dpo
The next DPO in the graph to follow.
Definition: ila.h:87
ila_interface
int ila_interface(u32 sw_if_index, u8 disable)
Definition: ila.c:822
ila_main_t::ip6_lookup_next_index
u32 ip6_lookup_next_index
Definition: ila.h:97
ila_direction_t
ila_direction_t
Definition: ila.h:56
bihash_template.h
ILA_CSUM_N_TYPES
@ ILA_CSUM_N_TYPES
Definition: ila.h:48
ila_entry_t::dir
ila_direction_t dir
Definition: ila.h:72
fib_node.h
ila_add_del_entry_args_t::dir
ila_direction_t dir
Definition: ila.h:109
ila_main_t::lookup_table_nbuckets
u64 lookup_table_nbuckets
Definition: ila.h:93
ila_entry_t::type
ila_type_t type
Definition: ila.h:67
ila_add_del_entry_args_t::csum_mode
ila_csum_mode_t csum_mode
Definition: ila.h:108
ila_add_del_entry
int ila_add_del_entry(ila_add_del_entry_args_t *args)
Definition: ila.c:627
ila_entry_t::sir_address
ip6_address_t sir_address
Definition: ila.h:68
ila_type_t
ila_type_t
Definition: ila.h:33
ila_entry_t
Definition: ila.h:62
ila_add_del_entry_args_t::is_del
u8 is_del
Definition: ila.h:110
ila_add_del_entry_args_t::type
ila_type_t type
Definition: ila.h:102
ila_csum_mode_t
ila_csum_mode_t
Definition: ila.h:44
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
ila_add_del_entry_args_t::sir_address
ip6_address_t sir_address
Definition: ila.h:103
ila_entry_t::ila_address
ip6_address_t ila_address
Definition: ila.h:69
ila_add_del_entry_args_t::local_adj_index
u32 local_adj_index
Definition: ila.h:107
ila_add_del_entry_args_t
Definition: ila.h:101
ila_entry_t::ila_fib_node
fib_node_t ila_fib_node
Fib Node base class.
Definition: ila.h:66
ila_main_t::entries
ila_entry_t * entries
Definition: ila.h:91
ila_add_del_entry_args_t::vnid
u32 vnid
Definition: ila.h:106
u64
unsigned long u64
Definition: types.h:89
ila_entry_t::next_hop_child_index
u32 next_hop_child_index
The child index on the FIB entry.
Definition: ila.h:82
ila_entry_t::next_hop
ip6_address_t next_hop
Definition: ila.h:70
ip.h
u32
unsigned int u32
Definition: types.h:88
ila_main_t::id_to_entry_table
clib_bihash_24_8_t id_to_entry_table
Definition: ila.h:95
fib_node_t_
An node in the FIB graph.
Definition: fib_node.h:301
ila_main_t
Definition: ila.h:90
ila_main_t::lookup_table_size
u64 lookup_table_size
Definition: ila.h:94
u8
unsigned char u8
Definition: types.h:56
ila_entry_t::next_hop_fib_entry_index
fib_node_index_t next_hop_fib_entry_index
The FIB entry index for the next-hop.
Definition: ila.h:77
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
ila_add_del_entry_args_t::locator
u64 locator
Definition: ila.h:105
vnet.h
ila_foreach_direction
#define ila_foreach_direction
Definition: ila.h:51
ila_csum_foreach_type
#define ila_csum_foreach_type
Definition: ila.h:39
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
ila_entry_t::csum_mode
ila_csum_mode_t csum_mode
Definition: ila.h:71
ila_add_del_entry_args_t::next_hop_address
ip6_address_t next_hop_address
Definition: ila.h:104