diff options
Diffstat (limited to 'package/network/services/ead/src/libbridge.h')
-rw-r--r-- | package/network/services/ead/src/libbridge.h | 81 |
1 files changed, 28 insertions, 53 deletions
diff --git a/package/network/services/ead/src/libbridge.h b/package/network/services/ead/src/libbridge.h index 13c8c64..d7bbdc4 100644 --- a/package/network/services/ead/src/libbridge.h +++ b/package/network/services/ead/src/libbridge.h @@ -19,67 +19,42 @@ #ifndef _LIBBRIDGE_H #define _LIBBRIDGE_H -#include <sys/socket.h> -#include <linux/if.h> -#include <linux/in6.h> -#include <linux/if_bridge.h> +#ifdef linux -/* defined in net/if.h but that conflicts with linux/if.h... */ -extern unsigned int if_nametoindex (const char *__ifname); -extern char *if_indextoname (unsigned int __ifindex, char *__ifname); +int br_init(void); +void br_shutdown(void); -struct bridge_id +int br_foreach_port(const char *brname, + int (*iterator)(const char *br, const char *port, void *arg), + void *arg); + +int br_foreach_bridge(int (*iterator)(const char *, void *), void *arg); + +#else + +static inline int br_init(void) { - unsigned char prio[2]; - unsigned char addr[6]; -}; + return 0; +} -struct bridge_info +static inline void br_shutdown(void) { - struct bridge_id designated_root; - struct bridge_id bridge_id; - unsigned root_path_cost; - struct timeval max_age; - struct timeval hello_time; - struct timeval forward_delay; - struct timeval bridge_max_age; - struct timeval bridge_hello_time; - struct timeval bridge_forward_delay; - u_int16_t root_port; - unsigned char stp_enabled; - unsigned char topology_change; - unsigned char topology_change_detected; - struct timeval ageing_time; - struct timeval hello_timer_value; - struct timeval tcn_timer_value; - struct timeval topology_change_timer_value; - struct timeval gc_timer_value; -}; +} -struct fdb_entry +static inline int +br_foreach_port(const char *brname, + int (*iterator)(const char *br, const char *port, void *arg), + void *arg) { - u_int8_t mac_addr[6]; - u_int16_t port_no; - unsigned char is_local; - struct timeval ageing_timer_value; -}; + return 0; +} -struct port_info +static inline int +br_foreach_bridge(int (*iterator)(const char *, void *), void *arg) { - unsigned port_no; - struct bridge_id designated_root; - struct bridge_id designated_bridge; - u_int16_t port_id; - u_int16_t designated_port; - u_int8_t priority; - unsigned char top_change_ack; - unsigned char config_pending; - unsigned char state; - unsigned path_cost; - unsigned designated_cost; - struct timeval message_age_timer_value; - struct timeval forward_delay_timer_value; - struct timeval hold_timer_value; -}; + return 0; +} + +#endif #endif |