Add netlink/genetlink structs to notbsd

This commit is contained in:
Linus Färnstrand 2018-02-21 13:59:34 +01:00
parent 88c33d4580
commit 6e211cdf61
4 changed files with 126 additions and 0 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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;