diff options
author | bors <bors@rust-lang.org> | 2022-08-21 23:49:09 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2022-08-21 23:49:09 +0000 |
commit | 7c04c757949f70a24b7f055b47dadf6e85442c3d (patch) | |
tree | f6dac9cd97da10847eb20d72460cc4ea43b7f093 /src | |
parent | 9358dbf672e18fea085e1851396a655c9f5d96a0 (diff) | |
parent | 5d42e0a19feeeaa1b6f62e399023fcff021e23f9 (diff) | |
download | rust-libc-7c04c757949f70a24b7f055b47dadf6e85442c3d.tar.gz |
Auto merge of #2882 - devnexen:eui64_fbsd, r=JohnTitor
IEEE EUI-64 callss for freebsd/dragonflybsd.
Diffstat (limited to 'src')
-rw-r--r-- | src/unix/bsd/freebsdlike/mod.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs index b314b68568..3bf083c5ca 100644 --- a/src/unix/bsd/freebsdlike/mod.rs +++ b/src/unix/bsd/freebsdlike/mod.rs @@ -376,6 +376,10 @@ s! { pub seq: ::c_ushort, pub key: ::key_t, } + + pub struct eui64 { + pub octet: [u8; EUI64_LEN], + } } s_no_extra_traits! { @@ -1329,6 +1333,8 @@ pub const ONLRET: ::tcflag_t = 0x40; pub const CMGROUP_MAX: usize = 16; +pub const EUI64_LEN: usize = 8; + // https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h pub const BPF_ALIGNMENT: usize = SIZEOF_LONG; @@ -1720,6 +1726,11 @@ extern "C" { pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int; pub fn gethostid() -> ::c_long; pub fn sethostid(hostid: ::c_long); + + pub fn eui64_aton(a: *const ::c_char, e: *mut eui64) -> ::c_int; + pub fn eui64_ntoa(id: *const eui64, a: *mut ::c_char, len: ::size_t) -> ::c_int; + pub fn eui64_ntohost(hostname: *mut ::c_char, len: ::size_t, id: *const eui64) -> ::c_int; + pub fn eui64_hostton(hostname: *const ::c_char, id: *mut eui64) -> ::c_int; } #[link(name = "rt")] |