diff options
author | Linus Färnstrand <linus@mullvad.net> | 2018-02-21 13:59:34 +0100 |
---|---|---|
committer | Linus Färnstrand <linus@mullvad.net> | 2018-02-22 14:58:10 +0100 |
commit | 6e211cdf61e1de332b97f73c7750b248f7deb2ed (patch) | |
tree | 0b32d4d442779465c63605c80e55dc2a45a96f48 | |
parent | 88c33d45800b2bc869dba4a449857c17a1a2be32 (diff) | |
download | rust-libc-6e211cdf61e1de332b97f73c7750b248f7deb2ed.tar.gz |
Add netlink/genetlink structs to notbsd
-rw-r--r-- | src/unix/notbsd/android/mod.rs | 44 | ||||
-rw-r--r-- | src/unix/notbsd/linux/mips/mod.rs | 38 | ||||
-rw-r--r-- | src/unix/notbsd/linux/mod.rs | 6 | ||||
-rw-r--r-- | src/unix/notbsd/linux/other/mod.rs | 38 |
4 files changed, 126 insertions, 0 deletions
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs index cf7a07809d..b735b3662f 100644 --- a/src/unix/notbsd/android/mod.rs +++ b/src/unix/notbsd/android/mod.rs @@ -185,6 +185,50 @@ s! { pub uid: ::uid_t, pub gid: ::gid_t, } + + pub struct genlmsghdr { + cmd: u8, + version: u8, + reserved: u16, + } + + pub struct nlmsghdr { + nlmsg_len: u32, + nlmsg_type: u16, + nlmsg_flags: u16, + nlmsg_seq: u32, + nlmsg_pid: u32, + } + + pub struct nlmsgerr { + error: ::c_int, + msg: nlmsghdr, + } + + pub struct nl_pktinfo { + group: u32, + } + + pub struct nl_mmap_req { + nm_block_size: ::c_uint, + nm_block_nr: ::c_uint, + nm_frame_size: ::c_uint, + nm_frame_nr: ::c_uint, + } + + pub struct nl_mmap_hdr { + nm_status: ::c_uint, + nm_len: ::c_uint, + nm_group: u32, + nm_pid: u32, + nm_uid: u32, + nm_gid: u32, + } + + pub struct nlattr { + nla_len: u16, + nla_type: u16, + } } pub const O_TRUNC: ::c_int = 512; diff --git a/src/unix/notbsd/linux/mips/mod.rs b/src/unix/notbsd/linux/mips/mod.rs index 15fdb5007c..f4bed915fd 100644 --- a/src/unix/notbsd/linux/mips/mod.rs +++ b/src/unix/notbsd/linux/mips/mod.rs @@ -39,6 +39,44 @@ s! { pub c_ispeed: ::speed_t, pub c_ospeed: ::speed_t, } + + pub struct nlmsghdr { + nlmsg_len: u32, + nlmsg_type: u16, + nlmsg_flags: u16, + nlmsg_seq: u32, + nlmsg_pid: u32, + } + + pub struct nlmsgerr { + error: ::c_int, + msg: nlmsghdr, + } + + pub struct nl_pktinfo { + group: u32, + } + + pub struct nl_mmap_req { + nm_block_size: ::c_uint, + nm_block_nr: ::c_uint, + nm_frame_size: ::c_uint, + nm_frame_nr: ::c_uint, + } + + pub struct nl_mmap_hdr { + nm_status: ::c_uint, + nm_len: ::c_uint, + nm_group: u32, + nm_pid: u32, + nm_uid: u32, + nm_gid: u32, + } + + pub struct nlattr { + nla_len: u16, + nla_type: u16, + } } pub const SFD_CLOEXEC: ::c_int = 0x080000; diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index cb78ee6791..16bedaca62 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -483,6 +483,12 @@ s! { __policy: ::c_int, __pad: [::c_int; 16], } + + pub struct genlmsghdr { + cmd: u8, + version: u8, + reserved: u16, + } } pub const ABDAY_1: ::nl_item = 0x20000; diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs index a94dcb2875..5fcfa3ada6 100644 --- a/src/unix/notbsd/linux/other/mod.rs +++ b/src/unix/notbsd/linux/other/mod.rs @@ -178,6 +178,44 @@ s! { pub fordblks: ::c_int, pub keepcost: ::c_int, } + + pub struct nlmsghdr { + nlmsg_len: u32, + nlmsg_type: u16, + nlmsg_flags: u16, + nlmsg_seq: u32, + nlmsg_pid: u32, + } + + pub struct nlmsgerr { + error: ::c_int, + msg: nlmsghdr, + } + + pub struct nl_pktinfo { + group: u32, + } + + pub struct nl_mmap_req { + nm_block_size: ::c_uint, + nm_block_nr: ::c_uint, + nm_frame_size: ::c_uint, + nm_frame_nr: ::c_uint, + } + + pub struct nl_mmap_hdr { + nm_status: ::c_uint, + nm_len: ::c_uint, + nm_group: u32, + nm_pid: u32, + nm_uid: u32, + nm_gid: u32, + } + + pub struct nlattr { + nla_len: u16, + nla_type: u16, + } } pub const __UT_LINESIZE: usize = 32; |