#include <net/ethernet.h>
#include <stdint.h>
#include <sys/queue.h>
#include "cne_common.h"
#include "cnet_const.h"
#include "cne_inet.h"
#include "cnet_stk.h"
#include "cnet_route.h"
Go to the source code of this file.
|
CNDP_API int | cnet_route4_create (struct cnet *cnet, uint32_t num_rules, uint32_t num_tbl8s) |
| Create a IPv4 route instance. More...
|
|
CNDP_API int | cnet_route4_destroy (struct cnet *cnet) |
| Destroy the IPv4 routing instance. More...
|
|
CNDP_API struct rt4_entry * | cnet_route4_alloc (void) |
| Allocate a IPv4 route entry. More...
|
|
CNDP_API int | cnet_route4_alloc_bulk (struct rt4_entry **rt, int n) |
| Allocate a number of IPv4 route entries. More...
|
|
CNDP_API void | cnet_route4_free (struct rt4_entry *entry) |
| Free a IPv4 route entry. More...
|
|
CNDP_API void | cnet_route4_free_bulk (struct rt4_entry **entry, int n) |
| Free a bulk of IPv4 route entries. More...
|
|
CNDP_API void | cne_route4_timer (void) |
| Enable a IPv4 route entry timer to age entries. More...
|
|
CNDP_API int | cne_route4_notify (void) |
| Routine to call when a route notification is received. More...
|
|
CNDP_API int | cnet_route4_insert (int netif_idx, struct in_addr *dst, struct in_addr *netmask, struct in_addr *gate, uint8_t metric, uint16_t timo) |
| Insert IPv4 route into the routing table. More...
|
|
CNDP_API int | cnet_route4_delete (struct in_addr *ipaddr) |
| Delete a IPv4 route entry. More...
|
|
CNDP_API int | cnet_route4_get_bulk (uint64_t *nh, struct rt4_entry **rt, int n) |
| Get a bulk of route entries using the nexthop index values. More...
|
|
CNDP_API struct rt4_entry * | cnet_route4_get (uint64_t nh) |
| Return a single route entry given the nexthop index value. More...
|
|
CNDP_API int | cnet_route4_show (void) |
| Display the IPvr route entries. More...
|
|
CNET Route routines and constants for IPv4.
Definition in file cnet_route4.h.
◆ cnet_route4_create()
CNDP_API int cnet_route4_create |
( |
struct cnet * |
cnet, |
|
|
uint32_t |
num_rules, |
|
|
uint32_t |
num_tbl8s |
|
) |
| |
Create a IPv4 route instance.
- Parameters
-
cnet | The cnet pointer to use for creating the routing structure. |
num_rules | The total number of rules or routes to support. If zero use default RT4_DEFAULT_NUM_RULES |
num_tbl8s | Number of TBL8 entries in the FIB table to use. If zero use default RT4_DEFAULT_NUM_TBL8S |
- Returns
- -1 on error or 0 on success.
◆ cnet_route4_destroy()
CNDP_API int cnet_route4_destroy |
( |
struct cnet * |
cnet | ) |
|
Destroy the IPv4 routing instance.
- Parameters
-
cnet | The cnet pointer to use for creating the routing structure. |
- Returns
- -1 on error or 0 on success.
◆ cnet_route4_alloc()
CNDP_API struct rt4_entry* cnet_route4_alloc |
( |
void |
| ) |
|
Allocate a IPv4 route entry.
- Returns
- NULL on error or pointer to struct rt4_entry.
◆ cnet_route4_alloc_bulk()
CNDP_API int cnet_route4_alloc_bulk |
( |
struct rt4_entry ** |
rt, |
|
|
int |
n |
|
) |
| |
Allocate a number of IPv4 route entries.
- Parameters
-
rt | The pointer array to use for creating the number of entries. |
n | The number of entries to allocate. |
- Returns
- -1 on error or 0 on success.
◆ cnet_route4_free()
CNDP_API void cnet_route4_free |
( |
struct rt4_entry * |
entry | ) |
|
Free a IPv4 route entry.
- Parameters
-
entry | The route entry to free. |
- Returns
- N/A
◆ cnet_route4_free_bulk()
CNDP_API void cnet_route4_free_bulk |
( |
struct rt4_entry ** |
entry, |
|
|
int |
n |
|
) |
| |
Free a bulk of IPv4 route entries.
- Parameters
-
entry | The array of pointer to free route entries |
n | The number or route entries to free. |
- Returns
- N/A
◆ cne_route4_timer()
CNDP_API void cne_route4_timer |
( |
void |
| ) |
|
Enable a IPv4 route entry timer to age entries.
- Returns
- N/A
◆ cne_route4_notify()
CNDP_API int cne_route4_notify |
( |
void |
| ) |
|
Routine to call when a route notification is received.
- Returns
- -1 on error or 0 on success.
◆ cnet_route4_insert()
CNDP_API int cnet_route4_insert |
( |
int |
netif_idx, |
|
|
struct in_addr * |
dst, |
|
|
struct in_addr * |
netmask, |
|
|
struct in_addr * |
gate, |
|
|
uint8_t |
metric, |
|
|
uint16_t |
timo |
|
) |
| |
Insert IPv4 route into the routing table.
- Parameters
-
netif_idx | The netif index to insert into the routing table. |
dst | The destination IPv4 address to insert into the routing table. |
netmask | The destination IPv4 netmask. |
gate | The destination IPv4 gateway address. |
metric | The destination IPv4 metric. |
timo | The destination IPv4 route timeout. |
- Returns
- -1 on error or 0 on success.
◆ cnet_route4_delete()
CNDP_API int cnet_route4_delete |
( |
struct in_addr * |
ipaddr | ) |
|
Delete a IPv4 route entry.
- Parameters
-
ipaddr | The IPv4 destination address to delete. |
- Returns
- -1 on error or 0 on success.
◆ cnet_route4_get_bulk()
CNDP_API int cnet_route4_get_bulk |
( |
uint64_t * |
nh, |
|
|
struct rt4_entry ** |
rt, |
|
|
int |
n |
|
) |
| |
Get a bulk of route entries using the nexthop index values.
- Parameters
-
nh | The array of nexthop index values to find the route entries |
rt | The array to return the route entry pointers. |
n | The number of nexthop and route entries to return. |
- Returns
- -1 on error or 0 on success.
◆ cnet_route4_get()
CNDP_API struct rt4_entry* cnet_route4_get |
( |
uint64_t |
nh | ) |
|
Return a single route entry given the nexthop index value.
- Parameters
-
nh | The nexthop index value to be used to return the route entry. |
- Returns
- NULL on error or pointer to found route entry
◆ cnet_route4_show()
CNDP_API int cnet_route4_show |
( |
void |
| ) |
|
Display the IPvr route entries.
- Returns
- -1 on error or 0 on success.