net/tipc/node.c
Source file repositories/reference/linux-study-clean/net/tipc/node.c
File Facts
- System
- Linux kernel
- Corpus path
net/tipc/node.c- Extension
.c- Size
- 81006 bytes
- Lines
- 3166
- 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
core.hlink.hnode.hname_distr.hsocket.hbcast.hmonitor.hdiscover.hnetlink.htrace.hcrypto.h
Detected Declarations
struct tipc_link_entrystruct tipc_bclink_entrystruct tipc_nodestruct tipc_sock_connfunction tipc_node_get_mtufunction tipc_node_get_idfunction tipc_node_get_capabilitiesfunction tipc_node_get_addrfunction tipc_node_freefunction tipc_node_kref_releasefunction tipc_node_putfunction tipc_node_getfunction tipc_node_read_lockfunction tipc_node_read_unlockfunction tipc_node_write_lockfunction tipc_node_write_unlock_fastfunction tipc_node_write_unlockfunction tipc_node_assign_peer_netfunction for_each_net_rcufunction list_for_each_entry_rcufunction list_for_each_entry_rcufunction tipc_link_min_winfunction tipc_node_calculate_timerfunction tipc_node_delete_from_listfunction tipc_node_deletefunction tipc_node_stopfunction tipc_node_subscribefunction tipc_node_unsubscribefunction tipc_node_add_connfunction tipc_node_remove_connfunction tipc_node_clear_linksfunction tipc_node_cleanupfunction tipc_node_timeoutfunction activefunction activefunction tipc_node_link_failoverfunction __tipc_node_link_downfunction tipc_node_link_downfunction node_is_upfunction tipc_node_is_upfunction tipc_node_suggest_addrfunction tipc_node_try_addrfunction tipc_node_check_destfunction tipc_node_delete_linksfunction tipc_node_reset_linksfunction tipc_node_fsm_evtfunction node_lost_contactfunction tipc_node_get_linkname
Annotated Snippet
struct tipc_link_entry {
struct tipc_link *link;
spinlock_t lock; /* per link */
u32 mtu;
struct sk_buff_head inputq;
struct tipc_media_addr maddr;
};
struct tipc_bclink_entry {
struct tipc_link *link;
struct sk_buff_head inputq1;
struct sk_buff_head arrvq;
struct sk_buff_head inputq2;
struct sk_buff_head namedq;
u16 named_rcv_nxt;
bool named_open;
};
/**
* struct tipc_node - TIPC node structure
* @addr: network address of node
* @kref: reference counter to node object
* @lock: rwlock governing access to structure
* @net: the applicable net namespace
* @hash: links to adjacent nodes in unsorted hash chain
* @active_links: bearer ids of active links, used as index into links[] array
* @links: array containing references to all links to node
* @bc_entry: broadcast link entry
* @action_flags: bit mask of different types of node actions
* @state: connectivity state vs peer node
* @preliminary: a preliminary node or not
* @failover_sent: failover sent or not
* @sync_point: sequence number where synch/failover is finished
* @list: links to adjacent nodes in sorted list of cluster's nodes
* @working_links: number of working links to node (both active and standby)
* @link_cnt: number of links to node
* @capabilities: bitmap, indicating peer node's functional capabilities
* @signature: node instance identifier
* @link_id: local and remote bearer ids of changing link, if any
* @peer_id: 128-bit ID of peer
* @peer_id_string: ID string of peer
* @publ_list: list of publications
* @conn_sks: list of connections (FIXME)
* @timer: node's keepalive timer
* @keepalive_intv: keepalive interval in milliseconds
* @rcu: rcu struct for tipc_node
* @delete_at: indicates the time for deleting a down node
* @peer_net: peer's net namespace
* @peer_hash_mix: hash for this peer (FIXME)
* @crypto_rx: RX crypto handler
*/
struct tipc_node {
u32 addr;
struct kref kref;
rwlock_t lock;
struct net *net;
struct hlist_node hash;
int active_links[2];
struct tipc_link_entry links[MAX_BEARERS];
struct tipc_bclink_entry bc_entry;
int action_flags;
struct list_head list;
int state;
bool preliminary;
bool failover_sent;
u16 sync_point;
int link_cnt;
u16 working_links;
u16 capabilities;
u32 signature;
u32 link_id;
u8 peer_id[16];
char peer_id_string[NODE_ID_STR_LEN];
struct list_head publ_list;
struct list_head conn_sks;
unsigned long keepalive_intv;
struct timer_list timer;
struct rcu_head rcu;
unsigned long delete_at;
struct net *peer_net;
u32 peer_hash_mix;
#ifdef CONFIG_TIPC_CRYPTO
struct tipc_crypto *crypto_rx;
#endif
};
/* Node FSM states and events:
*/
enum {
SELF_DOWN_PEER_DOWN = 0xdd,
Annotation
- Immediate include surface: `core.h`, `link.h`, `node.h`, `name_distr.h`, `socket.h`, `bcast.h`, `monitor.h`, `discover.h`.
- Detected declarations: `struct tipc_link_entry`, `struct tipc_bclink_entry`, `struct tipc_node`, `struct tipc_sock_conn`, `function tipc_node_get_mtu`, `function tipc_node_get_id`, `function tipc_node_get_capabilities`, `function tipc_node_get_addr`, `function tipc_node_free`, `function tipc_node_kref_release`.
- 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.