|
| 1 | +/** |
| 2 | + * Copyright (c) 20XX Microsoft Open Technologies, Inc. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 5 | + * not use this file except in compliance with the License. You may obtain |
| 6 | + * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | + * |
| 8 | + * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR |
| 9 | + * CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT |
| 10 | + * LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS |
| 11 | + * FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT. |
| 12 | + * |
| 13 | + * See the Apache Version 2.0 License for specific language governing |
| 14 | + * permissions and limitations under the License. |
| 15 | + * |
| 16 | + * Microsoft would like to thank the following companies for their review and |
| 17 | + * assistance with these files: Intel Corporation, Mellanox Technologies Ltd, |
| 18 | + * Dell Products, L.P., Facebook, Inc., Marvell International Ltd. |
| 19 | + * |
| 20 | + * @file sail2ecmpgroup.h |
| 21 | + * |
| 22 | + * @brief This module defines SAI L2 ECMP GROUP interface |
| 23 | + */ |
| 24 | + |
| 25 | +#if !defined (__SAIL2ECMPGROUP_H_) |
| 26 | +#define __SAIL2ECMPGROUP_H_ |
| 27 | + |
| 28 | +#include <saitypes.h> |
| 29 | + |
| 30 | +/** |
| 31 | + * @defgroup SAIL2ECMPGROUP SAI - L2 ECMP GROUP specific API definitions |
| 32 | + * |
| 33 | + * @{ |
| 34 | + */ |
| 35 | + |
| 36 | +/** |
| 37 | + * @brief Attribute id for L2 ECMP GROUP |
| 38 | + */ |
| 39 | +typedef enum _sai_l2_ecmp_group_attr_t |
| 40 | +{ |
| 41 | + /** |
| 42 | + * @brief Start of attributes |
| 43 | + */ |
| 44 | + SAI_L2_ECMP_GROUP_ATTR_START, |
| 45 | + |
| 46 | + /** |
| 47 | + * @brief Number of L2 ECMP GROUP members in the group |
| 48 | + * |
| 49 | + * @type sai_uint32_t |
| 50 | + * @flags READ_ONLY |
| 51 | + */ |
| 52 | + SAI_L2_ECMP_GROUP_ATTR_MEMBER_COUNT = SAI_L2_ECMP_GROUP_ATTR_START, |
| 53 | + |
| 54 | + /** |
| 55 | + * @brief L2 ECMP GROUP member list |
| 56 | + * |
| 57 | + * @type sai_object_list_t |
| 58 | + * @flags READ_ONLY |
| 59 | + * @objects SAI_OBJECT_TYPE_L2_ECMP_GROUP_MEMBER |
| 60 | + */ |
| 61 | + SAI_L2_ECMP_GROUP_ATTR_MEMBER_LIST, |
| 62 | + |
| 63 | + /** |
| 64 | + * @brief Attach a counter |
| 65 | + * |
| 66 | + * When it is empty, then packet hits won't be counted |
| 67 | + * |
| 68 | + * @type sai_object_id_t |
| 69 | + * @flags CREATE_AND_SET |
| 70 | + * @objects SAI_OBJECT_TYPE_COUNTER |
| 71 | + * @allownull true |
| 72 | + * @default SAI_NULL_OBJECT_ID |
| 73 | + */ |
| 74 | + SAI_L2_ECMP_GROUP_ATTR_COUNTER_ID, |
| 75 | + |
| 76 | + /** |
| 77 | + * @brief End of attributes |
| 78 | + */ |
| 79 | + SAI_L2_ECMP_GROUP_ATTR_END, |
| 80 | + |
| 81 | + /** Custom range base value */ |
| 82 | + SAI_L2_ECMP_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000, |
| 83 | + |
| 84 | + /** End of custom range base */ |
| 85 | + SAI_L2_ECMP_GROUP_ATTR_CUSTOM_RANGE_END |
| 86 | + |
| 87 | +} sai_l2_ecmp_group_attr_t; |
| 88 | + |
| 89 | +typedef enum _sai_l2_ecmp_group_member_attr_t |
| 90 | +{ |
| 91 | + /** |
| 92 | + * @brief Start of attributes |
| 93 | + */ |
| 94 | + SAI_L2_ECMP_GROUP_MEMBER_ATTR_START, |
| 95 | + |
| 96 | + /** |
| 97 | + * @brief L2 ECMP GROUP id |
| 98 | + * |
| 99 | + * @type sai_object_id_t |
| 100 | + * @flags MANDATORY_ON_CREATE | CREATE_ONLY |
| 101 | + * @objects SAI_OBJECT_TYPE_L2_ECMP_GROUP |
| 102 | + */ |
| 103 | + SAI_L2_ECMP_GROUP_MEMBER_ATTR_L2_ECMP_GROUP_ID = SAI_L2_ECMP_GROUP_MEMBER_ATTR_START, |
| 104 | + |
| 105 | + /** |
| 106 | + * @brief P2P Tunnel oid |
| 107 | + * |
| 108 | + * @type sai_object_id_t |
| 109 | + * @flags MANDATORY_ON_CREATE | CREATE_ONLY |
| 110 | + * @objects SAI_OBJECT_TYPE_TUNNEL |
| 111 | + */ |
| 112 | + SAI_L2_ECMP_GROUP_MEMBER_ATTR_TUNNEL_ID, |
| 113 | + |
| 114 | + /** |
| 115 | + * @brief End of attributes |
| 116 | + */ |
| 117 | + SAI_L2_ECMP_GROUP_MEMBER_ATTR_END, |
| 118 | + |
| 119 | + /** Custom range base value */ |
| 120 | + SAI_L2_ECMP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000, |
| 121 | + |
| 122 | + /** End of custom range base */ |
| 123 | + SAI_L2_ECMP_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END |
| 124 | + |
| 125 | +} sai_l2_ecmp_group_member_attr_t; |
| 126 | + |
| 127 | +/** |
| 128 | + * @brief Create L2 ECMP group |
| 129 | + * |
| 130 | + * @param[out] l2_ecmp_group_id L2 ECMP group id |
| 131 | + * @param[in] switch_id Switch id |
| 132 | + * @param[in] attr_count Number of attributes |
| 133 | + * @param[in] attr_list Array of attributes |
| 134 | + * |
| 135 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 136 | + */ |
| 137 | +typedef sai_status_t (*sai_create_l2_ecmp_group_fn)( |
| 138 | + _Out_ sai_object_id_t *l2_ecmp_group_id, |
| 139 | + _In_ sai_object_id_t switch_id, |
| 140 | + _In_ uint32_t attr_count, |
| 141 | + _In_ const sai_attribute_t *attr_list); |
| 142 | + |
| 143 | +/** |
| 144 | + * @brief Remove L2 ECMP group |
| 145 | + * |
| 146 | + * @param[in] l2_ecmp_group_id L2 ECMP group id |
| 147 | + * |
| 148 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 149 | + */ |
| 150 | +typedef sai_status_t (*sai_remove_l2_ecmp_group_fn)( |
| 151 | + _In_ sai_object_id_t l2_ecmp_group_id); |
| 152 | + |
| 153 | +/** |
| 154 | + * @brief Set L2 ECMP Group attribute |
| 155 | + * |
| 156 | + * @param[in] l2_ecmp_group_id L2 ECMP group id |
| 157 | + * @param[in] attr Attribute |
| 158 | + * |
| 159 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 160 | + */ |
| 161 | +typedef sai_status_t (*sai_set_l2_ecmp_group_attribute_fn)( |
| 162 | + _In_ sai_object_id_t l2_ecmp_group_id, |
| 163 | + _In_ const sai_attribute_t *attr); |
| 164 | + |
| 165 | +/** |
| 166 | + * @brief Get L2 ECMP Group attribute |
| 167 | + * |
| 168 | + * @param[in] l2_ecmp_group_id L2 ECMP group ID |
| 169 | + * @param[in] attr_count Number of attributes |
| 170 | + * @param[inout] attr_list Array of attributes |
| 171 | + * |
| 172 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 173 | + */ |
| 174 | +typedef sai_status_t (*sai_get_l2_ecmp_group_attribute_fn)( |
| 175 | + _In_ sai_object_id_t l2_ecmp_group_id, |
| 176 | + _In_ uint32_t attr_count, |
| 177 | + _Inout_ sai_attribute_t *attr_list); |
| 178 | + |
| 179 | +/** |
| 180 | + * @brief Create L2 ECMP group member |
| 181 | + * |
| 182 | + * @param[out] l2_ecmp_group_member_id L2 ECMP group member id |
| 183 | + * @param[in] switch_id Switch ID |
| 184 | + * @param[in] attr_count Number of attributes |
| 185 | + * @param[in] attr_list Array of attributes |
| 186 | + * |
| 187 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 188 | + */ |
| 189 | +typedef sai_status_t (*sai_create_l2_ecmp_group_member_fn)( |
| 190 | + _Out_ sai_object_id_t *l2_ecmp_group_member_id, |
| 191 | + _In_ sai_object_id_t switch_id, |
| 192 | + _In_ uint32_t attr_count, |
| 193 | + _In_ const sai_attribute_t *attr_list); |
| 194 | + |
| 195 | +/** |
| 196 | + * @brief Remove L2 ECMP group member |
| 197 | + * |
| 198 | + * @param[in] l2_ecmp_group_member_id L2 ECMP group member ID |
| 199 | + * |
| 200 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 201 | + */ |
| 202 | +typedef sai_status_t (*sai_remove_l2_ecmp_group_member_fn)( |
| 203 | + _In_ sai_object_id_t l2_ecmp_group_member_id); |
| 204 | + |
| 205 | +/** |
| 206 | + * @brief Set L2 ECMP Group member attribute |
| 207 | + * |
| 208 | + * @param[in] l2_ecmp_group_member_id L2 ECMP group member ID |
| 209 | + * @param[in] attr Attribute |
| 210 | + * |
| 211 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 212 | + */ |
| 213 | +typedef sai_status_t (*sai_set_l2_ecmp_group_member_attribute_fn)( |
| 214 | + _In_ sai_object_id_t l2_ecmp_group_member_id, |
| 215 | + _In_ const sai_attribute_t *attr); |
| 216 | + |
| 217 | +/** |
| 218 | + * @brief Get L2 ECMP Group member attribute |
| 219 | + * |
| 220 | + * @param[in] l2_ecmp_group_member_id L2 ECMP group member ID |
| 221 | + * @param[in] attr_count Number of attributes |
| 222 | + * @param[inout] attr_list Array of attributes |
| 223 | + * |
| 224 | + * @return #SAI_STATUS_SUCCESS on success, failure status code on error |
| 225 | + */ |
| 226 | +typedef sai_status_t (*sai_get_l2_ecmp_group_member_attribute_fn)( |
| 227 | + _In_ sai_object_id_t l2_ecmp_group_member_id, |
| 228 | + _In_ uint32_t attr_count, |
| 229 | + _Inout_ sai_attribute_t *attr_list); |
| 230 | + |
| 231 | +typedef struct _sai_l2_ecmp_group_api_t |
| 232 | +{ |
| 233 | + sai_create_l2_ecmp_group_fn create_l2_ecmp_group; |
| 234 | + sai_remove_l2_ecmp_group_fn remove_l2_ecmp_group; |
| 235 | + sai_set_l2_ecmp_group_attribute_fn set_l2_ecmp_group_attribute; |
| 236 | + sai_get_l2_ecmp_group_attribute_fn get_l2_ecmp_group_attribute; |
| 237 | + sai_create_l2_ecmp_group_member_fn create_l2_ecmp_group_member; |
| 238 | + sai_remove_l2_ecmp_group_member_fn remove_l2_ecmp_group_member; |
| 239 | + sai_set_l2_ecmp_group_member_attribute_fn set_l2_ecmp_group_member_attribute; |
| 240 | + sai_get_l2_ecmp_group_member_attribute_fn get_l2_ecmp_group_member_attribute; |
| 241 | +} sai_l2_ecmp_group_api_t; |
| 242 | + |
| 243 | +/** |
| 244 | + * @} |
| 245 | + */ |
| 246 | +#endif /** __SAIL2ECMPGROUP_H_ */ |
0 commit comments