feat: expose openconnect connection options

This commit is contained in:
Kevin Yue committed 2026-05-06 23:20:55 +08:00
1 parent a51f034036
commit 5ace087f92
7 files changed
+93 -6

No files matched your search

+33
View File
@@ -49,6 +49,9 @@ pub struct ConnectArgs {
mtu: u32,
disable_ipv6: bool,
no_dtls: bool,
local_hostname: Option<String>,
force_dpd: u32,
no_xmlpost: bool,
}
impl ConnectArgs {
@@ -70,6 +73,9 @@ impl ConnectArgs {
mtu: 0,
disable_ipv6: false,
no_dtls: false,
local_hostname: None,
force_dpd: 0,
no_xmlpost: false,
}
}
@@ -136,6 +142,18 @@ impl ConnectArgs {
pub fn no_dtls(&self) -> bool {
self.no_dtls
}
pub fn local_hostname(&self) -> Option<String> {
self.local_hostname.clone()
}
pub fn force_dpd(&self) -> u32 {
self.force_dpd
}
pub fn no_xmlpost(&self) -> bool {
self.no_xmlpost
}
}
#[derive(Debug, Deserialize, Serialize, Type)]
@@ -227,6 +245,21 @@ impl ConnectRequest {
self
}
pub fn with_local_hostname<T: Into<Option<String>>>(mut self, local_hostname: T) -> Self {
self.args.local_hostname = local_hostname.into();
self
}
pub fn with_force_dpd(mut self, force_dpd: u32) -> Self {
self.args.force_dpd = force_dpd;
self
}
pub fn with_no_xmlpost(mut self, no_xmlpost: bool) -> Self {
self.args.no_xmlpost = no_xmlpost;
self
}
pub fn gateway(&self) -> &Gateway {
self.info.gateway()
}