nwpd
is a userspace daemon for the Neighborhood Watch Protocol, an address
resolution protocol for XIA. nwpd
's consists of 8 main files:
-
config.c
: Consists of function for reading configuration files, and command line options, and writing them to the globalnwpd_config
. -
log.c
: Functions for logging. -
monitor.c
: Implements the monitoring system. The main variable here ishosts_table
, a hash table mapping Ethernet addresses to ahost_clock
structure, that stores a bunch of monitoring related data. Every given period of time (monitor.ping-period
),monitor_start_ping_process
will select a random host, and attempt to send it a ping packet. If the host doesn't receive an ack in a given amount of time (monitor.ack-timeout
),monitor_on_ack_timeout
will selectinvestigate-neighbor-count
hosts on the network, and send them investigative ping requests. Further, if no investigative ack is received inmonitor.investigate-ack-timeout
seconds, the offending host will be removed as a neighbor. -
neigh.c
: Contains the functionmodify_neighbor
andmodify_route
, which help add and remove neighbor and route entries, respectively. A neighbor is a main route in the Ether principal module, while a route from an AD XID to an Ether XID. -
nwp.c
: Contains functions for reading and validating NWP structures from provided buffers. -
rtnl.c
: Helperrtnetlink
functions for communicating with the XIA kernel. Useslibmnl
. -
timer.c
: Helper functions for working with POSIX timers (SIGEV_THREAD
). -
nwpd.c
: Functions for sending base NWP packets (announce, neighbor list), and listening on a hardware interface for NWP packets (ether_receiver
).
nwpd
can be configured either by command line options (a complete list of
options available by typing nwpd -h
), or a config file provided with the
flag -c
. An example config file is provided with the source code in the file
example.conf
.