net/tipc/core.h
Source file repositories/reference/linux-study-clean/net/tipc/core.h
File Facts
- System
- Linux kernel
- Corpus path
net/tipc/core.h- Extension
.h- Size
- 5993 bytes
- Lines
- 229
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/tipc.hlinux/tipc_config.hlinux/tipc_netlink.hlinux/types.hlinux/kernel.hlinux/errno.hlinux/hex.hlinux/mm.hlinux/timer.hlinux/string.hlinux/uaccess.hlinux/interrupt.hlinux/atomic.hlinux/netdevice.hlinux/in.hlinux/list.hlinux/slab.hlinux/vmalloc.hlinux/rtnetlink.hlinux/etherdevice.hnet/netns/generic.hlinux/rhashtable.hnet/genetlink.hnet/netns/hash.h
Detected Declarations
struct tipc_nodestruct tipc_bearerstruct tipc_bc_basestruct tipc_linkstruct tipc_topsrvstruct tipc_monitorstruct tipc_cryptostruct tipc_netfunction tipc_netidfunction tipc_hashfnfunction modfunction less_eqfunction morefunction lessfunction tipc_in_rangefunction tipc_net_hash_mixesfunction hash128to32
Annotated Snippet
struct tipc_net {
u8 node_id[NODE_ID_LEN];
u32 node_addr;
u32 trial_addr;
unsigned long addr_trial_end;
char node_id_string[NODE_ID_STR_LEN];
int net_id;
int random;
bool legacy_addr_format;
/* Node table and node list */
spinlock_t node_list_lock;
struct hlist_head node_htable[NODE_HTABLE_SIZE];
struct list_head node_list;
u32 num_nodes;
u32 num_links;
/* Neighbor monitoring list */
struct tipc_monitor *monitors[MAX_BEARERS];
int mon_threshold;
/* Bearer list */
struct tipc_bearer __rcu *bearer_list[MAX_BEARERS + 1];
/* Broadcast link */
spinlock_t bclock;
struct tipc_bc_base *bcbase;
struct tipc_link *bcl;
/* Socket hash table */
struct rhashtable sk_rht;
/* Name table */
spinlock_t nametbl_lock;
struct name_table *nametbl;
/* Topology subscription server */
struct tipc_topsrv *topsrv;
atomic_t subscription_count;
/* Cluster capabilities */
u16 capabilities;
/* Tracing of node internal messages */
struct packet_type loopback_pt;
#ifdef CONFIG_TIPC_CRYPTO
/* TX crypto handler */
struct tipc_crypto *crypto_tx;
#endif
/* Work item for net finalize */
struct work_struct work;
/* The numbers of work queues in schedule */
atomic_t wq_count;
};
static inline struct tipc_net *tipc_net(struct net *net)
{
return net_generic(net, tipc_net_id);
}
static inline int tipc_netid(struct net *net)
{
return tipc_net(net)->net_id;
}
static inline struct list_head *tipc_nodes(struct net *net)
{
return &tipc_net(net)->node_list;
}
static inline struct name_table *tipc_name_table(struct net *net)
{
return tipc_net(net)->nametbl;
}
static inline struct tipc_topsrv *tipc_topsrv(struct net *net)
{
return tipc_net(net)->topsrv;
}
static inline unsigned int tipc_hashfn(u32 addr)
{
return addr & (NODE_HTABLE_SIZE - 1);
}
static inline u16 mod(u16 x)
{
return x & 0xffffu;
}
Annotation
- Immediate include surface: `linux/tipc.h`, `linux/tipc_config.h`, `linux/tipc_netlink.h`, `linux/types.h`, `linux/kernel.h`, `linux/errno.h`, `linux/hex.h`, `linux/mm.h`.
- Detected declarations: `struct tipc_node`, `struct tipc_bearer`, `struct tipc_bc_base`, `struct tipc_link`, `struct tipc_topsrv`, `struct tipc_monitor`, `struct tipc_crypto`, `struct tipc_net`, `function tipc_netid`, `function tipc_hashfn`.
- 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.