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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// Network device attachment sending raw network packets over a file handle.
///
/// The file handle attachment transmits the raw packets/frames between the virtual network interface and a file handle.
/// The data transmitted through this attachment is at the level of the data link layer.
///
/// The file handle must hold a connected datagram socket.
///
///
/// See: VZNetworkDeviceConfiguration
///
/// See: VZVirtioNetworkDeviceConfiguration
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/virtualization/vzfilehandlenetworkdeviceattachment?language=objc)
#[unsafe(super(VZNetworkDeviceAttachment, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "VZNetworkDeviceAttachment")]
pub struct VZFileHandleNetworkDeviceAttachment;
);
#[cfg(feature = "VZNetworkDeviceAttachment")]
extern_conformance!(
unsafe impl NSObjectProtocol for VZFileHandleNetworkDeviceAttachment {}
);
#[cfg(feature = "VZNetworkDeviceAttachment")]
impl VZFileHandleNetworkDeviceAttachment {
extern_methods!(
/// Initialize the attachment with a file handle.
///
/// Parameter `fileHandle`: File handle holding a connected datagram socket.
#[unsafe(method(initWithFileHandle:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFileHandle(
this: Allocated<Self>,
file_handle: &NSFileHandle,
) -> Retained<Self>;
/// The file handle associated with this attachment.
#[unsafe(method(fileHandle))]
#[unsafe(method_family = none)]
pub unsafe fn fileHandle(&self) -> Retained<NSFileHandle>;
/// The maximum transmission unit (MTU) associated with this attachment.
///
/// The client side of the associated datagram socket must be properly configured with the appropriate values for
/// `SO_SNDBUF`, and `SO_RCVBUF`, which can be set using the `setsockopt` system call. The value of `SO_RCVBUF` is
/// expected to be at least double the value of `SO_SNDBUF`, and for optimal performance, the value of `SO_RCVBUF`
/// is recommended to be four times the value of `SO_SNDBUF`.
///
/// The default MTU is 1500.
/// The maximum MTU allowed is 65535, and the minimum MTU allowed is 1500. An invalid MTU value will result in an invalid
/// virtual machine configuration.
#[unsafe(method(maximumTransmissionUnit))]
#[unsafe(method_family = none)]
pub unsafe fn maximumTransmissionUnit(&self) -> NSInteger;
/// Setter for [`maximumTransmissionUnit`][Self::maximumTransmissionUnit].
#[unsafe(method(setMaximumTransmissionUnit:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaximumTransmissionUnit(&self, maximum_transmission_unit: NSInteger);
);
}
/// Methods declared on superclass `VZNetworkDeviceAttachment`.
#[cfg(feature = "VZNetworkDeviceAttachment")]
impl VZFileHandleNetworkDeviceAttachment {
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>;
);
}