3 * @brief this file contains the public API of @ref IxEthDB component
7 * IXP400 SW Release version 2.0
9 * -- Copyright Notice --
12 * Copyright 2001-2005, Intel Corporation.
13 * All rights reserved.
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 * 3. Neither the name of the Intel Corporation nor the names of its contributors
25 * may be used to endorse or promote products derived from this software
26 * without specific prior written permission.
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
30 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
31 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
32 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
33 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
34 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
35 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
36 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
37 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
38 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * -- End of Copyright Notice --
49 #include <IxOsBuffMgt.h>
53 * @defgroup IxEthDB IXP400 Ethernet Database (IxEthDB) API
55 * @brief ethDB is a library that does provides a MAC address database learning/filtering capability
60 #define INLINE __inline__
62 #define IX_ETH_DB_PRIVATE PRIVATE /* imported from IxTypes.h */
64 #define IX_ETH_DB_PUBLIC PUBLIC
67 * @brief port ID => message handler NPE id conversion (0 => NPE_B, 1 => NPE_C)
69 #define IX_ETH_DB_PORT_ID_TO_NPE(id) (id == 0 ? 1 : (id == 1 ? 2 : (id == 2 ? 0 : -1)))
72 * @def IX_ETH_DB_NPE_TO_PORT_ID(npe)
73 * @brief message handler NPE id => port ID conversion (NPE_B => 0, NPE_C => 1)
75 #define IX_ETH_DB_NPE_TO_PORT_ID(npe) (npe == 0 ? 2 : (npe == 1 ? 0 : (npe == 2 ? 1 : -1)))
77 /* temporary define - won't work for Azusa */
78 #define IX_ETH_DB_PORT_ID_TO_NPE_LOGICAL_ID(id) (IX_ETH_DB_PORT_ID_TO_NPE(id) << 4)
79 #define IX_ETH_DB_NPE_LOGICAL_ID_TO_PORT_ID(id) (IX_ETH_DB_NPE_TO_PORT_ID(id >> 4))
82 * @def IX_IEEE803_MAC_ADDRESS_SIZE
83 * @brief The size of the MAC address
85 #define IX_IEEE803_MAC_ADDRESS_SIZE (6)
88 * @def IX_IEEE802_1Q_QOS_PRIORITY_COUNT
89 * @brief Number of QoS priorities defined by IEEE802.1Q
91 #define IX_IEEE802_1Q_QOS_PRIORITY_COUNT (8)
95 * @brief Ethernet Database API return values
97 typedef enum /* IxEthDBStatus */
99 IX_ETH_DB_SUCCESS
= IX_SUCCESS
, /**< Success */
100 IX_ETH_DB_FAIL
= IX_FAIL
, /**< Failure */
101 IX_ETH_DB_INVALID_PORT
, /**< Invalid port */
102 IX_ETH_DB_PORT_UNINITIALIZED
, /**< Port not initialized */
103 IX_ETH_DB_MAC_UNINITIALIZED
, /**< MAC not initialized */
104 IX_ETH_DB_INVALID_ARG
, /**< Invalid argument */
105 IX_ETH_DB_NO_SUCH_ADDR
, /**< Address not found for search or delete operations */
106 IX_ETH_DB_NOMEM
, /**< Learning database memory full */
107 IX_ETH_DB_BUSY
, /**< Learning database cannot complete operation, access temporarily blocked */
108 IX_ETH_DB_END
, /**< Database browser passed the end of the record set */
109 IX_ETH_DB_INVALID_VLAN
, /**< Invalid VLAN ID (valid range is 0..4094, 0 signifies no VLAN membership, used for priority tagged frames) */
110 IX_ETH_DB_INVALID_PRIORITY
, /**< Invalid QoS priority/traffic class (valid range for QoS priority is 0..7, valid range for traffic class depends on run-time configuration) */
111 IX_ETH_DB_NO_PERMISSION
, /**< No permission for attempted operation */
112 IX_ETH_DB_FEATURE_UNAVAILABLE
, /**< Feature not available (or not enabled) */
113 IX_ETH_DB_INVALID_KEY
, /**< Invalid search key */
114 IX_ETH_DB_INVALID_RECORD_TYPE
/**< Invalid record type */
117 /** @brief VLAN ID type, valid range is 0..4094, 0 signifying no VLAN membership */
118 typedef UINT32 IxEthDBVlanId
;
120 /** @brief 802.1Q VLAN tag, contains 3 bits user priority, 1 bit CFI, 12 bits VLAN ID */
121 typedef UINT32 IxEthDBVlanTag
;
123 /** @brief QoS priority/traffic class type, valid range is 0..7, 0 being the lowest */
124 typedef UINT32 IxEthDBPriority
;
126 /** @brief Priority mapping table; 0..7 QoS priorities used to index, table contains traffic classes */
127 typedef UINT8 IxEthDBPriorityTable
[8];
129 /** @brief A 4096 bit array used to map the complete VLAN ID range */
130 typedef UINT8 IxEthDBVlanSet
[512];
132 #define IX_ETH_DB_802_1Q_VLAN_MASK (0xFFF)
133 #define IX_ETH_DB_802_1Q_QOS_MASK (0x7)
135 #define IX_ETH_DB_802_1Q_MAX_VLAN_ID (0xFFE)
138 * @def IX_ETH_DB_SET_VLAN_ID
139 * @brief returns the given 802.1Q tag with the VLAN ID field substituted with the given VLAN ID
141 * This macro is used to change the VLAN ID in a 802.1Q tag.
145 * tag = IX_ETH_DB_SET_VLAN_ID(tag, 32)
147 * inserts the VLAN ID "32" in the given tag.
149 #define IX_ETH_DB_SET_VLAN_ID(vlanTag, vlanID) (((vlanTag) & 0xF000) | ((vlanID) & IX_ETH_DB_802_1Q_VLAN_MASK))
152 * @def IX_ETH_DB_GET_VLAN_ID
153 * @brief returns the VLAN ID from the given 802.1Q tag
155 #define IX_ETH_DB_GET_VLAN_ID(vlanTag) ((vlanTag) & IX_ETH_DB_802_1Q_VLAN_MASK)
157 #define IX_ETH_DB_GET_QOS_PRIORITY(vlanTag) (((vlanTag) >> 13) & IX_ETH_DB_802_1Q_QOS_MASK)
159 #define IX_ETH_DB_SET_QOS_PRIORITY(vlanTag, priority) (((vlanTag) & 0x1FFF) | (((priority) & IX_ETH_DB_802_1Q_QOS_MASK) << 13))
161 #define IX_ETH_DB_CHECK_VLAN_TAG(vlanTag) { if(((vlanTag & 0xFFFF0000) != 0) || (IX_ETH_DB_GET_VLAN_ID(vlanTag) > 4094)) return IX_ETH_DB_INVALID_VLAN; }
163 #define IX_ETH_DB_CHECK_VLAN_ID(vlanId) { if (vlanId > IX_ETH_DB_802_1Q_MAX_VLAN_ID) return IX_ETH_DB_INVALID_VLAN; }
165 #define IX_IEEE802_1Q_VLAN_TPID (0x8100)
169 IX_ETH_DB_UNTAGGED_FRAMES
= 0x1, /**< Accepts untagged frames */
170 IX_ETH_DB_VLAN_TAGGED_FRAMES
= 0x2, /**< Accepts tagged frames */
171 IX_ETH_DB_PRIORITY_TAGGED_FRAMES
= 0x4, /**< Accepts tagged frames with VLAN ID set to 0 (no VLAN membership) */
172 IX_ETH_DB_ACCEPT_ALL_FRAMES
=
173 IX_ETH_DB_UNTAGGED_FRAMES
| IX_ETH_DB_VLAN_TAGGED_FRAMES
/**< Accepts all the frames */
174 } IxEthDBFrameFilter
;
178 IX_ETH_DB_PASS_THROUGH
= 0x1, /**< Leave frame as-is */
179 IX_ETH_DB_ADD_TAG
= 0x2, /**< Add default port VLAN tag */
180 IX_ETH_DB_REMOVE_TAG
= 0x3 /**< Remove VLAN tag from frame */
181 } IxEthDBTaggingAction
;
185 IX_ETH_DB_FIREWALL_WHITE_LIST
= 0x1, /**< Firewall operates in white-list mode (MAC address based admission) */
186 IX_ETH_DB_FIREWALL_BLACK_LIST
= 0x2 /**< Firewall operates in black-list mode (MAC address based blocking) */
187 } IxEthDBFirewallMode
;
191 IX_ETH_DB_FILTERING_RECORD
= 0x01, /**< <table><caption> Filtering record </caption>
192 * <tr><td> MAC address <td> static/dynamic type <td> age
195 IX_ETH_DB_FILTERING_VLAN_RECORD
= 0x02, /**< <table><caption> VLAN-enabled filtering record </caption>
196 * <tr><td> MAC address <td> static/dynamic type <td> age <td> 802.1Q tag
199 IX_ETH_DB_WIFI_RECORD
= 0x04, /**< <table><caption> WiFi header conversion record </caption>
200 * <tr><td> MAC address <td> optional gateway MAC address <td>
203 IX_ETH_DB_FIREWALL_RECORD
= 0x08, /**< <table><caption> Firewall record </caption>
204 * <tr><td> MAC address
207 IX_ETH_DB_GATEWAY_RECORD
= 0x10, /**< <i>For internal use only</i> */
208 IX_ETH_DB_MAX_RECORD_TYPE_INDEX
= 0x10, /**< <i>For internal use only</i> */
209 IX_ETH_DB_NO_RECORD_TYPE
= 0, /**< None of the registered record types */
210 IX_ETH_DB_ALL_FILTERING_RECORDS
= IX_ETH_DB_FILTERING_RECORD
| IX_ETH_DB_FILTERING_VLAN_RECORD
, /**< All the filtering records */
211 IX_ETH_DB_ALL_RECORD_TYPES
= IX_ETH_DB_FILTERING_RECORD
| IX_ETH_DB_FILTERING_VLAN_RECORD
|
212 IX_ETH_DB_WIFI_RECORD
| IX_ETH_DB_FIREWALL_RECORD
/**< All the record types registered within EthDB */
217 IX_ETH_DB_LEARNING
= 0x01, /**< Learning feature; enables EthDB to learn MAC address (filtering) records, including 802.1Q enabled records */
218 IX_ETH_DB_FILTERING
= 0x02, /**< Filtering feature; enables EthDB to communicate with the NPEs for downloading filtering information in the NPEs; depends on the learning feature */
219 IX_ETH_DB_VLAN_QOS
= 0x04, /**< VLAN/QoS feature; enables EthDB to configure NPEs to operate in VLAN/QoS aware modes */
220 IX_ETH_DB_FIREWALL
= 0x08, /**< Firewall feature; enables EthDB to configure NPEs to operate in firewall mode, using white/black address lists */
221 IX_ETH_DB_SPANNING_TREE_PROTOCOL
= 0x10, /**< Spanning tree protocol feature; enables EthDB to configure the NPEs as STP nodes */
222 IX_ETH_DB_WIFI_HEADER_CONVERSION
= 0x20 /**< WiFi 802.3 to 802.11 header conversion feature; enables EthDB to handle WiFi conversion data */
225 typedef UINT32 IxEthDBProperty
; /**< Property ID type */
229 IX_ETH_DB_INTEGER_PROPERTY
= 0x1, /**< 4 byte unsigned integer type */
230 IX_ETH_DB_STRING_PROPERTY
= 0x2, /**< NULL-terminated string type of maximum 255 characters (including the terminator) */
231 IX_ETH_DB_MAC_ADDR_PROPERTY
= 0x3, /**< 6 byte MAC address type */
232 IX_ETH_DB_BOOL_PROPERTY
= 0x4 /**< 4 byte boolean type; can contain only TRUE and FALSE values */
233 } IxEthDBPropertyType
;
235 /* list of supported properties for the IX_ETH_DB_VLAN_QOS feature */
236 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_COUNT_PROPERTY (0x01) /**< Property identifying number the supported number of traffic classes */
237 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_0_RX_QUEUE_PROPERTY (0x10) /**< Rx queue assigned to traffic class 0 */
238 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_1_RX_QUEUE_PROPERTY (0x11) /**< Rx queue assigned to traffic class 1 */
239 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_2_RX_QUEUE_PROPERTY (0x12) /**< Rx queue assigned to traffic class 2 */
240 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_3_RX_QUEUE_PROPERTY (0x13) /**< Rx queue assigned to traffic class 3 */
241 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_4_RX_QUEUE_PROPERTY (0x14) /**< Rx queue assigned to traffic class 4 */
242 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_5_RX_QUEUE_PROPERTY (0x15) /**< Rx queue assigned to traffic class 5 */
243 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_6_RX_QUEUE_PROPERTY (0x16) /**< Rx queue assigned to traffic class 6 */
244 #define IX_ETH_DB_QOS_TRAFFIC_CLASS_7_RX_QUEUE_PROPERTY (0x17) /**< Rx queue assigned to traffic class 7 */
246 /* private property used by EthAcc to indicate queue configuration complete */
247 #define IX_ETH_DB_QOS_QUEUE_CONFIGURATION_COMPLETE (0x18)
251 * @brief The IEEE 802.3 Ethernet MAC address structure.
253 * The data should be packed with bytes xx:xx:xx:xx:xx:xx
255 * @note The data must be packed in network byte order.
259 UINT8 macAddress
[IX_IEEE803_MAC_ADDRESS_SIZE
];
265 * @brief Definition of an IXP400 port.
267 typedef UINT32 IxEthDBPortId
;
272 * @brief Port dependency map definition
274 typedef UINT8 IxEthDBPortMap
[32];
279 * @fn IxEthDBStatus ixEthDBInit(void)
281 * @brief Initializes the Ethernet learning/filtering database
283 * @note calling this function multiple times does not constitute an error;
284 * redundant calls will be ignored, returning IX_ETH_DB_SUCCESS
286 * @retval IX_ETH_DB_SUCCESS initialization was successful
287 * @retval IX_ETH_DB_FAIL initialization failed (OS error)
290 IxEthDBStatus
ixEthDBInit(void);
295 * @fn IxEthDBStatus ixEthDBUnload(void)
297 * @brief Stops and prepares the EthDB component for unloading.
299 * @retval IX_ETH_DB_SUCCESS de-initialization was successful
300 * @retval IX_ETH_DB_BUSY de-initialization failed, ports must be disabled first
301 * @retval IX_ETH_DB_FAIL de-initialization failed (OS error)
304 IxEthDBStatus
ixEthDBUnload(void);
309 * @fn void ixEthDBPortInit(IxEthDBPortId portID)
311 * @brief Initializes a port
313 * This function is called automatically by the Ethernet Access
314 * ixEthAccPortInit() routine for Ethernet NPE ports and should be manually
315 * called for any user-defined port (any port that is not one of
316 * the two Ethernet NPEs).
318 * @param portID @ref IxEthDBPortId [in] - ID of the port to be initialized
320 * @see IxEthDBPortDefs.h for port definitions
322 * @note calling this function multiple times does not constitute an error;
323 * redundant calls will be ignored
326 void ixEthDBPortInit(IxEthDBPortId portID
);
331 * @fn IxEthDBStatus ixEthDBPortEnable(IxEthDBPortId portID)
333 * @brief Enables a port
335 * This function is called automatically from the Ethernet Access component
336 * ixEthAccPortEnable() routine for Ethernet NPE ports and should be manually
337 * called for any user-defined port (any port that is not one of
338 * the Ethernet NPEs).
340 * @param portID @ref IxEthDBPortId [in] - ID of the port to enable processing on
342 * @retval IX_ETH_DB_SUCCESS if enabling is successful
343 * @retval IX_ETH_DB_FAIL if the enabling was not successful due to
344 * a message handler error
345 * @retval IX_ETH_DB_MAC_UNINITIALIZED the MAC address of this port was
346 * not initialized (only for Ethernet NPEs)
347 * @retval IX_ETH_DB_INVALID_PORT if portID is invalid
349 * @pre ixEthDBPortAddressSet needs to be called prior to enabling the port events
352 * @see ixEthDBPortAddressSet
354 * @see IxEthDBPortDefs.h for port definitions
356 * @note calling this function multiple times does not constitute an error;
357 * redundant calls will be ignored
360 IxEthDBStatus
ixEthDBPortEnable(IxEthDBPortId portID
);
365 * @fn IxEthDBStatus ixEthDBPortDisable(IxEthDBPortId portID)
367 * @brief Disables processing on a port
369 * This function is called automatically from the Ethernet Access component
370 * ixEthAccPortDisable() routine for Ethernet NPE ports and should be manually
371 * called for any user-defined port (any port that is not one of
372 * the Ethernet NPEs).
374 * @note Calling ixEthAccPortDisable() will disable the respective Ethernet NPE.
375 * After Ethernet NPEs are disabled they are stopped therefore
376 * when re-enabled they need to be reset, downloaded with microcode and started.
377 * For learning to restart working the user needs to call again
378 * ixEthAccPortUnicastMacAddressSet or ixEthDBUnicastAddressSet
379 * with the respective port MAC address.
380 * Residual MAC addresses learnt before the port was disabled are deleted as soon
381 * as the port is disabled. This only applies to dynamic (learnt) entries, static
382 * entries do not dissapear when the port is disabled.
384 * @param portID @ref IxEthDBPortId [in] - ID of the port to disable processing on
386 * @retval IX_ETH_DB_SUCCESS if disabling is successful
387 * @retval IX_ETH_DB_FAIL if the disabling was not successful due to
388 * a message handler error
389 * @retval IX_ETH_DB_INVALID_PORT if portID is invalid
391 * @note calling this function multiple times after the first time completed successfully
392 * does not constitute an error; redundant calls will be ignored and return IX_ETH_DB_SUCCESS
395 IxEthDBStatus
ixEthDBPortDisable(IxEthDBPortId portID
);
400 * @fn IxEthDBStatus ixEthDBPortAddressSet(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
402 * @brief Sets the port MAC address
404 * This function is to be called from the Ethernet Access component top-level
405 * ixEthDBUnicastAddressSet(). Event processing cannot be enabled for a port
406 * until its MAC address has been set.
408 * @param portID @ref IxEthDBPortId [in] - ID of the port whose MAC address is set
409 * @param macAddr @ref IxEthDBMacAddr [in] - port MAC address
411 * @retval IX_ETH_DB_SUCCESS MAC address was set successfully
412 * @retval IX_ETH_DB_FAIL MAC address was not set due to a message handler failure
413 * @retval IX_ETH_DB_INVALID_PORT if the port is not an Ethernet NPE
415 * @see IxEthDBPortDefs.h for port definitions
418 IxEthDBStatus
ixEthDBPortAddressSet(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
423 * @fn IxEthDBStatus ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID, UINT32 maximumFrameSize)
425 * @brief Set the maximum frame size supported on the given port ID
427 * This functions set the maximum frame size supported on a specific port ID
430 * - ISR Callable - no
432 * @param portID @ref IxEthDBPortId [in] - port ID to configure
433 * @param maximumFrameSize UINT32 [in] - maximum frame size to configure
435 * @retval IX_ETH_DB_SUCCESS the port is configured
436 * @retval IX_ETH_DB_PORT_UNINITIALIZED the port has not been initialized
437 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
438 * @retval IX_ETH_DB_INVALID_ARG size parameter is out of range
439 * @retval IX_ETH_DB_NO_PERMISSION selected port is not an Ethernet NPE
440 * @retval IX_FAIL unknown OS or NPE communication error
443 * This maximum frame size is used to filter the frames based on their
444 * destination addresses and the capabilities of the destination port.
445 * The mximum value that can be set for a NPE port is 16320.
446 * (IX_ETHNPE_ACC_FRAME_LENGTH_MAX)
449 IxEthDBStatus
ixEthDBFilteringPortMaximumFrameSizeSet(IxEthDBPortId portID
, UINT32 maximumFrameSize
);
454 * @fn IxEthDBStatus ixEthDBFilteringStaticEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
456 * @brief Populate the Ethernet learning/filtering database with a static MAC address
458 * Populates the Ethernet learning/filtering database with a static MAC address. The entry will not be subject to aging.
459 * If there is an entry (static or dynamic) with the corresponding MAC address on any port this entry will take precedence.
460 * Any other entry with the same MAC address will be removed.
463 * - ISR Callable - yes
465 * @param portID @ref IxEthDBPortId [in] - port ID to add the static address to
466 * @param macAddr @ref IxEthDBMacAddr [in] - static MAC address to add
468 * @retval IX_ETH_DB_SUCCESS the add was successful
469 * @retval IX_ETH_DB_FAIL failed to populate the database entry
470 * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later
471 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
472 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
473 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
474 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
477 IxEthDBStatus
ixEthDBFilteringStaticEntryProvision(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
482 * @fn IxEthDBStatus ixEthDBFilteringDynamicEntryProvision(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
484 * @brief Populate the Ethernet learning/filtering database with a dynamic MAC address
486 * Populates the Ethernet learning/filtering database with a dynamic MAC address. This entry will be subject to normal
487 * aging function, if aging is enabled on its port.
488 * If there is an entry (static or dynamic) with the same MAC address on any port this entry will take precedence.
489 * Any other entry with the same MAC address will be removed.
492 * - ISR Callable - yes
494 * @param portID @ref IxEthDBPortId [in] - port ID to add the dynamic address to
495 * @param macAddr @ref IxEthDBMacAddr [in] - static MAC address to add
497 * @retval IX_ETH_DB_SUCCESS the add was successful
498 * @retval IX_ETH_DB_FAIL failed to populate the database entry
499 * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later
500 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
501 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
502 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
503 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
506 IxEthDBStatus
ixEthDBFilteringDynamicEntryProvision(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
511 * @fn IxEthDBStatus ixEthDBFilteringEntryDelete(IxEthDBMacAddr *macAddr)
513 * @brief Removes a MAC address entry from the Ethernet learning/filtering database
515 * @param macAddr IxEthDBMacAddr [in] - MAC address to remove
518 * - ISR Callable - no
520 * @retval IX_ETH_DB_SUCCESS the removal was successful
521 * @retval IX_ETH_DB_NO_SUCH_ADDR failed to remove the address (not in the database)
522 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
523 * @retval IX_ETH_DB_BUSY failed due to a temporary busy condition (i.e. lack of CPU cycles), try again later
526 IxEthDBStatus
ixEthDBFilteringEntryDelete(IxEthDBMacAddr
*macAddr
);
531 * @fn IxEthDBStatus ixEthDBFilteringPortSearch(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
533 * @brief Search the Ethernet learning/filtering database for the given MAC address and port ID
535 * This functions searches the database for a specific port ID and MAC address. Both the port ID
536 * and the MAC address have to match in order for the record to be reported as found.
539 * - ISR Callable - no
541 * @param portID @ref IxEthDBPortId [in] - port ID to search for
542 * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to search for
544 * @retval IX_ETH_DB_SUCCESS the record exists in the database
545 * @retval IX_ETH_DB_INVALID_ARG invalid macAddr pointer argument
546 * @retval IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database
547 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
548 * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
549 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
552 IxEthDBStatus
ixEthDBFilteringPortSearch(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
557 * @fn IxEthDBStatus ixEthDBFilteringDatabaseSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr)
559 * @brief Search the Ethernet learning/filtering database for a MAC address and return the port ID
561 * Searches the database for a MAC address. The function returns the portID for the
562 * MAC address record, if found. If no match is found the function returns IX_ETH_DB_NO_SUCH_ADDR.
563 * The portID is only valid if the function finds a match.
566 * - ISR Callable - no
568 * @param portID @ref IxEthDBPortId [in] - port ID the address belongs to (populated only on a successful search)
569 * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to search for
571 * @retval IX_ETH_DB_SUCCESS the record exists in the database
572 * @retval IX_ETH_DB_NO_SUCH_ADDR the record was not found in the database
573 * @retval IX_ETH_DB_INVALID_ARG invalid macAddr or portID pointer argument(s)
576 IxEthDBStatus
ixEthDBFilteringDatabaseSearch(IxEthDBPortId
*portID
, IxEthDBMacAddr
*macAddr
);
581 * @fn IxEthDBStatus ixEthDBFilteringPortUpdatingSearch(IxEthDBPortId *portID, IxEthDBMacAddr *macAddr)
583 * @brief Search the filtering database for a MAC address, return the port ID and reset the record age
585 * Searches the database for a MAC address. The function returns the portID for the
586 * MAC address record and resets the entry age to 0, if found.
587 * If no match is found the function returns IX_ETH_DB_NO_SUCH_ADDR.
588 * The portID is only valid if the function finds a match.
591 * - ISR Callable - no
593 * @retval IX_ETH_DB_SUCCESS the MAC address was found
594 * @retval IX_ETH_DB_NO_SUCH_ADDR the MAC address was not found
595 * @retval IX_ETH_DB_INVALID_ARG invalid macAddr or portID pointer argument(s)
598 IxEthDBStatus
ixEthDBFilteringPortUpdatingSearch(IxEthDBPortId
*portID
, IxEthDBMacAddr
*macAddr
);
603 * @def IX_ETH_DB_MAINTENANCE_TIME
605 * @brief The @ref ixEthDBDatabaseMaintenance must be called by the user at a frequency of
606 * IX_ETH_DB_MAINTENANCE_TIME
609 #define IX_ETH_DB_MAINTENANCE_TIME (1 * 60) /* 1 Minute */
614 * @def IX_ETH_DB_LEARNING_ENTRY_AGE_TIME
616 * @brief The define specifies the filtering database age entry time. Static entries older than
617 * IX_ETH_DB_LEARNING_ENTRY_AGE_TIME +/- IX_ETH_DB_MAINTENANCE_TIME shall be removed.
620 #define IX_ETH_DB_LEARNING_ENTRY_AGE_TIME (15 * 60 ) /* 15 Mins */
625 * @fn IxEthDBStatus ixEthDBPortAgingDisable(IxEthDBPortId portID)
627 * @brief Disable the aging function for a specific port
629 * @param portID @ref IxEthDBPortId [in] - port ID to disable aging on
632 * - ISR Callable - no
634 * @retval IX_ETH_DB_SUCCESS aging disabled successfully
635 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
636 * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
637 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
640 IxEthDBStatus
ixEthDBPortAgingDisable(IxEthDBPortId portID
);
645 * @fn IxEthDBStatus ixEthDBPortAgingEnable(IxEthDBPortId portID)
647 * @brief Enable the aging function for a specific port
649 * Enables the aging of dynamic MAC address entries stored in the learning/filtering database
651 * @note The aging function relies on the @ref ixEthDBDatabaseMaintenance being called with a period of
652 * @ref IX_ETH_DB_MAINTENANCE_TIME seconds.
655 * - ISR Callable - no
657 * @param portID @ref IxEthDBPortId [in] - port ID to enable aging on
659 * @retval IX_ETH_DB_SUCCESS aging enabled successfully
660 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
661 * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
662 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE learning feature is disabled
665 IxEthDBStatus
ixEthDBPortAgingEnable(IxEthDBPortId portID
);
670 * @fn void ixEthDBDatabaseMaintenance(void)
672 * @brief Performs a maintenance operation on the Ethernet learning/filtering database
674 * In order to perform a database maintenance this function must be called every
675 * @ref IX_ETH_DB_MAINTENANCE_TIME seconds. It should be called regardless of whether learning is
679 * - ISR Callable - no
681 * @note this function call will be ignored if the learning feature is disabled
684 void ixEthDBDatabaseMaintenance(void);
689 * @fn IxEthDBStatus ixEthDBFilteringDatabaseShow(IxEthDBPortId portID)
691 * @brief This function displays the Mac Ethernet MAC address filtering tables.
693 * It displays the MAC address, port ID, entry type (dynamic/static),and age for
697 * - ISR Callable - no
699 * @param portID @ref IxEthDBPortId [in] - port ID to display the MAC address entries
701 * @retval IX_ETH_DB_SUCCESS operation completed successfully
702 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
703 * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
704 * @retval IX_ETH_DB_FAIL record browser failed due to an internal busy or lock condition
706 * @note this function is deprecated and kept for compatibility reasons; use @ref ixEthDBFilteringDatabaseShowRecords instead
708 * @see ixEthDBFilteringDatabaseShowRecords
711 IxEthDBStatus
ixEthDBFilteringDatabaseShow(IxEthDBPortId portID
);
716 * @fn void ixEthDBFilteringDatabaseShowAll(void)
718 * @brief Displays the MAC address recorded in the filtering database for all registered
719 * ports (see IxEthDBPortDefs.h), grouped by port ID.
722 * - ISR Callable - no
726 * @note this function is deprecated and kept for compatibility reasons; use @ref ixEthDBFilteringDatabaseShowRecords instead
728 * @see ixEthDBFilteringDatabaseShowRecords
731 void ixEthDBFilteringDatabaseShowAll(void);
736 * @fn IxEthDBStatus ixEthDBFilteringDatabaseShowRecords(IxEthDBPortId portID, IxEthDBRecordType recordFilter)
738 * @brief This function displays per port database records, given a record type filter
740 * The supported record type filters are:
742 * - IX_ETH_DB_FILTERING_RECORD - displays the non-VLAN filtering records (MAC address, age, static/dynamic)
743 * - IX_ETH_DB_FILTERING_VLAN_RECORD - displays the VLAN filtering records (MAC address, age, static/dynamic, VLAN ID, CFI, QoS class)
744 * - IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_FILTERING_VLAN_RECORD - displays the previous two types of records
745 * - IX_ETH_DB_WIFI_RECORD - displays the WiFi header conversion records (MAC address, optional gateway MAC address) and WiFi header conversion parameters (BBSID, Duration/ID)
746 * - IX_ETH_DB_FIREWALL_RECORD - displays the firewall MAC address table and firewall operating mode (white list/black list)
747 * - IX_ETH_DB_ALL_RECORD_TYPES - displays all the record types
748 * - IX_ETH_DB_NO_RECORD_TYPE - displays only the port status (no records are displayed)
750 * Additionally, the status of each port will be displayed, containg the following information: type, capabilities, enabled status,
751 * aging enabled status, group membership and maximum frame size.
753 * The port ID can either be an actual port or IX_ETH_DB_ALL_PORTS, in which case the requested information
754 * will be displayed for all the ports (grouped by port)
757 * - ISR Callable - no
759 * @param portID ID of the port to display information on (use IX_ETH_DB_ALL_PORTS for all the ports)
760 * @param recordFilter record type filter
762 * @retval IX_ETH_DB_SUCCESS operation completed successfully
763 * @retval IX_ETH_DB_INVALID_PORT portID is invalid
764 * @retval IX_ETH_DB_PORT_UNINITIALIZED port ID is not initialized
767 IxEthDBStatus
ixEthDBFilteringDatabaseShowRecords(IxEthDBPortId portID
, IxEthDBRecordType recordFilter
);
772 * @fn IxEthDBStatus ixEthDBPortDependencyMapSet(IxEthDBPortId portID, IxEthDBPortMap dependencyPortMap)
774 * @brief Sets the dependency port map for a port
776 * @param portID ID of the port to set the dependency map to
777 * @param dependencyPortMap new dependency map (as bitmap, each bit set indicates a port being included)
779 * This function is used to share filtering information between ports.
780 * By adding a port into another port's dependency map the target port
781 * filtering data will import the filtering data from the port it depends on.
782 * Any changes to filtering data for a port - such as adding, updating or removing records -
783 * will trigger updates in the filtering information for all the ports depending on
784 * on the updated port.
786 * For example, if ports 2 and 3 are set in the port 0 dependency map the filtering
787 * information for port 0 will also include the filtering information from ports 2 and 3.
788 * Adding a record to port 2 will also trigger an update not only on port 2 but also on
791 * The dependency map is a 256 bit array where each bit corresponds to a port corresponding to the
792 * bit offset (bit 0 - port 0, bit 1 - port 1 etc). Setting a bit to 1 indicates that the corresponding
793 * port is the port map. For example, a dependency port map of 0x14 consists in the ports with IDs 2 and 4.
794 * Note that the last bit (offset 255) is reserved and should never be set (it will be automatically
795 * cleared by the function).
797 * By default, each port has a dependency port map consisting only of itself, i.e.
800 IxEthDBPortMap portMap;
802 // clear all ports from port map
803 memset(portMap, 0, sizeof (portMap));
805 // include portID in port map
806 portMap[portID / 8] = 1 << (portID % 8);
810 * - ISR Callable - no
812 * @note Setting dependency maps is useful for NPE ports, which benefit from automatic updates
813 * of filtering information. Setting dependency maps for user-defined ports is not an error
814 * but will have no actual effect.
816 * @note Including a port in its own dependency map is not compulsory, however note that
817 * in this case updating the port will not trigger an update on the port itself, which
818 * might not be the intended behavior
820 * @retval IX_ETH_DB_SUCCESS operation completed successfully
821 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
822 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
823 * @retval IX_ETH_DB_INVALID_ARG invalid <i>dependencyPortMap</i> pointer
824 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Filtering is not available or not enabled for the port
827 IxEthDBStatus
ixEthDBPortDependencyMapSet(IxEthDBPortId portID
, IxEthDBPortMap dependencyPortMap
);
832 * @fn IxEthDBStatus ixEthDBPortDependencyMapGet(IxEthDBPortId portID, IxEthDBPortMap dependencyPortMap)
834 * @brief Retrieves the dependency port map for a port
836 * @param portID ID of the port to set the dependency map to
837 * @param dependencyPortMap location where the port dependency map is to be copied
839 * This function will copy the port dependency map to a user specified location.
842 * - ISR Callable - no
844 * @retval IX_ETH_DB_SUCCESS operation completed successfully
845 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
846 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
847 * @retval IX_ETH_DB_INVALID_ARG invalid <i>dependencyPortMap</i> pointer
848 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Filtering is not available or not enabled for the port
851 IxEthDBStatus
ixEthDBPortDependencyMapGet(IxEthDBPortId portID
, IxEthDBPortMap dependencyPortMap
);
856 * @fn IxEthDBStatus ixEthDBPortVlanTagSet(IxEthDBPortId portID, IxEthDBVlanTag vlanTag)
858 * @brief Sets the default 802.1Q VLAN tag for a given port
860 * @param portID @ref IxEthDBPortId [in] - ID of the port to set the default VLAN tag to
861 * @param vlanTag @ref IxEthDBVlanTag [in] - default 802.1Q VLAN tag
863 * The tag format has 16 bits and it is defined in the IEEE802.1Q specification.
864 * This tag will be used for tagging untagged frames (if enabled) and classifying
865 * unexpedited traffic into an internal traffic class (using the user priority field).
867 * <table border="1"> <caption> 802.1Q tag format </caption>
868 * <tr> <td> <b> 3 bits <td> <b> 1 bit <td> <b> 12 bits </b>
869 * <tr> <td> user priority <td> CFI <td> VID
872 * User Priority : Defines user priority, giving eight (2^3) priority levels. IEEE 802.1P defines
873 * the operation for these 3 user priority bits
875 * CFI : Canonical Format Indicator is always set to zero for Ethernet switches. CFI is used for
876 * compatibility reason between Ethernet type network and Token Ring type network. If a frame received
877 * at an Ethernet port has a CFI set to 1, then that frame should not be forwarded as it is to an untagged port.
879 * VID : VLAN ID is the identification of the VLAN, which is basically used by the standard 802.1Q.
880 * It has 12 bits and allow the id entification of 4096 (2^12) VLANs. Of the 4096 possible VIDs, a VID of 0
881 * is used to identify priority frames and value 4095 (FFF) is reserved, so the maximum possible VLAN
882 * configurations are 4,094.
885 * - ISR Callable - no
887 * @retval IX_ETH_DB_SUCCESS operation completed successfully
888 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
889 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
890 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
891 * @retval IX_ETH_DB_INVALID_VLAN <i>vlanTag</i> argument does not parse to a valid 802.1Q VLAN tag
893 * @note a VLAN ID value of 0 indicates that the port is not part of any VLAN
894 * @note the value of the cannonical frame indicator (CFI) field is ignored, the
895 * field being used only in frame tagging operations
898 IxEthDBStatus
ixEthDBPortVlanTagSet(IxEthDBPortId portID
, IxEthDBVlanTag vlanTag
);
903 * @fn IxEthDBStatus ixEthDBPortVlanTagGet(IxEthDBPortId portID, IxEthDBVlanTag *vlanTag)
905 * @brief Retrieves the default 802.1Q port VLAN tag for a given port (see also @ref ixEthDBPortVlanTagSet)
907 * @param portID @ref IxEthDBPortId [in] - ID of the port to retrieve the default VLAN tag from
908 * @param vlanTag @ref IxEthDBVlanTag [out] - location to write the default port 802.1Q VLAN tag to
911 * - ISR Callable - no
913 * @retval IX_ETH_DB_SUCCESS operation completed successfully
914 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
915 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
916 * @retval IX_ETH_DB_INVALID_ARG invalid vlanTag pointer
917 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
920 IxEthDBStatus
ixEthDBPortVlanTagGet(IxEthDBPortId portID
, IxEthDBVlanTag
*vlanTag
);
925 * @fn IxEthDBStatus ixEthDBVlanTagSet(IxEthDBMacAddr *macAddr, IxEthDBVlanTag vlanTag)
927 * @brief Sets the 802.1Q VLAN tag for a database record
929 * @param macAddr MAC address
930 * @param vlanTag 802.1Q VLAN tag
932 * This function is used together with @ref ixEthDBVlanTagGet to provide MAC-based VLAN classification support.
933 * Please note that the bridging application must contain specific code to make use of this feature (see below).
935 * VLAN tags can be set only in IX_ETH_DB_FILTERING_RECORD or IX_ETH_DB_FILTERING_VLAN_RECORD type records.
936 * If to an IX_ETH_DB_FILTERING_RECORD type record is added a VLAN tag the record type is automatically
937 * changed to IX_ETH_DB_FILTERING_VLAN_RECORD. Once this has occurred the record type will never
938 * revert to a non-VLAN type (unless deleted and re-added).
940 * Record types used for different purposes (such as IX_ETH_DB_WIFI_RECORD) will be ignored by
943 * After using this function to associate a VLAN ID with a MAC address the VLAN ID can be extracted knowing the
944 * MAC address using @ref ixEthDBVlanTagGet. This mechanism can be used to implement MAC-based VLAN classification
945 * if a bridging application searches for the VLAN tag when receiving a frame based on the source MAC address
946 * (contained in the <i>ixp_ne_src_mac</i> field of the buffer header).
947 * If found in the database, the application can instruct the NPE to tag the frame by writing the VLAN tag
948 * in the <i>ixp_ne_vlan_tci</i> field of the buffer header. This way the NPE will inspect the Egress tagging
949 * rule associated with the given VLAN ID on the Tx port and tag the frame if Egress tagging on the VLAN is
950 * allowed. Additionally, Egress tagging can be forced by setting the <i>ixp_ne_tx_flags.tag_over</i> and
951 * <i>ixp_ne_tx_flags.tag_mode</i> flags in the buffer header.
954 * - ISR Callable - no
956 * @note this function will <b>not</b> add a filtering record, it can only be used to update an existing one
958 * @retval IX_ETH_DB_SUCCESS operation completed successfully
959 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer
960 * @retval IX_ETH_DB_NO_SUCH_ADDR a filtering record with the specified MAC address was not found
961 * @retval IX_ETH_DB_INVALID_VLAN <i>vlanTag</i> argument does not parse to a valid 802.1Q VLAN tag
964 IxEthDBStatus
ixEthDBVlanTagSet(IxEthDBMacAddr
*macAddr
, IxEthDBVlanTag vlanTag
);
969 * @fn ixEthDBVlanTagGet(IxEthDBMacAddr *macAddr, IxEthDBVlanTag *vlanTag)
971 * @brief Retrieves the 802.1Q VLAN tag from a database record given the record MAC address
973 * @param macAddr MAC address
974 * @param vlanTag location to write the record 802.1Q VLAN tag to
976 * @note VLAN tags can be retrieved only from IX_ETH_DB_FILTERING_VLAN_RECORD type records
978 * This function is used together with ixEthDBVlanTagSet to provide MAC-based VLAN classification support.
979 * Please note that the bridging application must contain specific code to make use of this feature (see @ref ixEthDBVlanTagSet).
982 * - ISR Callable - no
984 * @retval IX_ETH_DB_SUCCESS operation completed successfully
985 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> or <i>vlanTag</i> pointer
986 * @retval IX_ETH_DB_NO_SUCH_ADDR a filtering record with the specified MAC address was not found
989 IxEthDBStatus
ixEthDBVlanTagGet(IxEthDBMacAddr
*macAddr
, IxEthDBVlanTag
*vlanTag
);
994 * @fn IxEthDBStatus ixEthDBPortVlanMembershipAdd(IxEthDBPortId portID, IxEthDBVlanId vlanID)
996 * @brief Adds a VLAN ID to a port's VLAN membership table
998 * Adding a VLAN ID to a port's VLAN membership table will cause frames tagged with the specified
999 * VLAN ID to be accepted by the frame filter, if Ingress VLAN membership filtering is enabled.
1002 * - ISR Callable - no
1004 * @param portID @ref IxEthDBPortId [in] - ID of the port to add the VLAN ID membership to
1005 * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID to be added to the port membership table
1007 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1008 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1009 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1010 * @retval IX_ETH_DB_INVALID_VLAN vlanID is not a valid VLAN ID
1011 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1012 * @retval IX_FAIL unknown OS or NPE communication error
1014 * @note A port's default VLAN ID is always in its own membership table, hence there
1015 * is no need to explicitly add it using this function (although it is not an error
1019 IxEthDBStatus
ixEthDBPortVlanMembershipAdd(IxEthDBPortId portID
, IxEthDBVlanId vlanID
);
1024 * @fn IxEthDBStatus ixEthDBPortVlanMembershipRangeAdd(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax)
1026 * @brief Adds a VLAN ID range to a port's VLAN membership table
1028 * All the VLAN IDs in the specified range will be added to the port VLAN
1029 * membership table, including the range start and end VLAN IDs. Tagged frames with
1030 * VLAN IDs in the specified range will be accepted by the frame filter, if Ingress VLAN
1031 * membership filtering is enabled.
1034 * - ISR Callable - no
1036 * @param portID @ref IxEthDBPortId [in] - port ID to add the VLAN membership range into
1037 * @param vlanIDMin @ref IxEthDBVlanId [in] - start of the VLAN ID range
1038 * @param vlanIDMax @ref IxEthDBVlanId [in] - end of the VLAN ID range
1040 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1041 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1042 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1043 * @retval IX_ETH_DB_INVALID_VLAN the specified VLAN IDs are invalid or do not constitute a range
1044 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1045 * @retval IX_FAIL unknown OS or NPE communication error
1047 * @note Is is valid to use the same VLAN ID for both vlanIDMin and vlanIDMax, in which case this
1048 * function will behave as @ref ixEthDBPortVlanMembershipAdd
1050 * @note A port's default VLAN ID is always in its own membership table, hence there is no need
1051 * to explicitly add it using this function (although it is not an error to do so)
1054 IxEthDBStatus
ixEthDBPortVlanMembershipRangeAdd(IxEthDBPortId portID
, IxEthDBVlanId vlanIDMin
, IxEthDBVlanId vlanIDMax
);
1059 * @fn IxEthDBStatus ixEthDBPortVlanMembershipRemove(IxEthDBPortId portID, IxEthDBVlanId vlanID)
1061 * @brief Removes a VLAN ID from a port's VLAN membership table
1063 * Frames tagged with a VLAN ID which is not in a port's VLAN membership table
1064 * will be discarded by the frame filter, if Ingress membership filtering is enabled.
1067 * - ISR Callable - no
1069 * @param portID @ref IxEthDBPortId [in] - ID of the port to remove the VLAN ID membership from
1070 * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID to be removed from the port membership table
1072 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1073 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1074 * @retval IX_ETH_DB_INVALID_VLAN vlanID is not a valid VLAN ID
1075 * @retval IX_ETH_DB_NO_PERMISSION attempted to remove the default VLAN ID
1076 * from the port membership table (vlanID was set to the default port VLAN ID)
1077 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1078 * @retval IX_FAIL unknown OS or NPE communication error
1080 * @note A port's default VLAN ID cannot be removed from the port's membership
1081 * table; attempting it will return IX_ETH_DB_NO_PERMISSION
1084 IxEthDBStatus
ixEthDBPortVlanMembershipRemove(IxEthDBPortId portID
, IxEthDBVlanId vlanID
);
1089 * @fn IxEthDBStatus ixEthDBPortVlanMembershipRangeRemove(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax)
1091 * @brief Removes a VLAN ID range from a port's VLAN membership table
1093 * All the VLAN IDs in the specified range will be removed from the port VLAN
1094 * membership table, including the range start and end VLAN IDs. Tagged frames
1095 * with VLAN IDs in the range will be discarded by the frame filter, if Ingress
1096 * membership filtering is enabled.
1099 * - ISR Callable - no
1101 * @param portID @ref IxEthDBPortId [in] - ID of the port to remove the VLAN membership range from
1102 * @param vlanIDMin @ref IxEthDBVlanId [in] - start of the VLAN ID range
1103 * @param vlanIDMax @ref IxEthDBVlanId [in] - end of the VLAN ID range
1105 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1106 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1107 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1108 * @retval IX_ETH_DB_INVALID_VLAN the specified VLAN IDs are invalid or do not constitute a range
1109 * @retval IX_ETH_DB_NO_PERMISSION attempted to remove the default VLAN ID
1110 * from the port membership table (both vlanIDMin and vlanIDMax were set to the default port VLAN ID)
1111 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1112 * @retval IX_FAIL unknown OS or NPE communication error
1114 * @note Is is valid to use the same VLAN ID for both vlanIDMin and vlanIDMax, in which case
1115 * function will behave as @ref ixEthDBPortVlanMembershipRemove
1117 * @note If the given range overlaps the default port VLAN ID this function
1118 * will remove all the VLAN IDs in the range except for the port VLAN ID from its
1119 * own membership table. This situation will be silently dealt with (no error message
1120 * will be returned) as long as the range contains more than one value (i.e. at least
1121 * one other value, apart from the default port VLAN ID). If the function is called
1122 * with the vlanIDMin and vlanIDMax parameters both set to the port default VLAN ID, the
1123 * function will infer that an attempt was specifically made to remove the default port
1124 * VLAN ID from the port membership table, in which case the return value will be
1125 * IX_ETH_DB_NO_PERMISSION.
1128 IxEthDBStatus
ixEthDBPortVlanMembershipRangeRemove(IxEthDBPortId portID
, IxEthDBVlanId vlanIDMin
, IxEthDBVlanId vlanIDMax
);
1133 * @fn IxEthDBStatus ixEthDBPortVlanMembershipSet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
1135 * @brief Sets a port's VLAN membership table
1137 * Sets a port's VLAN membership table from a complete VLAN table containing all the possible
1138 * 4096 VLAN IDs. The table format is an array containing 4096 bits (512 bytes), where each bit
1139 * indicates whether the VLAN at that bit index is in the port's membership list (if set) or
1142 * The bit at index 0, indicating VLAN ID 0, indicates no VLAN membership and therefore no
1143 * other bit must be set if bit 0 is set.
1145 * The bit at index 4095 is reserved and should never be set (it will be ignored if set).
1147 * The bit referencing the same VLAN ID as the default port VLAN ID should always be set, as
1148 * the membership list must contain at least the default port VLAN ID.
1151 * - ISR Callable - no
1153 * @param portID @ref IxEthDBPortId [in] - port ID to set the VLAN membership table to
1154 * @param vlanSet @ref IxEthDBVlanSet [in] - pointer to the VLAN membership table
1156 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1157 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1158 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1159 * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
1160 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1161 * @retval IX_FAIL unknown OS or NPE communication error
1164 IxEthDBStatus
ixEthDBPortVlanMembershipSet(IxEthDBPortId portID
, IxEthDBVlanSet vlanSet
);
1169 * @fn IxEthDBStatus ixEthDBPortVlanMembershipGet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
1171 * @brief Retrieves a port's VLAN membership table
1173 * Retrieves the complete VLAN membership table from a port, containing all the possible
1174 * 4096 VLAN IDs. The table format is an array containing 4096 bits (512 bytes), where each bit
1175 * indicates whether the VLAN at that bit index is in the port's membership list (if set) or
1178 * The bit at index 0, indicating VLAN ID 0, indicates no VLAN membership and therefore no
1179 * other bit will be set if bit 0 is set.
1181 * The bit at index 4095 is reserved and will not be set (it will be ignored if set).
1183 * The bit referencing the same VLAN ID as the default port VLAN ID will always be set, as
1184 * the membership list must contain at least the default port VLAN ID.
1187 * - ISR Callable - no
1189 * @param portID @ref IxEthDBPortId [in] - port ID to retrieve the VLAN membership table from
1190 * @param vlanSet @ref IxEthDBVlanSet [out] - pointer a location where the VLAN membership table will be
1193 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1194 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1195 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1196 * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
1197 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1200 IxEthDBStatus
ixEthDBPortVlanMembershipGet(IxEthDBPortId portID
, IxEthDBVlanSet vlanSet
);
1205 * @fn IxEthDBStatus ixEthDBAcceptableFrameTypeSet(IxEthDBPortId portID, IxEthDBFrameFilter frameFilter)
1207 * @brief Sets a port's acceptable frame type filter
1209 * The acceptable frame type is one (or a combination) of the following values:
1210 * - IX_ETH_DB_ACCEPT_ALL_FRAMES - accepts all the frames
1211 * - IX_ETH_DB_UNTAGGED_FRAMES - accepts untagged frames
1212 * - IX_ETH_DB_VLAN_TAGGED_FRAMES - accepts tagged frames
1213 * - IX_ETH_DB_PRIORITY_TAGGED_FRAMES - accepts tagged frames with VLAN ID set to 0 (no VLAN membership)
1215 * Except for using the exact values given above only the following combinations are valid:
1216 * - IX_ETH_DB_UNTAGGED_FRAMES | IX_ETH_DB_VLAN_TAGGED_FRAMES
1217 * - IX_ETH_DB_UNTAGGED_FRAMES | IX_ETH_DB_PRIORITY_TAGGED_FRAMES
1219 * Please note that IX_ETH_DB_UNTAGGED_FRAMES | IX_ETH_DB_VLAN_TAGGED_FRAMES is equivalent
1220 * to IX_ETH_DB_ACCEPT_ALL_FRAMES.
1223 * - ISR Callable - no
1225 * @note by default the acceptable frame type filter is set to IX_ETH_DB_ACCEPT_ALL_FRAMES
1227 * @note setting the acceptable frame type to PRIORITY_TAGGED_FRAMES is internally
1228 * accomplished by changing the frame filter to VLAN_TAGGED_FRAMES and setting the
1229 * VLAN membership list to include only VLAN ID 0; the membership list will need
1230 * to be restored manually to an appropriate value if the acceptable frame type
1231 * filter is changed back to ACCEPT_ALL_FRAMES or VLAN_TAGGED_FRAMES; failure to do so
1232 * will filter all VLAN traffic bar frames tagged with VLAN ID 0
1234 * @param portID @ref IxEthDBPortId [in] - port ID to set the acceptable frame type filter to
1235 * @param frameFilter @ref IxEthDBFrameFilter [in] - acceptable frame type filter
1237 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1238 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1239 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1240 * @retval IX_ETH_DB_INVALID_ARG invalid frame type filter
1241 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1242 * @retval IX_FAIL unknown OS or NPE communication error
1245 IxEthDBStatus
ixEthDBAcceptableFrameTypeSet(IxEthDBPortId portID
, IxEthDBFrameFilter frameFilter
);
1250 * @fn IxEthDBStatus ixEthDBAcceptableFrameTypeGet(IxEthDBPortId portID, IxEthDBFrameFilter *frameFilter)
1252 * @brief Retrieves a port's acceptable frame type filter
1254 * For a description of the acceptable frame types see @ref ixEthDBAcceptableFrameTypeSet
1257 * - ISR Callable - no
1259 * @param portID @ref IxEthDBPortId [in] - port ID to retrieve the acceptable frame type filter from
1260 * @param frameFilter @ref IxEthDBFrameFilter [out] - location to store the acceptable frame type filter
1262 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1263 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1264 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1265 * @retval IX_ETH_DB_INVALID_ARG invalid <i>frameFilter</i> pointer argument
1266 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1269 IxEthDBStatus
ixEthDBAcceptableFrameTypeGet(IxEthDBPortId portID
, IxEthDBFrameFilter
*frameFilter
);
1274 * @fn IxEthDBStatus ixEthDBPriorityMappingTableSet(IxEthDBPortId portID, IxEthDBPriorityTable priorityTable)
1276 * @brief Sets a port's priority mapping table
1278 * The priority mapping table is an 8x2 table mapping a QoS (user) priority into an internal
1279 * traffic class. There are 8 valid QoS priorities (0..7, 0 being the lowest) which can be
1280 * mapped into one of the 4 available traffic classes (0..3, 0 being the lowest).
1281 * If a custom priority mapping table is not specified using this function the following
1282 * default priority table will be used (as per IEEE 802.1Q and IEEE 802.1D):
1284 * <table border="1"> <caption> QoS traffic classes </caption>
1285 * <tr> <td> <b> QoS priority <td> <b> Default traffic class <td> <b> Traffic type </b>
1286 * <tr> <td> 0 <td> 1 <td> Best effort, default class for unexpedited traffic
1287 * <tr> <td> 1 <td> 0 <td> Background traffic
1288 * <tr> <td> 2 <td> 0 <td> Spare bandwidth
1289 * <tr> <td> 3 <td> 1 <td> Excellent effort
1290 * <tr> <td> 4 <td> 2 <td> Controlled load
1291 * <tr> <td> 5 <td> 2 <td> Video traffic
1292 * <tr> <td> 6 <td> 3 <td> Voice traffic
1293 * <tr> <td> 7 <td> 3 <td> Network control
1297 * - ISR Callable - no
1299 * @param portID @ref IxEthDBPortId [in] - port ID of the port to set the priority mapping table to
1300 * @param priorityTable @ref IxEthDBPriorityTable [in] - location of the user priority table
1302 * @note The provided table will be copied into internal data structures in EthDB and
1303 * can be deallocated by the called after this function has completed its execution, if
1306 * @warning The number of available traffic classes differs depending on the NPE images
1307 * and queue configuration. Check IxEthDBQoS.h for up-to-date information on the availability of
1308 * traffic classes. Note that specifiying a traffic class in the priority map which exceeds
1309 * the system availability will produce an IX_ETH_DB_INVALID_PRIORITY return error code and no
1310 * priority will be remapped.
1312 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1313 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1314 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1315 * @retval IX_ETH_DB_INVALID_ARG invalid <i>priorityTable</i> pointer
1316 * @retval IX_ETH_DB_INVALID_PRIORITY at least one priority value exceeds
1317 * the current number of available traffic classes
1318 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1319 * @retval IX_FAIL unknown OS or NPE communication error
1322 IxEthDBStatus
ixEthDBPriorityMappingTableSet(IxEthDBPortId portID
, IxEthDBPriorityTable priorityTable
);
1327 * @fn IxEthDBStatus ixEthDBPriorityMappingTableGet(IxEthDBPortId portID, IxEthDBPriorityTable priorityTable)
1329 * @brief Retrieves a port's priority mapping table
1331 * The priority mapping table for the given port will be copied in the location
1332 * specified by the caller using "priorityTable"
1335 * - ISR Callable - no
1337 * @param portID ID @ref IxEthDBPortId [in] - of the port to retrieve the priority mapping table from
1338 * @param priorityTable @ref IxEthDBPriorityTable [out] - pointer to a user specified location where the table will be copied to
1340 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1341 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1342 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1343 * @retval IX_ETH_DB_INVALID_ARG invalid priorityTable pointer
1344 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1347 IxEthDBStatus
ixEthDBPriorityMappingTableGet(IxEthDBPortId portID
, IxEthDBPriorityTable priorityTable
);
1352 * @fn IxEthDBStatus ixEthDBPriorityMappingClassSet(IxEthDBPortId portID, IxEthDBPriority userPriority, IxEthDBPriority trafficClass)
1354 * @brief Sets one QoS/user priority => traffic class mapping in a port's priority mapping table
1356 * This function establishes a mapping between a user (QoS) priority and an internal traffic class.
1357 * The mapping will be saved in the port's priority mapping table. Use this function when not all
1358 * the QoS priorities need remapping (see also @ref ixEthDBPriorityMappingTableSet)
1361 * - ISR Callable - no
1363 * @param portID @ref IxEthDBPortId [in] - ID of the port to set the mapping to
1364 * @param userPriority @ref IxEthDBPriority [in] - user (QoS) priority, between 0 and 7 (0 being the lowest)
1365 * @param trafficClass @ref IxEthDBPriority [in] - internal traffic class, between 0 and 3 (0 being the lowest)
1367 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1368 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1369 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1370 * @retval IX_ETH_DB_INVALID_PRIORITY <i>userPriority</i> out of range or
1371 * <i>trafficClass</i> is beyond the number of currently available traffic classes
1372 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1373 * @retval IX_FAIL unknown OS or NPE communication error
1376 IxEthDBStatus
ixEthDBPriorityMappingClassSet(IxEthDBPortId portID
, IxEthDBPriority userPriority
, IxEthDBPriority trafficClass
);
1381 * @fn IxEthDBStatus ixEthDBPriorityMappingClassGet(IxEthDBPortId portID, IxEthDBPriority userPriority, IxEthDBPriority *trafficClass)
1383 * @brief Retrieves one QoS/user priority => traffic class mapping in a port's priority mapping table
1385 * This function retrieves the internal traffic class associated with a QoS (user) priority from a given
1386 * port's priority mapping table. Use this function when not all the QoS priority mappings are
1387 * required (see also @ref ixEthDBPriorityMappingTableGet)
1390 * - ISR Callable - no
1392 * @param portID @ref IxEthDBPortId [in] - ID of the port to set the mapping to
1393 * @param userPriority @ref IxEthDBPriority [in] - user (QoS) priority, between 0 and 7 (0 being the lowest)
1394 * @param trafficClass @ref IxEthDBPriority [out] - location to write the corresponding internal traffic class to
1396 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1397 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1398 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1399 * @retval IX_ETH_DB_INVALID_PRIORITY invalid userPriority value (out of range)
1400 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1401 * @retval IX_ETH_DB_INVALID_ARG invalid <i>trafficClass</i> pointer argument
1404 IxEthDBStatus
ixEthDBPriorityMappingClassGet(IxEthDBPortId portID
, IxEthDBPriority userPriority
, IxEthDBPriority
*trafficClass
);
1409 * @fn IxEthDBStatus ixEthDBEgressVlanEntryTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanId vlanID, BOOL enabled)
1411 * @brief Enables or disables Egress VLAN tagging for a port and a given VLAN
1413 * This function enables or disables Egress VLAN tagging for the given port and VLAN ID.
1414 * If the VLAN tagging for a certain VLAN ID is enabled then all the frames to be
1415 * transmitted on the given port tagged with the same VLAN ID will be transmitted in a tagged format.
1416 * If tagging is not enabled for the given VLAN ID, the VLAN tag from the frames matching
1417 * this VLAN ID will be removed (the frames will be untagged).
1419 * VLAN ID 4095 is reserved and should never be used with this function.
1420 * VLAN ID 0 has the special meaning of "No VLAN membership" and it is used in this
1421 * context to allow the port to send priority-tagged frames or not.
1423 * By default, no Egress VLAN tagging is enabled on any port.
1426 * - ISR Callable - no
1428 * @param portID @ref IxEthDBPortId [in] - ID of the port to enable or disable the VLAN ID Egress tagging on
1429 * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID to be matched against outgoing frames
1430 * @param enabled BOOL [in] - TRUE to enable Egress VLAN tagging on the port and given VLAN, and
1431 * FALSE to disable Egress VLAN tagging
1433 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1434 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1435 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1436 * @retval IX_ETH_DB_INVALID_VLAN invalid VLAN ID (out of range)
1437 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1438 * @retval IX_FAIL unknown OS or NPE communication error
1441 IxEthDBStatus
ixEthDBEgressVlanEntryTaggingEnabledSet(IxEthDBPortId portID
, IxEthDBVlanId vlanID
, BOOL enabled
);
1446 * @fn IxEthDBStatus ixEthDBEgressVlanEntryTaggingEnabledGet(IxEthDBPortId portID, IxEthDBVlanId vlanID, BOOL *enabled)
1448 * @brief Retrieves the Egress VLAN tagging enabling status for a port and VLAN ID
1450 * @param portID [in] - ID of the port to extract the Egress VLAN ID tagging status from
1451 * @param vlanID VLAN [in] - ID whose tagging status is to be extracted
1452 * @param enabled [in] - user-specifed location where the status is copied to; following
1453 * the successfull execution of this function the value will be TRUE if Egress VLAN
1454 * tagging is enabled for the given port and VLAN ID, and FALSE otherwise
1457 * - ISR Callable - no
1459 * @see ixEthDBEgressVlanEntryTaggingEnabledGet
1461 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1462 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1463 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1464 * @retval IX_ETH_DB_INVALID_VLAN invalid VLAN ID (out of range)
1465 * @retval IX_ETH_DB_INVALID_ARG invalid <i>enabled</i> argument pointer
1466 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1469 IxEthDBStatus
ixEthDBEgressVlanEntryTaggingEnabledGet(IxEthDBPortId portID
, IxEthDBVlanId vlanID
, BOOL
*enabled
);
1474 * @fn IxEthDBStatus ixEthDBEgressVlanRangeTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanId vlanIDMin, IxEthDBVlanId vlanIDMax, BOOL enabled)
1476 * @brief Enables or disables Egress VLAN tagging for a port and given VLAN range
1478 * This function is very similar to @ref ixEthDBEgressVlanEntryTaggingEnabledSet with the
1479 * difference that it can manipulate the Egress tagging status on multiple VLAN IDs,
1480 * defined by a contiguous range. Note that both limits in the range are explicitly
1481 * included in the execution of this function.
1484 * - ISR Callable - no
1486 * @param portID @ref IxEthDBPortId [in] - ID of the port to enable or disable the VLAN ID Egress tagging on
1487 * @param vlanIDMin @ref IxEthDBVlanId [in] - start of the VLAN range to be matched against outgoing frames
1488 * @param vlanIDMax @ref IxEthDBVlanId [in] - end of the VLAN range to be matched against outgoing frames
1489 * @param enabled BOOL [in] - TRUE to enable Egress VLAN tagging on the port and given VLAN range,
1490 * and FALSE to disable Egress VLAN tagging
1492 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1493 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1494 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1495 * @retval IX_ETH_DB_INVALID_VLAN invalid VLAN ID (out of range), or do not constitute a range
1496 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1497 * @retval IX_ETH_DB_NO_PERMISSION attempted to explicitly remove the default port VLAN ID from the tagging table
1498 * @retval IX_FAIL unknown OS or NPE communication error
1500 * @note Specifically removing the default port VLAN ID from the Egress tagging table by setting both vlanIDMin and vlanIDMax
1501 * to the VLAN ID portion of the PVID is not allowed by this function and will return IX_ETH_DB_NO_PERMISSION.
1502 * However, this can be circumvented, should the user specifically desire this, by either using a
1503 * larger range (vlanIDMin < vlanIDMax) or by using ixEthDBEgressVlanEntryTaggingEnabledSet.
1506 IxEthDBStatus
ixEthDBEgressVlanRangeTaggingEnabledSet(IxEthDBPortId portID
, IxEthDBVlanId vlanIDMin
, IxEthDBVlanId vlanIDMax
, BOOL enabled
);
1511 * @fn IxEthDBStatus ixEthDBEgressVlanTaggingEnabledSet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
1513 * @brief Sets the complete Egress VLAN tagging table for a port
1515 * This function is used to set the VLAN tagging/untagging per VLAN ID for a given port
1516 * covering the entire VLAN ID range (0..4094). The <i>vlanSet</i> parameter is a 4096
1517 * bit array, each bit indicating the Egress behavior for the corresponding VLAN ID.
1518 * If a bit is set then outgoing frames with the corresponding VLAN ID will be transmitted
1519 * with the VLAN tag, otherwise the frame will be transmitted without the VLAN tag.
1521 * Bit 0 has a special significance, indicating tagging or tag removal for priority-tagged
1524 * Bit 4095 is reserved and should never be set (it will be ignored if set).
1527 * - ISR Callable - no
1529 * @param portID @ref IxEthDBPortId [in] - ID of the port whose Egress VLAN tagging behavior is set
1530 * @param vlanSet @ref IxEthDBVlanSet [in] - 4096 bit array controlling per-VLAN tagging and untagging
1532 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1533 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1534 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1535 * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
1536 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1537 * @retval IX_FAIL unknown OS or NPE communication error
1539 * @warning This function will automatically add the default port VLAN ID to the Egress tagging table
1540 * every time it is called. The user should manually call ixEthDBEgressVlanEntryTaggingEnabledSet to
1541 * prevent tagging on the default port VLAN ID if the default behavior is not intended.
1544 IxEthDBStatus
ixEthDBEgressVlanTaggingEnabledSet(IxEthDBPortId portID
, IxEthDBVlanSet vlanSet
);
1549 * @fn IxEthDBStatus ixEthDBEgressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBVlanSet vlanSet)
1551 * @brief Retrieves the complete Egress VLAN tagging table from a port
1553 * This function copies the 4096 bit table controlling the Egress VLAN tagging into a user specified
1554 * area. Each bit in the array indicates whether tagging for the corresponding VLAN (the bit position
1555 * in the array) is enabled (the bit is set) or not (the bit is unset).
1557 * Bit 4095 is reserved and should not be set (it will be ignored if set).
1559 * @see ixEthDBEgressVlanTaggingEnabledSet
1561 * @param portID @ref IxEthDBPortId [in] - ID of the port whose Egress VLAN tagging behavior is retrieved
1562 * @param vlanSet @ref IxEthDBVlanSet [out] - user location to copy the Egress tagging table into; should have
1563 * room to store 4096 bits (512 bytes)
1565 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1566 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1567 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1568 * @retval IX_ETH_DB_INVALID_ARG invalid <i>vlanSet</i> pointer
1569 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1572 IxEthDBStatus
ixEthDBEgressVlanTaggingEnabledGet(IxEthDBPortId portID
, IxEthDBVlanSet vlanSet
);
1577 * @fn IxEthDBStatus ixEthDBIngressVlanTaggingEnabledSet(IxEthDBPortId portID, IxEthDBTaggingAction taggingAction)
1579 * @brief Sets the Ingress VLAN tagging behavior for a port
1581 * A port's Ingress tagging behavior is controlled by the taggingAction parameter,
1582 * which can take one of the following values:
1584 * - IX_ETH_DB_PASS_THROUGH - leaves the frame unchanged (does not add or remove the VLAN tag)
1585 * - IX_ETH_DB_ADD_TAG - adds the VLAN tag if not present, using the default port VID
1586 * - IX_ETH_DB_REMOVE_TAG - removes the VLAN tag if present
1588 * @param portID @ref IxEthDBPortId [in] - ID of the port whose Ingress VLAN tagging behavior is set
1589 * @param taggingAction @ref IxEthDBTaggingAction [in] - tagging behavior for the port
1591 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1592 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1593 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1594 * @retval IX_ETH_DB_INVALID_ARG invalid <i>taggingAction</i> argument
1595 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1596 * @retval IX_FAIL unknown OS or NPE communication error
1599 IxEthDBStatus
ixEthDBIngressVlanTaggingEnabledSet(IxEthDBPortId portID
, IxEthDBTaggingAction taggingAction
);
1604 * @fn IxEthDBStatus ixEthDBIngressVlanTaggingEnabledGet(IxEthDBPortId portID, IxEthDBTaggingAction *taggingAction)
1606 * @brief Retrieves the Ingress VLAN tagging behavior from a port (see @ref ixEthDBIngressVlanTaggingEnabledSet)
1608 * @param portID @ref IxEthDBPortId [in] - ID of the port whose Ingress VLAN tagging behavior is set
1609 * @param taggingAction @ref IxEthDBTaggingAction [out] - location where the tagging behavior for the port is written to
1611 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1612 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1613 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1614 * @retval IX_ETH_DB_INVALID_ARG invalid <i>taggingAction</i> pointer argument
1615 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1618 IxEthDBStatus
ixEthDBIngressVlanTaggingEnabledGet(IxEthDBPortId portID
, IxEthDBTaggingAction
*taggingAction
);
1623 * @fn IxEthDBStatus ixEthDBVlanPortExtractionEnable(IxEthDBPortId portID, BOOL enable)
1625 * @brief Enables or disables port ID extraction
1627 * This feature can be used in the situation when a multi-port device (e.g. a switch)
1628 * is connected to an IXP4xx port and the device can provide incoming frame port
1629 * identification by tagging the TPID field in the Ethernet frame. Enabling
1630 * port extraction will instruct the NPE to copy the TPID field from the frame and
1631 * place it in the <i>ixp_ne_src_port</i> of the <i>ixp_buf</i> header. In addition,
1632 * the NPE restores the TPID field to 0.
1634 * If the frame is not tagged the NPE will fill the <i>ixp_ne_src_port</i> with the
1635 * port ID of the MII interface the frame was received from.
1637 * The TPID field is the least significant byte of the type/length field, which is
1638 * normally set to 0x8100 for 802.1Q-tagged frames.
1640 * This feature is disabled by default.
1642 * @param portID ID of the port to configure port ID extraction on
1643 * @param enable TRUE to enable port ID extraction and FALSE to disable it
1645 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1646 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1647 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1648 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE VLAN/QoS feature is not available or not enabled for the port
1649 * @retval IX_FAIL unknown OS or NPE communication error
1652 IxEthDBStatus
ixEthDBVlanPortExtractionEnable(IxEthDBPortId portID
, BOOL enable
);
1657 * @fn IxEthDBStatus ixEthDBFeatureCapabilityGet(IxEthDBPortId portID, IxEthDBFeature *featureSet)
1659 * @brief Retrieves the feature capability set for a port
1661 * This function retrieves the feature capability set for a port or the common capabilities shared between all
1662 * the ports, writing the feature capability set in a user specified location.
1664 * The feature capability set will consist of a set formed by OR-ing one or more of the following values:
1665 * - IX_ETH_DB_LEARNING - Learning feature; enables EthDB to learn MAC address (filtering) records, including 802.1Q enabled records
1666 * - IX_ETH_DB_FILTERING - Filtering feature; enables EthDB to communicate with the NPEs for downloading filtering information in the NPEs; depends on the learning feature
1667 * - IX_ETH_DB_VLAN_QOS - VLAN/QoS feature; enables EthDB to configure NPEs to operate in VLAN/QoS aware modes
1668 * - IX_ETH_DB_FIREWALL - Firewall feature; enables EthDB to configure NPEs to operate in firewall mode, using white/black address lists
1669 * - IX_ETH_DB_SPANNING_TREE_PROTOCOL - Spanning tree protocol feature; enables EthDB to configure the NPEs as STP nodes
1670 * - IX_ETH_DB_WIFI_HEADER_CONVERSION - WiFi 802.3 to 802.11 header conversion feature; enables EthDB to handle WiFi conversion data
1672 * Note that EthDB provides only the LEARNING feature for non-NPE ports.
1674 * @param portID @ref IxEthDBPortId [in] - ID of the port to retrieve the capability set for
1675 * (use IX_ETH_DB_ALL_PORTS to retrieve the common capabilities shared between all the ports)
1676 * @param featureSet @ref IxEthDBFeature [out] - location where the capability set will be written to
1678 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1679 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1680 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1681 * @retval IX_ETH_DB_INVALID_ARG invalid <i>featureSet</i> pointer
1684 IxEthDBStatus
ixEthDBFeatureCapabilityGet(IxEthDBPortId portID
, IxEthDBFeature
*featureSet
);
1689 * @fn IxEthDBStatus ixEthDBFeatureEnable(IxEthDBPortId portID, IxEthDBFeature feature, BOOL enabled)
1691 * @brief Enables or disables one or more EthDB features
1693 * Selects one or more features (see @ref ixEthDBFeatureCapabilityGet for a description of the supported
1694 * features) to be enabled or disabled on the selected port (or all the ports).
1696 * Note that some features are mutually incompatible:
1697 * - IX_ETH_DB_FILTERING is incompatible with IX_ETH_DB_WIFI_HEADER_CONVERSION
1699 * Also note that some features require other features to be enabled:
1700 * - IX_ETH_DB_FILTERING requires IX_ETH_DB_LEARNING
1702 * This function will either enable the entire selected feature set for the selected port (or all the ports),
1703 * in which case it will return IX_ETH_DB_SUCCESS, or in case of error it will not enable any feature at all
1704 * and return an appropriate error message.
1706 * The following features are enabled by default (for ports with the respective capability),
1707 * for compatibility reasons with previous versions of CSR:
1708 * - IX_ETH_DB_LEARNING
1709 * - IX_ETH_DB_FILTERING
1711 * All other features are disabled by default and require manual enabling using ixEthDBFeatureEnable.
1713 * <b>Default settings for VLAN, QoS, Firewall and WiFi header conversion features:</b>
1717 * When the VLAN/QoS feature is enabled for a port for the first time the default VLAN behavior
1718 * of the port is set to be as <b>permissive</b> (it will accept all the frames) and
1719 * <b>non-interferential</b> (it will not change any frames) as possible:
1720 * - the port VLAN ID (VID) is set to 0
1721 * - the Ingress acceptable frame filter is set to accept all frames
1722 * - the VLAN port membership is set to the complete VLAN range (0 - 4094)
1723 * - the Ingress tagging mode is set to pass-through (will not change frames)
1724 * - the Egress tagging mode is to send tagged frames in the entire VLAN range (0 - 4094)
1726 * Note that further disabling and re-enabling the VLAN feature for a given port will not reset the port VLAN behavior
1727 * to the settings listed above. Any VLAN settings made by the user are kept.
1731 * The following default priority mapping table will be used (as per IEEE 802.1Q and IEEE 802.1D):
1733 * <table border="1"> <caption> QoS traffic classes </caption>
1734 * <tr> <td> <b> QoS priority <td> <b> Default traffic class <td> <b> Traffic type </b>
1735 * <tr> <td> 0 <td> 1 <td> Best effort, default class for unexpedited traffic
1736 * <tr> <td> 1 <td> 0 <td> Background traffic
1737 * <tr> <td> 2 <td> 0 <td> Spare bandwidth
1738 * <tr> <td> 3 <td> 1 <td> Excellent effort
1739 * <tr> <td> 4 <td> 2 <td> Controlled load
1740 * <tr> <td> 5 <td> 2 <td> Video traffic
1741 * <tr> <td> 6 <td> 3 <td> Voice traffic
1742 * <tr> <td> 7 <td> 3 <td> Network control
1747 * The port firewall is configured by default in <b>black-list mode</b>, and the firewall address table is empty.
1748 * This means the firewall will not filter any frames until the feature is configured and the firewall table is
1749 * downloaded to the NPE.
1751 * <i> Spanning Tree </i>
1753 * The port is set to <b>STP unblocked mode</b>, therefore it will accept all frames until re-configured.
1755 * <i> WiFi header conversion </i>
1757 * The WiFi header conversion database is empty, therefore no actual header conversion will take place until this
1758 * feature is configured and the conversion table downloaded to the NPE.
1760 * @param portID @ref IxEthDBPortId [in] - ID of the port to enable or disable the features on (use IX_ETH_DB_ALL_PORTS for all the ports)
1761 * @param feature @ref IxEthDBFeature [in] - feature or feature set to enable or disable
1762 * @param enabled BOOL [in] - TRUE to enable the feature and FALSE to disable it
1764 * @note Certain features, from a functional point of view, cannot be disabled as such at NPE level;
1765 * when such features are set to <i>disabled</i> using the EthDB API they will be configured in such
1766 * a way to determine a behavior equivalent to the feature being disabled. As well as this, disabled
1767 * features cannot be configured or accessed via the EthDB API (except for getting their status).
1769 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1770 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1771 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1772 * @retval IX_ETH_DB_NO_PERMISSION attempted to enable mutually exclusive features,
1773 * or a feature that depends on another feature which is not present or enabled
1774 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE at least one of the features selected is unavailable
1775 * @retval IX_FAIL unknown OS or NPE communication error
1778 IxEthDBStatus
ixEthDBFeatureEnable(IxEthDBPortId portID
, IxEthDBFeature feature
, BOOL enabled
);
1783 * @fn IxEthDBStatus ixEthDBFeatureStatusGet(IxEthDBPortId portID, IxEthDBFeature feature, BOOL *present, BOOL *enabled)
1785 * @brief Retrieves the availability and status of a feature set
1787 * This function returns the availability and status for a feature set.
1788 * Note that if more than one feature is selected (e.g. IX_ETH_DB_LEARNING | IX_ETH_DB_FILTERING)
1789 * the "present" and "enabled" return values will be set to TRUE only if all the features in the
1790 * feature set are present and enabled (not only some).
1792 * @param portID @ref IxEthDBPortId [in] - ID of the port
1793 * @param feature @ref IxEthDBFeature [in] - identifier of the feature to retrieve the status for
1794 * @param present BOOL [out] - location where a boolean flag indicating whether this feature is present will be written to
1795 * @param enabled BOOL [out] - location where a boolean flag indicating whether this feature is enabled will be written to
1797 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1798 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1799 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
1800 * @retval IX_ETH_DB_INVALID_ARG either <i>present</i> or <i>enabled</i> pointer argument is invalid
1803 IxEthDBStatus
ixEthDBFeatureStatusGet(IxEthDBPortId portID
, IxEthDBFeature feature
, BOOL
*present
, BOOL
*enabled
);
1808 * @fn IxEthDBStatus ixEthDBFeaturePropertyGet(IxEthDBPortId portID, IxEthDBFeature feature, IxEthDBProperty property, IxEthDBPropertyType *type, void *value)
1810 * @brief Retrieves the value of a feature property
1812 * The EthDB features usually contain feature-specific properties describing or
1813 * controlling how the feature operates. While essential properties (e.g. the
1814 * firewall operating mode) have their own API, secondary properties can be
1815 * retrieved using this function.
1817 * Properties can be read-only or read-write. ixEthDBFeaturePropertyGet operates with
1818 * both types of features.
1820 * Properties have types associated with them. A descriptor indicating the property
1821 * type is returned in the <i>type</i> argument for convenience.
1823 * The currently supported properties and their corresponding features are as follows:
1825 * <table border="1"> <caption> Properties for IX_ETH_DB_VLAN_QOS </caption>
1826 * <tr> <td> <b> Property identifier <td> <b> Property type <td> <b> Property value <td> <b> Read-Only </b>
1827 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_COUNT_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> number of internal traffic classes <td> Yes
1828 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_0_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 0 <td> Yes
1829 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_1_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 1 <td> Yes
1830 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_2_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 2 <td> Yes
1831 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_3_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 3 <td> Yes
1832 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_4_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 4 <td> Yes
1833 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_5_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 5 <td> Yes
1834 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_6_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 6 <td> Yes
1835 * <tr> <td> IX_ETH_DB_QOS_TRAFFIC_CLASS_7_RX_QUEUE_PROPERTY <td> IX_ETH_DB_INTEGER_PROPERTY <td> queue assignment for traffic class 7 <td> Yes
1838 * @see ixEthDBFeaturePropertySet
1840 * @param portID @ref IxEthDBPortId [in] - ID of the port
1841 * @param feature @ref IxEthDBFeature [in] - EthDB feature for which the property is retrieved
1842 * @param property @ref IxEthDBProperty [in] - property identifier
1843 * @param type @ref IxEthDBPropertyType [out] - location where the property type will be stored
1844 * @param value void [out] - location where the property value will be stored
1846 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1847 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1848 * @retval IX_ETH_DB_INVALID_ARG invalid property identifier, <i>type</i> or <i>value</i> pointer arguments
1849 * @retval IX_ETH_DB_FAIL incorrect property value or unknown error
1852 IxEthDBStatus
ixEthDBFeaturePropertyGet(IxEthDBPortId portID
, IxEthDBFeature feature
, IxEthDBProperty property
, IxEthDBPropertyType
*type
, void *value
);
1857 * @fn IxEthDBStatus ixEthDBFeaturePropertySet(IxEthDBPortId portID, IxEthDBFeature feature, IxEthDBProperty property, void *value)
1859 * @brief Sets the value of a feature property
1861 * Unlike @ref ixEthDBFeaturePropertyGet, this function operates only with read-write properties
1863 * The currently supported properties and their corresponding features are as follows:
1865 * - IX_ETH_DB_QOS_QUEUE_CONFIGURATION_COMPLETE (for IX_ETH_DB_VLAN_QOS): freezes the availability of traffic classes
1866 * to the number of traffic classes currently in use
1868 * Note that this function creates deep copies of the property values; once the function is invoked the client
1869 * can free or reuse the memory area containing the original property value.
1871 * Copy behavior for different property types is defined as follows:
1873 * - IX_ETH_DB_INTEGER_PROPERTY - 4 bytes are copied from the source location
1874 * - IX_ETH_DB_STRING_PROPERTY - the source string will be copied up to the NULL '\0' string terminator, maximum of 255 characters
1875 * - IX_ETH_DB_MAC_ADDR_PROPERTY - 6 bytes are copied from the source location
1876 * - IX_ETH_DB_BOOL_PROPERTY - 4 bytes are copied from the source location; the only allowed values are TRUE (1L) and false (0L)
1878 * @see ixEthDBFeaturePropertySet
1880 * @warning IX_ETH_DB_QOS_QUEUE_CONFIGURATION_COMPLETE is provided for EthAcc internal use;
1881 * do not attempt to set this property directly
1883 * @param portID @ref IxEthDBPortId [in] - ID of the port
1884 * @param feature @ref IxEthDBFeature [in] - EthDB feature for which the property is set
1885 * @param property @ref IxEthDBProperty [in] - property identifier
1886 * @param value void [in] - location where the property value is to be copied from
1888 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1889 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1890 * @retval IX_ETH_DB_INVALID_ARG invalid property identifier, <i>value</i> pointer, or invalid property value
1893 IxEthDBStatus
ixEthDBFeaturePropertySet(IxEthDBPortId portID
, IxEthDBFeature feature
, IxEthDBProperty property
, void *value
);
1898 * @fn IxEthDBStatus ixEthDBDatabaseClear(IxEthDBPortId portID, IxEthDBRecordType recordType)
1900 * @brief Deletes a set of record types from the Ethernet Database
1902 * This function deletes all the records of certain types (specified in the recordType filter)
1903 * associated with a port. Additionally, the IX_ETH_DB_ALL_PORTS value can be used as port ID
1904 * to indicate that the specified record types should be deleted for all the ports.
1906 * The record type filter can be an ORed combination of the following types:
1908 * <caption> Record types </caption>
1909 * - IX_ETH_DB_FILTERING_RECORD <table><caption> Filtering record </caption>
1910 * <tr><td> MAC address <td> static/dynamic type <td> age </tr>
1913 * - IX_ETH_DB_FILTERING_VLAN_RECORD <table><caption> VLAN-enabled filtering record </caption>
1914 * <tr><td> MAC address <td> static/dynamic type <td> age <td> 802.1Q tag </tr>
1917 * - IX_ETH_DB_WIFI_RECORD <table><caption> WiFi header conversion record </caption>
1918 * <tr><td> MAC address <td> optional gateway MAC address <td> </tr>
1921 * - IX_ETH_DB_FIREWALL_RECORD <table><caption> Firewall record </caption>
1922 * <tr><td> MAC address </tr>
1924 * - IX_ETH_DB_ALL_RECORD_TYPES
1926 * Any combination of the above types is valid e.g.
1928 * (IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_FILTERING_VLAN_RECORD | IX_ETH_DB_FIREWALL_RECORD),
1930 * although some might be redundant (it is not an error to do so) e.g.
1932 * (IX_ETH_DB_FILTERING_RECORD | IX_ETH_DB_ALL_RECORD_TYPES)
1934 * @param portID @ref IxEthDBPortId [in] - ID of the port
1935 * @param recordType @ref IxEthDBRecordType [in] - record type filter
1937 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1938 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1939 * @retval IX_ETH_DB_INVALID_ARG invalid <i>recordType</i> filter
1941 * @note If the record type filter contains any unrecognized value (hence the
1942 * IX_ETH_DB_INVALID_ARG error value is returned) no actual records will be deleted.
1945 IxEthDBStatus
ixEthDBDatabaseClear(IxEthDBPortId portID
, IxEthDBRecordType recordType
);
1950 * @fn IxEthDBStatus ixEthDBWiFiStationEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
1952 * @brief Adds an "Access Point to Station" record to the database, for 802.3 => 802.11 frame
1955 * Frame header conversion is controlled by the set of MAC addresses
1956 * added using @ref ixEthDBWiFiStationEntryAdd and @ref ixEthDBWiFiAccessPointEntryAdd.
1957 * Conversion arguments are added using @ref ixEthDBWiFiFrameControlSet,
1958 * @ref ixEthDBWiFiDurationIDSet and @ref ixEthDBWiFiBBSIDSet.
1960 * Note that adding the same MAC address twice will not return an error
1961 * (but will not accomplish anything either), while re-adding a record previously added
1962 * as an "Access Point to Access Point" will migrate the record to the "Access Point
1965 * @param portID @ref IxEthDBPortId [in] - ID of the port
1966 * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to add
1968 * @retval IX_ETH_DB_SUCCESS operation completed successfully
1969 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
1970 * @retval IX_ETH_DB_INVALID_ARG macAddr is an invalid pointer
1971 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
1972 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
1973 * @retval IX_ETH_DB_NOMEM maximum number of records reached
1974 * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
1977 IxEthDBStatus
ixEthDBWiFiStationEntryAdd(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
1982 * @fn IxEthDBStatus ixEthDBWiFiAccessPointEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr, IxEthDBMacAddr *gatewayMacAddr)
1984 * @brief Adds an "Access Point to Access Point" record to the database
1986 * @see ixEthDBWiFiStationEntryAdd
1988 * Note that adding the same MAC address twice will simply overwrite the previously
1989 * defined gateway MAC address value in the same record, if the record was previously of the
1990 * "Access Point to Access Point" type.
1992 * Re-adding a MAC address as "Access Point to Access Point", which was previously added as
1993 * "Access Point to Station" will migrate the record type to "Access Point to Access Point" and
1994 * record the gateway MAC address.
1996 * @param portID @ref IxEthDBPortId [in] - ID of the port
1997 * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to add
1998 * @param gatewayMacAddr @ref IxEthDBMacAddr [in] - MAC address of the gateway Access Point
2000 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2001 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2002 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
2003 * @retval IX_ETH_DB_INVALID_ARG macAddr is an invalid pointer
2004 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
2005 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> or <i>gatewayMacAddr</i> pointer argument
2006 * @retval IX_ETH_DB_NOMEM maximum number of records reached
2007 * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
2010 IxEthDBStatus
ixEthDBWiFiAccessPointEntryAdd(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
, IxEthDBMacAddr
*gatewayMacAddr
);
2015 * @fn IxEthDBStatus ixEthDBWiFiEntryRemove(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
2017 * @brief Removes a WiFi station record
2019 * This function removes both types of WiFi records ("Access Point to Station" and
2020 * "Access Point to Access Point").
2022 * @param portID @ref IxEthDBPortId [in] - ID of the port
2023 * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to remove
2025 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2026 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2027 * @retval IX_ETH_DB_PORT_UNINITIALIZED port is not initialized
2028 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
2029 * @retval IX_ETH_DB_NO_SUCH_ADDR specified address was not found in the database
2030 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
2031 * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
2034 IxEthDBStatus
ixEthDBWiFiEntryRemove(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
2039 * @fn IxEthDBStatus ixEthDBWiFiConversionTableDownload(IxEthDBPortId portID)
2041 * @brief Downloads the MAC address table for 802.3 => 802.11 frame header
2042 * conversion to the NPE
2044 * Note that the frame conversion MAC address table must be individually downloaded
2045 * to each NPE for which the frame header conversion feature is enabled (i.e. it
2046 * is not possible to specify IX_ETH_DB_ALL_PORTS).
2048 * @param portID @ref IxEthDBPortId [in] - ID of the port
2050 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2051 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2052 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2053 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
2054 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2057 IxEthDBStatus
ixEthDBWiFiConversionTableDownload(IxEthDBPortId portID
);
2062 * @fn IxEthDBStatus ixEthDBWiFiFrameControlSet(IxEthDBPortId portID, UINT16 frameControl)
2064 * @brief Sets the GlobalFrameControl field
2066 * The GlobalFrameControl field is a 2-byte value inserted in the <i>Frame Control</i>
2067 * field for all 802.3 to 802.11 frame header conversions
2069 * @param portID @ref IxEthDBPortId [in] - ID of the port
2070 * @param frameControl UINT16 [in] - GlobalFrameControl value
2072 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2073 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2074 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2075 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
2076 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2079 IxEthDBStatus
ixEthDBWiFiFrameControlSet(IxEthDBPortId portID
, UINT16 frameControl
);
2084 * @fn IxEthDBStatus ixEthDBWiFiDurationIDSet(IxEthDBPortId portID, UINT16 durationID)
2086 * @brief Sets the GlobalDurationID field
2088 * The GlobalDurationID field is a 2-byte value inserted in the <i>Duration/ID</i>
2089 * field for all 802.3 to 802.11 frame header conversions
2091 * @param portID @ref IxEthDBPortId [in] - ID of the port
2092 * @param durationID UINT16 [in] - GlobalDurationID field
2094 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2095 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2096 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2097 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
2098 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2101 IxEthDBStatus
ixEthDBWiFiDurationIDSet(IxEthDBPortId portID
, UINT16 durationID
);
2106 * @fn IxEthDBStatus ixEthDBWiFiBBSIDSet(IxEthDBPortId portID, IxEthDBMacAddr *bbsid)
2108 * @brief Sets the BBSID field
2110 * The BBSID field is a 6-byte value which
2111 * identifies the infrastructure of the service set managed
2112 * by the Access Point having the IXP400 as its processor. The value
2113 * is written in the <i>BBSID</i> field of the 802.11 frame header.
2114 * The BBSID value is the MAC address of the Access Point.
2116 * @param portID @ref IxEthDBPortId [in] - ID of the port
2117 * @param bbsid @ref IxEthDBMacAddr [in] - pointer to 6 bytes containing the BSSID
2119 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2120 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2121 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2122 * @retval IX_ETH_DB_INVALID_ARG invalid <i>bbsid</i> pointer argument
2123 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE WiFi feature not enabled
2124 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2127 IxEthDBStatus
ixEthDBWiFiBBSIDSet(IxEthDBPortId portID
, IxEthDBMacAddr
*bbsid
);
2132 * @fn IxEthDBStatus ixEthDBSpanningTreeBlockingStateSet(IxEthDBPortId portID, BOOL blocked)
2134 * @brief Sets the STP blocked/unblocked state for a port
2136 * @param portID @ref IxEthDBPortId [in] - ID of the port
2137 * @param blocked BOOL [in] - TRUE to set the port as STP blocked, FALSE to set it as unblocked
2139 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2140 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2141 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2142 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Spanning Tree Protocol feature not enabled
2143 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2146 IxEthDBStatus
ixEthDBSpanningTreeBlockingStateSet(IxEthDBPortId portID
, BOOL blocked
);
2151 * @fn IxEthDBStatus ixEthDBSpanningTreeBlockingStateGet(IxEthDBPortId portID, BOOL *blocked)
2153 * @brief Retrieves the STP blocked/unblocked state for a port
2155 * @param portID @ref IxEthDBPortId [in] - ID of the port
2156 * @param blocked BOOL * [in] - set to TRUE if the port is STP blocked, FALSE otherwise
2158 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2159 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2160 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2161 * @retval IX_ETH_DB_INVALID_ARG invalid <i>blocked</i> pointer argument
2162 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Spanning Tree Protocol feature not enabled
2165 IxEthDBStatus
ixEthDBSpanningTreeBlockingStateGet(IxEthDBPortId portID
, BOOL
*blocked
);
2170 * @fn IxEthDBStatus ixEthDBFirewallModeSet(IxEthDBPortId portID, IxEthDBFirewallMode mode)
2172 * @brief Sets the firewall mode to use white or black listing
2174 * When enabled, the NPE MAC address based firewall support operates in two modes:
2176 * - white-list mode (MAC address based admission)
2177 * - <i>mode</i> set to IX_ETH_DB_FIREWALL_WHITE_LIST
2178 * - only packets originating from MAC addresses contained in the firewall address list
2179 * are allowed on the Rx path
2180 * - black-list mode (MAC address based blocking)
2181 * - <i>mode</i> set to IX_ETH_DB_FIREWALL_BLACK_LIST
2182 * - packets originating from MAC addresses contained in the firewall address list
2185 * @param portID @ref IxEthDBPortId [in] - ID of the port
2186 * @param mode @ref IxEthDBFirewallMode [in] - firewall mode (IX_ETH_DB_FIREWALL_WHITE_LIST or IX_ETH_DB_FIREWALL_BLACK_LIST)
2188 * @note by default the firewall operates in black-list mode with an empty address
2189 * list, hence it doesn't filter any packets
2191 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2192 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2193 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2194 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
2195 * @retval IX_ETH_DB_INVALID_ARGUMENT <i>mode</i> argument is not a valid firewall configuration mode
2196 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2199 IxEthDBStatus
ixEthDBFirewallModeSet(IxEthDBPortId portID
, IxEthDBFirewallMode mode
);
2204 * @fn ixEthDBFirewallInvalidAddressFilterEnable(IxEthDBPortId portID, BOOL enable)
2206 * @brief Enables or disables invalid MAC address filtering
2208 * According to IEEE802 it is illegal for a source address to be a multicast
2209 * or broadcast address. If this feature is enabled the NPE inspects the source
2210 * MAC addresses of incoming frames and discards them if invalid addresses are
2213 * By default this service is enabled, if the firewall feature is supported by the
2216 * @param portID ID of the port
2217 * @param enable TRUE to enable invalid MAC address filtering and FALSE to disable it
2219 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2220 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2221 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2222 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
2223 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2226 IxEthDBStatus
ixEthDBFirewallInvalidAddressFilterEnable(IxEthDBPortId portID
, BOOL enable
);
2231 * @fn IxEthDBStatus ixEthDBFirewallEntryAdd(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
2233 * @brief Adds a MAC address to the firewall address list
2235 * Note that adding the same MAC address twice will not return an error
2236 * but will not actually accomplish anything.
2238 * The firewall MAC address list has a limited number of entries; once
2239 * the maximum number of entries has been reached this function will failed
2240 * to add more addresses, returning IX_ETH_DB_NOMEM.
2242 * @param portID @ref IxEthDBPortId [in] - ID of the port
2243 * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to be added
2245 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2246 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2247 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2248 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
2249 * @retval IX_ETH_DB_NOMEM maximum number of records reached
2250 * @retval IX_ETH_DB_BUSY lock condition or transaction in progress, try again later
2251 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
2254 IxEthDBStatus
ixEthDBFirewallEntryAdd(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
2259 * @fn IxEthDBStatus ixEthDBFirewallEntryRemove(IxEthDBPortId portID, IxEthDBMacAddr *macAddr)
2261 * @brief Removes a MAC address from the firewall address list
2263 * @param portID @ref IxEthDBPortId [in] - ID of the port
2264 * @param macAddr @ref IxEthDBMacAddr [in] - MAC address to be removed
2266 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2267 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2268 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2269 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
2270 * @retval IX_ETH_DB_NO_SUCH_ADDR address not found
2271 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
2274 IxEthDBStatus
ixEthDBFirewallEntryRemove(IxEthDBPortId portID
, IxEthDBMacAddr
*macAddr
);
2279 * @fn IxEthDBStatus ixEthDBFirewallTableDownload(IxEthDBPortId portID)
2281 * @brief Downloads the MAC firewall table to a port
2283 * @param portID ID of the port
2285 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2286 * @retval IX_ETH_DB_INVALID_PORT portID is not a valid port identifier
2287 * @retval IX_ETH_DB_PORT_UNINITIALIZED port not initialized
2288 * @retval IX_ETH_DB_FEATURE_UNAVAILABLE Firewall feature not enabled
2289 * @retval IX_ETH_DB_FAIL unknown OS or NPE communication error
2292 IxEthDBStatus
ixEthDBFirewallTableDownload(IxEthDBPortId portID
);
2297 * @fn IxEthDBStatus ixEthDBUserFieldSet(IxEthDBRecordType recordType, IxEthDBMacAddr *macAddr, IxEthDBPortId portID, IxEthDBVlanId vlanID, void *field)
2299 * @brief Adds a user-defined field to a database record
2301 * This function associates a user-defined field to a database record.
2302 * The user-defined field is passed as a <i>(void *)</i> parameter, hence it can be used
2303 * for any purpose (such as identifying a structure). Retrieving the user-defined field from
2304 * a record is done using @ref ixEthDBUserFieldGet. Note that EthDB never uses the user-defined
2305 * field for any internal operation and it is not aware of the significance of its contents. The
2306 * field is only stored as a pointer.
2308 * The database record is identified using a combination of the given parameters, depending on the record type.
2309 * All the record types require the record MAC address.
2311 * - IX_ETH_DB_FILTERING_RECORD requires only the MAC address
2312 * - IX_ETH_DB_VLAN_FILTERING_RECORD requires the MAC address and the VLAN ID
2313 * - IX_ETH_DB_WIFI_RECORD requires the MAC address and the portID
2314 * - IX_ETH_DB_FIREWALL_RECORD requires the MAC address and the portID
2316 * Please note that if a parameter is not required it is completely ignored (it does not undergo parameter checking).
2317 * The user-defined field can be cleared using a <b>NULL</b> <i>field</i> parameter.
2319 * @param recordType @ref IxEthDBRecordType [in] - type of record (can be IX_ETH_DB_FILTERING_RECORD,
2320 * IX_ETH_DB_FILTERING_VLAN_RECORD, IX_ETH_DB_WIFI_RECORD or IX_ETH_DB_FIREWALL_RECORD)
2321 * @param portID @ref IxEthDBPortId [in] - ID of the port (required only for WIFI and FIREWALL records)
2322 * @param macAddr @ref IxEthDBMacAddr * [in] - MAC address of the record
2323 * @param vlanID @ref IxEthDBVlanId [in] - VLAN ID of the record (required only for FILTERING_VLAN records)
2324 * @param field void * [in] - user defined field
2326 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2327 * @retval IX_ETH_DB_INVALID_PORT portID was required but it is not a valid port identifier
2328 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> pointer argument
2329 * @retval IX_ETH_DB_NO_SUCH_ADDR record not found
2332 IxEthDBStatus
ixEthDBUserFieldSet(IxEthDBRecordType recordType
, IxEthDBMacAddr
*macAddr
, IxEthDBPortId portID
, IxEthDBVlanId vlanID
, void *field
);
2337 * @fn IxEthDBStatus ixEthDBUserFieldGet(IxEthDBRecordType recordType, IxEthDBMacAddr *macAddr, IxEthDBPortId portID, IxEthDBVlanId vlanID, void **field)
2339 * @brief Retrieves a user-defined field from a database record
2341 * The database record is identified using a combination of the given parameters, depending on the record type.
2342 * All the record types require the record MAC address.
2344 * - IX_ETH_DB_FILTERING_RECORD requires only the MAC address
2345 * - IX_ETH_DB_VLAN_FILTERING_RECORD requires the MAC address and the VLAN ID
2346 * - IX_ETH_DB_WIFI_RECORD requires the MAC address and the portID
2347 * - IX_ETH_DB_FIREWALL_RECORD requires the MAC address and the portID
2349 * Please note that if a parameter is not required it is completely ignored (it does not undergo parameter checking).
2351 * If no user-defined field was registered with the specified record then <b>NULL</b> will be written
2352 * at the location specified by <i>field</i>.
2354 * @param recordType type of record (can be IX_ETH_DB_FILTERING_RECORD, IX_ETH_DB_FILTERING_VLAN_RECORD, IX_ETH_DB_WIFI_RECORD
2355 * or IX_ETH_DB_FIREWALL_RECORD)
2356 * @param portID ID of the port (required only for WIFI and FIREWALL records)
2357 * @param macAddr MAC address of the record
2358 * @param vlanID VLAN ID of the record (required only for FILTERING_VLAN records)
2359 * @param field location to write the user defined field into
2361 * @retval IX_ETH_DB_SUCCESS operation completed successfully
2362 * @retval IX_ETH_DB_INVALID_PORT portID was required but it is not a valid port identifier
2363 * @retval IX_ETH_DB_INVALID_ARG invalid <i>macAddr</i> or <i>field</i> pointer arguments
2364 * @retval IX_ETH_DB_NO_SUCH_ADDR record not found
2367 IxEthDBStatus
ixEthDBUserFieldGet(IxEthDBRecordType recordType
, IxEthDBMacAddr
*macAddr
, IxEthDBPortId portId
, IxEthDBVlanId vlanID
, void **field
);
2373 #endif /* IxEthDB_H */