Add native local port forwarding
ci / test (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
DuProcess
2026-06-13 15:36:10 -04:00
parent f324a7627f
commit 6aa81d0ce3
4 changed files with 844 additions and 55 deletions
+54
View File
@@ -30,6 +30,13 @@ pub enum PacketKind {
NativeServerHello = 15,
NativeUserAuth = 16,
NativeAuthOk = 17,
StreamOpen = 18,
StreamOpenOk = 19,
StreamOpenReject = 20,
StreamData = 21,
StreamWindowAdjust = 22,
StreamEof = 23,
StreamClose = 24,
}
impl TryFrom<u8> for PacketKind {
@@ -54,6 +61,13 @@ impl TryFrom<u8> for PacketKind {
15 => Self::NativeServerHello,
16 => Self::NativeUserAuth,
17 => Self::NativeAuthOk,
18 => Self::StreamOpen,
19 => Self::StreamOpenOk,
20 => Self::StreamOpenReject,
21 => Self::StreamData,
22 => Self::StreamWindowAdjust,
23 => Self::StreamEof,
24 => Self::StreamClose,
_ => bail!("unknown packet kind {value}"),
})
}
@@ -278,6 +292,46 @@ pub struct Resize {
pub rows: u16,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamOpen {
pub stream_id: u64,
pub target_host: String,
pub target_port: u16,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamOpenOk {
pub stream_id: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamOpenReject {
pub stream_id: u64,
pub reason: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamData {
pub stream_id: u64,
pub bytes: Vec<u8>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamWindowAdjust {
pub stream_id: u64,
pub bytes: u32,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamEof {
pub stream_id: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct StreamClose {
pub stream_id: u64,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Frame {
pub session: String,