ead: fix compile errors with recent kernels
[openwrt/staging/yousong.git] / package / network / services / ead / src / libbridge.h
1 /*
2 * Copyright (C) 2000 Lennert Buytenhek
3 *
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.
8 *
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.
13 *
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.
17 */
18
19 #ifndef _LIBBRIDGE_H
20 #define _LIBBRIDGE_H
21
22 #include <sys/socket.h>
23 #include <linux/if.h>
24 #include <linux/in6.h>
25 #include <linux/if_bridge.h>
26
27 /* defined in net/if.h but that conflicts with linux/if.h... */
28 extern unsigned int if_nametoindex (const char *__ifname);
29 extern char *if_indextoname (unsigned int __ifindex, char *__ifname);
30
31 struct bridge_id
32 {
33 unsigned char prio[2];
34 unsigned char addr[6];
35 };
36
37 struct bridge_info
38 {
39 struct bridge_id designated_root;
40 struct bridge_id bridge_id;
41 unsigned root_path_cost;
42 struct timeval max_age;
43 struct timeval hello_time;
44 struct timeval forward_delay;
45 struct timeval bridge_max_age;
46 struct timeval bridge_hello_time;
47 struct timeval bridge_forward_delay;
48 u_int16_t root_port;
49 unsigned char stp_enabled;
50 unsigned char topology_change;
51 unsigned char topology_change_detected;
52 struct timeval ageing_time;
53 struct timeval hello_timer_value;
54 struct timeval tcn_timer_value;
55 struct timeval topology_change_timer_value;
56 struct timeval gc_timer_value;
57 };
58
59 struct fdb_entry
60 {
61 u_int8_t mac_addr[6];
62 u_int16_t port_no;
63 unsigned char is_local;
64 struct timeval ageing_timer_value;
65 };
66
67 struct port_info
68 {
69 unsigned port_no;
70 struct bridge_id designated_root;
71 struct bridge_id designated_bridge;
72 u_int16_t port_id;
73 u_int16_t designated_port;
74 u_int8_t priority;
75 unsigned char top_change_ack;
76 unsigned char config_pending;
77 unsigned char state;
78 unsigned path_cost;
79 unsigned designated_cost;
80 struct timeval message_age_timer_value;
81 struct timeval forward_delay_timer_value;
82 struct timeval hold_timer_value;
83 };
84
85 #endif