Event handler for ethernet interface specific events.
Handles events on ethernet interfaces. Includes physical interfaces and LAGs (port-channels) among other interface types.
Public Functions
Registers to receive updates on changes to the interface.
Signifies whether notifications should be propagated to this handler instance or not.
Registers this class to receive change updates on the given interface.
Signifies which interface to subscribe to.
Signifies whether notifications should be propagated to this handler instance or not.
Handler called when an ethernet interface is created.
After on_eth_intf_create is called, the given intf_id is guaranteed to exist (ie eth_intf_mgr::exists will return true). At that point, the intf_id can be used will all methods of the eth_intf_mgr class.
This also means that the intf_id can be used with all other relevant *intf_mgr classes (ie intf_mgr, eth_phy_intf_mgr, eth_lag_intf_mgr, and subintf_mgr as appropriate based on the intf_type).
Handler called when an ethernet interface is deleted.
After on_eth_intf_delete is called, the given intf_id is guaranteed to not exist (ie eth_intf_mgr::exists will return false). At that point, the intf_id cannot be used will any methods in the eth_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, eth_phy_intf_mgr, eth_lag_intf_mgr, and subintf_mgr as appropriate based on the intf_type).
Handler called when the mac address of an interface changes
Note that for physical interfaces, the on_eth_addr handler will get called with the default eth_addr_t value when the hardware for that physical interface is removed.
Iterator type for ethernet interfaces.
Private Functions
Friends
The ethernet interface manager.
Public Functions
Returns whether the given 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, eth_phy_intf_mgr, eth_lag_intf_mgr, and/or subintf_mgr) are all guaranteed to return the same result.
Returns the operational ethernet address of the interface.
Returns the currently configured ethernet address.
Configures the ethernet address of the interface
The interface ID of the interface to change the address of
The address to set
Returns the currently configured mode of operation of a given interface. Note that only Ethernet and Port-Channel interfaces can be switchports, using any other type of interface will lead to a panic.
Configures the mode of operation of a given interface. Note that only Ethernet and Port-Channel interfaces can be switchports, using any other type of interface will lead to a panic.
Returns the ‘default’ VLAN of a given interface. The ‘default’ VLAN depends on the switchport mode of the interface. If the interface is in access mode, then the access VLAN is returned. If the interface is in tap or trunk mode, then the native VLAN is returned. If no native VLAN is configured, then 0 is returned.
Configures the ‘default’ VLAN of a given interface. The ‘default’ VLAN depends on the switchport mode of the interface. If the interface is in access mode, then the access VLAN is configured. If the interface is in tap or trunk mode, then the native VLAN is configured.
Returns the set of VLANs trunked on this interface. Note that by default all VLANs are trunked on all interfaces.
Adds a VLAN to the set of allowed VLANs when in trunk mode. If the interface isn’t in trunk mode, then the configuration is changed nevertheless, but the configuration won’t take effect until the interface is switched to trunk mode.
Configures the set of allowed VLANs when in trunk mode. If the interface isn’t in trunk mode, then the configuration is changed nevertheless, but the configuration won’t take effect until the interface is switched to trunk mode.
Removes a VLAN to the set of allowed VLANs when in trunk mode. If the interface isn’t in trunk mode, then the configuration is changed nevertheless, but the configuration won’t take effect until the interface is switched to trunk mode.
Protected Functions
Private Members
Friends
Enums
The mode of operation of a switch port.
Values:
Interface only has access to its access VLAN.
Interface is in 802.1q mode (“trunk mode”).
Interface is in 802.1ad mode (“QinQ mode”).
Interface is in tap mode (“span mode”).
Interface is a tool port (egress for a tap).
Interface is routed (“no switchport”).