FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
mactime.h
Go to the documentation of this file.
1 
2 /*
3  * mactime.h - time-based src mac address filtration
4  *
5  * Copyright (c) <current-year> <your-organization>
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at:
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #ifndef __included_mactime_h__
19 #define __included_mactime_h__
20 
21 #include <vnet/vnet.h>
22 #include <vnet/ip/ip.h>
23 #include <vnet/ethernet/ethernet.h>
24 //#include <vnet/ethernet/arp.h>
25 #include <vlib/counter.h>
26 
27 #include <vppinfra/hash.h>
28 #include <vppinfra/error.h>
29 #include <vppinfra/time_range.h>
30 #include <vppinfra/bihash_8_8.h>
31 
32 #include <mactime/mactime_device.h>
33 
34 typedef struct
35 {
36  union
37  {
40  };
42 
43 typedef struct
44 {
45  /* API message ID base */
47 
48  /* Timebase */
50 
51  /* cached sunday midnight */
53 
54  /* Lookup table */
55  clib_bihash_8_8_t lookup_table;
56 
57  /* Device table */
60 
61  /* Counters */
64 
65  /* config parameters */
69 
70  /* Once-only data structure create flag */
72 
73  /* arp cache copy, for "show mactime" */
75 
76  /* convenience */
81 
82 /* size for an hgw use-case */
83 #define MACTIME_NUM_BUCKETS 128
84 #define MACTIME_MEMORY_SIZE (256<<10)
85 
87 
90 
93 
94 /* Periodic function events */
95 #define MACTIME_EVENT1 1
96 #define MACTIME_EVENT2 2
97 #define MACTIME_EVENT_PERIODIC_ENABLE_DISABLE 3
98 
99 #endif /* __included_mactime_h__ */
100 
101 /*
102  * fd.io coding-style-patch-verification: ON
103  *
104  * Local Variables:
105  * eval: (c-set-style "gnu")
106  * End:
107  */
mactime_main_t::vnet_main
vnet_main_t * vnet_main
Definition: mactime.h:78
mactime_main_t::timebase
clib_timebase_t timebase
Definition: mactime.h:49
mactime_main_t::timezone_offset
i32 timezone_offset
Definition: mactime.h:68
mactime_main_t::device_table_epoch
u32 device_table_epoch
Definition: mactime.h:59
bihash_8_8.h
mactime_main_t::drop_counters
vlib_combined_counter_main_t drop_counters
Definition: mactime.h:63
mactime_device.h
mactime_main
mactime_main_t mactime_main
Definition: mactime.c:38
u16
unsigned short u16
Definition: types.h:57
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
mactime_main_t::msg_id_base
u16 msg_id_base
Definition: mactime.h:46
ethernet.h
mactime_main_t::ethernet_main
ethernet_main_t * ethernet_main
Definition: mactime.h:79
i32
signed int i32
Definition: types.h:77
mactime_device_t
Definition: mactime_device.h:25
error.h
mactime_main_t::lookup_table_num_buckets
u32 lookup_table_num_buckets
Definition: mactime.h:66
ethernet_main_t_
Definition: ethernet.h:289
clib_timebase_t
Definition: time_range.h:28
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
mactime_main_t::sunday_midnight
f64 sunday_midnight
Definition: mactime.h:52
uword
u64 uword
Definition: types.h:112
mactime_main_t::vlib_main
vlib_main_t * vlib_main
Definition: mactime.h:77
mactime_main_t::allow_counters
vlib_combined_counter_main_t allow_counters
Definition: mactime.h:62
f64
double f64
Definition: types.h:142
mactime_url_init
void mactime_url_init(vlib_main_t *vm)
Definition: builtins.c:158
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
mactime_main_t::lookup_table_memory_size
uword lookup_table_memory_size
Definition: mactime.h:67
mactime_main_t::devices
mactime_device_t * devices
Definition: mactime.h:58
mactime_tx_node
vlib_node_registration_t mactime_tx_node
(constructor) VLIB_REGISTER_NODE (mactime_tx_node)
Definition: node.c:383
mactime_send_create_entry_message
void mactime_send_create_entry_message(u8 *mac_address)
Create a lookup table entry for the indicated mac address.
Definition: mactime.c:248
vnet_main_t
Definition: vnet.h:76
time_range.h
mactime_node
vlib_node_registration_t mactime_node
(constructor) VLIB_REGISTER_NODE (mactime_node)
Definition: node.c:353
u64
unsigned long u64
Definition: types.h:89
vlib_combined_counter_main_t
A collection of combined counters.
Definition: counter.h:203
ip.h
u32
unsigned int u32
Definition: types.h:88
mactime_main_t
Definition: mactime.h:43
mactime_key_t
Definition: mactime.h:34
mactime_key_t::as_u64
u64 as_u64
Definition: mactime.h:39
mactime_main_t::arp_cache_copy
index_t * arp_cache_copy
Definition: mactime.h:74
vlib_main_t
Definition: main.h:102
hash.h
u8
unsigned char u8
Definition: types.h:56
mactime_main_t::lookup_table
clib_bihash_8_8_t lookup_table
Definition: mactime.h:55
counter.h
vnet.h
mactime_main_t::feature_initialized
int feature_initialized
Definition: mactime.h:71
mac_address
manual_print typedef u8 mac_address[6]
Definition: ethernet_types.api:19