ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / linux / if_bridge.h
1 /*
2  *      Linux ethernet bridge
3  *
4  *      Authors:
5  *      Lennert Buytenhek               <buytenh@gnu.org>
6  *
7  *      $Id: if_bridge.h,v 1.1 2000/02/18 16:47:01 davem Exp $
8  *
9  *      This program is free software; you can redistribute it and/or
10  *      modify it under the terms of the GNU General Public License
11  *      as published by the Free Software Foundation; either version
12  *      2 of the License, or (at your option) any later version.
13  */
14
15 #ifndef _LINUX_IF_BRIDGE_H
16 #define _LINUX_IF_BRIDGE_H
17
18 #include <linux/types.h>
19
20 #define BRCTL_VERSION 1
21
22 #define BRCTL_GET_VERSION 0
23 #define BRCTL_GET_BRIDGES 1
24 #define BRCTL_ADD_BRIDGE 2
25 #define BRCTL_DEL_BRIDGE 3
26 #define BRCTL_ADD_IF 4
27 #define BRCTL_DEL_IF 5
28 #define BRCTL_GET_BRIDGE_INFO 6
29 #define BRCTL_GET_PORT_LIST 7
30 #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
31 #define BRCTL_SET_BRIDGE_HELLO_TIME 9
32 #define BRCTL_SET_BRIDGE_MAX_AGE 10
33 #define BRCTL_SET_AGEING_TIME 11
34 #define BRCTL_SET_GC_INTERVAL 12
35 #define BRCTL_GET_PORT_INFO 13
36 #define BRCTL_SET_BRIDGE_STP_STATE 14
37 #define BRCTL_SET_BRIDGE_PRIORITY 15
38 #define BRCTL_SET_PORT_PRIORITY 16
39 #define BRCTL_SET_PATH_COST 17
40 #define BRCTL_GET_FDB_ENTRIES 18
41
42 #define BR_STATE_DISABLED 0
43 #define BR_STATE_LISTENING 1
44 #define BR_STATE_LEARNING 2
45 #define BR_STATE_FORWARDING 3
46 #define BR_STATE_BLOCKING 4
47
48 struct __bridge_info
49 {
50         __u64 designated_root;
51         __u64 bridge_id;
52         __u32 root_path_cost;
53         __u32 max_age;
54         __u32 hello_time;
55         __u32 forward_delay;
56         __u32 bridge_max_age;
57         __u32 bridge_hello_time;
58         __u32 bridge_forward_delay;
59         __u8 topology_change;
60         __u8 topology_change_detected;
61         __u8 root_port;
62         __u8 stp_enabled;
63         __u32 ageing_time;
64         __u32 gc_interval;
65         __u32 hello_timer_value;
66         __u32 tcn_timer_value;
67         __u32 topology_change_timer_value;
68         __u32 gc_timer_value;
69 };
70
71 struct __port_info
72 {
73         __u64 designated_root;
74         __u64 designated_bridge;
75         __u16 port_id;
76         __u16 designated_port;
77         __u32 path_cost;
78         __u32 designated_cost;
79         __u8 state;
80         __u8 top_change_ack;
81         __u8 config_pending;
82         __u8 unused0;
83         __u32 message_age_timer_value;
84         __u32 forward_delay_timer_value;
85         __u32 hold_timer_value;
86 };
87
88 struct __fdb_entry
89 {
90         __u8 mac_addr[6];
91         __u8 port_no;
92         __u8 is_local;
93         __u32 ageing_timer_value;
94         __u32 unused;
95 };
96
97 #ifdef __KERNEL__
98
99 #include <linux/netdevice.h>
100
101 extern void brioctl_set(int (*ioctl_hook)(unsigned long));
102 extern int (*br_handle_frame_hook)(struct sk_buff *skb);
103 extern int (*br_should_route_hook)(struct sk_buff **pskb);
104
105 #endif
106
107 #endif