feat(transport): pin PacketConnection contract for the router seam
Define the async PacketConnection trait (send_packet/recv_packet over &self) that aura-tunnel's router consumes and the QUIC connection will implement. Committed before Wave 3 so the transport and tunnel agents build against a stable cross-crate contract from isolated worktrees. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
//! The transport's full-duplex packet-connection abstraction.
|
||||
//!
|
||||
//! [`PacketConnection`] is the seam between this crate (QUIC transport + the post-handshake
|
||||
//! `aura_proto::Session`) and `aura-tunnel`'s router. The router reads IP packets from the TUN
|
||||
//! device and `send_packet`s the ones routed through the VPN, while a second task `recv_packet`s
|
||||
//! decrypted IP packets to write back to the TUN. The methods take `&self` (not `&mut self`) so a
|
||||
//! single connection can be shared — e.g. behind `Arc<dyn PacketConnection>` — across the
|
||||
//! concurrent send and receive tasks.
|
||||
|
||||
use async_trait::async_trait;
|
||||
|
||||
/// A bidirectional, encrypted packet pipe to the peer (one IP packet per call).
|
||||
#[async_trait]
|
||||
pub trait PacketConnection: Send + Sync {
|
||||
/// Encrypt and send one IP packet to the peer.
|
||||
async fn send_packet(&self, packet: &[u8]) -> anyhow::Result<()>;
|
||||
|
||||
/// Receive and decrypt one IP packet from the peer. Returns the plaintext IP packet.
|
||||
async fn recv_packet(&self) -> anyhow::Result<Vec<u8>>;
|
||||
}
|
||||
@@ -1 +1,9 @@
|
||||
//! aura-transport — QUIC transport and traffic mimicry (skeleton; implemented in Wave 3).
|
||||
//! aura-transport — QUIC transport, HTTPS/H3 traffic mimicry, and the packet-connection seam.
|
||||
//!
|
||||
//! Implemented in Wave 3. This file currently pins the cross-crate [`PacketConnection`] contract
|
||||
//! consumed by `aura-tunnel`'s router; the QUIC endpoint (quinn), mimicry, and padding land
|
||||
//! alongside it in the `quic`, `mimicry`, and `padding` modules.
|
||||
|
||||
pub mod conn;
|
||||
|
||||
pub use conn::PacketConnection;
|
||||
|
||||
Reference in New Issue
Block a user