source: SVN/cambria/redboot/packages/devs/eth/intel/npe/ethDB/current/src/IxEthDBSpanningTree.c @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 3.4 KB
Line 
1/**
2 * @file IxEthDBSpanningTree.c
3 *
4 * @brief Implementation of the STP API
5 *
6 * @par
7 * IXP400 SW Release version 2.3
8 *
9 * -- Copyright Notice --
10 *
11 * @par
12 * Copyright (c) 2001-2005, Intel Corporation.
13 * All rights reserved.
14 *
15 * @par
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
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.
27 *
28 *
29 * @par
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
40 * SUCH DAMAGE.
41 *
42 *
43 * @par
44 * -- End of Copyright Notice --
45 */
46
47
48#include "IxEthDB_p.h"
49
50/**
51 * @brief sets the STP blocking state of a port
52 *
53 * @param portID ID of the port
54 * @param blocked TRUE to block the port or FALSE to unblock it
55 *
56 * Note that this function is documented in the main component
57 * header file, IxEthDB.h.
58 *
59 * @return IX_ETH_DB_SUCCESS if the operation completed successfully
60 * or an appropriate error message otherwise
61 */
62IX_ETH_DB_PUBLIC
63IxEthDBStatus ixEthDBSpanningTreeBlockingStateSet(IxEthDBPortId portID, BOOL blocked)
64{
65    IxNpeMhMessage message;
66    IX_STATUS result;
67   
68    IX_ETH_DB_CHECK_PORT(portID);
69   
70    IX_ETH_DB_CHECK_SINGLE_NPE(portID);
71 
72    IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_SPANNING_TREE_PROTOCOL);
73   
74    ixEthDBPortInfo[portID].stpBlocked = blocked;
75
76    FILL_SETBLOCKINGSTATE_MSG(message, portID, blocked);
77   
78    IX_ETHDB_SEND_NPE_MSG(IX_ETHNPE_PHYSICAL_ID_TO_NODE(portID), message, result);
79   
80    return result;
81}
82
83/**
84 * @brief retrieves the STP blocking state of a port
85 *
86 * @param portID ID of the port
87 * @param blocked address to write the blocked status into
88 *
89 * Note that this function is documented in the main component
90 * header file, IxEthDB.h.
91 *
92 * @return IX_ETH_DB_SUCCESS if the operation completed successfully
93 * or an appropriate error message otherwise
94 */
95IX_ETH_DB_PUBLIC
96IxEthDBStatus ixEthDBSpanningTreeBlockingStateGet(IxEthDBPortId portID, BOOL *blocked)
97{
98    IX_ETH_DB_CHECK_PORT(portID);
99   
100    IX_ETH_DB_CHECK_SINGLE_NPE(portID);
101 
102    IX_ETH_DB_CHECK_FEATURE(portID, IX_ETH_DB_SPANNING_TREE_PROTOCOL);
103   
104    IX_ETH_DB_CHECK_REFERENCE(blocked);
105   
106    *blocked = ixEthDBPortInfo[portID].stpBlocked;
107   
108    return IX_ETH_DB_SUCCESS;
109}
Note: See TracBrowser for help on using the repository browser.