Open Ethernet Networking (OpEN) API Guide and Reference Manual  3.13.1.2
openapi_lag.h
Go to the documentation of this file.
1 
9 /*********************************************************************
10 *
11 * Copyright 2016-2024 Broadcom.
12 *
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
16 *
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 *
25 **********************************************************************
26 *
27 * @filename openapi_lag.h
28 *
29 * @purpose LAG Configuration and Status
30 *
31 * @component OPEN
32 *
33 * @create 10/10/2012
34 *
35 * @end
36 *
37 **********************************************************************/
38 #ifndef OPENAPI_LAG_H_INCLUDED
39 #define OPENAPI_LAG_H_INCLUDED
40 
41 #include <stdio.h>
42 #include <stddef.h>
43 #include <sys/un.h>
44 
45 #include "openapi_common.h"
46 
48 typedef enum
49 {
58 
60 typedef enum
61 {
66 
67 #define OPEN_MAX_MEMBERS_PER_LAG 32
68 #define OPEN_LAG_MEMBER_BUFFER_SIZE (sizeof(uint32_t) * OPEN_MAX_MEMBERS_PER_LAG)
69 
70 #define OPEN_LAG_PORT_ACTOR_SYSTEM_PRIORITY_MIN 0
71 #define OPEN_LAG_PORT_ACTOR_SYSTEM_PRIORITY_DEFAULT 32768
72 #define OPEN_LAG_PORT_ACTOR_SYSTEM_PRIORITY_MAX 65535
73 
74 #define OPEN_LAG_PORT_ACTOR_PORT_PRIORITY_MIN 0
75 #define OPEN_LAG_PORT_ACTOR_PORT_PRIORITY_DEFAULT 128
76 #define OPEN_LAG_PORT_ACTOR_PORT_PRIORITY_MAX 65535
77 
79 typedef enum
80 {
84  OPEN_LAG_NON_UNICAST_HASH_MODE_OPTIONS_TOTAL
86 
88 typedef struct
89 {
90  maskValue_t modesConfigured[OPEN_MASK_LEN(OPEN_LAG_NON_UNICAST_HASH_MODE_OPTIONS_TOTAL)];
92 
93 
94 /*****************************************************************/
111  uint32_t lagIfNum,
112  uint32_t phyIfNum);
113 
114 /*****************************************************************/
129  uint32_t lagIfNum,
130  uint32_t phyIfNum);
131 
132 /*****************************************************************/
148  uint32_t lagIfNum,
149  OPEN_CONTROL_t *staticMode);
150 
151 /*****************************************************************/
172  uint32_t lagIfNum,
173  OPEN_CONTROL_t staticMode);
174 
175 /*****************************************************************/
188  uint32_t *maxLen);
189 
190 /***********************************************************************/
208  uint32_t lagIfNum,
209  open_buffdesc *name);
210 
211 /***********************************************************************/
230  uint32_t lagIfNum,
231  open_buffdesc *name);
232 
233 /****************************************************************************/
248  uint32_t lagIfNum,
249  OPEN_LAG_HASH_MODE_t *lbMode);
250 
251 /****************************************************************************/
268  uint32_t lagIfNum,
269  OPEN_LAG_HASH_MODE_t lbMode);
270 
271 /*****************************************************************/
287  uint32_t *minThreshold,
288  uint32_t *maxThreshold);
289 
290 /****************************************************************************/
307  uint32_t lagIfNum,
308  uint32_t *minUpLinks);
309 
310 /****************************************************************************/
330  uint32_t lagIfNum,
331  uint32_t minUpLinks);
332 
333 /*****************************************************************/
348  uint32_t *memberMax);
349 
350 /****************************************************************************/
372  uint32_t lagIfNum,
373  uint32_t *count,
374  open_buffdesc *bufd);
375 
376 /****************************************************************************/
398  uint32_t lagIfNum,
399  uint32_t *count,
400  open_buffdesc *bufd);
401 
402 /****************************************************************************/
424  uint32_t lagIfNum,
425  uint32_t *count,
426  open_buffdesc *bufd);
427 
428 /****************************************************************************/
450  uint32_t lagIfNum,
451  uint32_t *count,
452  open_buffdesc *bufd);
453 
454 /****************************************************************************/
469  uint32_t ifNum,
470  OPEN_CONTROL_t *lacpMode);
471 
472 /****************************************************************************/
487  uint32_t ifNum,
488  OPEN_CONTROL_t lacpMode);
489 
490 /****************************************************************************/
506  uint32_t ifNum,
508  OPEN_CONTROL_t *state);
509 
510 /****************************************************************************/
526  uint32_t ifNum,
528  OPEN_CONTROL_t mode);
529 
530 /*****************************************************************/
546  uint32_t lagIfNum,
547  OPEN_CONTROL_t *adminMode);
548 
549 /*****************************************************************/
565  uint32_t lagIfNum,
566  OPEN_CONTROL_t adminMode);
567 
568 /*****************************************************************/
586  OPEN_CONTROL_t *adminMode);
587 
588 /*****************************************************************/
606  OPEN_CONTROL_t adminMode);
607 
608 /****************************************************************************/
625  OPEN_LAG_HASH_MODE_t *hashMode);
626 
627 /****************************************************************************/
644  OPEN_LAG_HASH_MODE_t hashMode);
645 
646 /*****************************************************************/
664  OPEN_CONTROL_t *adminMode);
665 
666 /*****************************************************************/
685  OPEN_CONTROL_t adminMode);
686 
687 /*****************************************************************/
706  uint32_t lagIntIfNum,
707  OPEN_CONTROL_t *adminMode);
708 
709 /*****************************************************************/
727  uint32_t lagIntIfNum,
728  OPEN_BOOL_t *autoLagStatus);
729 
730 /*************************************************************************/
746  uint32_t ifNum, uint32_t *val);
747 
748 /*************************************************************************/
764  uint32_t ifNum, uint32_t val);
765 /*************************************************************************/
780  uint32_t *val);
781 
782 /*************************************************************************/
797  uint32_t val);
798 
799 /*************************************************************************/
815  uint32_t ifNum, uint32_t *val);
816 /*************************************************************************/
832  uint32_t ifNum, uint32_t val);
833 
834 /*************************************************************************/
849  uint32_t *lagCount);
850 
851 /*************************************************************************/
866  uint32_t *intfIndex);
867 
868 /*************************************************************************/
887  uint32_t intfIndex,
888  uint32_t *nextIntfIndex);
889 
890 /*************************************************************************/
909  uint32_t ifNum,
910  uint32_t *portChannelId);
911 
912 /*****************************************************************/
934  openLagNonUnicastHashMode_t *hashMode);
935 
936 /*****************************************************************/
959  openLagNonUnicastHashMode_t hashMode);
960 #endif
961 
open_error_t openapiLagPortChannelIdGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *portChannelId)
Get the port channel ID for a given interface number.
open_error_t openapiLagIfIndexGetNext(openapiClientHandle_t *client_handle, uint32_t intfIndex, uint32_t *nextIntfIndex)
Get the interface index number of the next successive LAG interface.
open_error_t openapiLagAutoLAGAvbProfileModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *adminMode)
Get the Auto-LAG global AVB profile mode.
open_error_t openapiLagIfIndexGetFirst(openapiClientHandle_t *client_handle, uint32_t *intfIndex)
Get the interface index number of the first LAG interface.
open_error_t openapiLagNameGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, open_buffdesc *name)
Gets name of the LAG interface.
open_error_t openapiDot3adAggPortLacpModeGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t *lacpMode)
Gets the LACP mode of the physical interface.
open_error_t openapiLagLoadBalanceModeSet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, OPEN_LAG_HASH_MODE_t lbMode)
Sets load balancing mode of the LAG interface.
#define OPEN_MASK_LEN(_size)
SETMASKBIT turns on bit index # k in mask j.
open_error_t openapiLagNameMaxLengthGet(openapiClientHandle_t *client_handle, uint32_t *maxLen)
Get the maximum LAG name length.
open_error_t openapiLagActiveMembersListGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t *count, open_buffdesc *bufd)
Gets a comma-delimited list of active member ports for the LAG interface.
OPEN_LAG_HASH_MODE_t
Hash Mode names.
Definition: openapi_lag.h:48
open_error_t openapiLagThresholdMinMaxGet(openapiClientHandle_t *client_handle, uint32_t *minThreshold, uint32_t *maxThreshold)
Get the LAG Threshold minimum and maximum values.
open_error_t openapiDot3adAggPortActorAdminStateSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DOT3AD_STATE_TYPE_t type, OPEN_CONTROL_t mode)
Sets the LACP actor admin state.
open_error_t openapiLagAvbProfileModeGet(openapiClientHandle_t *client_handle, uint32_t lagIntIfNum, OPEN_CONTROL_t *adminMode)
Get the AVB profile mode of the LAG interface.
OPEN_LAG_NON_UNICAST_HASH_MODE_OPTIONS_t
Definition: openapi_lag.h:79
open_error_t
OPEN uses these enumerators to indicate the error codes.
Src IP and Src TCP/UDP Port fields.
Definition: openapi_lag.h:53
Enhanced hashing mode.
Definition: openapi_lag.h:56
open_error_t openapiLagNonUnicastGlobalHashModeGet(openapiClientHandle_t *client_handle, openLagNonUnicastHashMode_t *hashMode)
Set global non unicast hash mode for a LAG system.
open_error_t openapiLagStaticModeGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, OPEN_CONTROL_t *staticMode)
Gets static mode of the LAG interface.
open_error_t openapiLagAdminModeSet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, OPEN_CONTROL_t adminMode)
Set the administrative mode of a LAG interface.
open_error_t openapiLagMinUplinksSet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t minUpLinks)
Sets minimum uplinks for the LAG interface.
OPEN_DOT3AD_STATE_TYPE_t
OpEN uses these enumerations to indicate DOT3AD state types.
Definition: openapi_lag.h:60
open_error_t openapiLagAggPortActorPortPrioritySet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t val)
Set the priority of this aggregation port.
open_error_t openapiLagMembersGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t *count, open_buffdesc *bufd)
Gets the list of member ports for the LAG interface.
open_error_t openapiLagAutoLAGModeGet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t *adminMode)
Get the Auto-LAG administrative mode.
open_error_t openapiLagLoadBalanceModeGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, OPEN_LAG_HASH_MODE_t *lbMode)
Gets load balancing mode of the LAG interface.
open_error_t openapiLagMembersListGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t *count, open_buffdesc *bufd)
Gets a comma-delimited list of member ports for the LAG interface.
open_error_t openapiLagAggPortActorSystemPriorityGet(openapiClientHandle_t *client_handle, uint32_t *val)
Get the priority value associated with the system actor&#39;s ID.
Dest MAC, VLAN, EType, incoming port.
Definition: openapi_lag.h:51
open_error_t openapiLagNameSet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, open_buffdesc *name)
Sets name of the LAG interface.
Dest IP and Dest TCP/UDP Port fields.
Definition: openapi_lag.h:54
open_error_t openapiLagAutoLAGHashModeGet(openapiClientHandle_t *client_handle, OPEN_LAG_HASH_MODE_t *hashMode)
Get the Auto-LAG global hash mode.
open_error_t openapiLagNonUnicastGlobalHashModeSet(openapiClientHandle_t *client_handle, openLagNonUnicastHashMode_t hashMode)
Set global non unicast hash mode for a LAG system.
open_error_t openapiLagCountGet(openapiClientHandle_t *client_handle, uint32_t *lagCount)
Get the current number of LAGs in the system (static and dynamic).
open_error_t openapiLagAutoLAGHashModeSet(openapiClientHandle_t *client_handle, OPEN_LAG_HASH_MODE_t hashMode)
Set the Auto-LAG global hash mode.
open_error_t openapiLagLinkTrapGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *val)
Get the link trap mode of a configured LAG.
Src/Dest MAC, VLAN, EType, incoming port.
Definition: openapi_lag.h:52
open_error_t openapiLagAdminModeGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, OPEN_CONTROL_t *adminMode)
Get the administrative mode of a LAG interface.
open_error_t openapiLagMaxMemberCountGet(openapiClientHandle_t *client_handle, uint32_t *memberMax)
Get the maximum number of members allowed for a LAG.
OPEN_CONTROL_t
OPEN uses these enumerators to indicate enable or disable for a given config or status parameter...
OPEN_BOOL_t
OPEN uses these enumerators to indicate true or false for a given config or status parameter...
open_error_t openapiLagPortDelete(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t phyIfNum)
Delete a physical interface from a LAG interface.
open_error_t openapiDot3adAggPortLacpModeSet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_CONTROL_t lacpMode)
Sets the LACP mode of the physical interface.
open_error_t openapiDot3adAggPortActorAdminStateGet(openapiClientHandle_t *client_handle, uint32_t ifNum, OPEN_DOT3AD_STATE_TYPE_t type, OPEN_CONTROL_t *state)
Gets the LACP actor admin state.
open_error_t openapiLagAutoLAGStatusGet(openapiClientHandle_t *client_handle, uint32_t lagIntIfNum, OPEN_BOOL_t *autoLagStatus)
Get the Auto-LAG status of the LAG interface.
open_error_t openapiLagAutoLAGAvbProfileModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t adminMode)
Set the Auto-LAG global AVB profile mode.
open_error_t openapiLagPortAdd(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t phyIfNum)
Adds a physical interface to a LAG interface.
open_error_t openapiLagAggPortActorPortPriorityGet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t *val)
Get the priority assigned to this aggregation port.
open_error_t openapiLagActiveMembersGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t *count, open_buffdesc *bufd)
Gets the list of active member ports for the LAG interface.
open_error_t openapiLagMinUplinksGet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, uint32_t *minUpLinks)
Gets minimum uplinks for the LAG interface.
Src/Dest IP and TCP/UDP Port fields.
Definition: openapi_lag.h:55
open_error_t openapiLagLinkTrapSet(openapiClientHandle_t *client_handle, uint32_t ifNum, uint32_t val)
Set the link trap mode of a configured LAG.
open_error_t openapiLagAggPortActorSystemPrioritySet(openapiClientHandle_t *client_handle, uint32_t val)
Set the priority value associated with the system actor&#39;s ID.
open_error_t openapiLagAutoLAGModeSet(openapiClientHandle_t *client_handle, OPEN_CONTROL_t adminMode)
Set the Auto-LAG administrative mode.
open_error_t openapiLagStaticModeSet(openapiClientHandle_t *client_handle, uint32_t lagIfNum, OPEN_CONTROL_t staticMode)
Sets static mode of the LAG interface.
Src MAC, VLAN, EType, incoming port.
Definition: openapi_lag.h:50