61 const void *net_dest,
const void *net_source ) {
93 DBGC (
netdev,
"ARP %s %s %s could not transmit request: %s\n",
198 DBGC (
netdev,
"ARP %s %s %s could not transmit reply: %s\n",
void * memswap(void *first, void *second, size_t len)
Swap memory regions.
static void * arp_sender_pa(struct arphdr *arphdr)
ARP packet sender protocol address.
Address Resolution Protocol.
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
const char * name
Protocol name.
#define iob_put(iobuf, len)
uint8_t ll_addr_len
Link-layer address length.
static void * arp_target_ha(struct arphdr *arphdr)
ARP packet target hardware address.
static void * arp_target_pa(struct arphdr *arphdr)
ARP packet target protocol address.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
A neighbour discovery protocol.
const uint8_t * ll_broadcast
Link-layer broadcast address.
uint8_t ar_hln
Link-layer address length.
int neighbour_update(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *ll_dest)
Update existing neighbour cache entry.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
Address Resolution Protocol constants and types.
uint16_t ar_hrd
Link-layer protocol.
int(* check)(struct net_device *netdev, const void *net_addr)
Check existence of address.
A network-layer protocol that relies upon ARP.
const char * name
Protocol name.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define MAX_LL_ADDR_LEN
Maximum length of a link-layer address.
#define __unused
Declare a variable or data structure as unused.
#define ARPOP_REQUEST
ARP request.
const char *(* ntoa)(const void *net_addr)
Transcribe network-layer address.
struct net_protocol * net_protocol
Network-layer protocol.
static struct net_device * netdev
#define MAX_LL_HEADER_LEN
Maximum length of a link-layer header.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
struct neighbour_discovery arp_discovery
ARP neighbour discovery protocol.
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.
int arp_tx_request(struct net_device *netdev, struct net_protocol *net_protocol, const void *net_dest, const void *net_source)
Transmit ARP request.
char * strerror(int errno)
Retrieve string representation of error number.
uint16_t ar_op
ARP opcode.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
static const char * arp_ntoa(const void *net_addr __unused)
Transcribe ARP address.
#define ARPOP_REPLY
ARP reply.
uint16_t net_proto
Network-layer protocol.
uint16_t ll_proto
Link-layer protocol.
static void * arp_sender_ha(struct arphdr *arphdr)
ARP packet sender hardware address.
A network-layer protocol.
Network device management.
#define iob_reserve(iobuf, len)
char name[NETDEV_NAME_LEN]
Name of this network device.
int net_tx(struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *ll_dest, const void *ll_source)
Transmit network-layer packet.
#define EPROTONOSUPPORT
Protocol not supported.
uint8_t net_addr_len
Network-layer address length.
#define ARP_NET_PROTOCOLS
ARP protocol table.
void * data
Start of data.
uint16_t ar_pro
Network-layer protocol.
uint8_t ar_pln
Network-layer address length.
const char *(* ntoa)(const void *ll_addr)
Transcribe link-layer address.
struct net_protocol arp_protocol __net_protocol
ARP network protocol.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static struct arp_net_protocol * arp_find_protocol(uint16_t net_proto)
Identify ARP protocol.
static size_t arp_len(struct arphdr *arphdr)
ARP packet length.
#define MAX_NET_ADDR_LEN
Maximum length of a network-layer address.
#define NULL
NULL pointer (VOID *)
struct bofm_section_header done
struct ll_protocol * ll_protocol
Link-layer protocol.
void * memset(void *dest, int character, size_t len) __nonnull