l1_source

L1 source management module.

On platforms with a crosspoint, interfaces can configure their source using a config.

This module provides APIs to set and delete source configs, watch for config changes, get source configs and source statuses, and iterate through source configs and source statuses.

namespace eos
class l1_source_handler

Public Functions

l1_source_handler(l1_source_mgr *)
l1_source_mgr * get_l1_source_mgr() const
void watch_all_l1_source(bool)

Register to receive notification when l1 source config for any interface changes.

void watch_l1_source(intf_id_t, bool)

Register to receive notification when l1 source config of an interface changes.

virtual void on_l1_source_set(intf_id_t)

Called when l1 source of an interface is set.

virtual void on_l1_source_del(intf_id_t)

Called when l1 source of an interface is removed.

class l1_source_iter_t
#include <l1_source.h>

An iterator that yields a intf_id_t for each l1 source config/status.

Private Functions

l1_source_iter_t(l1_source_iter_impl * const)

Friends

friend class l1_source_iter_impl
class l1_source_mgr
#include <l1_source.h>

The l1 source manager. This class inspects and configures l1 source for an interface.

Public Functions

virtual ~l1_source_mgr()
virtual void l1_source_is(intf_id_t, l1_source_t source) = 0

Configures l1 source of an interface.

virtual void l1_source_del(intf_id_t) = 0

Remove the l1 source of an interface.

virtual bool exists(intf_id_t) const = 0

Returns whether a l1 source config exists for the interface.

virtual l1_source_t l1_source_config(intf_id_t) = 0

Returns the source config for an interface. If no source config is set, returns the default source config.

virtual l1_source_t l1_source_status(intf_id_t) = 0

Returns the source status for an interface. If no source status exists, returns the default source status.

virtual l1_source_iter_t l1_source_config_iter() const = 0

Iterator for l1 source configuration.

virtual l1_source_iter_t l1_source_status_iter() const = 0

Iterator for l1 source status.

virtual void app_description_is(intf_id_t, std::string) = 0

Configures the description of an application interface.

virtual void app_description_del(intf_id_t) = 0

Remove the description of an application interface.

Protected Functions

l1_source_mgr()

Private Members

l1_source_mgr

Friends

friend class l1_source_handler

Type definitions in l1_source

namespace eos

Enums

l1_source_type_t enum

The type of an l1 source.

Values:

  • unknown -
  • none -
  • port -
  • mac -
  • switchPort -
class l1_source_t
#include <l1_source.h>

L1 source class.

The interface id “port” should be defined only if l1 source type is port.

Public Functions

l1_source_t()

Default constructor.

l1_source_t(l1_source_type_t l1_source_type)

Constructor specifying only l1 source type.

l1_source_t(l1_source_type_t l1_source_type, intf_id_t port)

Constructor specifying both l1 source type and interface id.

l1_source_t(const l1_source_t & other)
l1_source_t & operator=(l1_source_t const & other)
l1_source_type_t l1_source_type() const
void l1_source_type_is(l1_source_type_t l1_source_type)
intf_id_t port() const
void port_is(intf_id_t port)
bool operator==(l1_source_t const & other) const
bool operator!=(l1_source_t const & other) const
bool operator<(l1_source_t const & other) const
uint32_t hash() const

The hash function for type l1_source_t.

void mix_me(hash_mix & h) const

The hash mix function for type l1_source_t.

std::string to_string() const

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

Private Members

std::shared_ptr< l1_source_impl_t > pimpl

Friends

friend std::ostream & operator<<

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