feat: add working native SAMv3 TCP client and CLI with sane defaults
check / check (macos-latest) (push) Failing after 28s
check / check (ubuntu-latest) (push) Failing after 29s
check / check (windows-latest) (push) Failing after 30s

This commit is contained in:
nandi committed 2026-11-27 19:10:01 +00:00
1 parent e527b84bc3
commit 4d79d78f06
13 files changed
+1910 -11

No files matched your search

+13 -3
View File
@@ -230,18 +230,28 @@ pub fn hello_version(
///|
/// Builds `SESSION CREATE STYLE=<style> ID=<id> DESTINATION=<dest> ...`.
/// Per the SAMv3 specification, `SIGNATURE_TYPE` is only included when
/// `destination == "TRANSIENT"`. Additional I2CP / tunnel options can be passed
/// via `options`.
pub fn session_create(
style : String,
id : String,
destination~ : String = "TRANSIENT",
signature_type~ : String = "7",
options~ : Array[(String, String)] = [],
) -> SamMessage {
SamMessage::new("SESSION", subcommand=Some("CREATE"), params=[
let params : Array[(String, String)] = [
("STYLE", style),
("ID", id),
("DESTINATION", destination),
("SIGNATURE_TYPE", signature_type),
])
]
if destination == "TRANSIENT" {
params.push(("SIGNATURE_TYPE", signature_type))
}
for opt in options {
params.push(opt)
}
SamMessage::new("SESSION", subcommand=Some("CREATE"), params~)
}
///|