pub const lifreq = extern struct ifrn: extern union { /// Interface name, e.g. "lo0", "en0". name: [IFNAMESIZE]u8, }Not actually in a union, but the stdlib expects one for ifreq
ru1: extern union { /// For subnet/token etc. addrlen: i32, /// Driver's PPA (physical point of attachment). ppa: u32, }type: u32One of the IFT types, e.g. IFT_ETHER.
ifru: extern union { /// Address. addr: sockaddr.storage, /// Other end of a peer-to-peer link. dstaddr: sockaddr.storage, /// Broadcast address. broadaddr: sockaddr.storage, /// Address token. token: sockaddr.storage, /// Subnet prefix. subnet: sockaddr.storage, /// Interface index. ivalue: i32, /// Flags for SIOC?LIFFLAGS. flags: u64, /// Hop count metric metric: i32, /// Maximum transmission unit mtu: u32, // Technically [2]i32 muxid: packed struct(u64) { ip: i32, arp: i32 }, /// Neighbor reachability determination entries nd_req: lif_nd_req, /// Link info ifinfo_req: lif_ifinfo_req, /// Name of the multipath interface group groupname: [IFNAMESIZE]u8, binding: [IFNAMESIZE]u8, /// Zone id associated with this interface. zoneid: zoneid_t, /// Duplicate address detection state. Either in progress or completed. dadstate: u32, }266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313pub const lifreq = extern struct {
// Not actually in a union, but the stdlib expects one for ifreq
ifrn: extern union {
/// Interface name, e.g. "lo0", "en0".
name: [IFNAMESIZE]u8,
},
ru1: extern union {
/// For subnet/token etc.
addrlen: i32,
/// Driver's PPA (physical point of attachment).
ppa: u32,
},
/// One of the IFT types, e.g. IFT_ETHER.
type: u32,
ifru: extern union {
/// Address.
addr: sockaddr.storage,
/// Other end of a peer-to-peer link.
dstaddr: sockaddr.storage,
/// Broadcast address.
broadaddr: sockaddr.storage,
/// Address token.
token: sockaddr.storage,
/// Subnet prefix.
subnet: sockaddr.storage,
/// Interface index.
ivalue: i32,
/// Flags for SIOC?LIFFLAGS.
flags: u64,
/// Hop count metric
metric: i32,
/// Maximum transmission unit
mtu: u32,
// Technically [2]i32
muxid: packed struct(u64) { ip: i32, arp: i32 },
/// Neighbor reachability determination entries
nd_req: lif_nd_req,
/// Link info
ifinfo_req: lif_ifinfo_req,
/// Name of the multipath interface group
groupname: [IFNAMESIZE]u8,
binding: [IFNAMESIZE]u8,
/// Zone id associated with this interface.
zoneid: zoneid_t,
/// Duplicate address detection state. Either in progress or completed.
dadstate: u32,
},
}
IP interface request. See if_tcp(7p) for more info.