Auto merge of #2791 - openqrnch:macos-rawsock, r=Amanieu

Macos rawsock

Add some types needed for raw socket access on macos.
This commit is contained in:
bors 2022-05-24 11:46:44 +00:00
commit 7c67179682
2 changed files with 13 additions and 0 deletions

View file

@ -208,10 +208,13 @@ fn test_apple(target: &str) {
"mach/thread_policy.h",
"malloc/malloc.h",
"net/bpf.h",
"net/dlil.h",
"net/if.h",
"net/if_arp.h",
"net/if_dl.h",
"net/if_utun.h",
"net/if_var.h",
"net/ndrv.h",
"net/route.h",
"netdb.h",
"netinet/if_ether.h",
@ -236,6 +239,7 @@ fn test_apple(target: &str) {
"stdlib.h",
"string.h",
"sysdir.h",
"sys/appleapiopts.h",
"sys/attr.h",
"sys/clonefile.h",
"sys/event.h",

View file

@ -672,6 +672,13 @@ s! {
pub s_addr: ::in_addr_t,
}
// net/ndrv.h
pub struct sockaddr_ndrv {
pub snd_len: ::c_uchar,
pub snd_family: ::c_uchar,
pub snd_name: [::c_uchar; 16] // IFNAMSIZ from if.h
}
// sys/socket.h
pub struct sa_endpoints_t {
@ -3466,6 +3473,7 @@ pub const pseudo_AF_RTIP: ::c_int = 22;
pub const AF_IPX: ::c_int = 23;
pub const AF_SIP: ::c_int = 24;
pub const pseudo_AF_PIP: ::c_int = 25;
pub const AF_NDRV: ::c_int = 27;
pub const AF_ISDN: ::c_int = 28;
pub const AF_E164: ::c_int = AF_ISDN;
pub const pseudo_AF_KEY: ::c_int = 29;
@ -3508,6 +3516,7 @@ pub const PF_SIP: ::c_int = AF_SIP;
pub const PF_IPX: ::c_int = AF_IPX;
pub const PF_RTIP: ::c_int = pseudo_AF_RTIP;
pub const PF_PIP: ::c_int = pseudo_AF_PIP;
pub const PF_NDRV: ::c_int = AF_NDRV;
pub const PF_ISDN: ::c_int = AF_ISDN;
pub const PF_KEY: ::c_int = pseudo_AF_KEY;
pub const PF_INET6: ::c_int = AF_INET6;