Skip to content

Commit 19cc1bc

Browse files
committed
Add PF_ROUTE structures on Apple systems
This commit adds the following structures from net/route.h: - rt_msghdr - rt_msghdr2 - rt_metrics and the following structures from net/if.h: - ifa_msghdr - ifma_msghdr - ifma_msghdr2
1 parent 8077351 commit 19cc1bc

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,77 @@ s! {
435435
pub ifm_data: if_data,
436436
}
437437

438+
pub struct ifa_msghdr {
439+
pub ifam_msglen: ::c_ushort,
440+
pub ifam_version: ::c_uchar,
441+
pub ifam_type: ::c_uchar,
442+
pub ifam_addrs: ::c_int,
443+
pub ifam_flags: ::c_int,
444+
pub ifam_index: ::c_ushort,
445+
pub ifam_metric: ::c_int,
446+
}
447+
448+
pub struct ifma_msghdr {
449+
pub ifmam_msglen: ::c_ushort,
450+
pub ifmam_version: ::c_uchar,
451+
pub ifmam_type: ::c_uchar,
452+
pub ifmam_addrs: ::c_int,
453+
pub ifmam_flags: ::c_int,
454+
pub ifmam_index: ::c_ushort,
455+
}
456+
457+
pub struct ifma_msghdr2 {
458+
pub ifmam_msglen: ::c_ushort,
459+
pub ifmam_version: ::c_uchar,
460+
pub ifmam_type: ::c_uchar,
461+
pub ifmam_addrs: ::c_int,
462+
pub ifmam_flags: ::c_int,
463+
pub ifmam_index: ::c_ushort,
464+
pub ifmam_refcount: i32,
465+
}
466+
467+
pub struct rt_metrics {
468+
pub rmx_locks: c_ulong,
469+
pub rmx_mtu: c_ulong,
470+
pub rmx_hopcount: c_ulong,
471+
pub rmx_expire: c_ulong,
472+
pub rmx_recvpipe: c_ulong,
473+
pub rmx_sendpipe: c_ulong,
474+
pub rmx_ssthresh: c_ulong,
475+
pub rmx_rtt: c_ulong,
476+
pub rmx_rttvar: c_ulong,
477+
}
478+
479+
pub struct rt_msghdr {
480+
pub rtm_msglen: ::c_ushort,
481+
pub rtm_version: ::c_uchar,
482+
pub rtm_type: ::c_uchar,
483+
pub rtm_index: ::c_ushort,
484+
pub rtm_pid: ::pid_t,
485+
pub rtm_addrs: ::c_int,
486+
pub rtm_seq: ::c_int,
487+
pub rtm_errno: ::c_int,
488+
pub rtm_flags: ::c_int,
489+
pub rtm_use: ::c_int,
490+
pub rtm_inits: ::c_ulong,
491+
pub rtm_rmx: rt_metrics,
492+
}
493+
494+
pub struct rt_msghdr2 {
495+
pub rtm_msglen: ::c_ushort,
496+
pub rtm_version: ::c_uchar,
497+
pub rtm_type: ::c_uchar,
498+
pub rtm_index: ::c_ushort,
499+
pub rtm_flags: ::c_int,
500+
pub rtm_addrs: ::c_int,
501+
pub rtm_refcnt: i32,
502+
pub rtm_parentflags: ::c_int,
503+
pub rtm_reserved: ::c_int,
504+
pub rtm_use: ::c_int,
505+
pub rtm_inits: u32,
506+
pub rtm_rmx: rt_metrics,
507+
}
508+
438509
pub struct termios {
439510
pub c_iflag: ::tcflag_t,
440511
pub c_oflag: ::tcflag_t,

0 commit comments

Comments
 (0)