#include <net/if_arp.h>

net/if_arp.h

includes: stdint.h, sys/appleapiopts.h, netinet/in.h
16 macros · 3 structs

structarphdr

Address Resolution Protocol. See RFC 826 for protocol description. ARP packets are variable in size; the arphdr structure defines the fixed-length portion. Protocol type values are the same as those for 10 Mb/s Ethernet. It is followed by the variable-sized fields ar_sha, arp_spa, arp_tha and arp_tpa in that order, according to the lengths specified. Field names used correspond to RFC 826.
size 8, align 2
u_shortar_hrdformat of hardware address
u_shortar_proformat of protocol address
u_charar_hlnlength of hardware address
u_charar_plnlength of protocol address
u_shortar_opone of:

macroARPHRD_ETHER

#define ARPHRD_ETHER 1
ethernet hardware format

macroARPHRD_IEEE802

#define ARPHRD_IEEE802 6
token-ring hardware format

macroARPHRD_FRELAY

#define ARPHRD_FRELAY 15
frame relay hardware format

macroARPHRD_IEEE1394

#define ARPHRD_IEEE1394 24
IEEE1394 hardware address

macroARPHRD_IEEE1394_EUI64

#define ARPHRD_IEEE1394_EUI64 27
IEEE1394 EUI-64

macroARPOP_REQUEST

#define ARPOP_REQUEST 1
request to resolve address

macroARPOP_REPLY

#define ARPOP_REPLY 2
response to previous request

macroARPOP_REVREQUEST

#define ARPOP_REVREQUEST 3
request protocol address given hardware

macroARPOP_REVREPLY

#define ARPOP_REVREPLY 4
response giving protocol address

macroARPOP_INVREQUEST

#define ARPOP_INVREQUEST 8
request to identify peer

macroARPOP_INVREPLY

#define ARPOP_INVREPLY 9
response identifying peer

structarpreq

ARP ioctl request
size 36, align 4
struct sockaddrarp_paprotocol address
struct sockaddrarp_hahardware address
intarp_flagsflags

macroATF_INUSE

arp_flags and at_flags field values
#define ATF_INUSE 0x01
entry in use

macroATF_COM

#define ATF_COM 0x02
completed entry (enaddr valid)

macroATF_PERM

#define ATF_PERM 0x04
permanent entry

macroATF_PUBL

#define ATF_PUBL 0x08
publish entry (respond for other host)

macroATF_USETRAILERS

#define ATF_USETRAILERS 0x10
has requested trailers

structarpstat

size 64, align 4
uint32_ttxrequestsNormal things that happen: # of ARP requests sent by this host.
uint32_ttxreplies# of ARP replies sent by this host.
uint32_ttxannounces# of ARP announcements sent by this host.
uint32_trxrequests# of ARP requests received by this host.
uint32_trxreplies# of ARP replies received by this host.
uint32_treceived# of ARP packets received by this host.
uint32_ttxconflictsAbnormal event and error counting: # of ARP conflict probes sent
uint32_tinvalidreqs# of invalid ARP resolve requests
uint32_treqnobufs# of failed requests due to no memory
uint32_tdropped# of packets dropped waiting for a reply.
uint32_tpurged# of packets purged while removing entries
uint32_ttimeouts# of times with entries removed
uint32_tdupipsdue to timeout. # of duplicate IPs detected.
uint32_tinuseGeneral statistics # of ARP entries in routing table
uint32_ttxurequests# of ARP requests sent (unicast)
uint32_theld# of packets held waiting for a reply