tools/testing/selftests/net/bind_wildcard.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/bind_wildcard.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/bind_wildcard.c- Extension
.c- Size
- 21052 bytes
- Lines
- 810
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sys/socket.hnetinet/in.hkselftest_harness.h
Detected Declarations
function setup_addrfunction bind_socket
Annotated Snippet
if (variant->expected_reuse_errno[i]) {
ASSERT_EQ(ret, -1);
ASSERT_EQ(errno, variant->expected_reuse_errno[i]);
} else {
ASSERT_EQ(ret, 0);
}
} else {
if (variant->expected_errno[i]) {
ASSERT_EQ(ret, -1);
ASSERT_EQ(errno, variant->expected_errno[i]);
} else {
ASSERT_EQ(ret, 0);
}
}
if (i == 0) {
ret = getsockname(self->fd[0], &self->addr[0].addr, &self->addrlen[0]);
ASSERT_EQ(ret, 0);
}
}
TEST_F(bind_wildcard, plain)
{
int i;
for (i = 0; i < NR_SOCKETS; i++)
bind_socket(_metadata, self, variant, i, 0);
}
TEST_F(bind_wildcard, reuseaddr)
{
int i;
for (i = 0; i < NR_SOCKETS; i++)
bind_socket(_metadata, self, variant, i, SO_REUSEADDR);
}
TEST_F(bind_wildcard, reuseport)
{
int i;
for (i = 0; i < NR_SOCKETS; i++)
bind_socket(_metadata, self, variant, i, SO_REUSEPORT);
}
TEST_HARNESS_MAIN
Annotation
- Immediate include surface: `sys/socket.h`, `netinet/in.h`, `kselftest_harness.h`.
- Detected declarations: `function setup_addr`, `function bind_socket`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
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.