CNDP  22.08.0
node_ip4_api.h File Reference
#include <cne_common.h>

Go to the source code of this file.

Enumerations

enum  cne_node_ip4_lookup_next { CNE_NODE_IP4_LOOKUP_NEXT_REWRITE , CNE_NODE_IP4_LOOKUP_NEXT_PKT_DROP , CNE_NODE_IP4_LOOKUP_NEXT_MAX }
 

Functions

int cne_node_ip4_route_add (uint32_t ip, uint8_t depth, uint16_t next_hop, enum cne_node_ip4_lookup_next next_node)
 
int cne_node_ip4_rewrite_add (uint16_t next_hop, uint8_t *rewrite_data, uint8_t rewrite_len, uint16_t dst_port)
 

Detailed Description

Warning
EXPERIMENTAL: All functions in this file may be changed or removed without prior notice.

This API allows to do control path functions of ip4_* nodes like ip4_lookup, ip4_rewrite.

Definition in file node_ip4_api.h.

Enumeration Type Documentation

◆ cne_node_ip4_lookup_next

IP4 lookup next nodes.

Enumerator
CNE_NODE_IP4_LOOKUP_NEXT_REWRITE 

Rewrite node.

CNE_NODE_IP4_LOOKUP_NEXT_PKT_DROP 

Packet drop node.

CNE_NODE_IP4_LOOKUP_NEXT_MAX 

Number of next nodes of lookup node.

Definition at line 28 of file node_ip4_api.h.

Function Documentation

◆ cne_node_ip4_route_add()

int cne_node_ip4_route_add ( uint32_t  ip,
uint8_t  depth,
uint16_t  next_hop,
enum cne_node_ip4_lookup_next  next_node 
)

Add ipv4 route to lookup table.

Parameters
ipIP address of route to be added.
depthDepth of the rule to be added.
next_hopNext hop id of the rule result to be added.
next_nodeNext node to redirect traffic to.
Returns
0 on success, negative otherwise.
Examples
examples/l3fwd-graph/fwd.c.

◆ cne_node_ip4_rewrite_add()

int cne_node_ip4_rewrite_add ( uint16_t  next_hop,
uint8_t *  rewrite_data,
uint8_t  rewrite_len,
uint16_t  dst_port 
)

Add a next hop's rewrite data.

Parameters
next_hopNext hop id to add rewrite data to.
rewrite_dataRewrite data.
rewrite_lenLength of rewrite data.
dst_portDestination port to redirect traffic to.
Returns
0 on success, negative otherwise.
Examples
examples/l3fwd-graph/fwd.c.