Add ICMPv6 Destination Unreachable and TUN reader/writer architecture

- New icmp.rs module: builds RFC 4443 compliant ICMPv6 Type 1 Code 0
  responses with proper checksum and packet validation
- TUN reader/writer separation: fd duplication allows independent I/O
  on separate threads
- TunWriter services mpsc queue for multiple future packet sources
- Reader now sends ICMPv6 errors for unroutable packets instead of
  silently dropping them
- 171 tests passing
This commit is contained in:
Johnathan Corgan
2026-01-30 05:25:28 +00:00
parent db8aa5825d
commit 385033fcb7
6 changed files with 513 additions and 13 deletions
+5 -1
View File
@@ -6,6 +6,7 @@
pub mod bloom;
pub mod cache;
pub mod config;
pub mod icmp;
pub mod identity;
pub mod node;
pub mod peer;
@@ -52,4 +53,7 @@ pub use peer::{Peer, PeerError, PeerState, UpstreamPeer};
pub use node::{Node, NodeError, NodeState};
// Re-export TUN types
pub use tun::{log_ipv6_packet, shutdown_tun_interface, TunDevice, TunError, TunState};
pub use tun::{log_ipv6_packet, shutdown_tun_interface, TunDevice, TunError, TunState, TunTx, TunWriter};
// Re-export ICMPv6 types
pub use icmp::{build_dest_unreachable, should_send_icmp_error, DestUnreachableCode, Icmpv6Type};