tools/testing/selftests/net/mptcp/mptcp_sockopt.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/mptcp/mptcp_sockopt.c- Extension
.c- Size
- 20051 bytes
- Lines
- 886
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
assert.herrno.hfcntl.hlimits.hstring.hstdarg.hstdbool.hstdint.hinttypes.hstdio.hstdlib.hstrings.htime.hunistd.hsys/socket.hsys/types.hsys/wait.hnetdb.hnetinet/in.hlinux/tcp.hlinux/compiler.h
Detected Declarations
struct mptcp_infostruct mptcp_subflow_datastruct mptcp_subflow_addrsstruct mptcp_subflow_infostruct mptcp_full_infostruct so_statestruct bogus_datastruct my_tcp_infostruct my_addrsfunction die_perrorfunction die_usagefunction xerrorfunction xgetaddrinfofunction sock_listen_mptcpfunction sock_connect_mptcpfunction parse_optsfunction do_getsockopt_bogus_sf_datafunction do_getsockopt_mptcp_infofunction do_getsockopt_tcp_infofunction do_getsockopt_subflow_addrsfunction do_getsockopt_mptcp_full_infofunction do_getsockoptsfunction connect_one_serverfunction process_one_clientfunction xacceptfunction serverfunction test_ip_tos_sockoptfunction clientfunction xforkfunction rcheckfunction init_rngfunction main
Annotated Snippet
struct mptcp_info {
__u8 mptcpi_subflows;
__u8 mptcpi_add_addr_signal;
__u8 mptcpi_add_addr_accepted;
__u8 mptcpi_subflows_max;
__u8 mptcpi_add_addr_signal_max;
__u8 mptcpi_add_addr_accepted_max;
__u32 mptcpi_flags;
__u32 mptcpi_token;
__u64 mptcpi_write_seq;
__u64 mptcpi_snd_una;
__u64 mptcpi_rcv_nxt;
__u8 mptcpi_local_addr_used;
__u8 mptcpi_local_addr_max;
__u8 mptcpi_csum_enabled;
__u32 mptcpi_retransmits;
__u64 mptcpi_bytes_retrans;
__u64 mptcpi_bytes_sent;
__u64 mptcpi_bytes_received;
__u64 mptcpi_bytes_acked;
};
struct mptcp_subflow_data {
__u32 size_subflow_data; /* size of this structure in userspace */
__u32 num_subflows; /* must be 0, set by kernel */
__u32 size_kernel; /* must be 0, set by kernel */
__u32 size_user; /* size of one element in data[] */
} __attribute__((aligned(8)));
struct mptcp_subflow_addrs {
union {
__kernel_sa_family_t sa_family;
struct sockaddr sa_local;
struct sockaddr_in sin_local;
struct sockaddr_in6 sin6_local;
struct __kernel_sockaddr_storage ss_local;
};
union {
struct sockaddr sa_remote;
struct sockaddr_in sin_remote;
struct sockaddr_in6 sin6_remote;
struct __kernel_sockaddr_storage ss_remote;
};
};
#define MPTCP_INFO 1
#define MPTCP_TCPINFO 2
#define MPTCP_SUBFLOW_ADDRS 3
#endif
#ifndef MPTCP_FULL_INFO
struct mptcp_subflow_info {
__u32 id;
struct mptcp_subflow_addrs addrs;
};
struct mptcp_full_info {
__u32 size_tcpinfo_kernel; /* must be 0, set by kernel */
__u32 size_tcpinfo_user;
__u32 size_sfinfo_kernel; /* must be 0, set by kernel */
__u32 size_sfinfo_user;
__u32 num_subflows; /* must be 0, set by kernel (real subflow count) */
__u32 size_arrays_user; /* max subflows that userspace is interested in;
* the buffers at subflow_info/tcp_info
* are respectively at least:
* size_arrays * size_sfinfo_user
* size_arrays * size_tcpinfo_user
* bytes wide
*/
__aligned_u64 subflow_info;
__aligned_u64 tcp_info;
struct mptcp_info mptcp_info;
};
#define MPTCP_FULL_INFO 4
#endif
struct so_state {
struct mptcp_info mi;
struct mptcp_info last_sample;
struct tcp_info tcp_info;
struct mptcp_subflow_addrs addrs;
uint64_t mptcpi_rcv_delta;
uint64_t tcpi_rcv_delta;
bool pkt_stats_avail;
};
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
Annotation
- Immediate include surface: `assert.h`, `errno.h`, `fcntl.h`, `limits.h`, `string.h`, `stdarg.h`, `stdbool.h`, `stdint.h`.
- Detected declarations: `struct mptcp_info`, `struct mptcp_subflow_data`, `struct mptcp_subflow_addrs`, `struct mptcp_subflow_info`, `struct mptcp_full_info`, `struct so_state`, `struct bogus_data`, `struct my_tcp_info`, `struct my_addrs`, `function die_perror`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.