void
arp_ifinit(
struct ifnet *ifp
, struct ifaddr *ifa
)
int
arpresolve(
struct ifnet *ifp
, struct rtentry *rt
, struct mbuf *m
, struct sockaddr *dst
, u_char *desten
)
void
arpintr(
)
)
ifa
.
Additionally, it sends out a gratuitous
arp
request on
ifp
,
so that other machines are warned that we have a (new) address and
duplicate addresses can be detected.
You must call this in your drivers' ioctl function when you get a SIOCSIFADDR request with an AF_INET address family.
)
rt
is given, a new one is looked up or created.
If the passed or found
rt
does not contain a valid gateway link level address, a pointer to the packet
in
m
is stored in the route entry, possibly replacing older stored packets, and an
arp
request is sent instead.
When an
arp
reply is received, the last held packet is send.
Otherwise, the looked up address is returned and written into the storage
desten
points to.
arpresolve(
)
returns 1, if a valid address was stored to
desten
,
and the packet can be sent immediately.
Else a 0 is returned.
)
)
soft interrupt callback.
arpintr(
)
dequeues the packets, performs sanity checks and calls (for IPv4
arp
packets, which are the only ones supported currently) the
in_arpinput(
)
function.
in_arpinput(
)
either generates a reply to request packets, and adds the sender address
translation to the routing table, if a matching route entry is found.
If the route entry contained a pointer to a held packet, that packet is
sent.
sys/net/if_arp.h
,
sys/netinet/if_inarp.h
and
sys/netinet/if_arp.c
.