policer: remove SSE2 prefix
[vpp.git] / src / vnet / policer / policer.h
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 <vlib/vlib.h>
19 #include <vnet/vnet.h>
20
21 #include <vnet/policer/xlate.h>
22 #include <vnet/policer/police.h>
23
24 typedef struct
25 {
26   /* policer pool, aligned */
27   policer_read_response_type_st *policers;
28
29   /* config + template h/w policer instance parallel pools */
30   qos_pol_cfg_params_st *configs;
31   policer_read_response_type_st *policer_templates;
32
33   /* Config by name hash */
34   uword *policer_config_by_name;
35
36   /* Policer by name hash */
37   uword *policer_index_by_name;
38
39   /* Policer by sw_if_index vector */
40   u32 *policer_index_by_sw_if_index;
41
42   /* convenience */
43   vlib_main_t *vlib_main;
44   vnet_main_t *vnet_main;
45 } vnet_policer_main_t;
46
47 extern vnet_policer_main_t vnet_policer_main;
48
49 extern vlib_combined_counter_main_t policer_counters[];
50
51 typedef enum
52 {
53   VNET_POLICER_INDEX_BY_SW_IF_INDEX,
54   VNET_POLICER_INDEX_BY_OPAQUE,
55   VNET_POLICER_INDEX_BY_EITHER,
56 } vnet_policer_index_t;
57
58 typedef enum
59 {
60   VNET_POLICER_NEXT_TRANSMIT,
61   VNET_POLICER_NEXT_DROP,
62   VNET_POLICER_N_NEXT,
63 } vnet_policer_next_t;
64
65 u8 *format_policer_instance (u8 * s, va_list * va);
66 clib_error_t *policer_add_del (vlib_main_t *vm, u8 *name,
67                                qos_pol_cfg_params_st *cfg, u32 *policer_index,
68                                u8 is_add);
69
70 #endif /* __included_policer_h__ */
71
72 /*
73  * fd.io coding-style-patch-verification: ON
74  *
75  * Local Variables:
76  * eval: (c-set-style "gnu")
77  * End:
78  */