Support HIP report (#309)

This commit is contained in:
Kevin Yue
2024-02-05 05:35:45 -05:00
committed by GitHub
parent 662e4d0b8a
commit db9249bd61
12 changed files with 334 additions and 2 deletions

View File

@@ -32,6 +32,8 @@ pub struct ConnectArgs {
cookie: String,
vpnc_script: Option<String>,
user_agent: Option<String>,
csd_uid: u32,
csd_wrapper: Option<String>,
os: Option<ClientOs>,
}
@@ -42,6 +44,8 @@ impl ConnectArgs {
vpnc_script: None,
user_agent: None,
os: None,
csd_uid: 0,
csd_wrapper: None,
}
}
@@ -60,6 +64,14 @@ impl ConnectArgs {
pub fn openconnect_os(&self) -> Option<String> {
self.os.as_ref().map(|os| os.to_openconnect_os().to_string())
}
pub fn csd_uid(&self) -> u32 {
self.csd_uid
}
pub fn csd_wrapper(&self) -> Option<String> {
self.csd_wrapper.clone()
}
}
#[derive(Debug, Deserialize, Serialize, Type)]
@@ -81,6 +93,16 @@ impl ConnectRequest {
self
}
pub fn with_csd_uid(mut self, csd_uid: u32) -> Self {
self.args.csd_uid = csd_uid;
self
}
pub fn with_csd_wrapper<T: Into<Option<String>>>(mut self, csd_wrapper: T) -> Self {
self.args.csd_wrapper = csd_wrapper.into();
self
}
pub fn with_user_agent<T: Into<Option<String>>>(mut self, user_agent: T) -> Self {
self.args.user_agent = user_agent.into();
self