2 * @file IxEthDBSpanningTree.c
4 * @brief Implementation of the STP API
7 * IXP400 SW Release version 2.0
9 * -- Copyright Notice --
12 * Copyright 2001-2005, Intel Corporation.
13 * All rights reserved.
16 * SPDX-License-Identifier: BSD-3-Clause
18 * -- End of Copyright Notice --
22 #include "IxEthDB_p.h"
25 * @brief sets the STP blocking state of a port
27 * @param portID ID of the port
28 * @param blocked true to block the port or false to unblock it
30 * Note that this function is documented in the main component
31 * header file, IxEthDB.h.
33 * @return IX_ETH_DB_SUCCESS if the operation completed successfully
34 * or an appropriate error message otherwise
37 IxEthDBStatus ixEthDBSpanningTreeBlockingStateSet(IxEthDBPortId portID, BOOL blocked)
39 IxNpeMhMessage message;
42 IX_ETH_DB_CHECK_PORT(portID);
44 IX_ETH_DB_CHECK_SINGLE_NPE(portID);
46 IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_SPANNING_TREE_PROTOCOL);
48 ixEthDBPortInfo[portID].stpBlocked = blocked;
50 FILL_SETBLOCKINGSTATE_MSG(message, portID, blocked);
52 IX_ETHDB_SEND_NPE_MSG(IX_ETH_DB_PORT_ID_TO_NPE(portID), message, result);
58 * @brief retrieves the STP blocking state of a port
60 * @param portID ID of the port
61 * @param blocked address to write the blocked status into
63 * Note that this function is documented in the main component
64 * header file, IxEthDB.h.
66 * @return IX_ETH_DB_SUCCESS if the operation completed successfully
67 * or an appropriate error message otherwise
70 IxEthDBStatus ixEthDBSpanningTreeBlockingStateGet(IxEthDBPortId portID, BOOL *blocked)
72 IX_ETH_DB_CHECK_PORT(portID);
74 IX_ETH_DB_CHECK_SINGLE_NPE(portID);
76 IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_SPANNING_TREE_PROTOCOL);
78 IX_ETH_DB_CHECK_REFERENCE(blocked);
80 *blocked = ixEthDBPortInfo[portID].stpBlocked;
82 return IX_ETH_DB_SUCCESS;