Skip to content

Commit 404ad40

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 404ad40

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,80 @@ 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: u32,
469+
pub rmx_mtu: u32,
470+
pub rmx_hopcount: u32,
471+
pub rmx_expire: i32,
472+
pub rmx_recvpipe: u32,
473+
pub rmx_sendpipe: u32,
474+
pub rmx_ssthresh: u32,
475+
pub rmx_rtt: u32,
476+
pub rmx_rttvar: u32,
477+
pub rmx_pksent: u32,
478+
pub rmx_state: u32,
479+
pub rmx_filler: [u32; 3],
480+
}
481+
482+
pub struct rt_msghdr {
483+
pub rtm_msglen: ::c_ushort,
484+
pub rtm_version: ::c_uchar,
485+
pub rtm_type: ::c_uchar,
486+
pub rtm_index: ::c_ushort,
487+
pub rtm_flags: ::c_int,
488+
pub rtm_addrs: ::c_int,
489+
pub rtm_pid: ::pid_t,
490+
pub rtm_seq: ::c_int,
491+
pub rtm_errno: ::c_int,
492+
pub rtm_use: ::c_int,
493+
pub rtm_inits: u32,
494+
pub rtm_rmx: rt_metrics,
495+
}
496+
497+
pub struct rt_msghdr2 {
498+
pub rtm_msglen: ::c_ushort,
499+
pub rtm_version: ::c_uchar,
500+
pub rtm_type: ::c_uchar,
501+
pub rtm_index: ::c_ushort,
502+
pub rtm_flags: ::c_int,
503+
pub rtm_addrs: ::c_int,
504+
pub rtm_refcnt: i32,
505+
pub rtm_parentflags: ::c_int,
506+
pub rtm_reserved: ::c_int,
507+
pub rtm_use: ::c_int,
508+
pub rtm_inits: u32,
509+
pub rtm_rmx: rt_metrics,
510+
}
511+
438512
pub struct termios {
439513
pub c_iflag: ::tcflag_t,
440514
pub c_oflag: ::tcflag_t,

0 commit comments

Comments
 (0)