1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(C) 2020 Marvell International Ltd.
5 #ifndef __INCLUDE_RTE_NODE_IP4_API_H__
6 #define __INCLUDE_RTE_NODE_IP4_API_H__
9 * @file rte_node_ip4_api.h
13 * All functions in this file may be changed or removed without prior notice.
15 * This API allows to do control path functions of ip4_* nodes
16 * like ip4_lookup, ip4_rewrite.
23 #include <rte_common.h>
24 #include <rte_compat.h>
27 * IP4 lookup next nodes.
29 enum rte_node_ip4_lookup_next {
30 RTE_NODE_IP4_LOOKUP_NEXT_REWRITE,
32 RTE_NODE_IP4_LOOKUP_NEXT_PKT_DROP,
33 /**< Packet drop node. */
34 RTE_NODE_IP4_LOOKUP_NEXT_MAX,
35 /**< Number of next nodes of lookup node. */
39 * Add ipv4 route to lookup table.
42 * IP address of route to be added.
44 * Depth of the rule to be added.
46 * Next hop id of the rule result to be added.
48 * Next node to redirect traffic to.
51 * 0 on success, negative otherwise.
54 int rte_node_ip4_route_add(uint32_t ip, uint8_t depth, uint16_t next_hop,
55 enum rte_node_ip4_lookup_next next_node);
58 * Add a next hop's rewrite data.
61 * Next hop id to add rewrite data to.
65 * Length of rewrite data.
67 * Destination port to redirect traffic to.
70 * 0 on success, negative otherwise.
73 int rte_node_ip4_rewrite_add(uint16_t next_hop, uint8_t *rewrite_data,
74 uint8_t rewrite_len, uint16_t dst_port);
80 #endif /* __INCLUDE_RTE_NODE_IP4_API_H__ */