objc2_network_extension/
renamed_enums.rs

1#![allow(non_upper_case_globals)]
2
3use objc2::encode::{Encode, Encoding, RefEncode};
4use objc2::ffi::NSInteger;
5
6/// TLS version to use during TLS handshake.
7///
8/// See also [Apple's documentation](https://developer.apple.com/documentation/networkextension/nehotspotconfigurationeaptlsversion?language=objc)
9// NS_ENUM
10#[repr(transparent)]
11#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
12pub struct NEHotspotConfigurationEAPTLSVersion(pub NSInteger);
13impl NEHotspotConfigurationEAPTLSVersion {
14    #[doc(alias = "NEHotspotConfigurationEAPTLSVersion_1_0")]
15    pub const Version_1_0: Self = Self(0);
16    #[doc(alias = "NEHotspotConfigurationEAPTLSVersion_1_1")]
17    pub const Version_1_1: Self = Self(1);
18    #[doc(alias = "NEHotspotConfigurationEAPTLSVersion_1_2")]
19    pub const Version_1_2: Self = Self(2);
20}
21
22unsafe impl Encode for NEHotspotConfigurationEAPTLSVersion {
23    const ENCODING: Encoding = NSInteger::ENCODING;
24}
25
26unsafe impl RefEncode for NEHotspotConfigurationEAPTLSVersion {
27    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
28}
29
30/// IKEv2 Encryption Algorithms.
31///
32/// See also [Apple's documentation](https://developer.apple.com/documentation/networkextension/nevpnikev2encryptionalgorithm?language=objc)
33// NS_ENUM
34#[repr(transparent)]
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
36pub struct NEVPNIKEv2EncryptionAlgorithm(pub NSInteger);
37impl NEVPNIKEv2EncryptionAlgorithm {
38    #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
39    #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmDES")]
40    pub const AlgorithmDES: Self = Self(1);
41    #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
42    #[doc(alias = "NEVPNIKEv2EncryptionAlgorithm3DES")]
43    pub const Algorithm3DES: Self = Self(2);
44    #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
45    #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES128")]
46    pub const AlgorithmAES128: Self = Self(3);
47    #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES256")]
48    pub const AlgorithmAES256: Self = Self(4);
49    #[deprecated = "Use an encryption algorithm with 256-bit keys instead"]
50    #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES128GCM")]
51    pub const AlgorithmAES128GCM: Self = Self(5);
52    #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmAES256GCM")]
53    pub const AlgorithmAES256GCM: Self = Self(6);
54    #[doc(alias = "NEVPNIKEv2EncryptionAlgorithmChaCha20Poly1305")]
55    pub const AlgorithmChaCha20Poly1305: Self = Self(7);
56}
57
58unsafe impl Encode for NEVPNIKEv2EncryptionAlgorithm {
59    const ENCODING: Encoding = NSInteger::ENCODING;
60}
61
62unsafe impl RefEncode for NEVPNIKEv2EncryptionAlgorithm {
63    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
64}