FD.io VPP  v18.07-rc0-415-g6c78436
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 */
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
unsigned char u8
Definition: types.h:56
u32 p2p_ethernet_lookup(u32 parent_sw_if_index, u8 *client_mac)
Definition: p2p_ethernet.c:35
unsigned int u32
Definition: types.h:88
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
unsigned short u16
Definition: types.h:57
vnet_main_t * vnet_main
Definition: p2p_ethernet.h:35
u32 * p2p_ethernet_by_sw_if_index
Definition: p2p_ethernet.h:28
vlib_main_t * vm
Definition: buffer.c:294
u32 hw_if_index
Definition: p2p_ethernet.h:56
p2p_ethernet_main_t p2p_main
Definition: p2p_ethernet.c:23
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
vlib_main_t * vlib_main
Definition: p2p_ethernet.h:34
u64 uword
Definition: types.h:112
subint_config_t * p2p_subif_pool
Definition: p2p_ethernet.h:31