mactime: add a "top" command to watch device stats
[vpp.git] / src / plugins / mactime / mactime_device.h
1 /*
2  * mactime_device.h - device table entry
3  *
4  * Copyright (c) 2018 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef included_mactime_device_h
19 #define included_mactime_device_h
20 #include <vppinfra/time_range.h>
21
22 #define MACTIME_RANGE_TYPE_DROP 0
23 #define MACTIME_RANGE_TYPE_ALLOW 1
24
25 typedef struct
26 {
27   u8 *device_name;
28   u8 mac_address[6];
29   u64 data_quota;
30   u64 data_used_in_range;
31   u32 flags;
32   u32 pool_index;
33   f64 last_seen;
34   clib_timebase_range_t *ranges;
35 } mactime_device_t;
36
37 /** Always drop packets from this device */
38 #define MACTIME_DEVICE_FLAG_STATIC_DROP         (1<<0)
39 #define MACTIME_DEVICE_FLAG_STATIC_ALLOW        (1<<1)
40 #define MACTIME_DEVICE_FLAG_DYNAMIC_DROP        (1<<2)
41 #define MACTIME_DEVICE_FLAG_DYNAMIC_ALLOW       (1<<3)
42 #define MACTIME_DEVICE_FLAG_DYNAMIC_ALLOW_QUOTA (1<<4)
43 #define MACTIME_DEVICE_FLAG_DROP_UDP_10001      (1<<5)
44
45 #endif /* included_mactime_device_h */
46
47 /*
48  * fd.io coding-style-patch-verification: ON
49  *
50  * Local Variables:
51  * eval: (c-set-style "gnu")
52  * End:
53  */