|
| 1 | +/** |
| 2 | + * Copyright (c) 2014 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 saiexperimentaldashtrustedvni.h |
| 21 | + * |
| 22 | + * @brief This module defines SAI extensions for DASH trusted VNI |
| 23 | + * |
| 24 | + * @warning This module is a SAI experimental module |
| 25 | + */ |
| 26 | + |
| 27 | +#if !defined (__SAIEXPERIMENTALDASHTRUSTEDVNI_H_) |
| 28 | +#define __SAIEXPERIMENTALDASHTRUSTEDVNI_H_ |
| 29 | + |
| 30 | +#include <saitypesextensions.h> |
| 31 | + |
| 32 | +/** |
| 33 | + * @defgroup SAIEXPERIMENTALDASHTRUSTEDVNI SAI - Experimental: DASH trusted VNI specific API definitions |
| 34 | + * |
| 35 | + * @{ |
| 36 | + */ |
| 37 | + |
| 38 | +/** |
| 39 | + * @brief Attribute data for #SAI_TRUSTED_VNI_ENTRY_ATTR_ACTION |
| 40 | + */ |
| 41 | +typedef enum _sai_trusted_vni_entry_action_t |
| 42 | +{ |
| 43 | + SAI_TRUSTED_VNI_ENTRY_ACTION_PERMIT, |
| 44 | + |
| 45 | +} sai_trusted_vni_entry_action_t; |
| 46 | + |
| 47 | +/** |
| 48 | + * @brief Entry for trusted_vni_entry |
| 49 | + */ |
| 50 | +typedef struct _sai_trusted_vni_entry_t |
| 51 | +{ |
| 52 | + /** |
| 53 | + * @brief Switch ID |
| 54 | + * |
| 55 | + * @objects SAI_OBJECT_TYPE_SWITCH |
| 56 | + */ |
| 57 | + sai_object_id_t switch_id; |
| 58 | + |
| 59 | + /** |
| 60 | + * @brief Exact matched key eni_id |
| 61 | + * |
| 62 | + * @objects SAI_OBJECT_TYPE_ENI |
| 63 | + */ |
| 64 | + sai_object_id_t eni_id; |
| 65 | + |
| 66 | + /** |
| 67 | + * @brief Range matched key vni_range |
| 68 | + */ |
| 69 | + sai_u32_range_t vni_range; |
| 70 | + |
| 71 | +} sai_trusted_vni_entry_t; |
| 72 | + |
| 73 | +/** |
| 74 | + * @brief Attribute ID for trusted VNI entry |
| 75 | + */ |
| 76 | +typedef enum _sai_trusted_vni_entry_attr_t |
| 77 | +{ |
| 78 | + /** |
| 79 | + * @brief Start of attributes |
| 80 | + */ |
| 81 | + SAI_TRUSTED_VNI_ENTRY_ATTR_START, |
| 82 | + |
| 83 | + /** |
| 84 | + * @brief Action |
| 85 | + * |
| 86 | + * @type sai_trusted_vni_entry_action_t |
| 87 | + * @flags CREATE_AND_SET |
| 88 | + * @default SAI_TRUSTED_VNI_ENTRY_ACTION_PERMIT |
| 89 | + */ |
| 90 | + SAI_TRUSTED_VNI_ENTRY_ATTR_ACTION = SAI_TRUSTED_VNI_ENTRY_ATTR_START, |
| 91 | + |
| 92 | + /** |
| 93 | + * @brief End of attributes |
| 94 | + */ |
| 95 | + SAI_TRUSTED_VNI_ENTRY_ATTR_END, |
| 96 | + |
| 97 | + /** Custom range base value */ |
| 98 | + SAI_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000, |
| 99 | + |
| 100 | + /** End of custom range base */ |
| 101 | + SAI_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_END, |
| 102 | + |
| 103 | +} sai_trusted_vni_entry_attr_t; |
| 104 | + |
| 105 | +/** |
| 106 | + * @brief Create trusted VNI entry |
| 107 | + * |
| 108 | + * @param[in] trusted_vni_entry Entry |
| 109 | + * @param[in] attr_count Number of attributes |
| 110 | + * @param[in] attr_list Array of attributes |
| 111 | + * |
| 112 | + * @return #SAI_STATUS_SUCCESS on success Failure status code on error |
| 113 | + */ |
| 114 | +typedef sai_status_t (*sai_create_trusted_vni_entry_fn)( |
| 115 | + _In_ const sai_trusted_vni_entry_t *trusted_vni_entry, |
| 116 | + _In_ uint32_t attr_count, |
| 117 | + _In_ const sai_attribute_t *attr_list); |
| 118 | + |
| 119 | +/** |
| 120 | + * @brief Remove trusted VNI entry |
| 121 | + * |
| 122 | + * @param[in] trusted_vni_entry Entry |
| 123 | + * |
| 124 | + * @return #SAI_STATUS_SUCCESS on success Failure status code on error |
| 125 | + */ |
| 126 | +typedef sai_status_t (*sai_remove_trusted_vni_entry_fn)( |
| 127 | + _In_ const sai_trusted_vni_entry_t *trusted_vni_entry); |
| 128 | + |
| 129 | +/** |
| 130 | + * @brief Set attribute for trusted VNI entry |
| 131 | + * |
| 132 | + * @param[in] trusted_vni_entry Entry |
| 133 | + * @param[in] attr Attribute |
| 134 | + * |
| 135 | + * @return #SAI_STATUS_SUCCESS on success Failure status code on error |
| 136 | + */ |
| 137 | +typedef sai_status_t (*sai_set_trusted_vni_entry_attribute_fn)( |
| 138 | + _In_ const sai_trusted_vni_entry_t *trusted_vni_entry, |
| 139 | + _In_ const sai_attribute_t *attr); |
| 140 | + |
| 141 | +/** |
| 142 | + * @brief Get attribute for trusted VNI entry |
| 143 | + * |
| 144 | + * @param[in] trusted_vni_entry Entry |
| 145 | + * @param[in] attr_count Number of attributes |
| 146 | + * @param[inout] attr_list Array of attributes |
| 147 | + * |
| 148 | + * @return #SAI_STATUS_SUCCESS on success Failure status code on error |
| 149 | + */ |
| 150 | +typedef sai_status_t (*sai_get_trusted_vni_entry_attribute_fn)( |
| 151 | + _In_ const sai_trusted_vni_entry_t *trusted_vni_entry, |
| 152 | + _In_ uint32_t attr_count, |
| 153 | + _Inout_ sai_attribute_t *attr_list); |
| 154 | + |
| 155 | +/** |
| 156 | + * @brief Bulk create trusted VNI entry |
| 157 | + * |
| 158 | + * @param[in] object_count Number of objects to create |
| 159 | + * @param[in] trusted_vni_entry List of object to create |
| 160 | + * @param[in] attr_count List of attr_count. Caller passes the number |
| 161 | + * of attribute for each object to create. |
| 162 | + * @param[in] attr_list List of attributes for every object. |
| 163 | + * @param[in] mode Bulk operation error handling mode. |
| 164 | + * @param[out] object_statuses List of status for every object. Caller needs to |
| 165 | + * allocate the buffer |
| 166 | + * |
| 167 | + * @return #SAI_STATUS_SUCCESS on success when all objects are created or |
| 168 | + * #SAI_STATUS_FAILURE when any of the objects fails to create. When there is |
| 169 | + * failure, Caller is expected to go through the list of returned statuses to |
| 170 | + * find out which fails and which succeeds. |
| 171 | + */ |
| 172 | +typedef sai_status_t (*sai_bulk_create_trusted_vni_entry_fn)( |
| 173 | + _In_ uint32_t object_count, |
| 174 | + _In_ const sai_trusted_vni_entry_t *trusted_vni_entry, |
| 175 | + _In_ const uint32_t *attr_count, |
| 176 | + _In_ const sai_attribute_t **attr_list, |
| 177 | + _In_ sai_bulk_op_error_mode_t mode, |
| 178 | + _Out_ sai_status_t *object_statuses); |
| 179 | + |
| 180 | +/** |
| 181 | + * @brief Bulk remove trusted VNI entry |
| 182 | + * |
| 183 | + * @param[in] object_count Number of objects to remove |
| 184 | + * @param[in] trusted_vni_entry List of objects to remove |
| 185 | + * @param[in] mode Bulk operation error handling mode. |
| 186 | + * @param[out] object_statuses List of status for every object. Caller needs to |
| 187 | + * allocate the buffer |
| 188 | + * |
| 189 | + * @return #SAI_STATUS_SUCCESS on success when all objects are removed or |
| 190 | + * #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is |
| 191 | + * failure, Caller is expected to go through the list of returned statuses to |
| 192 | + * find out which fails and which succeeds. |
| 193 | + */ |
| 194 | +typedef sai_status_t (*sai_bulk_remove_trusted_vni_entry_fn)( |
| 195 | + _In_ uint32_t object_count, |
| 196 | + _In_ const sai_trusted_vni_entry_t *trusted_vni_entry, |
| 197 | + _In_ sai_bulk_op_error_mode_t mode, |
| 198 | + _Out_ sai_status_t *object_statuses); |
| 199 | + |
| 200 | +typedef struct _sai_dash_trusted_vni_api_t |
| 201 | +{ |
| 202 | + sai_create_trusted_vni_entry_fn create_trusted_vni_entry; |
| 203 | + sai_remove_trusted_vni_entry_fn remove_trusted_vni_entry; |
| 204 | + sai_set_trusted_vni_entry_attribute_fn set_trusted_vni_entry_attribute; |
| 205 | + sai_get_trusted_vni_entry_attribute_fn get_trusted_vni_entry_attribute; |
| 206 | + sai_bulk_create_trusted_vni_entry_fn create_trusted_vni_entries; |
| 207 | + sai_bulk_remove_trusted_vni_entry_fn remove_trusted_vni_entries; |
| 208 | + |
| 209 | +} sai_dash_trusted_vni_api_t; |
| 210 | + |
| 211 | +/** |
| 212 | + * @} |
| 213 | + */ |
| 214 | +#endif /** __SAIEXPERIMENTALDASHTRUSTEDVNI_H_ */ |
0 commit comments