1 #ifndef _GPXE_ARP_H 2 #define _GPXE_ARP_H 3 4 /** @file 5 * 6 * Address Resolution Protocol 7 * 8 */ 9 10 FILE_LICENCE ( GPL2_OR_LATER ); 11 12 #include <gpxe/tables.h> 13 14 struct net_device; 15 struct net_protocol; 16 17 /** A network-layer protocol that relies upon ARP */ 18 struct arp_net_protocol { 19 /** Network-layer protocol */ 20 struct net_protocol *net_protocol; 21 /** Check existence of address 22 * 23 * @v netdev Network device 24 * @v net_addr Network-layer address 25 * @ret rc Return status code 26 */ 27 int ( * check ) ( struct net_device *netdev, 28 const void *net_addr ); 29 }; 30 31 /** ARP protocol table */ 32 #define ARP_NET_PROTOCOLS \ 33 __table ( struct arp_net_protocol, "arp_net_protocols" ) 34 35 /** Declare an ARP protocol */ 36 #define __arp_net_protocol __table_entry ( ARP_NET_PROTOCOLS, 01 ) 37 38 extern struct net_protocol arp_protocol; 39 40 extern int arp_resolve ( struct net_device *netdev, 41 struct net_protocol *net_protocol, 42 const void *dest_net_addr, 43 const void *source_net_addr, 44 void *dest_ll_addr ); 45 46 #endif /* _GPXE_ARP_H */ 47