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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
15 #ifndef __included_policer_h__
16 #define __included_policer_h__
18 #include <vlib/vlib.h>
19 #include <vnet/vnet.h>
21 #include <vnet/policer/xlate.h>
22 #include <vnet/policer/police.h>
25 /* policer pool, aligned */
26 policer_read_response_type_st * policers;
28 /* config + template h/w policer instance parallel pools */
29 sse2_qos_pol_cfg_params_st * configs;
30 policer_read_response_type_st * policer_templates;
32 /* Config by name hash */
33 uword * policer_config_by_name;
35 /* Policer by sw_if_index vector */
36 u32 * policer_index_by_sw_if_index;
39 vlib_main_t * vlib_main;
40 vnet_main_t * vnet_main;
41 } vnet_policer_main_t;
43 vnet_policer_main_t vnet_policer_main;
46 VNET_POLICER_INDEX_BY_SW_IF_INDEX,
47 VNET_POLICER_INDEX_BY_OPAQUE,
48 VNET_POLICER_INDEX_BY_EITHER,
49 } vnet_policer_index_t;
53 VNET_POLICER_NEXT_TRANSMIT,
54 VNET_POLICER_NEXT_DROP,
56 } vnet_policer_next_t;
58 u8 * format_policer_instance (u8 * s, va_list * va);
60 #endif /* __included_policer_h__ */