Commit Graph

266 Commits

Author SHA1 Message Date
Patricio Whittingslow 41dffbb074 README update 2026-04-10 16:56:18 -03:00
Patricio Whittingslow 8807272494 documentation improvements to internal/slices.go and README 2026-04-10 12:16:21 -03:00
Pat Whittingslow 0382410f02 begin adding udp conn (#69)
* begin adding udp conn

* udp tests passing

* bugfixes for udp Send,Abort,Encapsulate methods

* document UDP methods
2026-04-10 00:34:37 -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
Patricio Whittingslow 548d96da95 notify if icmp cannot be used due to bad StackConfig 2026-04-09 12:44:50 -03:00
Pat Whittingslow 8813ccef82 ICMP tests and various fixes (#68)
* various icmp fixes

* improve existing tests
2026-04-09 12:31:31 -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 63f7870fe5 Add round-robin implementation (#66)
* add handler.encapsulateNode

* implement round robin handler approach

* simplify round robin implementation

* leave TODO

* internet.node touch up

* fix conflict resolve f-up

* replace certain ErrShortBuffer with ErrTruncatedFrame error
2026-04-09 09:36:17 -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
Ron Evans 22c7e6c9d8 fix: StackBerkeley Bind/Listen/Connect and StackGo dial support (#64)
* fix: StackBerkeley Bind/Listen/Connect and StackGo dial support

- Bind now stores the bound address; Listen and Connect forward it to
  the gostack so the local port reaches SocketNetip.
- Fix StackGo.Socket parsing laddr/raddr instead of zero-value locals.
- Fix inverted isvalid() checks in StackBerkeley.Close causing nil deref.
- Auto-assign ephemeral port for outbound dial connections in SocketNetip.
- Configure tcp.Conn with TX/RX buffers before DialTCP; add DialConfig
  fields to StackGoConfig.

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

* use already existing poolconfig for new tcp config

---------

Signed-off-by: deadprogram <ron@hybridgroup.com>
Co-authored-by: Patricio Whittingslow <graded.sp@gmail.com>
2026-03-31 19:04:08 -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 33f492557a mdns+xnet: add test that replicates issue in cyw43439 2026-03-26 17:41:27 -03:00
Patricio Whittingslow c06a4fa99b mdns: add test that replicates issue in cyw43439 2026-03-26 15:54:45 -03:00
Pat Whittingslow 64b2647a5e tcp: retransmit logic rollback (#61)
* tcp: remove retransmit logic entirely; add duplicate ack counting to ControlBlock

* retransmit implemented in nice simple straightforward way

* narrow down retransmission cases

* remove old timing tests

* add ControlBlock retransmit test

* add failing handler test

* reworking payload length semantic meaning in code

* fix establish conn logic

* clean up tests and add TCB dupack generation and test it

* catch pending retransmit satisfy in test

* add fuzz test for control block

* bugfix: be more strict in what is considered dupack

* add IncomingIsDupACK docs

* limit queue of retransmits

* protect retransmit overflow from incorrectly updating nxt
2026-03-26 11:48:02 -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 faae7ab076 TCP retransmission fixes and fuzz failure fixes (#59)
* fix for #58

* add fixes for both retransmit and fuzz failure found

* fix infinite challenge ack due to RST+SYN+FIN corrupt packet in SYNRCV state

* fuzz: previous recovery ack path led to infinite transmit

* fuzz: calculate CRCs when fuzzing to reduce search space to non-CRC error cases

* add local fuzz corpus to tests

* add more cases to fuzz corpus
2026-03-20 10:25:31 -03:00
Patricio Whittingslow 493446244f mdns: avoid dropping large answers that could not be decoded completely 2026-03-17 16:36:00 -03:00
Patricio Whittingslow 3cdb0a83fd fix spurious endless mdns response 2026-03-16 15:59:52 -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
Pat Whittingslow 376e1a0b4f Further reduce heap allocs (#56)
* work on tracking more heap allocations down

* write own heapless IP AppendFormatAddr functions

* remove potential Error method allocations

* more logging
2026-03-14 20:11:59 -03:00
Pat Whittingslow de2e756628 HTTP bugfixes and tests + LLM Policy (#54)
* claude: add http tests+bugfix for parsing first line; incomplete line handling; detect Connection:close

* add more http tests
2026-03-14 20:10:08 -03:00
Patricio Whittingslow 6b06cb1237 claude: add tests for tcp and ntp to consolidate functionality 2026-03-08 19:42:48 -03:00
Patricio Whittingslow 97acaa2cb3 fix coverage not showing inter-package coverage and add race flag 2026-03-08 19:25:14 -03:00
Pat Whittingslow 270b8df043 Implement basic retransmit queue reset method (#52)
* implement basic retransmit queue reset method

* tcp: rto reset on new ack; accept ack after retransmit bugfix
2026-03-05 17:35:16 -03:00
Patricio Whittingslow 06bd6b28dd finwait1 partial ack stays in finwait1 2026-03-04 13:35:56 -03:00
Pat Whittingslow d5c4fa53c6 tcp: bugfix for seq not in snd/rcv.wnd error (#49)
* tcp: bugfix for seq not in snd/rcv.wnd error

* accept dupe ACKs for window updates and prevent decrement of UNA

* add fixes for incorrect tcp functioning

* remove Conn.Available* methods in favor of Conn.Free* methods due to ambiguous name
2026-03-04 12:59:30 -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
Patricio Whittingslow f6e7801d8c heap: remove heap alloc in pcap of HTTP content type; more debugging logs 2026-02-28 17:46:08 -03:00
Patricio Whittingslow 4f7635b216 debug: add free memory printing 2026-02-28 16:37:36 -03:00
Pat Whittingslow bd76ebe5ed tcp: bugfix for challenge ack panic edge case (#48) 2026-02-28 16:18:39 -03:00
Pat Whittingslow fa5ba918bb Error rewrites (#43)
* pcap: reuse Frame memory

* slog: reduce heap allocations of addresses; also prevent heap alloc of dhcp options in pcap

* dns: heapless improvement; add StackAsync buffer for more heapless operation; start thinking of errors

* errors: begin standardise errors in lneto

* errors: finish standardization of errors

* fix merge issues

* add more lneto errors to rest of package

* format errors.go
2026-02-28 16:18:27 -03:00
Pat Whittingslow 3d0bc93cbe tcp: bugfix for missing ack for window rejected segments (#45) 2026-02-28 15:21:07 -03:00
Pat Whittingslow 989bb6a0b9 Reduce heap allocs 2 (#46)
* reduce heap allocations in tcp logging; omit use of AppendFloat which allocates a metric sh*tton

* debugheaplog: better heap statistic logging

* heap: use string for pcap.Frame.Protocol

* add potential to eliminate Flags.String heap alloc, remove incorrect HEAP comments

* add StackAsync.DebugErr and httpraw.SetBytes

* many heap alloc reductions and replacement of bytes.Equal with internal.BytesEqual
2026-02-28 15:20:46 -03:00
Pat Whittingslow eab43c4653 tcp: Reject SYN on synchronized connections; fix maxSend underflow (#44)
* tcp: add test replicating bugs and 32bit panic with GOARCH=386

* tcp: reject SYN on synchronized connections; fix maxSend underflow
2026-02-27 12:38:46 -03:00
Pat Whittingslow f9748da94f Reduce heap allocations (#42)
* pcap: reuse Frame memory

* slog: reduce heap allocations of addresses; also prevent heap alloc of dhcp options in pcap

* dns: heapless improvement; add StackAsync buffer for more heapless operation; start thinking of errors

* reuse function for reclaiming frames among all protocols for lower memory usage

* remove extraneous code
2026-02-27 12:38:33 -03:00
Patricio Whittingslow 92b54487df improve TCP logging of remote ports 2026-02-27 08:52:23 -03:00
Patricio Whittingslow 04664afe3a remove overly verbose logging and short circuit TCP nop encapsulate 2026-02-27 08:43:31 -03:00
Patricio Whittingslow 76f896af40 use common internal logger among all implementations(debugheaplog build tag) 2026-02-26 17:06:47 -03:00
Pat Whittingslow be949d960c tcp: mss honoring; accept syn with ECE/CWR flags; add RSTQueue type (#41)
* tcp: mss honoring; accept syn with ECE/CWR flags; add RSTQueue type

* tcp: move option logic to own file

* remove prints in pcap

* add MSS send threshold inspired by linux/freebsd/lwip thresh
2026-02-25 12:58:55 -03:00
Patricio Whittingslow 58a9bf57e5 tcp: listener produces RST response when conns exhausted 2026-02-23 15:07:33 -03:00
Patricio Whittingslow 5221dc8248 improve HTTP body pcap formatting 2026-02-23 14:02:23 -03:00
Patricio Whittingslow 87a22441e7 rewrite tests to capture more finwait2 receive segment expected functionality 2026-02-23 13:39:12 -03:00
Patricio Whittingslow f061cbd744 bugfix: bare-ack acceptance in finwait2 2026-02-23 13:28:47 -03:00
Pat Whittingslow 7d323aae19 Tcp rst handling (#40)
* claude suggests a way forward

* add timing to capture printer

* add pcap.Flags

* fix ICMP CRC calculation and add test

* bugfix: still send data on half-close state(close-wait)

* fix pcap test
2026-02-23 09:50:13 -03:00
Pat Whittingslow 08423d0dba add proactive window update (#39)
* add proactive window update

* fix xnet tests due to runt padding bug
2026-02-22 12:02:53 -03:00
Patricio Whittingslow 996ba03612 add xnet.CapturePrinter type 2026-02-22 10:47:58 -03:00
Patricio Whittingslow c384641b7c arp: fix runt frames by extending at ethernet level; discard blocking ARP queries after success/failure 2026-02-21 23:52:27 -03:00
Patricio Whittingslow 1a07928ca8 ethernet: refactor VLAN API 2026-02-18 16:58:52 -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