summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroblabla <unfiltered@roblab.la>2023-04-18 23:51:02 +0200
committerroblabla <unfiltered@roblab.la>2023-04-25 17:15:19 +0200
commit404ad403297c56a996b4cea118927e27657cb728 (patch)
treef2a73e4da13a3e689ad48e3cb7b89e1fa6f361ce
parent8077351f4b28a1b9fc46e2ac11a530d782264273 (diff)
downloadrust-libc-404ad403297c56a996b4cea118927e27657cb728.tar.gz
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
-rw-r--r--src/unix/bsd/apple/mod.rs74
1 files changed, 74 insertions, 0 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 3348a7a8af..e380000038 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -435,6 +435,80 @@ s! {
pub ifm_data: if_data,
}
+ pub struct ifa_msghdr {
+ pub ifam_msglen: ::c_ushort,
+ pub ifam_version: ::c_uchar,
+ pub ifam_type: ::c_uchar,
+ pub ifam_addrs: ::c_int,
+ pub ifam_flags: ::c_int,
+ pub ifam_index: ::c_ushort,
+ pub ifam_metric: ::c_int,
+ }
+
+ pub struct ifma_msghdr {
+ pub ifmam_msglen: ::c_ushort,
+ pub ifmam_version: ::c_uchar,
+ pub ifmam_type: ::c_uchar,
+ pub ifmam_addrs: ::c_int,
+ pub ifmam_flags: ::c_int,
+ pub ifmam_index: ::c_ushort,
+ }
+
+ pub struct ifma_msghdr2 {
+ pub ifmam_msglen: ::c_ushort,
+ pub ifmam_version: ::c_uchar,
+ pub ifmam_type: ::c_uchar,
+ pub ifmam_addrs: ::c_int,
+ pub ifmam_flags: ::c_int,
+ pub ifmam_index: ::c_ushort,
+ pub ifmam_refcount: i32,
+ }
+
+ pub struct rt_metrics {
+ pub rmx_locks: u32,
+ pub rmx_mtu: u32,
+ pub rmx_hopcount: u32,
+ pub rmx_expire: i32,
+ pub rmx_recvpipe: u32,
+ pub rmx_sendpipe: u32,
+ pub rmx_ssthresh: u32,
+ pub rmx_rtt: u32,
+ pub rmx_rttvar: u32,
+ pub rmx_pksent: u32,
+ pub rmx_state: u32,
+ pub rmx_filler: [u32; 3],
+ }
+
+ pub struct rt_msghdr {
+ pub rtm_msglen: ::c_ushort,
+ pub rtm_version: ::c_uchar,
+ pub rtm_type: ::c_uchar,
+ pub rtm_index: ::c_ushort,
+ pub rtm_flags: ::c_int,
+ pub rtm_addrs: ::c_int,
+ pub rtm_pid: ::pid_t,
+ pub rtm_seq: ::c_int,
+ pub rtm_errno: ::c_int,
+ pub rtm_use: ::c_int,
+ pub rtm_inits: u32,
+ pub rtm_rmx: rt_metrics,
+ }
+
+ pub struct rt_msghdr2 {
+ pub rtm_msglen: ::c_ushort,
+ pub rtm_version: ::c_uchar,
+ pub rtm_type: ::c_uchar,
+ pub rtm_index: ::c_ushort,
+ pub rtm_flags: ::c_int,
+ pub rtm_addrs: ::c_int,
+ pub rtm_refcnt: i32,
+ pub rtm_parentflags: ::c_int,
+ pub rtm_reserved: ::c_int,
+ pub rtm_use: ::c_int,
+ pub rtm_inits: u32,
+ pub rtm_rmx: rt_metrics,
+ }
+
pub struct termios {
pub c_iflag: ::tcflag_t,
pub c_oflag: ::tcflag_t,