intf

Base interface types.

A base interface contains non-media or interface type specific information. Also included in this module is the interface ID type intf_id_t, used to uniquely identify any interface in the system of any type, as well as common enumerates.

namespace eos
class intf_handler
#include <intf.h>

This class receives changes to base interface attributes.

Public Functions

intf_handler(intf_mgr *)
intf_mgr * get_intf_mgr() const
void watch_all_intfs(bool)

Registers this class to receive change updates on the interface.

Expects a boolean signifying whether notifications should be propagated to this instance or not.

void watch_intf(intf_id_t, bool)

Registers this class to receive change updates on the given interface.

Expects the id of the corresponding interface and a boolean signifying whether notifications should be propagated to this instance or not.

virtual void on_intf_create(intf_id_t)

Handler called when a new interface is created.

After on_intf_create is called, the given intf_id is guaranteed to exist (ie intf_mgr::exists will return true). At that point, the intf_id can be used will all methods of the intf_mgr class.

This also means that the intf_id can be used with all other relevant *intf_mgr classes (ie eth_intf_mgr, eth_phy_intf_mgr, eth_lag_intf_mgr, and subintf_mgr as appropriate based on the intf_type).

virtual void on_intf_delete(intf_id_t)

Handler called when an interface has been removed.

After on_intf_delete is called, the given intf_id is guaranteed to not exist (ie intf_mgr::exists will return false). At that point, the intf_id cannot be used will any methods in the intf_mgr class.

This also means that the intf_id can no longer be used with all other relevant *intf_mgr classes (ie eth_intf_mgr, eth_phy_intf_mgr, eth_lag_intf_mgr, and subintf_mgr as appropriate based on the intf_type).

virtual void on_oper_status(intf_id_t, oper_status_t)

Handler called when the operational status of an interface changes.

Note that for physical interfaces, the on_oper_status handler will get called with INTF_OPER_NULL when the underlying hardware for that physical interface is removed.

virtual void on_admin_enabled(intf_id_t, bool)

Handler called after an interface has been configured to be enabled.

virtual void on_intf_description(intf_id_t, const std::string &)

Handler called when the configured description of an interface changes.

class intf_iter_t
#include <intf.h>

An interface iterator.

Private Functions

intf_iter_t(intf_iter_impl * const)

Friends

friend class intf_iter_impl
class intf_mgr
#include <intf.h>

The interface manager. This class inspects and configures base interface attributes.

Public Functions

virtual ~intf_mgr()
virtual intf_iter_t intf_iter() const = 0

Iterates over all interfaces currently available in the system.

virtual bool exists(intf_id_t) const = 0

Returns whether the given interface exists.

If exists returns true, then this intf_id_t can be successfully passed into every method of the intf_mgr. If not, then methods of the intf_mgr can throw a no_such_interface_error exception.

The exists method of all *intf_mgr classes that manage a given interface (ie intf_mgr, eth_intf_mgr, eth_phy_intf_mgr, eth_lag_intf_mgr, and/or subintf_mgr) are all guaranteed to return the same result.

virtual bool admin_enabled(intf_id_t) const = 0

Returns true if the given interface is configured to be enabled.

virtual void admin_enabled_is(intf_id_t, bool) = 0

Configures the enabled status of the interface.

virtual std::string description(intf_id_t) const = 0

Returns the configured description of the given interface.

virtual void description_is(intf_id_t, char const *) = 0

Configure the description of the given interface. Creates a copy of the passed in string description.

virtual void description_is(intf_id_t, const std::string &) = 0

Configure the description of the given interface.

virtual oper_status_t oper_status(intf_id_t) const = 0

Inspects the current operational status of the given interface.

Protected Functions

intf_mgr()

Private Members

intf_mgr

Friends

friend class intf_handler
class intf_counter_mgr
#include <intf.h>

The interface counter manager. This class inspects base interface counters and statistics.

Public Functions

virtual ~intf_counter_mgr()
virtual intf_counters_t counters(intf_id_t) const = 0

Get the current counters of the given interface.

virtual intf_traffic_rates_t traffic_rates(intf_id_t) const = 0

Get the current traffic rates of the given interface.

Protected Functions

intf_counter_mgr()

Private Members

intf_counter_mgr

Type definitions in intf

Warning

doxygenfile: Found multiple matches for file “eos/types/intf.h

Table Of Contents

Previous topic

hash_mix

Next topic

ip