Data Structures Featured in This Part of the Book
The section "Important Data
Structures" in Chapter 16 provided a
brief overview of the data structures used by the bridging code. This section provides a
field-by-field description of them. The trivial ones, such as mac_addr and br_config_bpdu, do not need
dedicated sections.
bridge_id Structure
We saw in the section "Bridge and Port IDs" in Chapter 15 that bridge IDs have two components, the priority and the address:
-
unsigned char prio[2] Bridge priority
-
unsigned char addr[6] Bridge MAC address
Note that the data structure definition does not reflect the changes introduced by 802.1t.
net_bridge_fdb_entry Structure
These are the fields that are used to define each entry in the forwarding database:
-
struct hlist_node list Pointer used to link the data structure into the bucket's list of colliding elements.
-
struct net_bridge_port *dst Bridge port.
-
struct rcu_head rcu Used when removing the data structure using the read-copy-update (RCU) scheme (see
br_fdb_putin net/bridge/br_fdb.c).-
atomic_t use_count Reference count. See the section "Lookups" in Chapter 30.
-
unsigned long ageing_timer Aging timer. Different parts of the kernel spell this as aging or ageing. See the section "Aging" in Chapter 16.
-
mac_addr addr MAC address. This is the key field used by the lookup routines.
-
unsigned char is_local When this flag is 1, the MAC address
addris configured on a local device.-
unsigned char is_static When this flag is 1, the MAC address
addris ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access