net/sctp/associola.c
Source file repositories/reference/linux-study-clean/net/sctp/associola.c
File Facts
- System
- Linux kernel
- Corpus path
net/sctp/associola.c- Extension
.c- Size
- 49607 bytes
- Lines
- 1712
- 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/types.hlinux/fcntl.hlinux/poll.hlinux/init.hlinux/slab.hlinux/in.hnet/ipv6.hnet/sctp/sctp.hnet/sctp/sm.h
Detected Declarations
function sctp_association_freefunction sctp_association_destroyfunction sctp_assoc_set_primaryfunction sctp_assoc_rm_peerfunction list_for_each_entryfunction sctp_connectxfunction list_for_each_entryfunction sctp_assoc_del_nonprimary_peersfunction list_for_each_entry_safefunction sctp_assoc_control_transportfunction sctp_association_holdfunction sctp_association_putfunction sctp_association_get_next_tsnfunction sctp_cmp_addr_exactfunction list_for_each_entryfunction list_for_each_entryfunction sctp_assoc_bh_rcvfunction laterfunction sctp_assoc_migratefunction sctp_assoc_updatefunction inactivefunction ktime_afterfunction sctp_assoc_update_retran_pathfunction sctp_select_active_and_retran_pathfunction ktime_afterfunction addressfunction sctp_assoc_choose_alter_transportfunction sctp_assoc_update_frag_pointfunction sctp_assoc_set_pmtufunction sctp_assoc_sync_pmtufunction sctp_peer_needs_updatefunction sctp_assoc_rwnd_increasefunction sctp_assoc_rwnd_decreasefunction sctp_assoc_set_bind_addr_from_epfunction sctp_assoc_set_bind_addr_from_cookiefunction sctp_assoc_lookup_laddrfunction sctp_assoc_set_idfunction sctp_assoc_free_asconf_queuefunction list_for_each_entry_safefunction sctp_assoc_free_asconf_acksfunction list_for_each_entry_safefunction sctp_assoc_clean_asconf_ack_cachefunction sctp_asconf_queue_teardown
Annotated Snippet
if (peer->state == SCTP_UNKNOWN) {
peer->state = SCTP_ACTIVE;
}
return peer;
}
peer = sctp_transport_new(asoc->base.net, addr, gfp);
if (!peer)
return NULL;
sctp_transport_set_owner(peer, asoc);
/* Initialize the peer's heartbeat interval based on the
* association configured value.
*/
peer->hbinterval = asoc->hbinterval;
peer->probe_interval = asoc->probe_interval;
peer->encap_port = asoc->encap_port;
/* Set the path max_retrans. */
peer->pathmaxrxt = asoc->pathmaxrxt;
/* And the partial failure retrans threshold */
peer->pf_retrans = asoc->pf_retrans;
/* And the primary path switchover retrans threshold */
peer->ps_retrans = asoc->ps_retrans;
/* Initialize the peer's SACK delay timeout based on the
* association configured value.
*/
peer->sackdelay = asoc->sackdelay;
peer->sackfreq = asoc->sackfreq;
if (addr->sa.sa_family == AF_INET6) {
__be32 info = addr->v6.sin6_flowinfo;
if (info) {
peer->flowlabel = ntohl(info & IPV6_FLOWLABEL_MASK);
peer->flowlabel |= SCTP_FLOWLABEL_SET_MASK;
} else {
peer->flowlabel = asoc->flowlabel;
}
}
peer->dscp = asoc->dscp;
/* Enable/disable heartbeat, SACK delay, and path MTU discovery
* based on association setting.
*/
peer->param_flags = asoc->param_flags;
/* Initialize the pmtu of the transport. */
sctp_transport_route(peer, NULL, sp);
/* If this is the first transport addr on this association,
* initialize the association PMTU to the peer's PMTU.
* If not and the current association PMTU is higher than the new
* peer's PMTU, reset the association PMTU to the new peer's PMTU.
*/
sctp_assoc_set_pmtu(asoc, asoc->pathmtu ?
min_t(int, peer->pathmtu, asoc->pathmtu) :
peer->pathmtu);
peer->pmtu_pending = 0;
/* The asoc->peer.port might not be meaningful yet, but
* initialize the packet structure anyway.
*/
sctp_packet_init(&peer->packet, peer, asoc->base.bind_addr.port,
asoc->peer.port);
/* 7.2.1 Slow-Start
*
* o The initial cwnd before DATA transmission or after a sufficiently
* long idle period MUST be set to
* min(4*MTU, max(2*MTU, 4380 bytes))
*
* o The initial value of ssthresh MAY be arbitrarily high
* (for example, implementations MAY use the size of the
* receiver advertised window).
*/
peer->cwnd = min(4*asoc->pathmtu, max_t(__u32, 2*asoc->pathmtu, 4380));
/* At this point, we may not have the receiver's advertised window,
* so initialize ssthresh to the default value and it will be set
* later when we process the INIT.
*/
peer->ssthresh = SCTP_DEFAULT_MAXWINDOW;
peer->partial_bytes_acked = 0;
Annotation
- Immediate include surface: `linux/types.h`, `linux/fcntl.h`, `linux/poll.h`, `linux/init.h`, `linux/slab.h`, `linux/in.h`, `net/ipv6.h`, `net/sctp/sctp.h`.
- Detected declarations: `function sctp_association_free`, `function sctp_association_destroy`, `function sctp_assoc_set_primary`, `function sctp_assoc_rm_peer`, `function list_for_each_entry`, `function sctp_connectx`, `function list_for_each_entry`, `function sctp_assoc_del_nonprimary_peers`, `function list_for_each_entry_safe`, `function sctp_assoc_control_transport`.
- 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.