2 * Copyright (C) 2000 Lennert Buytenhek
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <linux/if_bridge.h>
27 unsigned char prio[2];
28 unsigned char addr[6];
33 struct bridge_id designated_root;
34 struct bridge_id bridge_id;
35 unsigned root_path_cost;
36 struct timeval max_age;
37 struct timeval hello_time;
38 struct timeval forward_delay;
39 struct timeval bridge_max_age;
40 struct timeval bridge_hello_time;
41 struct timeval bridge_forward_delay;
43 unsigned char stp_enabled;
44 unsigned char topology_change;
45 unsigned char topology_change_detected;
46 struct timeval ageing_time;
47 struct timeval hello_timer_value;
48 struct timeval tcn_timer_value;
49 struct timeval topology_change_timer_value;
50 struct timeval gc_timer_value;
57 unsigned char is_local;
58 struct timeval ageing_timer_value;
64 struct bridge_id designated_root;
65 struct bridge_id designated_bridge;
67 u_int16_t designated_port;
69 unsigned char top_change_ack;
70 unsigned char config_pending;
73 unsigned designated_cost;
74 struct timeval message_age_timer_value;
75 struct timeval forward_delay_timer_value;
76 struct timeval hold_timer_value;
79 extern int br_init(void);
80 extern int br_refresh(void);
81 extern void br_shutdown(void);
83 extern int br_foreach_bridge(int (*iterator)(const char *brname, void *),
85 extern int br_foreach_port(const char *brname,
86 int (*iterator)(const char *brname, const char *port,
89 extern const char *br_get_state_name(int state);
91 extern int br_get_bridge_info(const char *br, struct bridge_info *info);
92 extern int br_get_port_info(const char *brname, const char *port,
93 struct port_info *info);
94 extern int br_add_bridge(const char *brname);
95 extern int br_del_bridge(const char *brname);
96 extern int br_add_interface(const char *br, const char *dev);
97 extern int br_del_interface(const char *br, const char *dev);
98 extern int br_set_bridge_forward_delay(const char *br, struct timeval *tv);
99 extern int br_set_bridge_hello_time(const char *br, struct timeval *tv);
100 extern int br_set_bridge_max_age(const char *br, struct timeval *tv);
101 extern int br_set_ageing_time(const char *br, struct timeval *tv);
102 extern int br_set_stp_state(const char *br, int stp_state);
103 extern int br_set_bridge_priority(const char *br, int bridge_priority);
104 extern int br_set_port_priority(const char *br, const char *p,
107 extern int br_set_port_snooping(const char *br, const char *p,
109 extern int br_clear_port_snooping(const char *br, const char *p,
111 extern int br_show_port_snooping(const char *br) ;
112 extern int br_enable_port_snooping(int enable) ;
114 extern int br_set_path_cost(const char *br, const char *p,
116 extern int br_read_fdb(const char *br, struct fdb_entry *fdbs,
117 unsigned long skip, int num);