FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
p2p_ethernet.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 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 #ifndef included_vnet_p2p_ethernet_h
16 #define included_vnet_p2p_ethernet_h
17 
18 #include <vnet/vnet.h>
19 #include <vnet/ethernet/ethernet.h>
20 
21 
22 typedef struct {
23  /**
24  * Hash mapping parent sw_if_index and client mac address to p2p_ethernet sub-interface
25  */
27 
29 
30  // Pool of p2p subifs;
32 
33  /* convenience */
37 
39 
40 typedef struct
41 {
44  u8 client_mac[6];
46 
47 /**
48  * @brief Key struct for P2P Ethernet
49  * Key fields: parent sw_if_index and client mac address
50  * all fields in NET byte order
51  */
52 
53 typedef struct {
54  u8 mac[6];
55  u16 pad1; // padding for u64 mac address
57  u32 pad2; // padding for u64
58 } p2p_key_t;
59 
60 u32 p2p_ethernet_lookup (u32 parent_sw_if_index, u8* client_mac);
61 int p2p_ethernet_add_del (vlib_main_t * vm, u32 parent_if_index, u8 * client_mac, u32 sub_id, int is_add, u32 *p2pe_if_index);
62 
63 #endif /* included_vnet_p2p_ethernet_h */
mac
vl_api_mac_address_t mac
Definition: l2.api:559
p2p_ethernet_main_t::p2p_subif_pool
subint_config_t * p2p_subif_pool
Definition: p2p_ethernet.h:31
p2p_ethernet_main_t::p2p_ethernet_by_key
uword * p2p_ethernet_by_key
Hash mapping parent sw_if_index and client mac address to p2p_ethernet sub-interface.
Definition: p2p_ethernet.h:26
p2p_ethernet_lookup
u32 p2p_ethernet_lookup(u32 parent_sw_if_index, u8 *client_mac)
Definition: p2p_ethernet.c:35
u16
unsigned short u16
Definition: types.h:57
p2p_key_t::pad1
u16 pad1
Definition: p2p_ethernet.h:55
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
ethernet.h
uword
u64 uword
Definition: types.h:112
p2p_ethernet_main_t::vnet_main
vnet_main_t * vnet_main
Definition: p2p_ethernet.h:35
p2p_ethernet_trace_t::p2pe_sw_if_index
u32 p2pe_sw_if_index
Definition: p2p_ethernet.h:43
p2p_key_t
Key struct for P2P Ethernet Key fields: parent sw_if_index and client mac address all fields in NET b...
Definition: p2p_ethernet.h:53
p2p_key_t::pad2
u32 pad2
Definition: p2p_ethernet.h:57
vnet_main_t
Definition: vnet.h:76
p2p_ethernet_trace_t
Definition: p2p_ethernet.h:40
p2p_ethernet_trace_t::sw_if_index
u32 sw_if_index
Definition: p2p_ethernet.h:42
p2p_ethernet_main_t::p2p_ethernet_by_sw_if_index
u32 * p2p_ethernet_by_sw_if_index
Definition: p2p_ethernet.h:28
u32
unsigned int u32
Definition: types.h:88
p2p_key_t::hw_if_index
u32 hw_if_index
Definition: p2p_ethernet.h:56
vlib_main_t
Definition: main.h:102
p2p_main
p2p_ethernet_main_t p2p_main
Definition: p2p_ethernet.c:23
p2p_ethernet_main_t::vlib_main
vlib_main_t * vlib_main
Definition: p2p_ethernet.h:34
u8
unsigned char u8
Definition: types.h:56
p2p_ethernet_add_del
int p2p_ethernet_add_del(vlib_main_t *vm, u32 parent_if_index, u8 *client_mac, u32 sub_id, int is_add, u32 *p2pe_if_index)
Definition: p2p_ethernet.c:50
vnet.h
subint_config_t
Definition: ethernet.h:208
p2p_ethernet_main_t
Definition: p2p_ethernet.h:22