lib: remind experimental status in headers
[dpdk.git] / lib / librte_node / rte_node_ip4_api.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2020 Marvell International Ltd.
3  */
4
5 #ifndef __INCLUDE_RTE_NODE_IP4_API_H__
6 #define __INCLUDE_RTE_NODE_IP4_API_H__
7
8 /**
9  * @file rte_node_ip4_api.h
10  *
11  * @warning
12  * @b EXPERIMENTAL:
13  * All functions in this file may be changed or removed without prior notice.
14  *
15  * This API allows to do control path functions of ip4_* nodes
16  * like ip4_lookup, ip4_rewrite.
17  *
18  */
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 #include <rte_common.h>
24
25 /**
26  * IP4 lookup next nodes.
27  */
28 enum rte_node_ip4_lookup_next {
29         RTE_NODE_IP4_LOOKUP_NEXT_REWRITE,
30         /**< Rewrite node. */
31         RTE_NODE_IP4_LOOKUP_NEXT_PKT_DROP,
32         /**< Packet drop node. */
33         RTE_NODE_IP4_LOOKUP_NEXT_MAX,
34         /**< Number of next nodes of lookup node. */
35 };
36
37 /**
38  * Add ipv4 route to lookup table.
39  *
40  * @param ip
41  *   IP address of route to be added.
42  * @param depth
43  *   Depth of the rule to be added.
44  * @param next_hop
45  *   Next hop id of the rule result to be added.
46  * @param next_node
47  *   Next node to redirect traffic to.
48  *
49  * @return
50  *   0 on success, negative otherwise.
51  */
52 __rte_experimental
53 int rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop,
54                            enum rte_node_ip4_lookup_next next_node);
55
56 /**
57  * Add a next hop's rewrite data.
58  *
59  * @param next_hop
60  *   Next hop id to add rewrite data to.
61  * @param rewrite_data
62  *   Rewrite data.
63  * @param rewrite_len
64  *   Length of rewrite data.
65  * @param dst_port
66  *   Destination port to redirect traffic to.
67  *
68  * @return
69  *   0 on success, negative otherwise.
70  */
71 __rte_experimental
72 int rte_node_ip4_rewrite_add(uint16_t next_hop, uint8_t *rewrite_data,
73                              uint8_t rewrite_len, uint16_t dst_port);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif /* __INCLUDE_RTE_NODE_IP4_API_H__ */