summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/neighbour.h
diff options
context:
space:
mode:
authorMichael Brown2013-09-01 17:13:58 +0200
committerMichael Brown2013-09-03 03:02:58 +0200
commitc6a04085d25721a29af75beeb7c9c2e08a610cf2 (patch)
tree754695775f7c670fa395ea1a0782c06ccb8bd719 /src/include/ipxe/neighbour.h
parent[tcpip] Pass through network device to transport layer protocols (diff)
downloadipxe-c6a04085d25721a29af75beeb7c9c2e08a610cf2.tar.gz
ipxe-c6a04085d25721a29af75beeb7c9c2e08a610cf2.tar.xz
ipxe-c6a04085d25721a29af75beeb7c9c2e08a610cf2.zip
[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/neighbour.h')
-rw-r--r--src/include/ipxe/neighbour.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/include/ipxe/neighbour.h b/src/include/ipxe/neighbour.h
new file mode 100644
index 000000000..5720e8b0f
--- /dev/null
+++ b/src/include/ipxe/neighbour.h
@@ -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 */