diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-09-01 16:13:58 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-09-03 02:02:58 +0100 |
commit | c6a04085d25721a29af75beeb7c9c2e08a610cf2 (patch) | |
tree | 754695775f7c670fa395ea1a0782c06ccb8bd719 /src/include/ipxe/arp.h | |
parent | 6bf36f57a0f7a22ffa85ae4995933077df62e309 (diff) | |
download | ipxe-c6a04085d25721a29af75beeb7c9c2e08a610cf2.tar.gz |
[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>
Diffstat (limited to 'src/include/ipxe/arp.h')
-rw-r--r-- | src/include/ipxe/arp.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/include/ipxe/arp.h b/src/include/ipxe/arp.h index 00396d821..e30ae6b76 100644 --- a/src/include/ipxe/arp.h +++ b/src/include/ipxe/arp.h @@ -11,6 +11,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/tables.h> #include <ipxe/netdevice.h> +#include <ipxe/neighbour.h> /** A network-layer protocol that relies upon ARP */ struct arp_net_protocol { @@ -34,9 +35,26 @@ struct arp_net_protocol { #define __arp_net_protocol __table_entry ( ARP_NET_PROTOCOLS, 01 ) extern struct net_protocol arp_protocol __net_protocol; +extern struct neighbour_discovery arp_discovery; -extern int arp_tx ( struct io_buffer *iobuf, struct net_device *netdev, - struct net_protocol *net_protocol, const void *net_dest, - const void *net_source, const void *ll_source ); +/** + * Transmit packet, determining link-layer address via ARP + * + * @v iobuf I/O buffer + * @v netdev Network device + * @v net_protocol Network-layer protocol + * @v net_dest Destination network-layer address + * @v net_source Source network-layer address + * @v ll_source Source link-layer address + * @ret rc Return status code + */ +static inline int arp_tx ( struct io_buffer *iobuf, struct net_device *netdev, + struct net_protocol *net_protocol, + const void *net_dest, const void *net_source, + const void *ll_source ) { + + return neighbour_tx ( iobuf, netdev, net_protocol, net_dest, + &arp_discovery, net_source, ll_source ); +} #endif /* _IPXE_ARP_H */ |