Skip to content

IEEE EUI-64 callss for freebsd/dragonflybsd. #2882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,7 @@ fn test_dragonflybsd(target: &str) {
"sys/file.h",
"sys/ioctl.h",
"sys/cpuctl.h",
"sys/eui64.h",
"sys/ipc.h",
"sys/kinfo.h",
"sys/ktrace.h",
Expand Down Expand Up @@ -1889,6 +1890,7 @@ fn test_freebsd(target: &str) {
"sys/auxv.h",
"sys/cpuset.h",
"sys/domainset.h",
"sys/eui64.h",
"sys/event.h",
[freebsd13]:"sys/eventfd.h",
"sys/extattr.h",
Expand Down
4 changes: 4 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,10 @@ endgrent
endpwent
endservent
endutxent
eui64_aton
eui64_hostton
eui64_ntoa
eui64_ntohost
exit_status
explicit_bzero
faccessat
Expand Down
4 changes: 4 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,10 @@ endpwent
endservent
endutxent
erand48
eui64_aton
eui64_hostton
eui64_ntoa
eui64_ntohost
explicit_bzero
extattr_delete_fd
extattr_delete_file
Expand Down
11 changes: 11 additions & 0 deletions src/unix/bsd/freebsdlike/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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")]
Expand Down