linux net_bridge结构简介

来源:互联网 发布:最近网络流行的词语 编辑:程序博客网 时间:2024/06/03 05:06

1、简介

      net_bridge结构是表示网桥的数据结构,其内容如下:

struct net_bridge
{
       spinlock_t lock;
       struct list_headport_list;
       struct net_device*dev;
       struct net_device_statsstatistics;
       spinlock_thash_lock;
       struct hlist_headhash[BR_HASH_SIZE];
       struct list_headage_list;
       unsigned longfeature_mask;

       /* STP */
       bridge_iddesignated_root;
       bridge_idbridge_id;
       u32root_path_cost;
       unsigned longmax_age;
       unsigned longhello_time;
       unsigned longforward_delay;
       unsigned longbridge_max_age;
       unsigned longageing_time;
       unsigned longbridge_hello_time;
       unsigned longbridge_forward_delay;

       u8group_addr[ETH_ALEN];
       u16root_port;

       enum {
              BR_NO_STP,/* no spanning tree */
              BR_KERNEL_STP,/* old STP in kernel */
              BR_USER_STP,/* new RSTP in userspace */
       } stp_enabled;

       unsigned chartopology_change;
       unsigned chartopology_change_detected;

       struct timer_listhello_timer;
       struct timer_listtcn_timer;
       struct timer_listtopology_change_timer;
       struct timer_listgc_timer;
       struct kobjectifobj;
};

参考文献:linux 2.6内核

原创粉丝点击