FD.io VPP  v21.10.1-2-g0a485f517
Vector Packet Processing
policer.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_policer_h__
16 #define __included_policer_h__
17 
18 #include <stdbool.h>
19 
20 #include <vlib/vlib.h>
21 #include <vnet/vnet.h>
22 
23 #include <vnet/policer/xlate.h>
24 #include <vnet/policer/police.h>
25 
26 typedef struct
27 {
28  /* policer pool, aligned */
30 
31  /* config + template h/w policer instance parallel pools */
34 
35  /* Config by name hash */
37 
38  /* Policer by name hash */
40 
41  /* Policer by sw_if_index vector */
43 
44  /* convenience */
47 
49 
50  /* frame queue for thread handoff */
52 
55 
57 
59 
61 
62 typedef enum
63 {
68 
69 u8 *format_policer_instance (u8 * s, va_list * va);
71  qos_pol_cfg_params_st *cfg, u32 *policer_index,
72  u8 is_add);
73 int policer_bind_worker (u8 *name, u32 worker, bool bind);
75 
76 #endif /* __included_policer_h__ */
77 
78 /*
79  * fd.io coding-style-patch-verification: ON
80  *
81  * Local Variables:
82  * eval: (c-set-style "gnu")
83  * End:
84  */
vlib.h
format_policer_instance
u8 * format_policer_instance(u8 *s, va_list *va)
Definition: policer.c:201
vnet_policer_main_t::configs
qos_pol_cfg_params_st * configs
Definition: policer.h:32
vnet_policer_main_t
Definition: policer.h:26
vnet_policer_main_t::policer_config_by_name
uword * policer_config_by_name
Definition: policer.h:36
policer_add_del
clib_error_t * policer_add_del(vlib_main_t *vm, u8 *name, qos_pol_cfg_params_st *cfg, u32 *policer_index, u8 is_add)
Definition: policer.c:53
name
string name[64]
Definition: fib.api:25
vlib_log_class_t
u32 vlib_log_class_t
Definition: vlib.h:52
policer_t
Definition: police.h:73
policer_input
int policer_input(u8 *name, u32 sw_if_index, bool apply)
Definition: policer.c:169
vnet_policer_next_t
vnet_policer_next_t
Definition: policer.h:62
u16
unsigned short u16
Definition: types.h:57
VNET_POLICER_NEXT_DROP
@ VNET_POLICER_NEXT_DROP
Definition: policer.h:64
qos_pol_cfg_params_st_
Definition: xlate.h:115
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
vnet_policer_main_t::vnet_main
vnet_main_t * vnet_main
Definition: policer.h:46
vnet_policer_main_t::log_class
vlib_log_class_t log_class
Definition: policer.h:48
policer_counters
vlib_combined_counter_main_t policer_counters[]
Definition: policer.c:37
vnet_policer_main_t::vlib_main
vlib_main_t * vlib_main
Definition: policer.h:45
policer_bind_worker
int policer_bind_worker(u8 *name, u32 worker, bool bind)
Definition: policer.c:138
uword
u64 uword
Definition: types.h:112
xlate.h
vnet_policer_main_t::policer_index_by_sw_if_index
u32 * policer_index_by_sw_if_index
Definition: policer.h:42
apply
static int apply(phash_main_t *pm, u32 tail, u32 rollback)
Definition: phash.c:408
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
vnet_policer_main_t::policer_templates
policer_t * policer_templates
Definition: policer.h:33
vnet_main_t
Definition: vnet.h:76
vlib_combined_counter_main_t
A collection of combined counters.
Definition: counter.h:203
police.h
u32
unsigned int u32
Definition: types.h:88
VNET_POLICER_NEXT_HANDOFF
@ VNET_POLICER_NEXT_HANDOFF
Definition: policer.h:65
vnet_policer_main
vnet_policer_main_t vnet_policer_main
Definition: policer.c:22
vlib_main_t
Definition: main.h:102
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vnet.h
vnet_policer_main_t::policers
policer_t * policers
Definition: policer.h:29
policer_input_node
vlib_node_registration_t policer_input_node
(constructor) VLIB_REGISTER_NODE (policer_input_node)
Definition: node_funcs.c:262
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vnet_policer_main_t::fq_index
u32 fq_index
Definition: policer.h:51
vnet_policer_main_t::policer_index_by_name
uword * policer_index_by_name
Definition: policer.h:39
vnet_policer_main_t::msg_id_base
u16 msg_id_base
Definition: policer.h:53
VNET_POLICER_N_NEXT
@ VNET_POLICER_N_NEXT
Definition: policer.h:66