dad5274522
names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
40 lines
852 B
C
40 lines
852 B
C
#ifndef _GPXE_ARP_H
|
|
#define _GPXE_ARP_H
|
|
|
|
/** @file
|
|
*
|
|
* Address Resolution Protocol
|
|
*
|
|
*/
|
|
|
|
#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 );
|
|
};
|
|
|
|
/** Declare an ARP protocol */
|
|
#define __arp_net_protocol \
|
|
__table ( struct arp_net_protocol, arp_net_protocols, 01 )
|
|
|
|
extern int arp_resolve ( struct net_device *netdev,
|
|
struct net_protocol *net_protocol,
|
|
const void *dest_net_addr,
|
|
const void *source_net_addr,
|
|
void *dest_ll_addr );
|
|
|
|
#endif /* _GPXE_ARP_H */
|