MAC address table management module.
This module offers a MAC address table manager, used to define MAC addresses in system configuration.
This module also offers a handler that provides notifications when a MAC address has been learned (or forgotten).
Please refer to examples/SimpleMac.cpp for an example.
Handler for the MAC table.
This handler provides notifications when MAC addresses are learned on or removed from an interface. Note: This handler currently only provides notifications for unicast MAC addresses.
Public Functions
Registers this class to receive change updates from the MAC table.
Expects a boolean signifying whether notifications should be propagated to this instance or not.
Registers this class to receive change updates on the given MAC entry.
Expects the key of the corresponding MAC address and a boolean signifying whether notifications should be propagated to this instance or not.
This handler is called when a unicast MAC entry is learned for the first time, or when a unicast MAC entry has moved to a different interface.
This handler is called when a unicast entry is removed from the MAC address table.
Private Functions
Friends
Private Functions
Friends
Manager for the MAC address table.
Public Functions
Iterator for all configured MAC addresses.
Iterator for the MAC address table.
Retrieves a mac_entry_t given the VLAN and MAC address key from the collection of configured entries.
This entry contains the interface (or, for multicast entries, the interfaces) that the given key was configured on. If the entry has not been configured, an empty mac_entry_t() is returned.
The MAC address key object, consisting of a VLAN and a MAC address, which are used to retrieve that unique MAC entry.
Returns a mac_entry_t given a VLAN and MAC address from the collection of configured entries.
Retrieves a mac_entry_t given the VLAN and MAC address key from the collection of entries either learned dynamically or explicitly configured.
This entry contains the interface (or, for multicast entries, the interfaces) that the given key has been learned on. If the entry has not been learned, an empty mac_entry_t() is returned. Note: At this time, a multicast MAC entry’s status directly mirrors its configuration and does not reflect whether or not the entry has been programmed into hardware.
The MAC address key object, consisting of a VLAN and a MAC address, which are used to retrieve that unique MAC entry.
Returns the type of the programmed MAC entry.
Returns the number of times the MAC entry has moved.
Returns the time at which the MAC entry last moved (since boot).
Configure a MAC address statically as “learned” on a given interface (or set of interfaces for multicast MAC entries).
Remove a MAC entry with the given key from the collection of entries that were either learned dynamically or configured explicitly.
Protected Functions
Private Members
Friends
Enums
Types of MAC entries.
Values:
The MAC entry key class. Maps a MAC address with a specific VLAN ID to an interface.
Public Functions
Default constructor.
Getter for ‘vlan_id’: the VLAN subdomain identifier.
Getter for ‘eth_addr’: the Ethernet address of the MAC entry.
Non-existent keys are effectively false(so this returns true).
The hash function for type mac_key_t.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of mac_key_t to the ostream.
An entry from the MAC address table.
Public Functions
Default constructor.
Constructor for basic MAC entry.
Constructor for unicast MAC entry and interface.
Constructor for multicast MAC entry and interfaces.
Deprecated constructor.
Deprecated constructor. Default VLAN identifier is 0. Please use method mac_key_is with a VLAN ID and the eth_addr attribute to set a valid VLAN ID.
Getter for ‘mac_key’: the key of the MAC entry.
Setter for ‘mac_key’.
Getter for ‘intfs’: the set of interfaces that this key forwards to. For unicast MAC entries, this expects a set with either 1 interface or 0 interfaces to signify a drop. If passed a multicast MAC address, ‘intfs’ can contain one or more output interfaces.
Setter for ‘intfs’.
Inserts one intf of ‘value’ to the set.
Deletes one intf of ‘value’ from the set.
Getter for ‘persistent’: indicates whether this MAC entry persists in system configuration. If true, MAC entry appears in “show running-config”.
Setter for ‘persistent’.
Returns ‘true’ if this key is “empty”, that is if neither the VLAN nor the MAC address is set.
The VLAN subdomain identifier of the MAC entry.
The Ethernet address of the MAC entry.
Return the interface of the unicast MAC entry, the first interface of a multicast MAC entry, or an empty object if the entry is a drop entry.
Setter for ‘intf’: a single interface in a MAC entry.
The hash function for type mac_entry_t.
Returns a string representation of the current object’s values.
Friends
A utility stream operator that adds a string representation of mac_entry_t to the ostream.