objc2_io_kit/generated/network.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkcontrollerclass?language=objc)
11pub const kIONetworkControllerClass: &CStr =
12 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkController\0") };
13/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiovendor?language=objc)
14pub const kIOVendor: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOVendor\0") };
15/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomodel?language=objc)
16pub const kIOModel: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOModel\0") };
17/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiorevision?language=objc)
18pub const kIORevision: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IORevision\0") };
19/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiofeatures?language=objc)
20pub const kIOFeatures: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOFeatures\0") };
21/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumdictionary?language=objc)
22pub const kIOMediumDictionary: &CStr =
23 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMediumDictionary\0") };
24/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiodefaultmedium?language=objc)
25pub const kIODefaultMedium: &CStr =
26 unsafe { CStr::from_bytes_with_nul_unchecked(b"IODefaultMedium\0") };
27/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioselectedmedium?language=objc)
28pub const kIOSelectedMedium: &CStr =
29 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOSelectedMedium\0") };
30/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioactivemedium?language=objc)
31pub const kIOActiveMedium: &CStr =
32 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOActiveMedium\0") };
33/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiolinkspeed?language=objc)
34pub const kIOLinkSpeed: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOLinkSpeed\0") };
35/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiolinkstatus?language=objc)
36pub const kIOLinkStatus: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOLinkStatus\0") };
37/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiolinkdata?language=objc)
38pub const kIOLinkData: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOLinkData\0") };
39/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiopacketfilters?language=objc)
40pub const kIOPacketFilters: &CStr =
41 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOPacketFilters\0") };
42/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomacaddress?language=objc)
43pub const kIOMACAddress: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMACAddress\0") };
44/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomaxpacketsize?language=objc)
45pub const kIOMaxPacketSize: &CStr =
46 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMaxPacketSize\0") };
47/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiominpacketsize?language=objc)
48pub const kIOMinPacketSize: &CStr =
49 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMinPacketSize\0") };
50/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfiltergroup?language=objc)
51pub const kIONetworkFilterGroup: &CStr =
52 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkFilterGroup\0") };
53/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetcontrollerclass?language=objc)
54pub const kIOEthernetControllerClass: &CStr =
55 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOEthernetController\0") };
56/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetaddresssize?language=objc)
57pub const kIOEthernetAddressSize: c_uint = 6;
58/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetmaxpacketsize?language=objc)
59pub const kIOEthernetMaxPacketSize: c_uint = 1518;
60/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetminpacketsize?language=objc)
61pub const kIOEthernetMinPacketSize: c_uint = 64;
62/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetcrcsize?language=objc)
63pub const kIOEthernetCRCSize: c_uint = 4;
64/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetwakeonlanfiltergroup?language=objc)
65pub const kIOEthernetWakeOnLANFilterGroup: &CStr =
66 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOEthernetWakeOnLANFilterGroup\0") };
67/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetdisabledwakeonlanfiltergroup?language=objc)
68pub const kIOEthernetDisabledWakeOnLANFilterGroup: &CStr =
69 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOEthernetDisabledWakeOnLANFilterGroup\0") };
70/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdatabasicaccesstypes?language=objc)
71pub const kIONetworkDataBasicAccessTypes: c_uint =
72 kIONetworkDataAccessTypeRead | kIONetworkDataAccessTypeSerialize;
73/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdatabytes?language=objc)
74pub const kIONetworkDataBytes: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"Data\0") };
75/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdataaccesstypes?language=objc)
76pub const kIONetworkDataAccessTypes: &CStr =
77 unsafe { CStr::from_bytes_with_nul_unchecked(b"Access Types\0") };
78/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdatasize?language=objc)
79pub const kIONetworkDataSize: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"Size\0") };
80/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkstackusercommandkey?language=objc)
81pub const kIONetworkStackUserCommandKey: &CStr =
82 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkStackUserCommand\0") };
83/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkstackusercommand?language=objc)
84pub const kIONetworkStackUserCommand: &CStr =
85 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkStackUserCommand\0") };
86/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetinterfaceclass?language=objc)
87pub const kIOEthernetInterfaceClass: &CStr =
88 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOEthernetInterface\0") };
89/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioactivepacketfilters?language=objc)
90pub const kIOActivePacketFilters: &CStr =
91 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOActivePacketFilters\0") };
92/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiorequiredpacketfilters?language=objc)
93pub const kIORequiredPacketFilters: &CStr =
94 unsafe { CStr::from_bytes_with_nul_unchecked(b"IORequiredPacketFilters\0") };
95/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomulticastaddresslist?language=objc)
96pub const kIOMulticastAddressList: &CStr =
97 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMulticastAddressList\0") };
98/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomulticastfilterdata?language=objc)
99pub const kIOMulticastFilterData: &CStr = kIOMulticastAddressList;
100/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkinterfaceclass?language=objc)
101pub const kIONetworkInterfaceClass: &CStr =
102 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkInterface\0") };
103/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdata?language=objc)
104pub const kIONetworkData: &CStr =
105 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkData\0") };
106/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiointerfacetype?language=objc)
107pub const kIOInterfaceType: &CStr =
108 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOInterfaceType\0") };
109/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomaxtransferunit?language=objc)
110pub const kIOMaxTransferUnit: &CStr =
111 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMaxTransferUnit\0") };
112/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediaaddresslength?language=objc)
113pub const kIOMediaAddressLength: &CStr =
114 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMediaAddressLength\0") };
115/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediaheaderlength?language=objc)
116pub const kIOMediaHeaderLength: &CStr =
117 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOMediaHeaderLength\0") };
118/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiointerfaceflags?language=objc)
119pub const kIOInterfaceFlags: &CStr =
120 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOInterfaceFlags\0") };
121/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiointerfaceextraflags?language=objc)
122pub const kIOInterfaceExtraFlags: &CStr =
123 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOInterfaceExtraFlags\0") };
124/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiointerfaceunit?language=objc)
125pub const kIOInterfaceUnit: &CStr =
126 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOInterfaceUnit\0") };
127/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiointerfacestate?language=objc)
128pub const kIOInterfaceState: &CStr =
129 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOInterfaceState\0") };
130/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiointerfacenameprefix?language=objc)
131pub const kIOInterfaceNamePrefix: &CStr =
132 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOInterfaceNamePrefix\0") };
133/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioprimaryinterface?language=objc)
134pub const kIOPrimaryInterface: &CStr =
135 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOPrimaryInterface\0") };
136/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiobuiltin?language=objc)
137pub const kIOBuiltin: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOBuiltin\0") };
138/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiolocation?language=objc)
139pub const kIOLocation: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"IOLocation\0") };
140/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworknobsdattachkey?language=objc)
141pub const kIONetworkNoBSDAttachKey: &CStr =
142 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkNoBSDAttach\0") };
143/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkstatskey?language=objc)
144pub const kIONetworkStatsKey: &CStr =
145 unsafe { CStr::from_bytes_with_nul_unchecked(b"IONetworkStatsKey\0") };
146/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiooutputqueuestatskey?language=objc)
147pub const kIOOutputQueueStatsKey: &CStr =
148 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOOutputQueueStatsKey\0") };
149/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetstatskey?language=objc)
150pub const kIOEthernetStatsKey: &CStr =
151 unsafe { CStr::from_bytes_with_nul_unchecked(b"IOEthernetStatsKey\0") };
152/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumtype?language=objc)
153pub const kIOMediumType: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"Type\0") };
154/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumflags?language=objc)
155pub const kIOMediumFlags: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"Flags\0") };
156/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumspeed?language=objc)
157pub const kIOMediumSpeed: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"Speed\0") };
158/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumindex?language=objc)
159pub const kIOMediumIndex: &CStr = unsafe { CStr::from_bytes_with_nul_unchecked(b"Index\0") };
160/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkuserclienttypeid?language=objc)
161pub const kIONetworkUserClientTypeID: c_uint = 0xff000001;
162/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionuctype?language=objc)
163pub const kIONUCType: c_uint = 0xff000001;
164/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiopacketfilterunicast?language=objc)
165pub const kIOPacketFilterUnicast: c_uint = 0x1;
166/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiopacketfilterbroadcast?language=objc)
167pub const kIOPacketFilterBroadcast: c_uint = 0x2;
168/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiopacketfiltermulticast?language=objc)
169pub const kIOPacketFilterMulticast: c_uint = 0x10;
170/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiopacketfiltermulticastall?language=objc)
171pub const kIOPacketFilterMulticastAll: c_uint = 0x20;
172/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiopacketfilterpromiscuous?language=objc)
173pub const kIOPacketFilterPromiscuous: c_uint = 0x100;
174/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiopacketfilterpromiscuousall?language=objc)
175pub const kIOPacketFilterPromiscuousAll: c_uint = 0x200;
176
177/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturenobsdwait?language=objc)
178pub const kIONetworkFeatureNoBSDWait: c_uint = 0x001;
179/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturehardwarevlan?language=objc)
180pub const kIONetworkFeatureHardwareVlan: c_uint = 0x002;
181/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturesoftwarevlan?language=objc)
182pub const kIONetworkFeatureSoftwareVlan: c_uint = 0x004;
183/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturemultipages?language=objc)
184pub const kIONetworkFeatureMultiPages: c_uint = 0x008;
185/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturetsoipv4?language=objc)
186pub const kIONetworkFeatureTSOIPv4: c_uint = 0x010;
187/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturetsoipv6?language=objc)
188pub const kIONetworkFeatureTSOIPv6: c_uint = 0x020;
189/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturetransmitcompletionstatus?language=objc)
190pub const kIONetworkFeatureTransmitCompletionStatus: c_uint = 0x040;
191/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturehwtimestamp?language=objc)
192pub const kIONetworkFeatureHWTimeStamp: c_uint = 0x080;
193/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeatureswtimestamp?language=objc)
194pub const kIONetworkFeatureSWTimeStamp: c_uint = 0x100;
195/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkfeaturelro?language=objc)
196pub const kIONetworkFeatureLRO: c_uint = 0x200;
197
198/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetwakeonmagicpacket?language=objc)
199pub const kIOEthernetWakeOnMagicPacket: c_uint = 0x00000001;
200/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kioethernetwakeonpacketaddressmatch?language=objc)
201pub const kIOEthernetWakeOnPacketAddressMatch: c_uint = 0x00000002;
202
203/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdataaccesstyperead?language=objc)
204pub const kIONetworkDataAccessTypeRead: c_uint = 0x01;
205/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdataaccesstypewrite?language=objc)
206pub const kIONetworkDataAccessTypeWrite: c_uint = 0x02;
207/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdataaccesstypereset?language=objc)
208pub const kIONetworkDataAccessTypeReset: c_uint = 0x04;
209/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdataaccesstypeserialize?language=objc)
210pub const kIONetworkDataAccessTypeSerialize: c_uint = 0x08;
211/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdataaccesstypemask?language=objc)
212pub const kIONetworkDataAccessTypeMask: c_uint = 0xff;
213
214/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdatabuffertypeinternal?language=objc)
215pub const kIONetworkDataBufferTypeInternal: c_uint = 0;
216/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdatabuffertypeexternal?language=objc)
217pub const kIONetworkDataBufferTypeExternal: c_uint = 1;
218/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkdatabuffertypenone?language=objc)
219pub const kIONetworkDataBufferTypeNone: c_uint = 2;
220
221/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkstackregisterinterfacewithunit?language=objc)
222pub const kIONetworkStackRegisterInterfaceWithUnit: c_uint = 0;
223/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkstackregisterinterfacewithlowestunit?language=objc)
224pub const kIONetworkStackRegisterInterfaceWithLowestUnit: c_uint = 1;
225/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkstackregisterinterfaceall?language=objc)
226pub const kIONetworkStackRegisterInterfaceAll: c_uint = 2;
227
228/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkinterfaceregisteredstate?language=objc)
229pub const kIONetworkInterfaceRegisteredState: c_uint = 0x1;
230/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkinterfaceopenedstate?language=objc)
231pub const kIONetworkInterfaceOpenedState: c_uint = 0x2;
232/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworkinterfacedisabledstate?language=objc)
233pub const kIONetworkInterfaceDisabledState: c_uint = 0x4;
234
235/// Generic network statistics structure.
236/// Field: inputPackets count input packets.
237/// Field: inputErrors count input errors.
238/// Field: outputPackets count output packets.
239/// Field: outputErrors count output errors.
240/// Field: collisions count collisions on CDMA networks.
241///
242/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/ionetworkstats?language=objc)
243#[repr(C)]
244#[derive(Clone, Copy, Debug, PartialEq)]
245pub struct IONetworkStats {
246 pub inputPackets: u32,
247 pub inputErrors: u32,
248 pub outputPackets: u32,
249 pub outputErrors: u32,
250 pub collisions: u32,
251}
252
253#[cfg(feature = "objc2")]
254unsafe impl Encode for IONetworkStats {
255 const ENCODING: Encoding = Encoding::Struct(
256 "?",
257 &[
258 <u32>::ENCODING,
259 <u32>::ENCODING,
260 <u32>::ENCODING,
261 <u32>::ENCODING,
262 <u32>::ENCODING,
263 ],
264 );
265}
266
267#[cfg(feature = "objc2")]
268unsafe impl RefEncode for IONetworkStats {
269 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
270}
271
272/// Statistics recorded by IOOutputQueue objects.
273/// Field: capacity queue capacity.
274/// Field: size current size of the queue.
275/// Field: peakSize peak size of the queue.
276/// Field: dropCount number of packets dropped.
277/// Field: outputCount number of output packets.
278/// Field: retryCount number of retries.
279/// Field: stallCount number of queue stalls.
280///
281/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iooutputqueuestats?language=objc)
282#[repr(C)]
283#[derive(Clone, Copy, Debug, PartialEq)]
284pub struct IOOutputQueueStats {
285 pub capacity: u32,
286 pub size: u32,
287 pub peakSize: u32,
288 pub dropCount: u32,
289 pub outputCount: u32,
290 pub retryCount: u32,
291 pub stallCount: u32,
292 pub reserved: [u32; 4],
293}
294
295#[cfg(feature = "objc2")]
296unsafe impl Encode for IOOutputQueueStats {
297 const ENCODING: Encoding = Encoding::Struct(
298 "?",
299 &[
300 <u32>::ENCODING,
301 <u32>::ENCODING,
302 <u32>::ENCODING,
303 <u32>::ENCODING,
304 <u32>::ENCODING,
305 <u32>::ENCODING,
306 <u32>::ENCODING,
307 <[u32; 4]>::ENCODING,
308 ],
309 );
310}
311
312#[cfg(feature = "objc2")]
313unsafe impl RefEncode for IOOutputQueueStats {
314 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
315}
316
317/// Ethernet MIB statistics structure.
318/// Field: alignmentErrors dot3StatsAlignmentErrors.
319/// Field: fcsErrors dot3StatsFCSErrors.
320/// Field: singleCollisionFrames dot3StatsSingleCollisionFrames.
321/// Field: multipleCollisionFrames dot3StatsMultipleCollisionFrames.
322/// Field: sqeTestErrors dot3StatsSQETestErrors.
323/// Field: deferredTransmissions dot3StatsDeferredTransmissions.
324/// Field: lateCollisions dot3StatsLateCollisions.
325/// Field: excessiveCollisions dot3StatsExcessiveCollisions.
326/// Field: internalMacTransmitErrors dot3StatsInternalMacTransmitErrors.
327/// Field: carrierSenseErrors dot3StatsCarrierSenseErrors.
328/// Field: frameTooLongs dot3StatsFrameTooLongs.
329/// Field: internalMacReceiveErrors dot3StatsInternalMacReceiveErrors.
330/// Field: etherChipSet dot3StatsEtherChipSet.
331/// Field: missedFrames dot3StatsMissedFrames (not in RFC1650).
332///
333/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iodot3statsentry?language=objc)
334#[repr(C)]
335#[derive(Clone, Copy, Debug, PartialEq)]
336pub struct IODot3StatsEntry {
337 pub alignmentErrors: u32,
338 pub fcsErrors: u32,
339 pub singleCollisionFrames: u32,
340 pub multipleCollisionFrames: u32,
341 pub sqeTestErrors: u32,
342 pub deferredTransmissions: u32,
343 pub lateCollisions: u32,
344 pub excessiveCollisions: u32,
345 pub internalMacTransmitErrors: u32,
346 pub carrierSenseErrors: u32,
347 pub frameTooLongs: u32,
348 pub internalMacReceiveErrors: u32,
349 pub etherChipSet: u32,
350 pub missedFrames: u32,
351}
352
353#[cfg(feature = "objc2")]
354unsafe impl Encode for IODot3StatsEntry {
355 const ENCODING: Encoding = Encoding::Struct(
356 "?",
357 &[
358 <u32>::ENCODING,
359 <u32>::ENCODING,
360 <u32>::ENCODING,
361 <u32>::ENCODING,
362 <u32>::ENCODING,
363 <u32>::ENCODING,
364 <u32>::ENCODING,
365 <u32>::ENCODING,
366 <u32>::ENCODING,
367 <u32>::ENCODING,
368 <u32>::ENCODING,
369 <u32>::ENCODING,
370 <u32>::ENCODING,
371 <u32>::ENCODING,
372 ],
373 );
374}
375
376#[cfg(feature = "objc2")]
377unsafe impl RefEncode for IODot3StatsEntry {
378 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
379}
380
381/// Collision statistics structure.
382/// Field: collFrequencies dot3StatsCollFrequencies.
383///
384/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iodot3collentry?language=objc)
385#[repr(C)]
386#[derive(Clone, Copy, Debug, PartialEq)]
387pub struct IODot3CollEntry {
388 pub collFrequencies: [u32; 16],
389}
390
391#[cfg(feature = "objc2")]
392unsafe impl Encode for IODot3CollEntry {
393 const ENCODING: Encoding = Encoding::Struct("?", &[<[u32; 16]>::ENCODING]);
394}
395
396#[cfg(feature = "objc2")]
397unsafe impl RefEncode for IODot3CollEntry {
398 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
399}
400
401/// Extra receiver statistics not defined by RFC1650.
402/// Field: overruns receiver overruns.
403/// Field: watchdogTimeouts watchdog timer expirations.
404/// Field: frameTooShorts runt frames.
405/// Field: collisionErrors frames damages by late collision.
406/// Field: phyErrors PHY receive errors.
407/// Field: timeouts receiver timeouts.
408/// Field: interrupts receiver interrupts.
409/// Field: resets receiver resets.
410/// Field: resourceErrors receiver resource shortages.
411///
412/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iodot3rxextraentry?language=objc)
413#[repr(C)]
414#[derive(Clone, Copy, Debug, PartialEq)]
415pub struct IODot3RxExtraEntry {
416 pub overruns: u32,
417 pub watchdogTimeouts: u32,
418 pub frameTooShorts: u32,
419 pub collisionErrors: u32,
420 pub phyErrors: u32,
421 pub timeouts: u32,
422 pub interrupts: u32,
423 pub resets: u32,
424 pub resourceErrors: u32,
425 pub reserved: [u32; 4],
426}
427
428#[cfg(feature = "objc2")]
429unsafe impl Encode for IODot3RxExtraEntry {
430 const ENCODING: Encoding = Encoding::Struct(
431 "?",
432 &[
433 <u32>::ENCODING,
434 <u32>::ENCODING,
435 <u32>::ENCODING,
436 <u32>::ENCODING,
437 <u32>::ENCODING,
438 <u32>::ENCODING,
439 <u32>::ENCODING,
440 <u32>::ENCODING,
441 <u32>::ENCODING,
442 <[u32; 4]>::ENCODING,
443 ],
444 );
445}
446
447#[cfg(feature = "objc2")]
448unsafe impl RefEncode for IODot3RxExtraEntry {
449 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
450}
451
452/// Extra transmitter statistics not defined by RFC1650.
453/// Field: underruns transmit underruns.
454/// Field: jabbers jabber events.
455/// Field: phyErrors PHY transmit errors.
456/// Field: timeouts transmitter timeouts.
457/// Field: interrupts transmitter interrupts.
458/// Field: resets transmitter resets.
459/// Field: resourceErrors transmitter resource shortages.
460///
461/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iodot3txextraentry?language=objc)
462#[repr(C)]
463#[derive(Clone, Copy, Debug, PartialEq)]
464pub struct IODot3TxExtraEntry {
465 pub underruns: u32,
466 pub jabbers: u32,
467 pub phyErrors: u32,
468 pub timeouts: u32,
469 pub interrupts: u32,
470 pub resets: u32,
471 pub resourceErrors: u32,
472 pub reserved: [u32; 4],
473}
474
475#[cfg(feature = "objc2")]
476unsafe impl Encode for IODot3TxExtraEntry {
477 const ENCODING: Encoding = Encoding::Struct(
478 "?",
479 &[
480 <u32>::ENCODING,
481 <u32>::ENCODING,
482 <u32>::ENCODING,
483 <u32>::ENCODING,
484 <u32>::ENCODING,
485 <u32>::ENCODING,
486 <u32>::ENCODING,
487 <[u32; 4]>::ENCODING,
488 ],
489 );
490}
491
492#[cfg(feature = "objc2")]
493unsafe impl RefEncode for IODot3TxExtraEntry {
494 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
495}
496
497/// Aggregate Ethernet statistics structure.
498/// Field: dot3StatsEntry IODot3StatsEntry statistics group.
499/// Field: dot3CollEntry IODot3CollEntry statistics group.
500/// Field: dot3RxExtraEntry IODot3RxExtraEntry statistics group.
501/// Field: dot3TxExtraEntry IODot3TxExtraEntry statistics group.
502///
503/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/ioethernetstats?language=objc)
504#[repr(C)]
505#[derive(Clone, Copy, Debug, PartialEq)]
506pub struct IOEthernetStats {
507 pub dot3StatsEntry: IODot3StatsEntry,
508 pub dot3CollEntry: IODot3CollEntry,
509 pub dot3RxExtraEntry: IODot3RxExtraEntry,
510 pub dot3TxExtraEntry: IODot3TxExtraEntry,
511}
512
513#[cfg(feature = "objc2")]
514unsafe impl Encode for IOEthernetStats {
515 const ENCODING: Encoding = Encoding::Struct(
516 "?",
517 &[
518 <IODot3StatsEntry>::ENCODING,
519 <IODot3CollEntry>::ENCODING,
520 <IODot3RxExtraEntry>::ENCODING,
521 <IODot3TxExtraEntry>::ENCODING,
522 ],
523 );
524}
525
526#[cfg(feature = "objc2")]
527unsafe impl RefEncode for IOEthernetStats {
528 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
529}
530
531/// A 32-bit value divided into fields which describes
532/// a single medium type.
533///
534/// See also [Apple's documentation](https://developer.apple.com/documentation/iokit/iomediumtype?language=objc)
535pub type IOMediumType = u32;
536
537/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet?language=objc)
538pub const kIOMediumEthernet: c_uint = 32;
539/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernetauto?language=objc)
540pub const kIOMediumEthernetAuto: c_uint = 32;
541/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernetmanual?language=objc)
542pub const kIOMediumEthernetManual: c_uint = 33;
543/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernetnone?language=objc)
544pub const kIOMediumEthernetNone: c_uint = 34;
545/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10baset?language=objc)
546pub const kIOMediumEthernet10BaseT: c_uint = 35;
547/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10base2?language=objc)
548pub const kIOMediumEthernet10Base2: c_uint = 36;
549/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10base5?language=objc)
550pub const kIOMediumEthernet10Base5: c_uint = 37;
551/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet100basetx?language=objc)
552pub const kIOMediumEthernet100BaseTX: c_uint = 38;
553/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet100basefx?language=objc)
554pub const kIOMediumEthernet100BaseFX: c_uint = 39;
555/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet100baset4?language=objc)
556pub const kIOMediumEthernet100BaseT4: c_uint = 40;
557/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet100basevg?language=objc)
558pub const kIOMediumEthernet100BaseVG: c_uint = 41;
559/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet100baset2?language=objc)
560pub const kIOMediumEthernet100BaseT2: c_uint = 42;
561/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet1000basesx?language=objc)
562pub const kIOMediumEthernet1000BaseSX: c_uint = 43;
563/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10basestp?language=objc)
564pub const kIOMediumEthernet10BaseSTP: c_uint = 44;
565/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10basefl?language=objc)
566pub const kIOMediumEthernet10BaseFL: c_uint = 45;
567/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet1000baselx?language=objc)
568pub const kIOMediumEthernet1000BaseLX: c_uint = 46;
569/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet1000basecx?language=objc)
570pub const kIOMediumEthernet1000BaseCX: c_uint = 47;
571/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet1000basetx?language=objc)
572pub const kIOMediumEthernet1000BaseTX: c_uint = 48;
573/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet1000baset?language=objc)
574pub const kIOMediumEthernet1000BaseT: c_uint = 48;
575/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernethomepna1?language=objc)
576pub const kIOMediumEthernetHomePNA1: c_uint = 49;
577/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10gbasesr?language=objc)
578pub const kIOMediumEthernet10GBaseSR: c_uint = 50;
579/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10gbaselr?language=objc)
580pub const kIOMediumEthernet10GBaseLR: c_uint = 51;
581/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10gbasecx4?language=objc)
582pub const kIOMediumEthernet10GBaseCX4: c_uint = 52;
583/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet10gbaset?language=objc)
584pub const kIOMediumEthernet10GBaseT: c_uint = 53;
585/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet2500baset?language=objc)
586pub const kIOMediumEthernet2500BaseT: c_uint = 54;
587/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumethernet5000baset?language=objc)
588pub const kIOMediumEthernet5000BaseT: c_uint = 55;
589
590/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211?language=objc)
591pub const kIOMediumIEEE80211: c_uint = 128;
592/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211auto?language=objc)
593pub const kIOMediumIEEE80211Auto: c_uint = 128;
594/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211manual?language=objc)
595pub const kIOMediumIEEE80211Manual: c_uint = 129;
596/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211none?language=objc)
597pub const kIOMediumIEEE80211None: c_uint = 130;
598/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211fh1?language=objc)
599pub const kIOMediumIEEE80211FH1: c_uint = 131;
600/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211fh2?language=objc)
601pub const kIOMediumIEEE80211FH2: c_uint = 132;
602/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211ds2?language=objc)
603pub const kIOMediumIEEE80211DS2: c_uint = 133;
604/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211ds5?language=objc)
605pub const kIOMediumIEEE80211DS5: c_uint = 134;
606/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211ds11?language=objc)
607pub const kIOMediumIEEE80211DS11: c_uint = 135;
608/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211ds1?language=objc)
609pub const kIOMediumIEEE80211DS1: c_uint = 136;
610/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumieee80211optionadhoc?language=objc)
611pub const kIOMediumIEEE80211OptionAdhoc: c_uint = 256;
612
613/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptionfullduplex?language=objc)
614pub const kIOMediumOptionFullDuplex: c_uint = 1048576;
615/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptionhalfduplex?language=objc)
616pub const kIOMediumOptionHalfDuplex: c_uint = 2097152;
617/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptionflowcontrol?language=objc)
618pub const kIOMediumOptionFlowControl: c_uint = 4194304;
619/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptioneee?language=objc)
620pub const kIOMediumOptionEEE: c_uint = 8388608;
621/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptionflag0?language=objc)
622pub const kIOMediumOptionFlag0: c_uint = 16777216;
623/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptionflag1?language=objc)
624pub const kIOMediumOptionFlag1: c_uint = 33554432;
625/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptionflag2?language=objc)
626pub const kIOMediumOptionFlag2: c_uint = 67108864;
627/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kiomediumoptionloopback?language=objc)
628pub const kIOMediumOptionLoopback: c_uint = 134217728;
629
630/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworklinkvalid?language=objc)
631pub const kIONetworkLinkValid: c_uint = 1;
632/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworklinkactive?language=objc)
633pub const kIONetworkLinkActive: c_uint = 2;
634/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworklinknonetworkchange?language=objc)
635pub const kIONetworkLinkNoNetworkChange: c_uint = 4;
636
637/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionucresetnetworkdataindex?language=objc)
638pub const kIONUCResetNetworkDataIndex: c_uint = 0;
639/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionucwritenetworkdataindex?language=objc)
640pub const kIONUCWriteNetworkDataIndex: c_uint = 1;
641/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionucreadnetworkdataindex?language=objc)
642pub const kIONUCReadNetworkDataIndex: c_uint = 2;
643/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionucgetnetworkdatacapacityindex?language=objc)
644pub const kIONUCGetNetworkDataCapacityIndex: c_uint = 3;
645/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionucgetnetworkdatahandleindex?language=objc)
646pub const kIONUCGetNetworkDataHandleIndex: c_uint = 4;
647/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionuclastindex?language=objc)
648pub const kIONUCLastIndex: c_uint = 5;
649
650/// [Apple's documentation](https://developer.apple.com/documentation/iokit/iondhandle?language=objc)
651pub type IONDHandle = u32;
652
653extern "C-unwind" {
654 /// Open a connection to an IONetworkInterface object.
655 /// An IONetworkUserClient object is created to manage the connection.
656 ///
657 /// # Safety
658 ///
659 /// `con` must be a valid pointer.
660 #[cfg(feature = "libc")]
661 pub fn IONetworkOpen(obj: io_object_t, con: *mut io_connect_t) -> IOReturn;
662}
663
664/// Close the connection to an IONetworkInterface object.
665#[cfg(feature = "libc")]
666#[inline]
667pub extern "C-unwind" fn IONetworkClose(con: io_connect_t) -> IOReturn {
668 extern "C-unwind" {
669 fn IONetworkClose(con: io_connect_t) -> IOReturn;
670 }
671 unsafe { IONetworkClose(con) }
672}
673
674extern "C-unwind" {
675 /// Write to the buffer of a network data object.
676 ///
677 /// Parameter `conObj`: The connection object.
678 ///
679 /// Parameter `dataHandle`: The handle of a network data object.
680 ///
681 /// Parameter `srcBuf`: The data to write is taken from this buffer.
682 ///
683 /// Parameter `inSize`: The size of the source buffer.
684 ///
685 /// Returns: kIOReturnSuccess on success, or an error code otherwise.
686 ///
687 /// # Safety
688 ///
689 /// `src_buf` must be a valid pointer.
690 #[cfg(feature = "libc")]
691 pub fn IONetworkWriteData(
692 con_obj: io_connect_t,
693 data_handle: IONDHandle,
694 src_buf: *mut u8,
695 in_size: u32,
696 ) -> IOReturn;
697}
698
699extern "C-unwind" {
700 /// Read the buffer of a network data object.
701 ///
702 /// Parameter `conObj`: The connection object.
703 ///
704 /// Parameter `dataHandle`: The handle of a network data object.
705 ///
706 /// Parameter `destBuf`: The buffer where the data read shall be written to.
707 ///
708 /// Parameter `inOutSizeP`: Pointer to an integer that the caller must initialize
709 /// to contain the size of the buffer. This function will overwrite
710 /// it with the actual number of bytes written to the buffer.
711 ///
712 /// Returns: kIOReturnSuccess on success, or an error code otherwise.
713 ///
714 /// # Safety
715 ///
716 /// - `dest_buf` must be a valid pointer.
717 /// - `in_out_size_p` must be a valid pointer.
718 #[cfg(feature = "libc")]
719 pub fn IONetworkReadData(
720 con_obj: io_connect_t,
721 data_handle: IONDHandle,
722 dest_buf: *mut u8,
723 in_out_size_p: *mut u32,
724 ) -> IOReturn;
725}
726
727/// Fill the buffer of a network data object with zeroes.
728///
729/// Parameter `conObject`: The connection object.
730///
731/// Parameter `dataHandle`: The handle of a network data object.
732///
733/// Returns: kIOReturnSuccess on success, or an error code otherwise.
734#[cfg(feature = "libc")]
735#[inline]
736pub extern "C-unwind" fn IONetworkResetData(
737 con_object: io_connect_t,
738 data_handle: IONDHandle,
739) -> IOReturn {
740 extern "C-unwind" {
741 fn IONetworkResetData(con_object: io_connect_t, data_handle: IONDHandle) -> IOReturn;
742 }
743 unsafe { IONetworkResetData(con_object, data_handle) }
744}
745
746extern "C-unwind" {
747 /// Get the capacity (in bytes) of a network data object.
748 ///
749 /// Parameter `conObject`: The connection object.
750 ///
751 /// Parameter `dataHandle`: The handle of a network data object.
752 ///
753 /// Parameter `capacityP`: Upon success, the capacity is written to this address.
754 ///
755 /// Returns: kIOReturnSuccess on success, or an error code otherwise.
756 ///
757 /// # Safety
758 ///
759 /// `capacity_p` must be a valid pointer.
760 #[cfg(feature = "libc")]
761 pub fn IONetworkGetDataCapacity(
762 con_object: io_connect_t,
763 data_handle: IONDHandle,
764 capacity_p: *mut u32,
765 ) -> IOReturn;
766}
767
768extern "C-unwind" {
769 /// Get the handle of a network data object with the given name.
770 ///
771 /// Parameter `conObject`: The connection object.
772 ///
773 /// Parameter `dataName`: The name of the network data object.
774 ///
775 /// Parameter `dataHandleP`: Upon success, the handle is written to this address.
776 ///
777 /// Returns: kIOReturnSuccess on success, or an error code otherwise.
778 ///
779 /// # Safety
780 ///
781 /// - `data_name` must be a valid pointer.
782 /// - `data_handle_p` must be a valid pointer.
783 #[cfg(feature = "libc")]
784 pub fn IONetworkGetDataHandle(
785 con_object: io_connect_t,
786 data_name: *const c_char,
787 data_handle_p: *mut IONDHandle,
788 ) -> IOReturn;
789}
790
791extern "C-unwind" {
792 /// Set the packet filters for a given filter group.
793 ///
794 /// A network controller may support a number of packets filters
795 /// that can accept or reject a type of packet seen on the network. A filter
796 /// group identifies a set of related filters, such as all filters that will
797 /// allow a packet to pass upstream based on the destination address encoded
798 /// within the packet. This function allows an user-space program to set the
799 /// filtering performed by a given filter group.
800 ///
801 /// Parameter `connect`: The connection object returned from IONetworkOpen().
802 ///
803 /// Parameter `filterGroup`: The name of the packet filter group.
804 ///
805 /// Parameter `filtersMask`: A mask of filters to set.
806 ///
807 /// Parameter `options`: No options are currently defined.
808 ///
809 /// Returns: An IOReturn error code.
810 ///
811 /// # Safety
812 ///
813 /// `filter_group` Array TODO.
814 #[cfg(feature = "libc")]
815 pub fn IONetworkSetPacketFiltersMask(
816 connect: io_connect_t,
817 filter_group: io_name_t,
818 filters_mask: u32,
819 options: IOOptionBits,
820 ) -> IOReturn;
821}
822
823/// [Apple's documentation](https://developer.apple.com/documentation/iokit/kionetworksupportedpacketfilters?language=objc)
824pub const kIONetworkSupportedPacketFilters: c_uint = 0x0001;
825
826extern "C-unwind" {
827 /// Get the packet filters for a given filter group.
828 ///
829 /// A network controller may support a number of packets filters
830 /// that can accept or reject a type of packet seen on the network. A filter
831 /// group identifies a set of related filters, such as all filters that will
832 /// allow a packet to pass upstream based on the destination address encoded
833 /// within the packet. This function allows an user-space program to get the
834 /// filtering performed by a given filter group.
835 ///
836 /// Parameter `connect`: The connection object returned from IONetworkOpen().
837 ///
838 /// Parameter `filterGroup`: The name of the packet filter group.
839 ///
840 /// Parameter `filtersMask`: Pointer to the return value containing a mask of
841 /// packet filters.
842 ///
843 /// Parameter `options`: kIONetworkSupportedPacketFilters may be set to fetch the
844 /// filters that are supported by the hardware.
845 ///
846 /// Returns: An IOReturn error code.
847 ///
848 /// # Safety
849 ///
850 /// - `filter_group` Array TODO.
851 /// - `filters_mask` must be a valid pointer.
852 #[cfg(feature = "libc")]
853 pub fn IONetworkGetPacketFiltersMask(
854 connect: io_connect_t,
855 filter_group: io_name_t,
856 filters_mask: *mut u32,
857 options: IOOptionBits,
858 ) -> IOReturn;
859}