iPXE
|
Address Resolution Protocol. More...
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <byteswap.h>
#include <errno.h>
#include <ipxe/if_ether.h>
#include <ipxe/if_arp.h>
#include <ipxe/iobuf.h>
#include <ipxe/netdevice.h>
#include <ipxe/neighbour.h>
#include <ipxe/arp.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
int | arp_tx_request (struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *net_source) |
Transmit ARP request. More... | |
static struct arp_net_protocol * | arp_find_protocol (uint16_t net_proto) |
Identify ARP protocol. More... | |
static int | arp_rx (struct io_buffer *iobuf, struct net_device *netdev, const void *ll_dest __unused, const void *ll_source __unused, unsigned int flags __unused) |
Process incoming ARP packets. More... | |
static const char * | arp_ntoa (const void *net_addr __unused) |
Transcribe ARP address. More... | |
Variables | |
struct net_protocol arp_protocol | __net_protocol |
ARP network protocol. More... | |
struct neighbour_discovery | arp_discovery |
ARP neighbour discovery protocol. More... | |
Address Resolution Protocol.
This file implements the address resolution protocol as defined in RFC826. The implementation is media-independent and protocol-independent; it is not limited to Ethernet or to IPv4.
Definition in file arp.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
int arp_tx_request | ( | struct net_device * | netdev, |
struct net_protocol * | net_protocol, | ||
const void * | net_dest, | ||
const void * | net_source | ||
) |
Transmit ARP request.
netdev | Network device |
net_protocol | Network-layer protocol |
net_dest | Destination network-layer address |
net_source | Source network-layer address |
rc | Return status code |
Definition at line 59 of file arp.c.
References alloc_iob(), arphdr::ar_hln, arphdr::ar_hrd, arphdr::ar_op, arphdr::ar_pln, arphdr::ar_pro, ARPOP_REQUEST, DBGC, ENOMEM, htons, iob_put, iob_reserve, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_broadcast, ll_protocol::ll_proto, net_device::ll_protocol, MAX_LL_ADDR_LEN, MAX_LL_HEADER_LEN, MAX_NET_ADDR_LEN, memcpy(), memset(), net_protocol::name, net_device::name, net_protocol::net_addr_len, net_protocol::net_proto, net_tx(), netdev, net_protocol::ntoa, rc, and strerror().
Referenced by ipoib_transmit(), and ipv4_gratuitous_arp().
|
static |
Identify ARP protocol.
net_proto | Network-layer protocol, in network-endian order |
arp_net_protocol | ARP protocol, or NULL |
Definition at line 115 of file arp.c.
References ARP_NET_PROTOCOLS, for_each_table_entry, net_protocol::net_proto, arp_net_protocol::net_protocol, and NULL.
Referenced by arp_rx().
|
static |
Process incoming ARP packets.
iobuf | I/O buffer |
netdev | Network device |
ll_source | Link-layer source address |
flags | Packet flags |
rc | Return status code |
Definition at line 134 of file arp.c.
References arphdr::ar_hln, arphdr::ar_hrd, arphdr::ar_op, arphdr::ar_pln, arphdr::ar_pro, arp_find_protocol(), arp_len(), arp_sender_ha(), arp_sender_pa(), arp_target_ha(), arp_target_pa(), ARPOP_REPLY, ARPOP_REQUEST, arp_net_protocol::check, io_buffer::data, DBGC, DBGC2, done, EINVAL, EPROTONOSUPPORT, free_iob(), htons, iob_disown, iob_len(), len, net_device::ll_addr, ll_protocol::ll_addr_len, ll_protocol::ll_proto, net_device::ll_protocol, memcpy(), memswap(), net_protocol::name, ll_protocol::name, net_device::name, neighbour_update(), net_protocol::net_addr_len, arp_net_protocol::net_protocol, net_tx(), netdev, net_protocol::ntoa, ll_protocol::ntoa, rc, and strerror().
|
static |
struct net_protocol arp_protocol __net_protocol |
ARP network protocol.
AoE protocol.
struct neighbour_discovery arp_discovery |
ARP neighbour discovery protocol.
Definition at line 103 of file arp.c.
Referenced by arp_tx().