blob: a5f3bac6b99145aa925dd0a8c45f564ed3146e81 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
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
16#ifndef __included_vnet_input_acl_h__
17#define __included_vnet_input_acl_h__
18
19#include <vlib/vlib.h>
20#include <vnet/vnet.h>
21#include <vnet/classify/vnet_classify.h>
22
khemendra kumard7bfa0e2017-11-27 15:15:53 +053023typedef enum
24{
Ed Warnickecb9cada2015-12-08 15:45:58 -070025 INPUT_ACL_TABLE_IP4,
26 INPUT_ACL_TABLE_IP6,
27 INPUT_ACL_TABLE_L2,
28 INPUT_ACL_N_TABLES,
29} input_acl_table_id_t;
30
khemendra kumard7bfa0e2017-11-27 15:15:53 +053031typedef enum
32{
Ed Warnickecb9cada2015-12-08 15:45:58 -070033 ACL_NEXT_INDEX_DENY,
34 ACL_NEXT_INDEX_N_NEXT,
35} acl_next_index_t;
36
khemendra kumard7bfa0e2017-11-27 15:15:53 +053037typedef struct
38{
Ed Warnickecb9cada2015-12-08 15:45:58 -070039
40 /* classifier table vectors */
khemendra kumard7bfa0e2017-11-27 15:15:53 +053041 u32 *classify_table_index_by_sw_if_index[INPUT_ACL_N_TABLES];
Ed Warnickecb9cada2015-12-08 15:45:58 -070042
43 /* convenience variables */
khemendra kumard7bfa0e2017-11-27 15:15:53 +053044 vlib_main_t *vlib_main;
45 vnet_main_t *vnet_main;
46 vnet_classify_main_t *vnet_classify_main;
47 vnet_config_main_t *vnet_config_main[INPUT_ACL_N_TABLES];
Ed Warnickecb9cada2015-12-08 15:45:58 -070048} input_acl_main_t;
49
50extern input_acl_main_t input_acl_main;
51
52int vnet_set_input_acl_intfc (vlib_main_t * vm, u32 sw_if_index,
khemendra kumard7bfa0e2017-11-27 15:15:53 +053053 u32 ip4_table_index,
54 u32 ip6_table_index,
55 u32 l2_table_index, u32 is_add);
Ed Warnickecb9cada2015-12-08 15:45:58 -070056
57#endif /* __included_vnet_input_acl_h__ */
khemendra kumard7bfa0e2017-11-27 15:15:53 +053058
59/*
60 * fd.io coding-style-patch-verification: ON
61 *
62 * Local Variables:
63 * eval: (c-set-style "gnu")
64 * End:
65 */