--- zzzz-none-000/linux-2.4.17/net/bridge/br_private.h 2001-06-12 02:15:27.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/net/bridge/br_private.h 2004-11-24 13:22:09.000000000 +0000 @@ -4,7 +4,7 @@ * Authors: * Lennert Buytenhek * - * $Id: br_private.h,v 1.6 2001/06/01 09:28:28 davem Exp $ + * $Id: br_private.h,v 1.1.1.1.2.2 2003/07/03 18:15:53 qle Exp $ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -15,6 +15,14 @@ #ifndef _BR_PRIVATE_H #define _BR_PRIVATE_H + +#define AVM_DELAYQUEUE +/* --- #define AVM_DELAYQUEUE_STAT --- */ + +#define AVM_FAST_HASH +#define AVM_NO_FLOOD_OF_OWN_MACS + + #include #include #include @@ -25,6 +33,14 @@ #define BR_HOLD_TIME (1*HZ) +#define MAC_ADDR_LEN 6 +#define MATCH_PROTO 1 +#define MATCH_SRC_MAC 1<<1 +#define MATCH_DST_MAC 1<<2 +#define MATCH_SPORT 1<<3 +#define MATCH_DPORT 1<<4 + + typedef struct bridge_id bridge_id; typedef struct mac_addr mac_addr; typedef __u16 port_id; @@ -53,6 +69,21 @@ unsigned is_static:1; }; +struct bridge_fw_db_entry +{ + struct bridge_fw_db_entry *next; + atomic_t use_count; + char sport[10]; + char dport[10]; + unsigned char src_mac_addr[6]; + unsigned char dst_mac_addr[6]; + unsigned short eth_proto; + unsigned char access_type; + unsigned char match_check; + unsigned int frames_matched; +}; + + struct net_bridge_port { struct net_bridge_port *next; @@ -86,6 +117,8 @@ struct net_device_stats statistics; rwlock_t hash_lock; struct net_bridge_fdb_entry *hash[BR_HASH_SIZE]; + rwlock_t filter_lock; + struct bridge_fw_db_entry *blacklist; struct timer_list tick; /* STP */ @@ -102,6 +135,7 @@ unsigned stp_enabled:1; unsigned topology_change:1; unsigned topology_change_detected:1; + unsigned br_filter_active:1; struct br_timer hello_timer; struct br_timer tcn_timer; @@ -110,6 +144,20 @@ int ageing_time; int gc_interval; + +#ifdef AVM_DELAYQUEUE + atomic_t tokens; + unsigned long tokens_per_tick; /* 0 means: normal full speed operation */ + unsigned long delayqueue_max; + struct sk_buff_head delayqueue; + struct timer_list token_tick; +#ifdef AVM_DELAYQUEUE_STAT + unsigned long delayqueue_stat_last_jiffies; + unsigned long delayqueue_stat_suspends; + unsigned long delayqueue_stat_tokenmax; + unsigned long delayqueue_stat_drops; +#endif +#endif /* AVM_DELAYQUEUE */ }; extern struct notifier_block br_device_notifier; @@ -153,6 +201,7 @@ int clone); /* br_if.c */ +extern struct net_bridge **__find_br(char *name); extern int br_add_bridge(char *name); extern int br_del_bridge(char *name); extern int br_add_if(struct net_bridge *br, @@ -166,6 +215,16 @@ /* br_input.c */ extern void br_handle_frame(struct sk_buff *skb); +#ifdef AVM_DELAYQUEUE +extern void br_delayqueue_handle_frames(struct net_bridge *br); +extern void br_delayqueue_discard_frames(struct net_bridge *br, struct net_device *dev); +#endif + +/* br_filter.c */ +int br_add_filter_entry(struct net_bridge *br, unsigned char *_entry); +int br_del_filter_entry(struct net_bridge *br, unsigned char *_entry); +int br_flush_filter(struct net_bridge *br); +int br_show_filter_entries(struct net_bridge *br, unsigned char *_buf, int maxnum); /* br_ioctl.c */ extern void br_call_ioctl_atomic(void (*fn)(void));