mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
feat: add disable_ipv6 option (related #364)
This commit is contained in:
@@ -36,6 +36,7 @@ pub struct ConnectArgs {
|
||||
csd_wrapper: Option<String>,
|
||||
mtu: u32,
|
||||
os: Option<ClientOs>,
|
||||
disable_ipv6: bool,
|
||||
}
|
||||
|
||||
impl ConnectArgs {
|
||||
@@ -48,6 +49,7 @@ impl ConnectArgs {
|
||||
csd_uid: 0,
|
||||
csd_wrapper: None,
|
||||
mtu: 0,
|
||||
disable_ipv6: false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,6 +80,10 @@ impl ConnectArgs {
|
||||
pub fn mtu(&self) -> u32 {
|
||||
self.mtu
|
||||
}
|
||||
|
||||
pub fn disable_ipv6(&self) -> bool {
|
||||
self.disable_ipv6
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Type)]
|
||||
@@ -109,11 +115,6 @@ impl ConnectRequest {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_mtu(mut self, mtu: u32) -> Self {
|
||||
self.args.mtu = mtu;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_user_agent<T: Into<Option<String>>>(mut self, user_agent: T) -> Self {
|
||||
self.args.user_agent = user_agent.into();
|
||||
self
|
||||
@@ -124,6 +125,16 @@ impl ConnectRequest {
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_mtu(mut self, mtu: u32) -> Self {
|
||||
self.args.mtu = mtu;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_disable_ipv6(mut self, disable_ipv6: bool) -> Self {
|
||||
self.args.disable_ipv6 = disable_ipv6;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn gateway(&self) -> &Gateway {
|
||||
self.info.gateway()
|
||||
}
|
||||
|
Reference in New Issue
Block a user