xorp

ARPd Class Reference

an ARP daemon. More...

#include <arpd.hh>

List of all members.

Public Member Functions

 ARPd (VrrpInterface &vif)
void clear ()
 Remove all configured IPs.
void insert (const IPv4 &ip)
 Add an IP for which ARP replies should be sent.
void stop ()
 Stop the daemon.
void start ()
 Start the daemon.
void ips_updated ()
 Using this method the caller notifies ARPd that it has finished manipulating the IP addresses.
void recv (const Mac &src, const PAYLOAD &payload)
 This method notifies the reception of an ARP packet.
void set_mac (const Mac &mac)
 Sets the MAC address of the ARP daemon, used when generating replies.

Private Types

typedef set< IPv4IPS

Private Member Functions

void start_receiving ()
 Use this to notify the interface that we no longer need to receive packets.
void stop_receiving ()
 Notify the interface that we desire to receive ARP packets.

Private Attributes

VrrpInterface_vif
Mac _mac
IPS _ips
bool _running
bool _receiving

Detailed Description

an ARP daemon.

This daemon can be configured to "own" several IPs for which it will send out ARP replies when receiving ARP requests.


Constructor & Destructor Documentation

ARPd::ARPd ( VrrpInterface vif)
Parameters:
vifthe VRRP interface on which the daemon runs.

Member Function Documentation

void ARPd::insert ( const IPv4 ip)

Add an IP for which ARP replies should be sent.

Parameters:
ipthe IP to add.
void ARPd::ips_updated ( )

Using this method the caller notifies ARPd that it has finished manipulating the IP addresses.

This way one can clear and add IPs one by one without causing ARPd to stop (if IPs are cleared) and resume if IPs are added.

void ARPd::recv ( const Mac src,
const PAYLOAD &  payload 
)

This method notifies the reception of an ARP packet.

Parameters:
macthe source MAC address of the packet.
payloadthe ARP header and data.
void ARPd::set_mac ( const Mac mac)

Sets the MAC address of the ARP daemon, used when generating replies.

Parameters:
macthe MAC address.
void ARPd::start_receiving ( ) [private]

Use this to notify the interface that we no longer need to receive packets.

This can be used for example when no IPs are configured or when the ARPd has been stopped.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations