1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use serde::{Deserialize, Serialize};
pub const NODE_SEPARATOR: &'static str = "#/@";
pub const POLICY_STASH_PREFIX: &str = "config";
pub const POLICY_DATA_KEY: &str = "data";
pub const POLICY_STASH_ID: &str = "saved_networks";
pub type StashedSsid = Vec<u8>;
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct PersistentData {
pub credential: Credential,
pub has_ever_connected: bool,
}
#[derive(Clone, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub struct NetworkIdentifier {
pub ssid: StashedSsid,
pub security_type: SecurityType,
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, PartialEq, Serialize)]
pub enum SecurityType {
None,
Wep,
Wpa,
Wpa2,
Wpa3,
}
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub enum Credential {
None,
Password(Vec<u8>),
Psk(Vec<u8>),
}