338 Commits

Author SHA1 Message Date
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
Patricio Whittingslow fae4552ddb add IP/TCP/HTTP fuzzing and fixes to panics found 2026-02-12 16:25:48 -03:00
ddirect 1694e71e0c Use backoff to wait until there is enough room in the TCP write buffer (#34) 2026-02-09 01:27:18 +01:00
ddirect 085c7033cd TCP: advertising the currently available window size (#35) 2026-02-09 01:24:24 +01:00
Pat Whittingslow 199d978c99 no dhcp request on zeroed address (#33) 2026-02-05 18:18:27 -03:00
ddirect fba97c990a Checksum simplification proposal (#29)
* Simplified checksum calculation and verification

* Fixed tests

* UDP: using NewBoundedFrame to create a Frame instance limited to the actual frame size.

* Minor: renamed some functions

* Commented and made more readable consecutive SetCRC calls.

* Fixed icmp checksum calculation after rebase

* Replaced NewBoundedFrame with explicit validation
2026-02-05 17:35:42 -03:00
soypat cd51bd6c3f fix #31 by maintaining conns on listener encapsulate no-op 2026-02-02 22:38:41 +01:00
soypat 0a19c6bfd8 add more icmpv4 packet capturing 2026-02-02 14:16:51 +01:00
soypat ad239309a4 fix benchmarks 2026-02-02 10:33:47 +01:00
soypat c518b7e7fe add ethernet tx FCS to StackAsyncConfig 2026-01-29 19:14:40 +01:00
ddirect 360628f1b8 Simplified implementation (#27)
Introduced minimum backoff time
Max TCP backoff increased to 5ms
2026-01-26 18:49:33 -03:00
ddirect 5e61b4600d Checksum fixes (#24)
* Checksum 0x0000 is returned as 0xFFFF (mandatory for UDP, common for TCP)

* Both checksum zero values (0x0000 and 0xFFFF) are accepted when receiving

* Rename parameter in VerifySum16 to expectedSum16

---------

Co-authored-by: Pat Whittingslow <graded.sp@gmail.com>
2026-01-26 17:22:54 -03:00
Pat Whittingslow 85f018a02c ethernet: MTU semantic meaning corrections, add FCS logic (#28) 2026-01-26 16:45:35 -03:00
Patricio Whittingslow 6a6097a9ac improve formatter example 2026-01-26 12:12:13 -03:00
Patricio Whittingslow e8afc09a73 pcap: add subfield formatting 2026-01-26 12:09:25 -03:00
Patricio Whittingslow 4cffe26c30 fix pcap.Formatter fallthrough logic in formatField 2026-01-25 23:43:02 -03:00
Patricio Whittingslow 2e5cbd6f76 improvements to phy package 2026-01-25 22:30:26 -03:00
Patricio Whittingslow 470960f924 documentation improvements to rmii.md 2026-01-25 18:50:05 -03:00
Patricio Whittingslow e83665f147 relocate phy.MDIOBitBang tinygo example to Configure method 2026-01-25 09:11:08 -03:00
ddirect 91fea9ae58 Maximum segment size fixes (#25)
* Fixed MSS sent in SYN and SYN-ACK

* Fixed tests
2026-01-25 02:37:17 -03:00
Patricio Whittingslow 7edaea1093 add MDIOBitBang 2026-01-24 18:17:22 -03:00
Patricio Whittingslow 8ed7edc976 more complete RMII info 2026-01-22 14:30:23 -03:00
Patricio Whittingslow 0f10576521 forgot int64 wrap 2026-01-21 19:32:13 -03:00
Patricio Whittingslow 3396fd5265 phy: improvements and additions; document RMII 2026-01-21 18:54:45 -03:00
Pat Whittingslow e13bb45854 attempt to fix #22 (#23) 2026-01-19 23:22:54 -03:00
Patricio Whittingslow 9d83707557 add berkeley socket interface 2026-01-19 11:48:01 -03:00
Patricio Whittingslow 985e087842 refactor phy package 2026-01-19 10:29:15 -03:00
ddirect 3c6882b4b3 Repeating select call on Bridge when interrupted (#20)
* Repeating select if it is interrupted

* Restrict retries for syscall.EINTR to 10

Limit the number of retries on syscall.EINTR to 10.

---------

Co-authored-by: Pat Whittingslow <graded.sp@gmail.com>
2026-01-18 14:05:43 -03:00
ddirect 1a6ce6b056 Ignoring packet padding for IPv4 capture (#21) 2026-01-18 14:04:28 -03:00