diff options
author | Alexander Danilov <al.danilov@corp.mail.ru> | 2018-07-06 17:41:26 +0300 |
---|---|---|
committer | Alexander Danilov <al.danilov@corp.mail.ru> | 2018-07-06 17:41:26 +0300 |
commit | 6a5dd502f00dc7504c9cb9627f17fadd100063f9 (patch) | |
tree | f578d32172c9da7a88de068e7b6c3eecbe93ceb5 | |
parent | 460fb1310a5ec1951e730b4c668b922eb6ecb521 (diff) | |
download | rust-libc-6a5dd502f00dc7504c9cb9627f17fadd100063f9.tar.gz |
Add if_packet.h headers
Some structs for implementing af_packet(7)
-rw-r--r-- | src/unix/notbsd/linux/mod.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs index fdd26f8409..f02076abec 100644 --- a/src/unix/notbsd/linux/mod.rs +++ b/src/unix/notbsd/linux/mod.rs @@ -229,6 +229,13 @@ s! { pad: [::c_long; 4], } + pub struct packet_mreq { + pub mr_ifindex: ::c_int, + pub mr_type: ::c_ushort, + pub mr_alen: ::c_ushort, + pub mr_address: [::c_char; 8], + } + pub struct cpu_set_t { #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] @@ -1300,6 +1307,17 @@ pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0; pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1; pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2; + +// linux/if_packet.h +pub const PACKET_ADD_MEMBERSHIP: ::c_int = 1; +pub const PACKET_DROP_MEMBERSHIP: ::c_int = 2; + +pub const PACKET_MR_MULTICAST: ::c_int = 0; +pub const PACKET_MR_PROMISC: ::c_int = 1; +pub const PACKET_MR_ALLMULTI: ::c_int = 2; +pub const PACKET_MR_UNICAST: ::c_int = 3; + + // linux/netfilter.h pub const NF_DROP: ::c_int = 0; pub const NF_ACCEPT: ::c_int = 1; |