net/mptcp/protocol.h
Source file repositories/reference/linux-study-clean/net/mptcp/protocol.h
File Facts
- System
- Linux kernel
- Corpus path
net/mptcp/protocol.h- Extension
.h- Size
- 42494 bytes
- Lines
- 1380
- 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/random.hnet/tcp.hnet/inet_connection_sock.huapi/linux/mptcp.hnet/genetlink.hnet/rstreason.h
Detected Declarations
struct mptcp_skb_cbstruct mptcp_options_receivedstruct mptcp_pm_datastruct mptcp_pm_localstruct mptcp_pm_addr_entrystruct mptcp_data_fragstruct mptcp_sockstruct csum_pseudo_headerstruct mptcp_subflow_request_sockstruct mptcp_delegated_actionstruct mptcp_subflow_contextenum mptcp_pm_statusenum mptcp_pm_typeenum mptcp_addr_signal_statusfunction before64function mptcp_optionfunction msk_owned_by_mefunction mptcp_win_from_spacefunction mptcp_space_from_winfunction __mptcp_spacefunction mptcp_init_rtt_estfunction mptcp_rtt_us_estfunction mptcp_subflow_rskfunction mptcp_subflow_ctxfunction mptcp_subflow_tcp_sockfunction mptcp_subflow_ctx_resetfunction sk_rst_convert_mptcp_reasonfunction mptcp_send_active_reset_reasonfunction mptcp_subflow_lend_fwdmemfunction __mptcp_subflow_lend_fwdmemfunction mptcp_subflow_lend_fwdmemfunction mptcp_subflow_get_map_offsetfunction mptcp_subflow_get_mapped_dsnfunction mptcp_subflow_delegatefunction mptcp_subflow_delegated_nextfunction mptcp_data_availfunction mptcp_epollin_readyfunction __tcp_can_sendfunction __mptcp_subflow_activefunction mptcp_subflow_tcp_fallbackfunction mptcp_stop_tout_timerfunction mptcp_set_close_toutfunction mptcp_start_tout_timerfunction mptcp_is_fully_establishedfunction mptcp_stampfunction mptcp_expand_seqfunction mptcp_data_fin_enabledfunction mptcp_notsent_lowat
Annotated Snippet
struct mptcp_skb_cb {
u64 map_seq;
u64 end_seq;
u32 offset;
u8 has_rxtstamp;
u8 cant_coalesce;
};
#define MPTCP_SKB_CB(__skb) ((struct mptcp_skb_cb *)&((__skb)->cb[0]))
static inline bool before64(__u64 seq1, __u64 seq2)
{
return (__s64)(seq1 - seq2) < 0;
}
#define after64(seq2, seq1) before64(seq1, seq2)
struct mptcp_options_received {
u64 sndr_key;
u64 rcvr_key;
u64 data_ack;
u64 data_seq;
u32 subflow_seq;
u16 data_len;
__sum16 csum;
struct_group(status,
u16 suboptions;
u16 use_map:1,
dsn64:1,
data_fin:1,
use_ack:1,
ack64:1,
mpc_map:1,
reset_reason:4,
reset_transient:1,
echo:1,
backup:1,
deny_join_id0:1,
__unused:2;
);
u8 join_id;
u32 token;
u32 nonce;
u64 thmac;
u8 hmac[MPTCPOPT_HMAC_LEN];
struct mptcp_addr_info addr;
struct mptcp_rm_list rm_list;
u64 ahmac;
u64 fail_seq;
};
static inline __be32 mptcp_option(u8 subopt, u8 len, u8 nib, u8 field)
{
return htonl((TCPOPT_MPTCP << 24) | (len << 16) | (subopt << 12) |
((nib & 0xF) << 8) | field);
}
enum mptcp_pm_status {
MPTCP_PM_ADD_ADDR_RECEIVED,
MPTCP_PM_ADD_ADDR_SEND_ACK,
MPTCP_PM_RM_ADDR_RECEIVED,
MPTCP_PM_ESTABLISHED,
MPTCP_PM_SUBFLOW_ESTABLISHED,
MPTCP_PM_ALREADY_ESTABLISHED, /* persistent status, set after ESTABLISHED event */
MPTCP_PM_MPC_ENDPOINT_ACCOUNTED /* persistent status, set after MPC local address is
* accounted int id_avail_bitmap
*/
};
enum mptcp_pm_type {
MPTCP_PM_TYPE_KERNEL = 0,
MPTCP_PM_TYPE_USERSPACE,
__MPTCP_PM_TYPE_NR,
__MPTCP_PM_TYPE_MAX = __MPTCP_PM_TYPE_NR - 1,
};
/* Status bits below MPTCP_PM_ALREADY_ESTABLISHED need pm worker actions */
#define MPTCP_PM_WORK_MASK ((1 << MPTCP_PM_ALREADY_ESTABLISHED) - 1)
enum mptcp_addr_signal_status {
MPTCP_ADD_ADDR_SIGNAL,
MPTCP_ADD_ADDR_ECHO,
MPTCP_RM_ADDR_SIGNAL,
};
/* max value of mptcp_addr_info.id */
#define MPTCP_PM_MAX_ADDR_ID U8_MAX
struct mptcp_pm_data {
Annotation
- Immediate include surface: `linux/random.h`, `net/tcp.h`, `net/inet_connection_sock.h`, `uapi/linux/mptcp.h`, `net/genetlink.h`, `net/rstreason.h`.
- Detected declarations: `struct mptcp_skb_cb`, `struct mptcp_options_received`, `struct mptcp_pm_data`, `struct mptcp_pm_local`, `struct mptcp_pm_addr_entry`, `struct mptcp_data_frag`, `struct mptcp_sock`, `struct csum_pseudo_header`, `struct mptcp_subflow_request_sock`, `struct mptcp_delegated_action`.
- 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.