#include <cnet/cnet.h>
#include <net/cne_arp.h>
#include <net/cne_ip.h>
#include <net/ethernet.h>
#include <stdint.h>
#include "cne_inet.h"
#include "pktmbuf.h"
Go to the source code of this file.
CNET ARP routines.
Definition in file cnet_arp.h.
◆ anonymous enum
Enumerator |
---|
ARP_STATIC_FLAG | This entry does not timeout
|
ARP_SEND_GRATUITOUS | Send a gratuitous ARP packet
|
Definition at line 34 of file cnet_arp.h.
◆ cnet_arp_alloc()
CNDP_API struct arp_entry* cnet_arp_alloc |
( |
void |
| ) |
|
Allocate an ARP entry
- Returns
- NULL on error, otherwise pointer to ARP entry.
◆ cnet_arp_free()
CNDP_API void cnet_arp_free |
( |
struct arp_entry * |
entry | ) |
|
Free an ARP entry
- Parameters
-
entry | The ARP entry to free. |
◆ cnet_arp_create()
CNDP_API int cnet_arp_create |
( |
struct cnet * |
_cnet, |
|
|
uint32_t |
num_entries, |
|
|
uint32_t |
num_tbl8s |
|
) |
| |
Create the ARP table and structure to hold ARP information.
- Parameters
-
_cnet | The pointer to the current CNET structure. |
num_entries | The number of entries to allocate in ARP table, if zero use ARP_FIB_DEFAULT_ENTRIES. |
num_tbl8s | The number of table entries to allocate in ARP table, if zero use ARP_FIB_DEFAULT_NUM_TBLS8. |
- Returns
- 0 on success or -1 on error.
◆ cnet_arp_destroy()
CNDP_API int cnet_arp_destroy |
( |
struct cnet * |
cnet | ) |
|
Destroy the ARP table and structure to hold ARP information.
- Parameters
-
cnet | The pointer to the current CNET structure. |
- Returns
- 0 on success or -1 on error.
◆ cnet_arp_add()
CNDP_API struct arp_entry* cnet_arp_add |
( |
int |
netif_idx, |
|
|
struct in_addr * |
addr, |
|
|
struct ether_addr * |
mac, |
|
|
int |
perm |
|
) |
| |
Add an ARP entry to the ARP table. If perm is set then create a static entry.
- Parameters
-
netif_idx | The netif structure index to assign the ARP entry. |
addr | The IP address to add to the ARP table |
mac | The MAC address to add to the ARP table |
perm | If non-zero then add the entry to the ARP table as a static entry. |
- Returns
- -1 on error or 0 on success
◆ cnet_arp_delete()
CNDP_API int cnet_arp_delete |
( |
struct in_addr * |
addr | ) |
|
Delete an ARP entry
- Parameters
-
addr | The IP address to delete |
- Returns
- 0 on success or -1 on error
◆ cnet_arp_show()
CNDP_API int cnet_arp_show |
( |
void |
| ) |
|
Show the stack entry ARP table, each stack has an ARP table
- Returns
- 0 on success or -1 on error