The eth_lag_intf module manages link aggregation groups (LAGs), also known as Port Channels.
LAGs bundle physical interfaces together into a single logical link to provide combined bandwidth and other benefits. This module provides APIs to provision LAG interfaces. APIs include LAG creation, deletion, retrieval, member interface adding to or removal from LAG interfaces. Two iterators are also provided to allow iteration through all the LAG interfaces and also all the member interfaces that are configured on the system.
The handler for LAG interface events.
Public Functions
Registers this class to receive change updates on all interfaces.
Expects a boolean signifying whether notifications should be enabled on all interfaces and propogated to this instance.
Registers this class to receive change updates on the given interface.
Expects the ID of the corresponding LAG interface and a boolean signifying whether notifications should be propagated to this instance or not.
Handler called when a LAG ethernet interface is created.
After on_eth_lag_intf_create is called, the given intf_id is guaranteed to exist (ie eth_lag_intf_mgr::exists will return true). At that point, the intf_id can be used will all methods of the eth_lag_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).
Handler called when a LAG ethernet interface is deleted.
After on_eth_lag_intf_delete is called, the given intf_id is guaranteed to not exist (ie eth_lag_intf_mgr::exists will return false). At that point, the intf_id cannot be used will any methods in the eth_lag_intf_mgr class, with the exception of methods used to create new LAG interfaces.
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).
Handler called when a member interface is added to a watched LAG.
Handler called when a member interface is removed from a watched LAG.
Handler called when a LAG interface’s speed changes
An LAG interface iterator for iterating through all LAG interfaces created in the system.
Private Functions
Friends
An LAG member iterator for iterating through all interfaces configured as a member of one LAG interface in the system.
Private Functions
Friends
The manager for LAG interfaces. This is the main entry point for applications to use EosSdk LAG APIs.
Public Functions
Iterates through the LAG interfaces in system. An intf_id_t pointer is returned for each LAG interface.
Returns whether the given ethernet LAG interface exists.
If exists returns true, then this intf_id_t can be successfully passed into every method of the eth_lag_intf_mgr. If not, then methods of the eth_lag_intf_mgr can throw a no_such_interface_error exception, or return empty data like intf_id_t().
The exists method of all *intf_mgr classes that manage a given interface (ie intf_mgr, eth_intf_mgr, and eth_lag_intf_mgr for LAG interfaces) are all guaranteed to return the same result.
Iterates over physical interfaces configured as a member of any LAG interface in system. Note the interface may not be in a LAG interface yet, but still shows up if its priority/mode/timeout set. Yields an intf_id_t for each member.
Iterates over physical interfaces configured as members of a given LAG interface. Yields an intf_id_t for each member.
Creates a LAG interface, when given the LAG interface. No action will be taken if the LAG exists already.
Returns a LAG interface with the specified LAG interface. Will return an empty eth_lag_intf_t if the LAG does not exist already.
This API deletes a LAG interface. It is a no-op if the specified LAG interface doesn’t exist.
Returns the speed of a LAG interface in megabits. If the interface does not exist, 0 is returned.
Sets the min links for a LAG interface. It’s a no-op if the specified LAG interface does not exist.
Returns the minimum number of member interfaces required to be `OPER_STATUS_UP` before this LAG interface considered `OPER_STATUS_UP`. If the LAG interface does not exist, 0 will be returned.
Sets the fallback type for a LAG interface. It’s a no-op if the LAG interface does not exist. Throws “invalid_argument_error” exception if invalid fallback type is passed in.
Returns the fallback mode for a LAG interface. ETH_LAG_INTF_FALLBACK_NULL is returned if the LAG interface does not exist.
Sets the fallback timeout for a LAG interface. It’s a no-op if the LAG interface does not exist.
Returns the LACP active mode timeout value in seconds. 0 is returned if the LAG interface does not exist.
Returns the default fallback timeout value in seconds.
This API adds/removes a physical interface to/from a LAG interface. To add an interface, the interface id and its LACP mode are needed. To remove an interface from a LAG interface, the “intf” needs to be provided, and eth_lag_intf_id needs to be the empty intf with intf_type()==INTF_TYPE_NULL (created by intf_id_t()).
When removing an interface from a LAG interface, this API may throw “no_such_interface_error” exception if the specified LAG interface does not exist. It may also throw “invalid_argument_error” exception if the specified “intf” is not in any LAG interface.
When adding an interface to a LAG interface, this API may throw “Invalid_ argument_error” error if the interface’s mode is not compatible with the LAG interface mode.
Returns the LAG interface ID to which the physical interface is configured to belong. An empty intf_id_t is returned if the physical interface is not configured or is not in a LAG.
Returns the member interface’s status details. Will return empty eth_lag_intf_membership_t if the physical interface is not configured, or it’s not active in a LAG.
Sets the port LACP priority.
Gets the interface’s configured LACP priority. 0 will be returned if the member interface is not existing.
Sets the mode of this member in a LAG interface.
Returns the mode of this member in a LAG interface. If the member interface is not existing, ETH_LAG_INTF_MEMBER_LACP_MODE_NULL is returned.
Sets the LACP timeout for a member in a LAG.
Gets the configured LACP timeout for a member in a LAG. If the member interface does not exist, ETH_LAG_INTF_MEMBER_LACP_TIMEOUT_NULL will be returned.
Returns whether this interface is active in a LAG. False is returned if the member interface does not exist.
Returns the time in seconds since reboot when this interface was last added or removed as a member from a LAG. If this interface has never been a LAG member, this returns 0.
Returns the reason this interface isn’t active in LAG. Returns the empty string if the interface is not configured to be in any LAG, or if the interface is active in the LAg.
Protected Functions
Private Members
Friends
Enums
LAG interface fallback type.
Values:
Not a valid fallback type.
No fallback if no LACPDUs seen.
Fallback to static mode.
Fallback to individual mode.
How long to wait for LACP before fallback.
Values:
Values:
LAG interface mebmer LACP mode.
Values:
LAG interface mebmer timeout values.
Values:
This data structure is used to describe the operational status of an interface configured in an LAG interface.
Public Functions
Constructor with paremeters.
Getter for ‘eth_lag_intf_id’: the LAG interface id this interface is configured to be in.
Setter for ‘eth_lag_intf_id’.
Getter for ‘active’: the attribute indicating whether this interface is active in an LAG.
Getter for ‘reason’: if populated, reason this interface isn’t in LAG.
Setter for ‘reason’.
Getter for ‘member_time’: the time when this interface became member of an LAG. If never a member, then the value is 0; if once was member, but now is not, then this is the time the interface was removed from member.
Getter for ‘mode’: the LACP mode this interface is configured.
The hash function for type eth_lag_intf_membership_t.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of eth_lag_intf_membership_t to the ostream.
This data structure defines a LAG interface, which is also known as a Link-Aggregation Group, or Port-Channel. LAGs bundle physical interfaces together into a single logical link to provide combined bandwidth and other benefits.
Public Functions
Constructor with interface id.
Constructor with interface id.
Getter for ‘intf’: the id of this LAG interface.
Getter for ‘speed’: the aggregated capacity (speed) of this LAG interface in megabits.
Getter for ‘min_links’: the min links required up before bringing up an LAG interface.
Getter for ‘fallback_type’: the fallback mode for this LAG interface.
Getter for ‘fallback_timeout’: the LACP active mode timeout value in seconds.
Returns the default fallback timeout value in seconds.
The hash function for type eth_lag_intf_t.
Returns a string representation of the current object’s values.
Private Members
Friends
A utility stream operator that adds a string representation of eth_lag_intf_t to the ostream.