mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 04:50:25 +03:00
Simplify RX data path.
Kill off the static single net device and move to proper dynamic registration (which we need with the new device model). Break the (flawed) assumption that all network-layer protocols can use ARP; such network-layer protocols (i.e. IPv4) must now register as an ARP protocol using ARP_NET_PROTOCOL() and provide a single method for checking the existence of a local network-layer address.
This commit is contained in:
@@ -7,9 +7,33 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gpxe/tables.h>
|
||||
|
||||
struct net_device;
|
||||
struct net_protocol;
|
||||
|
||||
/** A network-layer protocol that relies upon ARP */
|
||||
struct arp_net_protocol {
|
||||
/** Network-layer protocol */
|
||||
struct net_protocol *net_protocol;
|
||||
/** Check existence of address
|
||||
*
|
||||
* @v netdev Network device
|
||||
* @v net_addr Network-layer address
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
int ( * check ) ( struct net_device *netdev,
|
||||
const void *net_addr );
|
||||
};
|
||||
|
||||
/**
|
||||
* Register an ARP protocol
|
||||
*
|
||||
* @v protocol ARP protocol
|
||||
*/
|
||||
#define ARP_NET_PROTOCOL( protocol ) \
|
||||
struct arp_net_protocol protocol __table ( arp_net_protocols, 01 )
|
||||
|
||||
extern int arp_resolve ( struct net_device *netdev,
|
||||
struct net_protocol *net_protocol,
|
||||
const void *dest_net_addr,
|
||||
|
||||
Reference in New Issue
Block a user