New upstream version 18.02
[deb_dpdk.git] / examples / ip_pipeline / pipeline / pipeline_firewall.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2015 Intel Corporation
3  */
4
5 #ifndef __INCLUDE_PIPELINE_FIREWALL_H__
6 #define __INCLUDE_PIPELINE_FIREWALL_H__
7
8 #include "pipeline.h"
9 #include "pipeline_firewall_be.h"
10
11 int
12 app_pipeline_firewall_add_rule(struct app_params *app,
13         uint32_t pipeline_id,
14         struct pipeline_firewall_key *key,
15         uint32_t priority,
16         uint32_t port_id);
17
18 int
19 app_pipeline_firewall_delete_rule(struct app_params *app,
20         uint32_t pipeline_id,
21         struct pipeline_firewall_key *key);
22
23 int
24 app_pipeline_firewall_add_bulk(struct app_params *app,
25                 uint32_t pipeline_id,
26                 struct pipeline_firewall_key *keys,
27                 uint32_t n_keys,
28                 uint32_t *priorities,
29                 uint32_t *port_ids);
30
31 int
32 app_pipeline_firewall_delete_bulk(struct app_params *app,
33         uint32_t pipeline_id,
34         struct pipeline_firewall_key *keys,
35         uint32_t n_keys);
36
37 int
38 app_pipeline_firewall_add_default_rule(struct app_params *app,
39         uint32_t pipeline_id,
40         uint32_t port_id);
41
42 int
43 app_pipeline_firewall_delete_default_rule(struct app_params *app,
44         uint32_t pipeline_id);
45
46 #ifndef APP_PIPELINE_FIREWALL_MAX_RULES_IN_FILE
47 #define APP_PIPELINE_FIREWALL_MAX_RULES_IN_FILE         65536
48 #endif
49
50 int
51 app_pipeline_firewall_load_file(char *filename,
52         struct pipeline_firewall_key *keys,
53         uint32_t *priorities,
54         uint32_t *port_ids,
55         uint32_t *n_keys,
56         uint32_t *line);
57
58 extern struct pipeline_type pipeline_firewall;
59
60 #endif