]> git.ipfire.org Git - people/ms/rstp.git/blame - ctl_functions.h
Initial commit
[people/ms/rstp.git] / ctl_functions.h
CommitLineData
ad02a0eb
SH
1/*****************************************************************************
2 Copyright (c) 2006 EMC Corporation.
3
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2 of the License, or (at your option)
7 any later version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 more details.
13
14 You should have received a copy of the GNU General Public License along with
15 this program; if not, write to the Free Software Foundation, Inc., 59
16 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
18 The full GNU General Public License is included in this distribution in the
19 file called LICENSE.
20
21 Authors: Srinivas Aji <Aji_Srinivas@emc.com>
22
23******************************************************************************/
24
25#ifndef CTL_FUNCTIONS_H
26#define CTL_FUNCTIONS_H
27
28#include <bitmap.h>
29#include <uid_stp.h>
30
31int CTL_enable_bridge_rstp(int br_index, int enable);
32
33int CTL_get_bridge_state(int br_index,
34 UID_STP_CFG_T *cfg, UID_STP_STATE_T *state);
35
36int CTL_set_bridge_config(int br_index,
37 UID_STP_CFG_T *cfg);
38
39int CTL_get_port_state(int br_index, int port_index,
40 UID_STP_PORT_CFG_T *cfg, UID_STP_PORT_STATE_T *state);
41
42int CTL_set_port_config(int br_index, int port_index,
43 UID_STP_PORT_CFG_T *cfg);
44
45int CTL_set_debug_level(int level);
46
47#define CTL_ERRORS \
48 CHOOSE(Err_Interface_not_a_bridge), \
49 CHOOSE(Err_Bridge_RSTP_not_enabled), \
50 CHOOSE(Err_Bridge_is_down), \
51 CHOOSE(Err_Port_does_not_belong_to_bridge), \
52
53#define CHOOSE(a) a
54
55enum Errors {
56 Err_Dummy_Start = 1000,
57 CTL_ERRORS
58 Err_Dummy_End
59};
60
61#undef CHOOSE
62
63const char *CTL_error_explanation(int err);
64
65#endif