if_bridge.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. * Linux ethernet bridge
  3. *
  4. * Authors:
  5. * Lennert Buytenhek <buytenh@gnu.org>
  6. *
  7. * $Id: if_bridge.h,v 1.1.1.1 2007/06/12 07:27:16 eyryu 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. #ifndef _LINUX_IF_BRIDGE_H
  15. #define _LINUX_IF_BRIDGE_H
  16. #include <linux/types.h>
  17. #define SYSFS_BRIDGE_ATTR "bridge"
  18. #define SYSFS_BRIDGE_FDB "brforward"
  19. #define SYSFS_BRIDGE_PORT_SUBDIR "brif"
  20. #define SYSFS_BRIDGE_PORT_ATTR "brport"
  21. #define SYSFS_BRIDGE_PORT_LINK "bridge"
  22. #define BRCTL_VERSION 1
  23. #define BRCTL_GET_VERSION 0
  24. #define BRCTL_GET_BRIDGES 1
  25. #define BRCTL_ADD_BRIDGE 2
  26. #define BRCTL_DEL_BRIDGE 3
  27. #define BRCTL_ADD_IF 4
  28. #define BRCTL_DEL_IF 5
  29. #define BRCTL_GET_BRIDGE_INFO 6
  30. #define BRCTL_GET_PORT_LIST 7
  31. #define BRCTL_SET_BRIDGE_FORWARD_DELAY 8
  32. #define BRCTL_SET_BRIDGE_HELLO_TIME 9
  33. #define BRCTL_SET_BRIDGE_MAX_AGE 10
  34. #define BRCTL_SET_AGEING_TIME 11
  35. #define BRCTL_SET_GC_INTERVAL 12
  36. #define BRCTL_GET_PORT_INFO 13
  37. #define BRCTL_SET_BRIDGE_STP_STATE 14
  38. #define BRCTL_SET_BRIDGE_PRIORITY 15
  39. #define BRCTL_SET_PORT_PRIORITY 16
  40. #define BRCTL_SET_PATH_COST 17
  41. #define BRCTL_GET_FDB_ENTRIES 18
  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. struct __bridge_info
  48. {
  49. __u64 designated_root;
  50. __u64 bridge_id;
  51. __u32 root_path_cost;
  52. __u32 max_age;
  53. __u32 hello_time;
  54. __u32 forward_delay;
  55. __u32 bridge_max_age;
  56. __u32 bridge_hello_time;
  57. __u32 bridge_forward_delay;
  58. __u8 topology_change;
  59. __u8 topology_change_detected;
  60. __u8 root_port;
  61. __u8 stp_enabled;
  62. __u32 ageing_time;
  63. __u32 gc_interval;
  64. __u32 hello_timer_value;
  65. __u32 tcn_timer_value;
  66. __u32 topology_change_timer_value;
  67. __u32 gc_timer_value;
  68. };
  69. struct __port_info
  70. {
  71. __u64 designated_root;
  72. __u64 designated_bridge;
  73. __u16 port_id;
  74. __u16 designated_port;
  75. __u32 path_cost;
  76. __u32 designated_cost;
  77. __u8 state;
  78. __u8 top_change_ack;
  79. __u8 config_pending;
  80. __u8 unused0;
  81. __u32 message_age_timer_value;
  82. __u32 forward_delay_timer_value;
  83. __u32 hold_timer_value;
  84. };
  85. struct __fdb_entry
  86. {
  87. __u8 mac_addr[6];
  88. __u8 port_no;
  89. __u8 is_local;
  90. __u32 ageing_timer_value;
  91. __u32 unused;
  92. };
  93. #ifdef __KERNEL__
  94. #include <linux/netdevice.h>
  95. extern void brioctl_set(int (*ioctl_hook)(unsigned int, void __user *));
  96. extern int (*br_handle_frame_hook)(struct net_bridge_port *p, struct sk_buff **pskb);
  97. extern int (*br_should_route_hook)(struct sk_buff **pskb);
  98. #endif
  99. #endif