mac_table

namespace eos
class mac_table_mgr
#include <mac_table.h>

Manager for the MAC address table.

Public Functions

virtual ~mac_table_mgr()
virtual mac_entry_t mac_entry(vlan_id_t vlan, eth_addr_t mac) const = 0

Returns the MAC table entry for the given VLAN and MAC address. If the given MAC is not found, or if the VLAN queried doesn’t exist, an empty mac_entry_t is returned (use the operator!() to easily determine whether that is the case).

Parameters
  • vlan -

    The VLAN in which to perform the look up.

  • mac -

    The MAC address to look up.

Protected Functions

mac_table_mgr()

Private Members

mac_table_mgr

Type definitions in mac_table

namespace eos
class mac_entry_t
#include <mac_table.h>

An entry from the MAC address table. TODO: add entry type, number of moves, last move time.

Public Functions

mac_entry_t()
mac_entry_t(eth_addr_t eth_addr, intf_id_t intf)
eth_addr_t eth_addr() const

Getter for ‘eth_addr’: the MAC address that was learned.

intf_id_t intf() const

Getter for ‘intf’: the interface from which the MAC address was learned.

bool operator!() const

Non-existent entries are effectively false (so this returns true).

std::string to_string() const

Returns a string representation of the current object’s values.

Private Members

eth_addr_t eth_addr_
intf_id_t intf_

Friends

friend std::ostream & operator<<

A utility stream operator that adds a string representation of mac_entry_t to the ostream.

Table Of Contents

Previous topic

iterator

Next topic

mlag