CNDP 22.08.0
Loading...
Searching...
No Matches
cnet_arp.h File Reference
#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.

Enumerations

enum  { ARP_STATIC_FLAG = 0x01 , ARP_SEND_GRATUITOUS = 0x02 }

Functions

CNDP_API struct arp_entry * cnet_arp_alloc (void)
CNDP_API void cnet_arp_free (struct arp_entry *entry)
CNDP_API int cnet_arp_create (struct cnet *_cnet, uint32_t num_entries, uint32_t num_tbl8s)
CNDP_API int cnet_arp_destroy (struct cnet *cnet)
CNDP_API struct arp_entry * cnet_arp_add (int netif_idx, struct in_addr *addr, struct ether_addr *mac, int perm)
CNDP_API int cnet_arp_delete (struct in_addr *addr)
CNDP_API int cnet_arp_show (void)

Detailed Description

CNET ARP routines.

Definition in file cnet_arp.h.

Enumeration Type Documentation

◆ anonymous enum

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.

Function Documentation

◆ 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
entryThe 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
_cnetThe pointer to the current CNET structure.
num_entriesThe number of entries to allocate in ARP table, if zero use ARP_FIB_DEFAULT_ENTRIES.
num_tbl8sThe 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
cnetThe 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_idxThe netif structure index to assign the ARP entry.
addrThe IP address to add to the ARP table
macThe MAC address to add to the ARP table
permIf 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
addrThe 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