The neighbor_table module manages IP/MAC mapping tables, including IPv4 ARP table and IPv6 neighbor table.
This module provides APIs to create and delete static IPv4/IPv6 entries. It also provides APIs to query the configured static entries and the learned (both static/dynamic) entries on the system from IPv4 ARP table and IPv6 neighbor table.
Two handler APIs are provided to allow 3rd party agents to react to the addition and deletion of entries in the learned ARP table or neighbor table on the system.
The neighbor table handler.
This class provides handler APIs to react to neighbor table entry deletion and addition. It works for both the IPv4 ARP table and IPv6 neighbor table.
Public Functions
Registers this class to receive change updates on all neighbor entries. This includes both IPv4 ARP table entries and IPv6 Neighbor Discovery table entries.
Registers this class to receive change updates on a given neighbor entry. This includes both IPv4 ARP table entries and IPv6 Neighbor Discovery table entries.
An iterator over the configured ARP and Neighbor Discovery tables.
Private Functions
Friends
The neighbor table manager.
This class provides access to the resolved MAC address for a given IP address off of an L3 interface (aka the ARP table for IPv4 addresses and the Neighbor Discovery table for IPv6 addresses). It also provides APIs to delete/add v4 static ARP entry and v6 static neighbor table entries.
Public Functions
Iterates through the configured ARP and Neighbor Discovery tables. A neighbor_key_t is returned for each entry.
Looks up a resolved neighbor entry for a given L3 interface and IP address.
Configures a new static entry in either ARP table for IPv4 or Neighbor table for IPv6. Note “intf_id” is needed only for v6 case, since the IP/MAC pair may not be unique. It’s not needed for v4 case.
Deletes a static entry in either ARP table (IPv4) or Neighbor table for IPv6. Note “intf_id” is needed only for v6 case, since the IP/MAC pair may not be unique. It’s not needed for v4 case.
Looks up a configured neighbor entry for a given L3 interface and IP address.
Protected Functions
Private Members
Friends
Enums
Neighbor entry types.
Values:
The neighbor entry key class. Maps an IP address to its associated MAC address on a specific interface. Note: the “intf_id” attribute is only relevant for IPv6 neighbors.
Public Functions
IPv6 neighbor keys include an interface ID.
Getter for ‘ip_addr’: the ip address of the neighbor entry.
Getter for ‘intf_id’: the interface of the neighbor entry.
The hash function for type neighbor_key_t.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of neighbor_key_t to the ostream.
The neighbor entry class.
Public Functions
Getter for ‘neighbor_key’: the key of the neighbor entry.
Getter for ‘eth_addr’: the Ethernet address of the neighbor entry.
Getter for ‘entry_type’: the type of neighbor entry, it will be either STATIC or DYNAMIC.
The hash function for type neighbor_entry_t.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of neighbor_entry_t to the ostream.