examples/ip_pipeline: add action profile objects
[dpdk.git] / examples / ip_pipeline / action.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2018 Intel Corporation
3  */
4
5 #ifndef _INCLUDE_ACTION_H_
6 #define _INCLUDE_ACTION_H_
7
8 #include <sys/queue.h>
9
10 #include <rte_port_in_action.h>
11 #include <rte_table_action.h>
12
13 #include "common.h"
14
15 /**
16  * Input port action
17  */
18 struct port_in_action_profile_params {
19         uint64_t action_mask;
20         struct rte_port_in_action_fltr_config fltr;
21         struct rte_port_in_action_lb_config lb;
22 };
23
24 struct port_in_action_profile {
25         TAILQ_ENTRY(port_in_action_profile) node;
26         char name[NAME_SIZE];
27         struct port_in_action_profile_params params;
28         struct rte_port_in_action_profile *ap;
29 };
30
31 TAILQ_HEAD(port_in_action_profile_list, port_in_action_profile);
32
33 int
34 port_in_action_profile_init(void);
35
36 struct port_in_action_profile *
37 port_in_action_profile_find(const char *name);
38
39 struct port_in_action_profile *
40 port_in_action_profile_create(const char *name,
41         struct port_in_action_profile_params *params);
42
43 /**
44  * Table action
45  */
46 struct table_action_profile_params {
47         uint64_t action_mask;
48         struct rte_table_action_common_config common;
49         struct rte_table_action_mtr_config mtr;
50         struct rte_table_action_tm_config tm;
51         struct rte_table_action_encap_config encap;
52         struct rte_table_action_nat_config nat;
53         struct rte_table_action_ttl_config ttl;
54         struct rte_table_action_stats_config stats;
55 };
56
57 struct table_action_profile {
58         TAILQ_ENTRY(table_action_profile) node;
59         char name[NAME_SIZE];
60         struct table_action_profile_params params;
61         struct rte_table_action_profile *ap;
62 };
63
64 TAILQ_HEAD(table_action_profile_list, table_action_profile);
65
66 int
67 table_action_profile_init(void);
68
69 struct table_action_profile *
70 table_action_profile_find(const char *name);
71
72 struct table_action_profile *
73 table_action_profile_create(const char *name,
74         struct table_action_profile_params *params);
75
76 #endif /* _INCLUDE_ACTION_H_ */