net/can/af_can.h
Source file repositories/reference/linux-study-clean/net/can/af_can.h
File Facts
- System
- Linux kernel
- Corpus path
net/can/af_can.h- Extension
.h- Size
- 3463 bytes
- Lines
- 104
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/skbuff.hlinux/netdevice.hlinux/list.hlinux/rcupdate.hlinux/can.h
Detected Declarations
struct receiverstruct can_pkg_statsstruct can_rcv_lists_stats
Annotated Snippet
struct receiver {
struct hlist_node list;
canid_t can_id;
canid_t mask;
atomic_long_t matches;
void (*func)(struct sk_buff *skb, void *data);
void *data;
char *ident;
struct sock *sk;
struct rcu_head rcu;
};
/* statistic structures */
/* can be reset e.g. by can_init_stats() */
struct can_pkg_stats {
unsigned long jiffies_init;
atomic_long_t rx_frames;
atomic_long_t tx_frames;
atomic_long_t matches;
unsigned long total_rx_rate;
unsigned long total_tx_rate;
unsigned long total_rx_match_ratio;
unsigned long current_rx_rate;
unsigned long current_tx_rate;
unsigned long current_rx_match_ratio;
unsigned long max_rx_rate;
unsigned long max_tx_rate;
unsigned long max_rx_match_ratio;
atomic_long_t rx_frames_delta;
atomic_long_t tx_frames_delta;
atomic_long_t matches_delta;
};
/* persistent statistics */
struct can_rcv_lists_stats {
unsigned long stats_reset;
unsigned long user_reset;
unsigned long rcv_entries;
unsigned long rcv_entries_max;
};
/* function prototypes for the CAN networklayer procfs (proc.c) */
void can_init_proc(struct net *net);
void can_remove_proc(struct net *net);
void can_stat_update(struct timer_list *t);
#endif /* AF_CAN_H */
Annotation
- Immediate include surface: `linux/skbuff.h`, `linux/netdevice.h`, `linux/list.h`, `linux/rcupdate.h`, `linux/can.h`.
- Detected declarations: `struct receiver`, `struct can_pkg_stats`, `struct can_rcv_lists_stats`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.