eth_phy_intf

namespace eos
class eth_phy_intf_handler
#include <eth_phy_intf.h>

A handler for Ethernet Physical Interface events.

Public Functions

eth_phy_intf_handler(eth_phy_intf_mgr *)
eth_phy_intf_mgr * get_eth_phy_intf_mgr() const
void watch_all_eth_phy_intfs(bool)

Registers this class to receive interface change update notifications.

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

void watch_eth_phy_intf(intf_id_t, bool)

Registers this class to receive interface change update notifications for 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_eth_phy_intf_create(intf_id_t)

Handler called when a physical ethernet interface is created.

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

This also means that the intf_id can be used with all other relevant *intf_mgr classes (ie intf_mgr and eth_intf_mgr).

virtual void on_eth_phy_intf_delete(intf_id_t)

Handler called when a physical ethernet interface is deleted.

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

This also means that the intf_id can no longer be used with all other relevant *intf_mgr classes (ie intf_mgr and eth_intf_mgr).

virtual void on_eth_phy_intf_hardware_present(intf_id_t, bool present)

Handler called when the presence of the underlying hardware for the physical ethernet interface changes.

When a physical interface goes from not-present to present, only on_eth_phy_intf_hardware_present will get called even though other attributes (like the link_speed) of the eth_phy_intf may have changed. Similarly, when the physical interface hardware goes from present to not-present, attributes of the eth_phy_intf (like the link_speed) that are based on the underlying hardware will go back to their default values even though their explicit handlers are not called. It is up to the user to handle the new values of those attributes within the on_eth_phy_intf_hardware_present handler.

virtual void on_eth_phy_intf_link_speed(intf_id_t, eth_link_speed_t)

Handler called when the operational link speed changes.

class eth_phy_intf_iter_t
#include <eth_phy_intf.h>

Iterator over physical interfaces.

Private Functions

eth_phy_intf_iter_t(eth_phy_intf_iter_impl * const)

Friends

friend class eth_phy_intf_iter_impl
class eth_phy_intf_mgr

Public Functions

virtual ~eth_phy_intf_mgr()
virtual eth_phy_intf_iter_t eth_phy_intf_iter() const = 0
virtual bool exists(intf_id_t) const = 0

Returns whether the given physical ethernet interface exists.

If exists returns true, then this intf_id_t can be successfully passed into every method of the eth_intf_mgr. If not, then methods of the eth_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, and eth_phy_intf_mgr for physical interfaces) are all guaranteed to return the same result.

virtual bool hardware_present(intf_id_t) const = 0

Returns whether the underlying hardware for this interface is present.

virtual eth_addr_t burned_in_eth_addr(intf_id_t) const = 0

Returns the “burned in” address of the interface.

If the underlying hardware is not present, returns the default eth_addr_t(). Once hardware_present is true, burned_in_eth_addr is guaranteed to be available.

virtual eth_link_speed_t link_speed(intf_id_t) const = 0

Returns the operational link speed.

If the underlying hardware is not present, returns LINK_SPEED_UNKNOWN.

Protected Functions

eth_phy_intf_mgr()

Private Members

eth_phy_intf_mgr

Friends

friend class eth_phy_intf_handler
class eth_phy_intf_counter_mgr
#include <eth_phy_intf.h>

The Ethernet interface counter manager.

This class inspects ethernet interface counters and statistics.

Public Functions

virtual ~eth_phy_intf_counter_mgr()
virtual eth_phy_intf_counters_t counters(intf_id_t) const = 0

Get the current counters of the given ethernet interface.

virtual eth_phy_intf_bin_counters_t bin_counters(intf_id_t) const = 0

Get the current bin counters of the given ethernet interface.

Protected Functions

eth_phy_intf_counter_mgr()

Private Members

eth_phy_intf_counter_mgr

Type definitions in eth_phy_intf

namespace eos

Enums

eth_link_speed_t enum

Possible interface link speeds.

Values:

  • LINK_SPEED_UNKNOWN -
  • LINK_SPEED_10MBPS -
  • LINK_SPEED_100MBPS -
  • LINK_SPEED_1GBPS -
  • LINK_SPEED_10GBPS -
  • LINK_SPEED_25GBPS -
  • LINK_SPEED_40GBPS -
  • LINK_SPEED_50GBPS -
  • LINK_SPEED_100GBPS -
  • LINK_SPEED_UNEXPECTED -
class eth_phy_intf_counters_t
#include <eth_phy_intf.h>

Ethernet interface counter class.

All of these attributes have the same meanings as the corresponding objects in the Ethernetlike (RFC3635) and RMON (RFC2819) MIBs.

Public Functions

eth_phy_intf_counters_t()
eth_phy_intf_counters_t(uint64_t single_collision_frames, uint64_t multiple_collision_frames, uint64_t fcs_errors, uint64_t alignment_errors, uint64_t deferred_transmissions, uint64_t late_collisions, uint64_t excessive_collisions, uint64_t internal_mac_transmit_errors, uint64_t carrier_sense_errors, uint64_t internal_mac_receive_errors, uint64_t frame_too_shorts, uint64_t frame_too_longs, uint64_t sqe_test_errors, uint64_t symbol_errors, uint64_t in_unknown_opcodes, uint64_t out_pause_frames, uint64_t in_pause_frames, uint64_t fragments, uint64_t jabbers)
uint64_t single_collision_frames() const

Getter for ‘single_collision_frames’: Etherlike-MIB singleCollisionFrames counter.

uint64_t multiple_collision_frames() const

Getter for ‘multiple_collision_frames’: Etherlike-MIB multipleCollisionFrames counter.

uint64_t fcs_errors() const

Getter for ‘fcs_errors’: Etherlike-MIB fcsErrors counter.

uint64_t alignment_errors() const

Getter for ‘alignment_errors’: Etherlike-MIB alignmentErrors counter.

uint64_t deferred_transmissions() const

Getter for ‘deferred_transmissions’: Etherlike-MIB deferredTransmissions counter.

uint64_t late_collisions() const

Getter for ‘late_collisions’: Etherlike-MIB lateCollisions counter.

uint64_t excessive_collisions() const

Getter for ‘excessive_collisions’: Etherlike-MIB excessiveCollisions counter.

uint64_t internal_mac_transmit_errors() const

Getter for ‘internal_mac_transmit_errors’: Etherlike-MIB internalMacTransmitErrors counter.

uint64_t carrier_sense_errors() const

Getter for ‘carrier_sense_errors’: Etherlike-MIB carrierSenseErrors counter.

uint64_t internal_mac_receive_errors() const

Getter for ‘internal_mac_receive_errors’: Etherlike-MIB internalMacReceiveErrors counter.

uint64_t frame_too_shorts() const

Getter for ‘frame_too_shorts’: Etherlike-MIB frameTooShorts counter.

uint64_t frame_too_longs() const

Getter for ‘frame_too_longs’: Etherlike-MIB frameTooLongs counter.

uint64_t sqe_test_errors() const

Getter for ‘sqe_test_errors’: Etherlike-MIB sqeTestErrors counter.

uint64_t symbol_errors() const

Getter for ‘symbol_errors’: Etherlike-MIB symbolErrors counter.

uint64_t in_unknown_opcodes() const

Getter for ‘in_unknown_opcodes’: Etherlike-MIB inUnknownOpcodes counter.

uint64_t out_pause_frames() const

Getter for ‘out_pause_frames’: Etherlike-MIB outPauseFrames counter.

uint64_t in_pause_frames() const

Getter for ‘in_pause_frames’: Etherlike-MIB inPauseFrames counter.

uint64_t fragments() const

Getter for ‘fragments’: RMON-MIB fragments counter.

uint64_t jabbers() const

Getter for ‘jabbers’: RMON-MIB jabbers counter.

bool operator==(eth_phy_intf_counters_t const & other) const
bool operator!=(eth_phy_intf_counters_t const & other) const
uint32_t hash() const

The hash function for type eth_phy_intf_counters_t.

std::string to_string() const

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

Private Members

uint64_t single_collision_frames_
uint64_t multiple_collision_frames_
uint64_t fcs_errors_
uint64_t alignment_errors_
uint64_t deferred_transmissions_
uint64_t late_collisions_
uint64_t excessive_collisions_
uint64_t internal_mac_transmit_errors_
uint64_t carrier_sense_errors_
uint64_t internal_mac_receive_errors_
uint64_t frame_too_shorts_
uint64_t frame_too_longs_
uint64_t sqe_test_errors_
uint64_t symbol_errors_
uint64_t in_unknown_opcodes_
uint64_t out_pause_frames_
uint64_t in_pause_frames_
uint64_t fragments_
uint64_t jabbers_

