1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(C) 2023 Marvell.
*/
#ifndef __INCLUDE_RTE_NODE_IP6_API_H__
#define __INCLUDE_RTE_NODE_IP6_API_H__
/**
* @file rte_node_ip6_api.h
*
* @warning
* @b EXPERIMENTAL:
* All functions in this file may be changed or removed without prior notice.
*
* This API allows to do control path functions of ip6_* nodes
* like ip6_lookup, ip6_rewrite.
*/
#include <rte_common.h>
#include <rte_compat.h>
#include <rte_fib6.h>
#include <rte_ip6.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* IP6 lookup next nodes.
*/
enum rte_node_ip6_lookup_next {
RTE_NODE_IP6_LOOKUP_NEXT_REWRITE,
/**< Rewrite node. */
RTE_NODE_IP6_LOOKUP_NEXT_PKT_DROP,
/**< Packet drop node. */
};
/**
* Add IPv6 route to lookup table.
*
* @param ip
* IPv6 address of route to be added.
* @param depth
* Depth of the rule to be added.
* @param next_hop
* Next hop id of the rule result to be added.
* @param next_node
* Next node to redirect traffic to.
*
* @return
* 0 on success, negative otherwise.
*/
__rte_experimental
int rte_node_ip6_route_add(const struct rte_ipv6_addr *ip, uint8_t depth, uint16_t next_hop,
enum rte_node_ip6_lookup_next next_node);
/**
* Add a next hop's rewrite data.
*
* @param next_hop
* Next hop id to add rewrite data to.
* @param rewrite_data
* Rewrite data.
* @param rewrite_len
* Length of rewrite data.
* @param dst_port
* Destination port to redirect traffic to.
*
* @return
* 0 on success, negative otherwise.
*/
__rte_experimental
int rte_node_ip6_rewrite_add(uint16_t next_hop, uint8_t *rewrite_data,
uint8_t rewrite_len, uint16_t dst_port);
/**
* Create ipv6 FIB.
*
* @param socket
* NUMA socket for FIB memory allocation.
* @param conf
* Structure containing FIB configuration.
*
* @return
* 0 on success, negative otherwise.
*/
__rte_experimental
int rte_node_ip6_fib_create(int socket, struct rte_fib6_conf *conf);
/**
* Add IPv6 route to FIB.
*
* @param ip
* IPv6 address of route to be added.
* @param depth
* Depth of the rule to be added.
* @param next_hop
* Next hop id of the rule result to be added.
* @param next_node
* Next node to redirect traffic to.
*
* @return
* 0 on success, negative otherwise.
*/
__rte_experimental
int rte_node_ip6_fib_route_add(const struct rte_ipv6_addr *ip, uint8_t depth, uint16_t next_hop,
enum rte_node_ip6_lookup_next next_node);
#ifdef __cplusplus
}
#endif
#endif /* __INCLUDE_RTE_NODE_IP6_API_H__ */
|