net/bridge/br_cfm_netlink.c
Source file repositories/reference/linux-study-clean/net/bridge/br_cfm_netlink.c
File Facts
- System
- Linux kernel
- Corpus path
net/bridge/br_cfm_netlink.c- Extension
.c- Size
- 21293 bytes
- Lines
- 729
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/genetlink.hbr_private.hbr_private_cfm.h
Detected Declarations
function br_mep_create_parsefunction br_mep_delete_parsefunction br_mep_config_parsefunction br_cc_config_parsefunction br_cc_peer_mep_add_parsefunction br_cc_peer_mep_remove_parsefunction br_cc_rdi_parsefunction br_cc_ccm_tx_parsefunction br_cfm_parsefunction br_cfm_config_fill_infofunction hlist_for_each_entry_rcufunction hlist_for_each_entry_rcufunction br_cfm_status_fill_infofunction hlist_for_each_entry_rcufunction hlist_for_each_entry_rcu
Annotated Snippet
hlist_for_each_entry_rcu(peer_mep, &mep->peer_mep_list, head) {
tb = nla_nest_start(skb,
IFLA_BRIDGE_CFM_CC_PEER_MEP_INFO);
if (!tb)
goto nla_info_failure;
if (nla_put_u32(skb,
IFLA_BRIDGE_CFM_CC_PEER_MEP_INSTANCE,
mep->instance))
goto nla_put_failure;
if (nla_put_u32(skb, IFLA_BRIDGE_CFM_CC_PEER_MEPID,
peer_mep->mepid))
goto nla_put_failure;
nla_nest_end(skb, tb);
}
}
return 0;
nla_put_failure:
nla_nest_cancel(skb, tb);
nla_info_failure:
return -EMSGSIZE;
}
int br_cfm_status_fill_info(struct sk_buff *skb,
struct net_bridge *br,
bool getlink)
{
struct br_cfm_peer_mep *peer_mep;
struct br_cfm_mep *mep;
struct nlattr *tb;
hlist_for_each_entry_rcu(mep, &br->mep_list, head) {
tb = nla_nest_start(skb, IFLA_BRIDGE_CFM_MEP_STATUS_INFO);
if (!tb)
goto nla_info_failure;
if (nla_put_u32(skb, IFLA_BRIDGE_CFM_MEP_STATUS_INSTANCE,
mep->instance))
goto nla_put_failure;
if (nla_put_u32(skb,
IFLA_BRIDGE_CFM_MEP_STATUS_OPCODE_UNEXP_SEEN,
mep->status.opcode_unexp_seen))
goto nla_put_failure;
if (nla_put_u32(skb,
IFLA_BRIDGE_CFM_MEP_STATUS_VERSION_UNEXP_SEEN,
mep->status.version_unexp_seen))
goto nla_put_failure;
if (nla_put_u32(skb,
IFLA_BRIDGE_CFM_MEP_STATUS_RX_LEVEL_LOW_SEEN,
mep->status.rx_level_low_seen))
goto nla_put_failure;
/* Only clear if this is a GETLINK */
if (getlink) {
/* Clear all 'seen' indications */
mep->status.opcode_unexp_seen = false;
mep->status.version_unexp_seen = false;
mep->status.rx_level_low_seen = false;
}
nla_nest_end(skb, tb);
hlist_for_each_entry_rcu(peer_mep, &mep->peer_mep_list, head) {
tb = nla_nest_start(skb,
IFLA_BRIDGE_CFM_CC_PEER_STATUS_INFO);
if (!tb)
goto nla_info_failure;
if (nla_put_u32(skb,
IFLA_BRIDGE_CFM_CC_PEER_STATUS_INSTANCE,
mep->instance))
goto nla_put_failure;
if (nla_put_u32(skb,
IFLA_BRIDGE_CFM_CC_PEER_STATUS_PEER_MEPID,
peer_mep->mepid))
goto nla_put_failure;
if (nla_put_u32(skb,
IFLA_BRIDGE_CFM_CC_PEER_STATUS_CCM_DEFECT,
peer_mep->cc_status.ccm_defect))
Annotation
- Immediate include surface: `net/genetlink.h`, `br_private.h`, `br_private_cfm.h`.
- Detected declarations: `function br_mep_create_parse`, `function br_mep_delete_parse`, `function br_mep_config_parse`, `function br_cc_config_parse`, `function br_cc_peer_mep_add_parse`, `function br_cc_peer_mep_remove_parse`, `function br_cc_rdi_parse`, `function br_cc_ccm_tx_parse`, `function br_cfm_parse`, `function br_cfm_config_fill_info`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.