Skip to content

Commit 7c04c75

Browse files
committed
Auto merge of #2882 - devnexen:eui64_fbsd, r=JohnTitor
IEEE EUI-64 callss for freebsd/dragonflybsd.
2 parents 9358dbf + 5d42e0a commit 7c04c75

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-0
lines changed

libc-test/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,6 +1224,7 @@ fn test_dragonflybsd(target: &str) {
12241224
"sys/file.h",
12251225
"sys/ioctl.h",
12261226
"sys/cpuctl.h",
1227+
"sys/eui64.h",
12271228
"sys/ipc.h",
12281229
"sys/kinfo.h",
12291230
"sys/ktrace.h",
@@ -1889,6 +1890,7 @@ fn test_freebsd(target: &str) {
18891890
"sys/auxv.h",
18901891
"sys/cpuset.h",
18911892
"sys/domainset.h",
1893+
"sys/eui64.h",
18921894
"sys/event.h",
18931895
[freebsd13]:"sys/eventfd.h",
18941896
"sys/extattr.h",

libc-test/semver/dragonfly.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,10 @@ endgrent
12481248
endpwent
12491249
endservent
12501250
endutxent
1251+
eui64_aton
1252+
eui64_hostton
1253+
eui64_ntoa
1254+
eui64_ntohost
12511255
exit_status
12521256
explicit_bzero
12531257
faccessat

libc-test/semver/freebsd.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,10 @@ endpwent
15231523
endservent
15241524
endutxent
15251525
erand48
1526+
eui64_aton
1527+
eui64_hostton
1528+
eui64_ntoa
1529+
eui64_ntohost
15261530
explicit_bzero
15271531
extattr_delete_fd
15281532
extattr_delete_file

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ s! {
376376
pub seq: ::c_ushort,
377377
pub key: ::key_t,
378378
}
379+
380+
pub struct eui64 {
381+
pub octet: [u8; EUI64_LEN],
382+
}
379383
}
380384

381385
s_no_extra_traits! {
@@ -1329,6 +1333,8 @@ pub const ONLRET: ::tcflag_t = 0x40;
13291333

13301334
pub const CMGROUP_MAX: usize = 16;
13311335

1336+
pub const EUI64_LEN: usize = 8;
1337+
13321338
// https://github.com/freebsd/freebsd/blob/master/sys/net/bpf.h
13331339
pub const BPF_ALIGNMENT: usize = SIZEOF_LONG;
13341340

@@ -1720,6 +1726,11 @@ extern "C" {
17201726
pub fn memset_s(s: *mut ::c_void, smax: ::size_t, c: ::c_int, n: ::size_t) -> ::c_int;
17211727
pub fn gethostid() -> ::c_long;
17221728
pub fn sethostid(hostid: ::c_long);
1729+
1730+
pub fn eui64_aton(a: *const ::c_char, e: *mut eui64) -> ::c_int;
1731+
pub fn eui64_ntoa(id: *const eui64, a: *mut ::c_char, len: ::size_t) -> ::c_int;
1732+
pub fn eui64_ntohost(hostname: *mut ::c_char, len: ::size_t, id: *const eui64) -> ::c_int;
1733+
pub fn eui64_hostton(hostname: *const ::c_char, id: *mut eui64) -> ::c_int;
17231734
}
17241735

17251736
#[link(name = "rt")]

0 commit comments

Comments
 (0)