blob: e3308f3a302d73e85a8da8e6f33fea3e7087cefd [file] [log] [blame]
Juraj Sloboda506b2452016-08-07 23:45:24 -07001/*
2 * Copyright (c) 2016 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_flow_classify_h__
17#define __included_vnet_flow_classify_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{
Juraj Sloboda506b2452016-08-07 23:45:24 -070025 FLOW_CLASSIFY_TABLE_IP4,
26 FLOW_CLASSIFY_TABLE_IP6,
27 FLOW_CLASSIFY_N_TABLES,
28} flow_classify_table_id_t;
29
khemendra kumard7bfa0e2017-11-27 15:15:53 +053030typedef enum
31{
Juraj Sloboda506b2452016-08-07 23:45:24 -070032 FLOW_CLASSIFY_NEXT_INDEX_DROP,
33 FLOW_CLASSIFY_NEXT_INDEX_N_NEXT,
34} flow_classify_next_index_t;
35
khemendra kumard7bfa0e2017-11-27 15:15:53 +053036typedef struct
37{
Juraj Sloboda506b2452016-08-07 23:45:24 -070038 /* Classifier table vectors */
khemendra kumard7bfa0e2017-11-27 15:15:53 +053039 u32 *classify_table_index_by_sw_if_index[FLOW_CLASSIFY_N_TABLES];
Juraj Sloboda506b2452016-08-07 23:45:24 -070040
41 /* Convenience variables */
khemendra kumard7bfa0e2017-11-27 15:15:53 +053042 vlib_main_t *vlib_main;
43 vnet_main_t *vnet_main;
44 vnet_classify_main_t *vnet_classify_main;
45 vnet_config_main_t *vnet_config_main[FLOW_CLASSIFY_N_TABLES];
Juraj Sloboda506b2452016-08-07 23:45:24 -070046} flow_classify_main_t;
47
Dave Wallace71612d62017-10-24 01:32:41 -040048extern flow_classify_main_t flow_classify_main;
Juraj Sloboda506b2452016-08-07 23:45:24 -070049
50int vnet_set_flow_classify_intfc (vlib_main_t * vm, u32 sw_if_index,
khemendra kumard7bfa0e2017-11-27 15:15:53 +053051 u32 ip4_table_index, u32 ip6_table_index,
52 u32 is_add);
Juraj Sloboda506b2452016-08-07 23:45:24 -070053
54#endif /* __included_vnet_flow_classify_h__ */
khemendra kumard7bfa0e2017-11-27 15:15:53 +053055
56/*
57 * fd.io coding-style-patch-verification: ON
58 *
59 * Local Variables:
60 * eval: (c-set-style "gnu")
61 * End:
62 */