tools/testing/selftests/net/tfo.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/net/tfo.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/net/tfo.c- Extension
.c- Size
- 3774 bytes
- Lines
- 178
- 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
error.hfcntl.hlimits.hstdbool.hstdint.hstdio.hstdlib.hstring.hunistd.harpa/inet.hsys/socket.hnetinet/tcp.herrno.h
Detected Declarations
function parse_addressfunction run_serverfunction run_clientfunction usagefunction parse_optsfunction main
Annotated Snippet
switch (c) {
case 's':
if (cfg_client)
error(1, 0, "Pass one of -s or -c");
cfg_server = 1;
break;
case 'c':
if (cfg_server)
error(1, 0, "Pass one of -s or -c");
cfg_client = 1;
break;
case 'h':
addr = optarg;
break;
case 'p':
cfg_port = strtoul(optarg, NULL, 0);
break;
case 'o':
cfg_outfile = strdup(optarg);
if (!cfg_outfile)
error(1, 0, "outfile invalid");
break;
}
}
if (cfg_server && addr)
error(1, 0, "Server cannot have -h specified");
memset(addr6, 0, sizeof(*addr6));
addr6->sin6_family = AF_INET6;
addr6->sin6_port = htons(cfg_port);
addr6->sin6_addr = in6addr_any;
if (addr) {
ret = parse_address(addr, cfg_port, addr6);
if (ret)
error(1, 0, "Client address parse error: %s", addr);
}
}
int main(int argc, char **argv)
{
parse_opts(argc, argv);
if (cfg_server)
run_server();
else if (cfg_client)
run_client();
return 0;
}
Annotation
- Immediate include surface: `error.h`, `fcntl.h`, `limits.h`, `stdbool.h`, `stdint.h`, `stdio.h`, `stdlib.h`, `string.h`.
- Detected declarations: `function parse_address`, `function run_server`, `function run_client`, `function usage`, `function parse_opts`, `function main`.
- 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.