diff --git a/inc/sai.h b/inc/sai.h index f33293364..ba664e696 100644 --- a/inc/sai.h +++ b/inc/sai.h @@ -78,6 +78,7 @@ #include "saimymac.h" #include "saigenericprogrammable.h" #include "saitwamp.h" +#include "sail2ecmpgroup.h" #include "saiversion.h" #include "saipoe.h" @@ -148,6 +149,7 @@ typedef enum _sai_api_t SAI_API_ARS_PROFILE = 49, /** + +/** + * @defgroup SAIL2ECMPGROUP SAI - L2 ECMP GROUP specific API definitions + * + * @{ + */ + +/** + * @brief Attribute id for L2 ECMP GROUP + */ +typedef enum _sai_l2_ecmp_group_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_L2_ECMP_GROUP_ATTR_START, + + /** + * @brief Number of L2 ECMP GROUP members in the group + * + * @type sai_uint32_t + * @flags READ_ONLY + */ + SAI_L2_ECMP_GROUP_ATTR_MEMBER_COUNT = SAI_L2_ECMP_GROUP_ATTR_START, + + /** + * @brief L2 ECMP GROUP member list + * + * @type sai_object_list_t + * @flags READ_ONLY + * @objects SAI_OBJECT_TYPE_L2_ECMP_GROUP_MEMBER + */ + SAI_L2_ECMP_GROUP_ATTR_MEMBER_LIST, + + /** + * @brief Attach a counter + * + * When it is empty, then packet hits won't be counted + * + * @type sai_object_id_t + * @flags CREATE_AND_SET + * @objects SAI_OBJECT_TYPE_COUNTER + * @allownull true + * @default SAI_NULL_OBJECT_ID + */ + SAI_L2_ECMP_GROUP_ATTR_COUNTER_ID, + + /** + * @brief End of attributes + */ + SAI_L2_ECMP_GROUP_ATTR_END, + + /** Custom range base value */ + SAI_L2_ECMP_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_L2_ECMP_GROUP_ATTR_CUSTOM_RANGE_END + +} sai_l2_ecmp_group_attr_t; + +typedef enum _sai_l2_ecmp_group_member_attr_t +{ + /** + * @brief Start of attributes + */ + SAI_L2_ECMP_GROUP_MEMBER_ATTR_START, + + /** + * @brief L2 ECMP GROUP id + * + * @type sai_object_id_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @objects SAI_OBJECT_TYPE_L2_ECMP_GROUP + */ + SAI_L2_ECMP_GROUP_MEMBER_ATTR_L2_ECMP_GROUP_ID = SAI_L2_ECMP_GROUP_MEMBER_ATTR_START, + + /** + * @brief P2P Tunnel oid + * + * @type sai_object_id_t + * @flags MANDATORY_ON_CREATE | CREATE_ONLY + * @objects SAI_OBJECT_TYPE_TUNNEL + */ + SAI_L2_ECMP_GROUP_MEMBER_ATTR_TUNNEL_ID, + + /** + * @brief End of attributes + */ + SAI_L2_ECMP_GROUP_MEMBER_ATTR_END, + + /** Custom range base value */ + SAI_L2_ECMP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000, + + /** End of custom range base */ + SAI_L2_ECMP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END + +} sai_l2_ecmp_group_member_attr_t; + +/** + * @brief Create L2 ECMP group + * + * @param[out] l2_ecmp_group_id L2 ECMP group id + * @param[in] switch_id Switch id + * @param[in] attr_count Number of attributes + * @param[in] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_create_l2_ecmp_group_fn)( + _Out_ sai_object_id_t *l2_ecmp_group_id, + _In_ sai_object_id_t switch_id, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove L2 ECMP group + * + * @param[in] l2_ecmp_group_id L2 ECMP group id + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_remove_l2_ecmp_group_fn)( + _In_ sai_object_id_t l2_ecmp_group_id); + +/** + * @brief Set L2 ECMP Group attribute + * + * @param[in] l2_ecmp_group_id L2 ECMP group id + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_set_l2_ecmp_group_attribute_fn)( + _In_ sai_object_id_t l2_ecmp_group_id, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get L2 ECMP Group attribute + * + * @param[in] l2_ecmp_group_id L2 ECMP group ID + * @param[in] attr_count Number of attributes + * @param[inout] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_get_l2_ecmp_group_attribute_fn)( + _In_ sai_object_id_t l2_ecmp_group_id, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +/** + * @brief Create L2 ECMP group member + * + * @param[out] l2_ecmp_group_member_id L2 ECMP group member id + * @param[in] switch_id Switch ID + * @param[in] attr_count Number of attributes + * @param[in] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_create_l2_ecmp_group_member_fn)( + _Out_ sai_object_id_t *l2_ecmp_group_member_id, + _In_ sai_object_id_t switch_id, + _In_ uint32_t attr_count, + _In_ const sai_attribute_t *attr_list); + +/** + * @brief Remove L2 ECMP group member + * + * @param[in] l2_ecmp_group_member_id L2 ECMP group member ID + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_remove_l2_ecmp_group_member_fn)( + _In_ sai_object_id_t l2_ecmp_group_member_id); + +/** + * @brief Set L2 ECMP Group member attribute + * + * @param[in] l2_ecmp_group_member_id L2 ECMP group member ID + * @param[in] attr Attribute + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_set_l2_ecmp_group_member_attribute_fn)( + _In_ sai_object_id_t l2_ecmp_group_member_id, + _In_ const sai_attribute_t *attr); + +/** + * @brief Get L2 ECMP Group member attribute + * + * @param[in] l2_ecmp_group_member_id L2 ECMP group member ID + * @param[in] attr_count Number of attributes + * @param[inout] attr_list Array of attributes + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_get_l2_ecmp_group_member_attribute_fn)( + _In_ sai_object_id_t l2_ecmp_group_member_id, + _In_ uint32_t attr_count, + _Inout_ sai_attribute_t *attr_list); + +typedef struct _sai_l2_ecmp_group_api_t +{ + sai_create_l2_ecmp_group_fn create_l2_ecmp_group; + sai_remove_l2_ecmp_group_fn remove_l2_ecmp_group; + sai_set_l2_ecmp_group_attribute_fn set_l2_ecmp_group_attribute; + sai_get_l2_ecmp_group_attribute_fn get_l2_ecmp_group_attribute; + sai_create_l2_ecmp_group_member_fn create_l2_ecmp_group_member; + sai_remove_l2_ecmp_group_member_fn remove_l2_ecmp_group_member; + sai_set_l2_ecmp_group_member_attribute_fn set_l2_ecmp_group_member_attribute; + sai_get_l2_ecmp_group_member_attribute_fn get_l2_ecmp_group_member_attribute; +} sai_l2_ecmp_group_api_t; + +/** + * @} + */ +#endif /** __SAIL2ECMPGROUP_H_ */ diff --git a/inc/saitypes.h b/inc/saitypes.h index 3ec3c9984..e10a98c6b 100644 --- a/inc/saitypes.h +++ b/inc/saitypes.h @@ -298,6 +298,8 @@ typedef enum _sai_object_type_t SAI_OBJECT_TYPE_POE_DEVICE = 108, SAI_OBJECT_TYPE_POE_PSE = 109, SAI_OBJECT_TYPE_POE_PORT = 110, + SAI_OBJECT_TYPE_L2_ECMP_GROUP = 111, + SAI_OBJECT_TYPE_L2_ECMP_GROUP_MEMBER = 112, /** Must remain in last position */ SAI_OBJECT_TYPE_MAX,