]> git.ipfire.org Git - people/ms/rstp.git/blame - rstplib/stp_to.h
RSTP testing - PATCH: source MAC address of BPDU
[people/ms/rstp.git] / rstplib / stp_to.h
CommitLineData
ad02a0eb
SH
1/************************************************************************
2 * RSTP library - Rapid Spanning Tree (802.1t, 802.1w)
3 * Copyright (C) 2001-2003 Optical Access
4 * Author: Alex Rozin
5 *
6 * This file is part of RSTP library.
7 *
8 * RSTP library is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by the
10 * Free Software Foundation; version 2.1
11 *
12 * RSTP library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with RSTP library; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 **********************************************************************/
22
23/* This file contains prototypes for system dependent API
24 from the RSTP to an operation system */
25
26#ifndef _STP_OUT_H__
27#define _STP_OUT_H__
28
29/* In the best case: clean all Learning entries with
30 the vlan_id and the port (if 'exclude'=0) or for all ports,
31 exclude the port (if ''exclude'=1). If 'port'=0, delete all
32 entries with the vlan_id, don't care to 'exclude' */
33typedef enum {
34 LT_FLASH_ALL_PORTS_EXCLUDE_THIS,
35 LT_FLASH_ONLY_THE_PORT
36} LT_FLASH_TYPE_T;
37
38int
39STP_OUT_flush_lt (IN int port_index, IN int vlan_id,
40 IN LT_FLASH_TYPE_T type, IN char* reason);
41
42void /* for bridge id calculation */
43STP_OUT_get_port_mac (IN int port_index, OUT unsigned char* mac);
44
45unsigned long
46STP_OUT_get_port_oper_speed (IN unsigned int portNo);
47
48int /* 1- Up, 0- Down */
49STP_OUT_get_port_link_status (IN int port_index);
50
51int /* 1- Full, 0- Half */
52STP_OUT_get_duplex (IN int port_index);
53
54#ifdef STRONGLY_SPEC_802_1W
55int
56STP_OUT_set_learning (IN int port_index, IN int vlan_id, IN int enable);
57
58int
59STP_OUT_set_forwarding (IN int port_index, IN int vlan_id, IN int enable);
60#else
61/*
62 * In many kinds of hardware the state of ports may
63 * be changed with another method
64 */
65int
66STP_OUT_set_port_state (IN int port_index, IN int vlan_id, IN RSTP_PORT_STATE state);
67#endif
68
69int
70STP_OUT_set_hardware_mode (int vlan_id, UID_STP_MODE_T mode);
71
72int
73STP_OUT_tx_bpdu (IN int port_index, IN int vlan_id,
74 IN unsigned char* bpdu,
75 IN size_t bpdu_len);
76
77const char *
78STP_OUT_get_port_name (IN int port_index);
79
80int
81STP_OUT_get_init_stpm_cfg (IN int vlan_id,
82 INOUT UID_STP_CFG_T* cfg);
83
84
85int
86STP_OUT_get_init_port_cfg (IN int vlan_id,
87 IN int port_index,
88 INOUT UID_STP_PORT_CFG_T* cfg);
89
90
91#endif /* _STP_OUT_H__ */
92