-
Notifications
You must be signed in to change notification settings - Fork 609
Expand file tree
/
Copy pathsaimymac.h
More file actions
172 lines (153 loc) · 4.53 KB
/
Copy pathsaimymac.h
File metadata and controls
172 lines (153 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/**
* Copyright (c) 2014 Microsoft Open Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
* LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS
* FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
*
* See the Apache Version 2.0 License for specific language governing
* permissions and limitations under the License.
*
* Microsoft would like to thank the following companies for their review and
* assistance with these files: Intel Corporation, Mellanox Technologies Ltd,
* Dell Products, L.P., Facebook, Inc., Marvell International Ltd.
*
* @file saimymac.h
*
* @brief This module defines SAI My MAC
*/
#if !defined (__SAIMYMAC_H_)
#define __SAIMYMAC_H_
#include <saitypes.h>
/**
* @brief My MAC entry attribute IDs
*/
typedef enum _sai_my_mac_attr_t
{
/**
* @brief Start of attributes
*/
SAI_MY_MAC_ATTR_START,
/**
* @brief Priority
*
* Value must be in the range defined in
* \[#SAI_SWITCH_ATTR_MY_MAC_TABLE_MINIMUM_PRIORITY,
* #SAI_SWITCH_ATTR_MY_MAC_TABLE_MAXIMUM_PRIORITY\]
* (default = #SAI_SWITCH_ATTR_MY_MAC_TABLE_MINIMUM_PRIORITY)
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 0
*/
SAI_MY_MAC_ATTR_PRIORITY = SAI_MY_MAC_ATTR_START,
/**
* @brief Associated Port, LAG object id,
* if not specified any port will match
*
* @type sai_object_id_t
* @flags CREATE_ONLY
* @objects SAI_OBJECT_TYPE_PORT, SAI_OBJECT_TYPE_LAG
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_MY_MAC_ATTR_PORT_ID,
/**
* @brief Associated Vlan Id,
* if not specified any vlan id will match
*
* @type sai_uint16_t
* @flags CREATE_ONLY
* @isvlan true
* @default 0
*/
SAI_MY_MAC_ATTR_VLAN_ID,
/**
* @brief MAC Address
*
* @type sai_mac_t
* @flags CREATE_ONLY
* @default vendor
*/
SAI_MY_MAC_ATTR_MAC_ADDRESS,
/**
* @brief MAC Address Mask
*
* @type sai_mac_t
* @flags CREATE_ONLY
* @default vendor
*/
SAI_MY_MAC_ATTR_MAC_ADDRESS_MASK,
/**
* @brief End of attributes
*/
SAI_MY_MAC_ATTR_END,
/** Custom range base value */
SAI_MY_MAC_ATTR_CUSTOM_RANGE_START = 0x10000000,
/** End of custom range base */
SAI_MY_MAC_ATTR_CUSTOM_RANGE_END
} sai_my_mac_attr_t;
/**
* @brief Create My MAC entry.
*
* @param[out] my_mac_id My MAC 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_my_mac_fn)(
_Out_ sai_object_id_t *my_mac_id,
_In_ sai_object_id_t switch_id,
_In_ uint32_t attr_count,
_In_ const sai_attribute_t *attr_list);
/**
* @brief Remove My MAC entry
*
* @param[in] my_mac_id My MAC Id
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_remove_my_mac_fn)(
_In_ sai_object_id_t my_mac_id);
/**
* @brief Set My MAC entry attribute
*
* @param[in] my_mac_id My MAC id
* @param[in] attr Attribute
*
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
*/
typedef sai_status_t (*sai_set_my_mac_attribute_fn)(
_In_ sai_object_id_t my_mac_id,
_In_ const sai_attribute_t *attr);
/**
* @brief Get My MAC entry attribute
*
* @param[in] my_mac_id My MAC 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_my_mac_attribute_fn)(
_In_ sai_object_id_t my_mac_id,
_In_ uint32_t attr_count,
_Inout_ sai_attribute_t *attr_list);
/**
* @brief My MAC methods table retrieved with sai_api_query()
*/
typedef struct _sai_my_mac_api_t
{
sai_create_my_mac_fn create_my_mac;
sai_remove_my_mac_fn remove_my_mac;
sai_set_my_mac_attribute_fn set_my_mac_attribute;
sai_get_my_mac_attribute_fn get_my_mac_attribute;
} sai_my_mac_api_t;
#endif /** __SAIMYMAC_H_ */