Skip to content

Commit 7c67179

Browse files
committed
Auto merge of #2791 - openqrnch:macos-rawsock, r=Amanieu
Macos rawsock Add some types needed for raw socket access on macos.
2 parents 91e6aa5 + adb6cae commit 7c67179

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

libc-test/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,13 @@ fn test_apple(target: &str) {
208208
"mach/thread_policy.h",
209209
"malloc/malloc.h",
210210
"net/bpf.h",
211+
"net/dlil.h",
211212
"net/if.h",
212213
"net/if_arp.h",
213214
"net/if_dl.h",
214215
"net/if_utun.h",
216+
"net/if_var.h",
217+
"net/ndrv.h",
215218
"net/route.h",
216219
"netdb.h",
217220
"netinet/if_ether.h",
@@ -236,6 +239,7 @@ fn test_apple(target: &str) {
236239
"stdlib.h",
237240
"string.h",
238241
"sysdir.h",
242+
"sys/appleapiopts.h",
239243
"sys/attr.h",
240244
"sys/clonefile.h",
241245
"sys/event.h",

src/unix/bsd/apple/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,13 @@ s! {
672672
pub s_addr: ::in_addr_t,
673673
}
674674

675+
// net/ndrv.h
676+
pub struct sockaddr_ndrv {
677+
pub snd_len: ::c_uchar,
678+
pub snd_family: ::c_uchar,
679+
pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h
680+
}
681+
675682
// sys/socket.h
676683

677684
pub struct sa_endpoints_t {
@@ -3466,6 +3473,7 @@ pub const pseudo_AF_RTIP: ::c_int = 22;
34663473
pub const AF_IPX: ::c_int = 23;
34673474
pub const AF_SIP: ::c_int = 24;
34683475
pub const pseudo_AF_PIP: ::c_int = 25;
3476+
pub const AF_NDRV: ::c_int = 27;
34693477
pub const AF_ISDN: ::c_int = 28;
34703478
pub const AF_E164: ::c_int = AF_ISDN;
34713479
pub const pseudo_AF_KEY: ::c_int = 29;
@@ -3508,6 +3516,7 @@ pub const PF_SIP: ::c_int = AF_SIP;
35083516
pub const PF_IPX: ::c_int = AF_IPX;
35093517
pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
35103518
pub const PF_PIP: ::c_int = pseudo_AF_PIP;
3519+
pub const PF_NDRV: ::c_int = AF_NDRV;
35113520
pub const PF_ISDN: ::c_int = AF_ISDN;
35123521
pub const PF_KEY: ::c_int = pseudo_AF_KEY;
35133522
pub const PF_INET6: ::c_int = AF_INET6;

0 commit comments

Comments
 (0)