add rtentry

This commit is contained in:
Andrew Cann 2018-05-31 12:38:50 +08:00
parent 6578c7c7d1
commit 651d6feafe
2 changed files with 22 additions and 0 deletions

View File

@ -84,6 +84,7 @@ fn main() {
cfg.header("sys/socket.h");
}
cfg.header("net/if.h");
cfg.header("net/route.h");
cfg.header("netdb.h");
cfg.header("netinet/in.h");
cfg.header("netinet/ip.h");

View File

@ -184,6 +184,27 @@ s! {
pub p_aliases: *mut *mut ::c_char,
pub p_proto: ::c_int,
}
pub struct rtentry {
pub rt_pad1: ::c_ulong,
pub rt_dst: ::sockaddr,
pub rt_gateway: ::sockaddr,
pub rt_genmask: ::sockaddr,
pub rt_flags: ::c_ushort,
pub rt_pad2: ::c_short,
pub rt_pad3: ::c_ulong,
pub rt_tos: ::c_uchar,
pub rt_class: ::c_uchar,
#[cfg(target_pointer_width = "64")]
pub rt_pad4: [::c_short; 3usize],
#[cfg(not(target_pointer_width = "64"))]
pub rt_pad4: ::c_short,
pub rt_metric: ::c_short,
pub rt_dev: *mut ::c_char,
pub rt_mtu: ::c_ulong,
pub rt_window: ::c_ulong,
pub rt_irtt: ::c_ushort,
}
}
pub const SIG_DFL: sighandler_t = 0 as sighandler_t;