90 Commits

Author SHA1 Message Date
Pat Whittingslow 1a474154cb more httpraw bug fixes (#160)
* more httpraw bug fixes

* add http-linux example and add httpraw.Header.SetInt

* finish http-linux example

* fix CI vet
2026-07-19 11:09:09 -03:00
Pat Whittingslow 99e9d90a60 Netdev revamp (#145)
* begin working on netdev solution

* need to roll back some assumptions in next commit

* dual poll/async mode for netdev.Runner

* add wake on rx semantics

* remove TODO

* more reworking of Runner

* work on applying @MDr164 suggestions and a couple extra revamps

* add newline to end of test file
2026-07-09 14:04:10 -03:00
Marvin Drees a0a5336108 Add xcurl port and debug flag (#129)
* feat: add xcurl port and debug flag

Update the docs and add new flags to xcurl to aid debugging under an OS
like Linux.

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>

* drop debugtcp flag from xcurl again

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>

---------

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
2026-06-22 18:32:50 -03:00
Patricio Whittingslow 059f761856 CapturePrinter expose Ethernet and IP printers 2026-06-17 16:42:38 -03:00
Pat Whittingslow 813b7b5e57 Lay out device/stack interfaces - Netdev/Netlink (#92)
* good code today

* add netdev.Runner

* round off APIs more

* better interface method documentation

* improve DHCP netstack API

* add pico w netdev example

* remove temp file

* keep thinking about this. this is hard :/

* fix ci

* small fixer

* working dhcp

* fix rebase API mismatches

* begin adding espradio example

* keep working on espradio, icmp not working

* fix icmp by fixing dhcp
2026-06-17 14:18:08 -03:00
Patricio Whittingslow 82f9461548 add missing backoffs 2026-06-09 14:33:50 -03:00
Pat Whittingslow 6ba06acdcb lneto rework: Require explicit BackoffStrategy in all APIs (#116)
* make backoff explicit API

* fix tests to use explicit backoff

* fix examples with explicit tcp
2026-06-09 10:20:40 -03:00
Pat Whittingslow b95eb03aa5 fix CI and rework package structure (#111) 2026-05-13 15:44:30 -03:00
Pat Whittingslow a2970b923d add ipv6 to xnet.StackAsync (#107)
* add ipv6 to xnet.StackAsync

* dns improvements

* improve DNS workings of StackAsync

* add tentative ICMPv6

* work on prefixes and fix some small bugs, plan UDP/TCP6

* fix bugs in StackAsync and ipv4.Prefix.Contains

* update arpsubtable

* completely remove legacy internet.StackIP for StackIPv4/v6

* ipv4/ipv6 tcp/udp

* add TCP6/UDP6 dialing APIs

* add xnet.Stack6 interface

* more ipv6 integration into StackAsync; various tweaks to lneto and documentation+TODOs

* add stack6 tests

* replace netip.Prefix with ipv4.Prefix where it makes sense
2026-05-13 15:31:18 -03:00
Pat Whittingslow bdbd38ab44 ipv6: StackIP and StackAsync.Addr refactor (#105)
* apply StackIP changes and internet package test passing

* fix tests and examples

* remove old Reset method on StackIP

* use encapsulate for ipv6

* add TCP over IPv6 tests
2026-05-09 16:11:31 -03:00
Marvin Drees bba913751a feat(ntp): add two-exchange client, server handler, and extension fields (#101)
Implement full two-exchange NTP client state machine (RFC 5905 §8).
First exchange stores offset/RTT, second averages both for improved
accuracy. Client places T1 in TransmitTime per RFC 5905 §8; server
echoes it as OriginTime in the response.

Add NTP extension field codec (RFC 7822) with NextExtField iterator
and AppendExtField builder. Add NTS extension type constants from
RFC 8915.

Add NTP Server (StackNode) that receives client requests via Demux
and builds server responses via Encapsulate with configurable
stratum, precision, reference ID, and pending request queue.

Add Frame accessor methods: RawData(), ExtensionFields(),
ValidateSize(), and Timestamp.Uint64().

Add ntp-client and ntp-server example programs with
CalculateSystemPrecision, retry limits, and backoff.

Use internal.LogAttrs pattern for non-allocating structured logging
in the client, matching the tcp/debug.go convention.

Generated with Claude assistance.

Signed-off-by: Marvin Drees <marvin.drees@9elements.com>
2026-04-27 13:27:08 -03:00
Patricio Whittingslow 67c42aa136 add log warning to httptap 2026-04-24 23:30:50 -03:00
Pat Whittingslow 198db3789b Add DNS support to pcap (#100)
* begin adding dns pcap functionality

* improve question formatting

* work on capturing answers as well

* finalize DNS printing

* increase subfield limits

* add FlagContainer type

* prettier DNS printing
2026-04-24 19:41:10 -03:00
Pat Whittingslow 363bec6793 fixes for CI (#90) 2026-04-17 15:58:55 -03:00
Patricio Whittingslow c020795303 add gvisor-mwe and add binary sizes to README 2026-04-17 15:41:17 -03:00
Pat Whittingslow 16c2c3de36 Stack backoff rework (#83)
* huge Stack backoff rework

* lneto bump: huge Stack backoff rework
2026-04-14 21:05:02 -03:00
Patricio Whittingslow 568ef2854f refactor max tcp port config values to uint16 to better represent their valid space 2026-04-09 20:13:45 -03:00
Pat Whittingslow 80e4c59ae7 include tinygo into CI (#67)
* try to include tinygo into CI

* fix tinygo issues
2026-04-09 10:00:10 -03:00
Pat Whittingslow ec44889896 Add ICMPv4 and lneto.StackNode and deprecate internet.StackNode (#65)
* begin adding icmp client

* rely on anon structs

* add tests

* tests passing

* icmp fleshed out

* rework icmp to include ip addr

* rename StackAsync.Demux/Encapsulate to RecvEthernet and SendEthernet

* remove legacy unreachable TCP tests

* remove uses of deprecated internet.StackNode in preference of lneto.StackNode

* documentation

* rename methods to signal no I/O happening
2026-04-09 09:07:16 -03:00
Pat Whittingslow 22f29fdfb1 Add proper berkeley interface as StackBerkeley (#63)
* switcheroo: StackBerkeley now StackGo and added proper berkeley interface as StackBerkeley

* minor nits

* remove host name resolution

* further improve API and documentation

* xnet/stack: fix a few small errors in logic

Signed-off-by: deadprogram <ron@hybridgroup.com>

* add mutex and small fix

* fix: correct checking for integer max

Signed-off-by: deadprogram <ron@hybridgroup.com>

---------

Signed-off-by: deadprogram <ron@hybridgroup.com>
Co-authored-by: deadprogram <ron@hybridgroup.com>
2026-03-31 14:03:30 -03:00
Patricio Whittingslow abb114fc31 add berkeley minimal working example of lneto 2026-03-25 19:27:04 -03:00
Pat Whittingslow e08aab7c0a Berkeley rework (#62)
* begin reworking berkeley stack and add example

* thread mock client logic

* fix mock stack in example not encapsulating when data available
2026-03-25 18:43:10 -03:00
Pat Whittingslow bd645b5e1e Add mdns package and Client implementation (#55)
* add mdns

* define mdns.Client

* fix some mdns stuff

* refine dns package for use with mdns

* remove Querier and Responder and replace with Client

* add record setting methods on dns.record to reuse record buffer

* protect against unbounded client answer growth

* round off sharp mdns edges; reduce allocs

* add mutlicast to stacks; add xnet tests for mdns

* fix documentation on acceptmulticast field

* mdns working
2026-03-16 15:48:17 -03:00
Patricio Whittingslow 02b4e71c2a gofmt: ran gofmt because noticed weird diffs in last commit, seemed OK though 2026-02-28 17:47:11 -03:00
Pat Whittingslow bf2d07d9f0 HTTP server example and DHCP Server rewrite (#38)
* improvements to dhcpv4 server

* begin adding examples/httpserver

* add better VLAN tagging methods

* pcap: add error printing; fix bug in CRC

* ipv4: ToS and Flags construction and flag manipulation improvements

* add dhcp interception to httptap and improve httpserver example
2026-02-18 16:48:30 -03:00
soypat be194ad7ea remove old examples and update readme 2026-01-08 12:52:51 -03:00
Pat Whittingslow 018f9258ac Add tcp.Listener (#15)
* begin reviewing TCP listener

* begin adding listener tests

* adding TestExchange implementation

* split out legacy and Step tests

* move listener to tcp package

* fix up tcp tests taking very long

* add xnet.TCPPool and work on TCPPool semantics

* xnet: TCPPool only accepts established connections

* xnet: getting to bottom of panic in xnet.Listener

* xnet: improve listener tests

* fix several data races in testing fixtures

* fix more synchronization things in listener test

* finalize tcplistener test
2026-01-03 12:41:57 -03:00
Patricio Whittingslow c6e88b1c3b tcp.Conn:add Flush method and more lock protection 2026-01-01 10:32:13 -03:00
Pat Whittingslow f8166aea05 Fix slow exchanges on linux by adding polling and other improvements (#14)
* add prints to investigate slowness

* add loop sleep for blocking Stack

* add connection close http attribute and detect end of HTML page

* add timeout to bridge read

* examples/xnet: add ntp timestamp to prints and show output in readme

* add polling to http tap interface

* more digits in ntp format

* prevent crashes on non-8 timestamp
2026-01-01 09:35:35 -03:00
soypat 3cbef6fa92 add FieldClassOperation to pcap and associated formatting changes 2025-12-31 18:54:21 -03:00
soypat dc374169dc use lneto.ErrDropPacket where appropiate; clean up examples/xnet output 2025-12-31 18:15:34 -03:00
soypat 243d1a720d fix httptap incorrectly capturing GRO frames 2025-12-31 17:08:53 -03:00
soypat 7369ec0b7e add pcap printing to examples/xnet 2025-12-31 13:21:46 -03:00
Patricio Whittingslow 5f0edf62a9 add pcap formatting 2025-12-31 02:17:44 -03:00
Patricio Whittingslow f6bc73ee6c apply some of @ddirect suggestions 2025-12-22 18:41:14 -03:00
Patricio Whittingslow 5e631a1b3d StackPorts: set MAC destination when node has MAC 2025-12-19 01:04:18 -03:00
Patricio Whittingslow 1554b89a08 StackNode refactor: add offsetToIP argument to Encapsulate 2025-12-19 00:38:28 -03:00
Patricio Whittingslow 7042a653a6 add lock to tcp.Conn; claude Fix ARP handler not responding after DHCP
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-09 14:16:23 -03:00
Patricio Whittingslow d731106c51 add xnet stack tcp handshake test 2025-10-18 19:51:57 -03:00
soypat d28203e75f upload changes done on plane 2025-08-31 12:42:46 -03:00
soypat 0f20090d78 bugfix: use ISS on active TCP connection 2025-08-16 18:26:50 -03:00
soypat 9cf4e35d2e changes to TCP stack to enable xnet functionality 2025-08-16 15:17:46 -03:00
soypat c2995383da add x/xnet experimental package 2025-08-03 11:30:51 -03:00
soypat 6b3062481e refine DHCP value acquisition 2025-07-19 20:40:23 -03:00
soypat 61c66a2e58 remove NodeARP in favor of arp.Handler; fix bug in IP stack node handling; use registerNode where applicable 2025-07-14 19:48:29 -03:00
soypat 1549e563e9 continue reworking node API 2025-07-13 01:07:08 -03:00
soypat 2bd056a04c NTP up and running 2025-07-12 16:45:20 -03:00
soypat 698610242e DNS resolution working butter smooth 2025-07-12 12:54:34 -03:00
soypat 68c4d1ea71 DNS working! 2025-07-12 12:34:20 -03:00
soypat a257becf15 major ARP Handler refactor; DNS improvements; bridge example rework 2025-07-09 22:49:13 -03:00