Friends

friend std::ostream & operator<<

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

class eth_phy_intf_bin_counters_t
#include <eth_phy_intf.h>

Ethernet interface bin counters class.

All of these attributes have the same meanings as the corresponding objects in the RMON MIB (RFC2819).

Public Functions

eth_phy_intf_bin_counters_t()
eth_phy_intf_bin_counters_t(uint64_t in_64_octet_frames, uint64_t in_65_to_127_octet_frames, uint64_t in_128_to_255_octet_frames, uint64_t in_256_to_511_octet_frames, uint64_t in_512_to_1023_octet_frames, uint64_t in_1024_to_1522_octet_frames, uint64_t in_1523_to_max_octet_frames, uint64_t out_64_octet_frames, uint64_t out_65_to_127_octet_frames, uint64_t out_128_to_255_octet_frames, uint64_t out_256_to_511_octet_frames, uint64_t out_512_to_1023_octet_frames, uint64_t out_1024_to_1522_octet_frames, uint64_t out_1523_to_max_octet_frames)
uint64_t in_64_octet_frames() const

Getter for ‘in_64_octet_frames’: Input 64 octet frame counter.

uint64_t in_65_to_127_octet_frames() const

Getter for ‘in_65_to_127_octet_frames’: Input 65 to 127 octet frame counter.

uint64_t in_128_to_255_octet_frames() const

Getter for ‘in_128_to_255_octet_frames’: Input 128 to 255 octet frame counter.

uint64_t in_256_to_511_octet_frames() const

Getter for ‘in_256_to_511_octet_frames’: Input 256 to 511 octet frame counter.

uint64_t in_512_to_1023_octet_frames() const

Getter for ‘in_512_to_1023_octet_frames’: Input 512 to 1023 octet frame counter.

uint64_t in_1024_to_1522_octet_frames() const

Getter for ‘in_1024_to_1522_octet_frames’: Input 1024 to 1522 octet frame counter.

uint64_t in_1523_to_max_octet_frames() const

Getter for ‘in_1523_to_max_octet_frames’: Input 1523 to max octet frame counter.

uint64_t out_64_octet_frames() const

Getter for ‘out_64_octet_frames’: Output 64 octet frame counter.

uint64_t out_65_to_127_octet_frames() const

Getter for ‘out_65_to_127_octet_frames’: Output 65 to 127 octet frame counter.

uint64_t out_128_to_255_octet_frames() const

Getter for ‘out_128_to_255_octet_frames’: Output 128 to 255 octet frame counter.

uint64_t out_256_to_511_octet_frames() const

Getter for ‘out_256_to_511_octet_frames’: Output 256 to 511 octet frame counter.

uint64_t out_512_to_1023_octet_frames() const

Getter for ‘out_512_to_1023_octet_frames’: Output 512 to 1023 octet frame counter.

uint64_t out_1024_to_1522_octet_frames() const

Getter for ‘out_1024_to_1522_octet_frames’: Output 1024 to 1522 octet frame counter.

uint64_t out_1523_to_max_octet_frames() const

Getter for ‘out_1523_to_max_octet_frames’: Output 1523 to max octet frame counter.

bool operator==(eth_phy_intf_bin_counters_t const & other) const
bool operator!=(eth_phy_intf_bin_counters_t const & other) const
uint32_t hash() const

The hash function for type eth_phy_intf_bin_counters_t.

std::string to_string() const

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

Private Members

uint64_t in_64_octet_frames_
uint64_t in_65_to_127_octet_frames_
uint64_t in_128_to_255_octet_frames_
uint64_t in_256_to_511_octet_frames_
uint64_t in_512_to_1023_octet_frames_
uint64_t in_1024_to_1522_octet_frames_
uint64_t in_1523_to_max_octet_frames_
uint64_t out_64_octet_frames_
uint64_t out_65_to_127_octet_frames_
uint64_t out_128_to_255_octet_frames_
uint64_t out_256_to_511_octet_frames_
uint64_t out_512_to_1023_octet_frames_
uint64_t out_1024_to_1522_octet_frames_
uint64_t out_1523_to_max_octet_frames_

Friends

friend std::ostream & operator<<

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

Table Of Contents

Previous topic

eth_lag_intf

Next topic

event_loop