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.
This class receives changes to base interface attributes.
Public Functions
Registers this class to receive change updates on the interface.
Expects a boolean signifying whether notifications should be propagated to this instance or not.
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.
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).
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).
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.
Handler called after an interface has been configured to be enabled.
Handler called when the configured description of an interface changes.
An interface iterator.
Private Functions
Friends
The interface manager. This class inspects and configures base interface attributes.
Public Functions
Iterates over all interfaces currently available in the system.
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.
Returns true if the given interface is configured to be enabled.
Configures the enabled status of the interface.
Returns the configured description of the given interface.
Configure the description of the given interface. Creates a copy of the passed in string description.
Configure the description of the given interface.
Inspects the current operational status of the given interface.
Protected Functions
Private Members
Friends
The interface counter manager. This class inspects base interface counters and statistics.
Public Functions
Get the current counters of the given interface.
Get the current traffic rates of the given interface.
Protected Functions
Private Members
Enums
The operational status of an interface.
Values:
The interface’s type.
Values:
Unique identifier for an interface.
Public Functions
Default constructor.
Constructor based on an interface name, i.e. ‘Ethernet3/1’, or ‘Management1’.
Constructor based on an interface name, i.e. ‘Ethernet3/1’, or ‘Management1’.
Constructor based on internal id representation, not part of the public API.
Returns true if the interface is Null0.
Returns true if the interface is a subinterface.
Returns the interface’s type.
Returns the interface name as a string, e.g., ‘Ethernet3/1’.
Only the ‘default interface’ provided by the default constructor evaluates to false.
The hash function for type intf_id_t.
Private Members
Friends
A utility stream operator that adds a string representation of intf_id_t to the ostream.
Interface counter class.
All of these attributes have the same meanings as the corresponding objects in the Interface MIB (RFC 2863, ‘IF-MIB’).
Public Functions
Getter for ‘out_ucast_pkts’: IF-MIB ifOutUcastPkts. Note that IF-MIB specifies that ifOutUcastPkts should include packets that were dropped due to excessive collisions, as if they were successfully transmitted. We count these as out_errors.
Getter for ‘out_multicast_pkts’: IF-MIB ifOutMulticastPkts counter.
Getter for ‘out_broadcast_pkts’: IF-MIB ifOutBroadcastPkts counter.
Getter for ‘in_ucast_pkts’: IF-MIB ifInUcastPkts.
Getter for ‘in_multicast_pkts’: IF-MIB ifInMulticastPkts counter.
Getter for ‘in_broadcast_pkts’: IF-MIB ifInBroadcastPkts counter.
Getter for ‘out_octets’: IF-MIB ifOutOctets counter. Note that for Ethernet interfaces, the octet counters include the MAC header and FCS (but not the preamble or SFD). This is different to the IEEE 802.3 counters (which do not include MAC header and FCS). See RFC 3635.
Getter for ‘in_octets’: IF-MIB ifInOctets counter. Note that for Ethernet interfaces, the octet counters include the MAC header and FCS (but not the preamble or SFD). This is different to the IEEE 802.3 counters (which do not include MAC header and FCS). See RFC 3635.
Getter for ‘out_discards’: IF-MIB ifOutDiscards counter.
Getter for ‘out_errors’: IF-MIB ifOutErrors counter.
Getter for ‘in_discards’: IF-MIB ifInDiscards counter.
Getter for ‘in_errors’: IF-MIB ifInErrors counter. The IF-MIB specifies that CRC errors should not get counted at all!, and that inErrors should include IP header checksum errors. We do not do this. We count CRC errors as inErrors, and IP header checksum errors as good packets at this level (in_ucast_pkts).
Getter for ‘sample_time’: time when the counters were updated.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of intf_counters_t to the ostream.
Interface traffic rates class.
Public Functions
Getter for ‘out_pkts_rate’: output packets per second.
Getter for ‘in_pkts_rate’: input packets per second.
Getter for ‘out_bits_rate’: output bits per second.
Getter for ‘in_bits_rate’: input bits per second.
Getter for ‘sample_time’: time when the rates were updated.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of intf_traffic_rates_t to the ostream.
Non-existent interface error.
Public Functions
Throws this exception.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of no_such_interface_error to the ostream.
Error of configuring an interface as a routed port that cannot be a routed port.
Public Functions
Throws this exception.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of not_switchport_eligible_error to the ostream.