aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-17 13:11:53 +0200
committeruser <user@clank>2026-07-17 13:11:53 +0200
commita565bcd942efeb617f5424ae5a881211a7bd0216 (patch)
tree518915e70d097ed8f8fee99422bc7161f9c53fc1 /tools
parentnet: TCP sockets in the kernel - a Game Boy fetches HTTP over real TCP (diff)
downloadgbos-a565bcd942efeb617f5424ae5a881211a7bd0216.tar.gz
gbos-a565bcd942efeb617f5424ae5a881211a7bd0216.tar.xz
gbos-a565bcd942efeb617f5424ae5a881211a7bd0216.zip
net: wget-by-hostname + shared DNS resolver (a Game Boy fetches example.com)
resolve.h: shared helper that turns a dotted-quad or a hostname into an IPv4 address (DNS A query over a UDP socket to 1.1.1.1). nslookup now uses it and slims down; wget uses it so you can name a host directly. wget HOST|IP now: resolve -> TCP connect -> "GET / HTTP/1.0" with the real Host header -> stream the body to the LCD/console until EOF. One command does DNS + TCP + HTTP, all on the kernel socket layer. Verified over tunbridge's NAT against the real internet: /# wget example.com connecting 172.66.147.243 HTTP/1.1 200 OK Server: cloudflare <!doctype html><html lang="en"><head><title>Example Domain</title>... </body></html> [eof] The full HTML page arrives across many TCP segments and is reassembled and printed - real DNS, real TCP, real HTTP, fetched by a Game Boy by name. (tunbridge.py already sets up + tears down the NAT, so the demo is a one-liner: sudo python3 tools/tunbridge.py "wget example.com")
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions