网桥在内核的实现
2009-09-10 00:00:00 来源:WEB开发网Java代码
struct net_bridge_port
{
///从属于的网桥设备
struct net_bridge *br;
///表示链接到这个端口的物理设备
struct net_device *dev;
struct list_head list;
///stp相关的一些参数。
u8 priority;
u8 state;
u16 port_no;
unsigned char topology_change_ack;
unsigned char config_pending;
port_id port_id;
port_id designated_port;
bridge_id designated_root;
bridge_id designated_bridge;
u32 path_cost;
u32 designated_cost;
///端口定时器,也就是stp控制超时的一些定时器列表.(详细的需要去看stp的协议).
struct timer_list forward_delay_timer;
struct timer_list hold_timer;
struct timer_list message_age_timer;
struct kobject kobj;
struct rcu_head rcu;
};
Java代码
struct net_bridge_fdb_entry
{
struct hlist_node hlist;
///桥的端口(最主要的两个域就是这个域和下面的mac地址域)
struct net_bridge_port *dst;
///当使用RCU策略,才用到
struct rcu_head rcu;
///引用计数
atomic_t use_count;
unsigned long ageing_timer;
///mac地址。
mac_addr addr;
unsigned char is_local;
unsigned char is_static;
};
更多精彩
赞助商链接