iPXE
arp.h
Go to the documentation of this file.
1 #ifndef _IPXE_ARP_H
2 #define _IPXE_ARP_H
3 
4 /** @file
5  *
6  * Address Resolution Protocol
7  *
8  */
9 
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11 FILE_SECBOOT ( PERMITTED );
12 
13 #include <ipxe/tables.h>
14 #include <ipxe/netdevice.h>
15 #include <ipxe/neighbour.h>
16 
17 /** A network-layer protocol that relies upon ARP */
19  /** Network-layer 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 __net_protocol;
40 
41 /**
42  * Transmit packet, determining link-layer address via ARP
43  *
44  * @v iobuf I/O buffer
45  * @v netdev Network device
46  * @v net_protocol Network-layer protocol
47  * @v net_dest Destination network-layer address
48  * @v net_source Source network-layer address
49  * @ret rc Return status code
50  */
51 static inline int arp_tx ( struct io_buffer *iobuf, struct net_device *netdev,
52  struct net_protocol *net_protocol,
53  const void *net_dest, const void *net_source ) {
54 
55  return neighbour_tx ( iobuf, netdev, net_protocol, net_dest,
56  &arp_discovery, net_source );
57 }
58 
59 extern int arp_tx_request ( struct net_device *netdev,
60  struct net_protocol *net_protocol,
61  const void *net_dest, const void *net_source );
62 
63 #endif /* _IPXE_ARP_H */
A neighbour discovery protocol.
Definition: neighbour.h:20
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct neighbour_discovery arp_discovery
ARP neighbour discovery protocol.
Definition: arp.c:104
int(* check)(struct net_device *netdev, const void *net_addr)
Check existence of address.
Definition: arp.h:27
A network-layer protocol that relies upon ARP.
Definition: arp.h:18
static int arp_tx(struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *net_source)
Transmit packet, determining link-layer address via ARP.
Definition: arp.h:51
struct net_protocol * net_protocol
Network-layer protocol.
Definition: arp.h:20
static struct net_device * netdev
Definition: gdbudp.c:52
A network device.
Definition: netdevice.h:353
struct net_protocol arp_protocol __net_protocol
AoE protocol.
Definition: aoe.c:56
A network-layer protocol.
Definition: netdevice.h:65
Network device management.
Neighbour discovery.
Linker tables.
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)
Transmit packet, determining link-layer address via neighbour discovery.
Definition: neighbour.c:377
FILE_SECBOOT(PERMITTED)
int arp_tx_request(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *net_source)
Transmit ARP request.
Definition: arp.c:60
A persistent I/O buffer.
Definition: iobuf.h:38