KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches

API for the Neighbor Discovery Protocol. More...

Functions

int net_ndp_init (void)
 Init NDP.
 
void net_ndp_shutdown (void)
 Shutdown NDP.
 
void net_ndp_gc (void)
 Garbage collect timed out NDP entries. This will be called periodically as NDP queries come in.
 
int net_ndp_insert (netif_t *nif, const uint8 mac[6], const struct in6_addr *ip, int unsol)
 Add an entry to the NDP cache.
 
int net_ndp_lookup (netif_t *net, const struct in6_addr *ip, uint8 mac_out[6], const ipv6_hdr_t *pkt, const uint8 *data, int data_size)
 Look up an entry from the NDP cache.
 

Detailed Description

API for the Neighbor Discovery Protocol.

Function Documentation

◆ net_ndp_gc()

void net_ndp_gc ( void  )

Garbage collect timed out NDP entries. This will be called periodically as NDP queries come in.

◆ net_ndp_init()

int net_ndp_init ( void  )

Init NDP.

Return values
0On success (no error conditions defined).

◆ net_ndp_insert()

int net_ndp_insert ( netif_t nif,
const uint8  mac[6],
const struct in6_addr ip,
int  unsol 
)

Add an entry to the NDP cache.

Parameters
nifThe network device in question.
macThe MAC address for the entry.
ipThe IPv6 address for the entry.
unsolWas this unsolicited?
Returns
0 on success, <0 on failure.

◆ net_ndp_lookup()

int net_ndp_lookup ( netif_t net,
const struct in6_addr ip,
uint8  mac_out[6],
const ipv6_hdr_t pkt,
const uint8 data,
int  data_size 
)

Look up an entry from the NDP cache.

If no entry is found, then an NDP query will be sent and an error will be returned. If you specify a packet with the call, it will be sent when the reply comes in.

Parameters
netThe network device to use.
ipThe IPv6 address to query.
mac_outStorage for the MAC address on success.
pktA simple IPv6 header, if you want to send a packet when a reply comes in.
dataAnything that comes after the header.
data_sizeThe size of data.
Returns
0 on success, <0 on failure.

◆ net_ndp_shutdown()

void net_ndp_shutdown ( void  )

Shutdown NDP.