Skip to content

Commit 6a5dd50

Browse files
author
Alexander Danilov
committed
Add if_packet.h headers
Some structs for implementing af_packet(7)
1 parent 460fb13 commit 6a5dd50

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/unix/notbsd/linux/mod.rs

+18
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,13 @@ s! {
229229
pad: [::c_long; 4],
230230
}
231231

232+
pub struct packet_mreq {
233+
pub mr_ifindex: ::c_int,
234+
pub mr_type: ::c_ushort,
235+
pub mr_alen: ::c_ushort,
236+
pub mr_address: [::c_char; 8],
237+
}
238+
232239
pub struct cpu_set_t {
233240
#[cfg(all(target_pointer_width = "32",
234241
not(target_arch = "x86_64")))]
@@ -1300,6 +1307,17 @@ pub const CTRL_ATTR_MCAST_GRP_UNSPEC: ::c_int = 0;
13001307
pub const CTRL_ATTR_MCAST_GRP_NAME: ::c_int = 1;
13011308
pub const CTRL_ATTR_MCAST_GRP_ID: ::c_int = 2;
13021309

1310+
1311+
// linux/if_packet.h
1312+
pub const PACKET_ADD_MEMBERSHIP: ::c_int = 1;
1313+
pub const PACKET_DROP_MEMBERSHIP: ::c_int = 2;
1314+
1315+
pub const PACKET_MR_MULTICAST: ::c_int = 0;
1316+
pub const PACKET_MR_PROMISC: ::c_int = 1;
1317+
pub const PACKET_MR_ALLMULTI: ::c_int = 2;
1318+
pub const PACKET_MR_UNICAST: ::c_int = 3;
1319+
1320+
13031321
// linux/netfilter.h
13041322
pub const NF_DROP: ::c_int = 0;
13051323
pub const NF_ACCEPT: ::c_int = 1;

0 commit comments

Comments
 (0)