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 * 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 --
46 #include "IxEthDB_p.h"
49 * @brief sets the STP blocking state of a port
51 * @param portID ID of the port
52 * @param blocked true to block the port or false to unblock it
54 * Note that this function is documented in the main component
55 * header file, IxEthDB.h.
57 * @return IX_ETH_DB_SUCCESS if the operation completed successfully
58 * or an appropriate error message otherwise
61 IxEthDBStatus ixEthDBSpanningTreeBlockingStateSet(IxEthDBPortId portID, BOOL blocked)
63 IxNpeMhMessage message;
66 IX_ETH_DB_CHECK_PORT(portID);
68 IX_ETH_DB_CHECK_SINGLE_NPE(portID);
70 IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_SPANNING_TREE_PROTOCOL);
72 ixEthDBPortInfo[portID].stpBlocked = blocked;
74 FILL_SETBLOCKINGSTATE_MSG(message, portID, blocked);
76 IX_ETHDB_SEND_NPE_MSG(IX_ETH_DB_PORT_ID_TO_NPE(portID), message, result);
82 * @brief retrieves the STP blocking state of a port
84 * @param portID ID of the port
85 * @param blocked address to write the blocked status into
87 * Note that this function is documented in the main component
88 * header file, IxEthDB.h.
90 * @return IX_ETH_DB_SUCCESS if the operation completed successfully
91 * or an appropriate error message otherwise
94 IxEthDBStatus ixEthDBSpanningTreeBlockingStateGet(IxEthDBPortId portID, BOOL *blocked)
96 IX_ETH_DB_CHECK_PORT(portID);
98 IX_ETH_DB_CHECK_SINGLE_NPE(portID);
100 IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_SPANNING_TREE_PROTOCOL);
102 IX_ETH_DB_CHECK_REFERENCE(blocked);
104 *blocked = ixEthDBPortInfo[portID].stpBlocked;
106 return IX_ETH_DB_SUCCESS;