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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// VZMACAddress represents a media access control address (MAC address), the 48-bit ethernet address.
///
/// The easiest way to obtain a MAC address is with +[VZMACAddress randomLocallyAdministeredAddress]. The method
/// returns a valid local MAC address typically used with network interfaces.
///
/// See: VZNetworkDeviceConfiguration
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzmacaddress?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct VZMACAddress;
);
extern_conformance!(
unsafe impl NSCopying for VZMACAddress {}
);
unsafe impl CopyingHelper for VZMACAddress {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for VZMACAddress {}
);
impl VZMACAddress {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Initialize the VZMACAddress from a string representation of a MAC address.
///
/// Parameter `string`: The string should be formatted representing the 6 bytes in hexadecimal separated by a colon character.
/// e.g. "01:23:45:ab:cd:ef"
///
/// The alphabetical characters can appear lowercase or uppercase.
///
/// Returns: A VZMACAddress or nil if the string is not formatted correctly.
#[unsafe(method(initWithString:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithString(
this: Allocated<Self>,
string: &NSString,
) -> Option<Retained<Self>>;
/// Create a valid, random, unicast, locally administered address.
///
/// The generated address is not guaranteed to be unique.
#[unsafe(method(randomLocallyAdministeredAddress))]
#[unsafe(method_family = none)]
pub unsafe fn randomLocallyAdministeredAddress() -> Retained<Self>;
/// The address represented as a string.
///
/// The 6 bytes are represented in hexadecimal form, separated by a colon character.
/// Alphabetical characters are lowercase.
///
/// The address is compatible with the parameter of -[VZMACAddress initWithString:].
#[unsafe(method(string))]
#[unsafe(method_family = none)]
pub unsafe fn string(&self) -> Retained<NSString>;
/// True if the address is the broadcast address, false otherwise.
#[unsafe(method(isBroadcastAddress))]
#[unsafe(method_family = none)]
pub unsafe fn isBroadcastAddress(&self) -> bool;
/// True if the address is a multicast address, false otherwise.
#[unsafe(method(isMulticastAddress))]
#[unsafe(method_family = none)]
pub unsafe fn isMulticastAddress(&self) -> bool;
/// True if the address is a unicast address, false otherwise.
#[unsafe(method(isUnicastAddress))]
#[unsafe(method_family = none)]
pub unsafe fn isUnicastAddress(&self) -> bool;
/// True if the address is a locally administered addresses (LAA), false otherwise.
#[unsafe(method(isLocallyAdministeredAddress))]
#[unsafe(method_family = none)]
pub unsafe fn isLocallyAdministeredAddress(&self) -> bool;
/// True if the address is a universally administered addresses (UAA), false otherwise.
#[unsafe(method(isUniversallyAdministeredAddress))]
#[unsafe(method_family = none)]
pub unsafe fn isUniversallyAdministeredAddress(&self) -> bool;
);
}