Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[neighbour] Generalise concept of neighbour discovery
Split the protocol-independent portions of arp.c into a separate file neighbour.c, to allow for sharing of functionality between IPv4+ARP and IPv6+NDP. Signed-off-by: Michael Brown <mcb30@ipxe.org>
- Loading branch information
Showing
5 changed files
with
579 additions
and
357 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#ifndef _IPXE_NEIGHBOUR_H | ||
#define _IPXE_NEIGHBOUR_H | ||
|
||
/** @file | ||
* | ||
* Neighbour discovery | ||
* | ||
*/ | ||
|
||
FILE_LICENCE ( GPL2_OR_LATER ); | ||
|
||
#include <ipxe/netdevice.h> | ||
|
||
/** A neighbour discovery protocol */ | ||
struct neighbour_discovery { | ||
/** Name */ | ||
const char *name; | ||
/** | ||
* Transmit neighbour discovery request | ||
* | ||
* @v netdev Network device | ||
* @v net_protocol Network-layer protocol | ||
* @v net_dest Destination network-layer address | ||
* @v net_source Source network-layer address | ||
* @ret rc Return status code | ||
*/ | ||
int ( * tx_request ) ( struct net_device *netdev, | ||
struct net_protocol *net_protocol, | ||
const void *net_dest, const void *net_source ); | ||
}; | ||
|
||
extern int neighbour_tx ( struct io_buffer *iobuf, struct net_device *netdev, | ||
struct net_protocol *net_protocol, | ||
const void *net_dest, | ||
struct neighbour_discovery *discovery, | ||
const void *net_source, const void *ll_source ); | ||
extern int neighbour_update ( struct net_device *netdev, | ||
struct net_protocol *net_protocol, | ||
const void *net_dest, const void *ll_dest ); | ||
extern int neighbour_define ( struct net_device *netdev, | ||
struct net_protocol *net_protocol, | ||
const void *net_dest, const void *ll_dest ); | ||
|
||
#endif /* _IPXE_NEIGHBOUR_H */ |
Oops, something went wrong.