diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-07-24 17:02:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-24 17:02:29 +0000 |
commit | 00f69814fe1eedb02464e976a2ebed3c1ecd973b (patch) | |
tree | 6a437cac41680f5258f9edaeb7c6fa6871977d13 /src/sys/socket/mod.rs | |
parent | 7cc33c15fe547dacebe7da154ffc9c1c5b595d6e (diff) | |
parent | 1040d970366100ce766eb8cb6af2c7453ffcdb6a (diff) | |
download | nix-00f69814fe1eedb02464e976a2ebed3c1ecd973b.zip |
Merge #1768
1768: Add ETH_P_ALL protocol number to SockProtocol r=asomers a=valdaarhun
Hi. I am working on a networking project that uses [packet sockets](https://man7.org/linux/man-pages/man7/packet.7.html) and noticed that ETH_P_ALL is not there in the `SockProtocol` enum. I thought it would be nice to have it here alongside IPPROTO_TCP and IPPROTO_UDP instead of having to separately import it from the libc crate.
Co-authored-by: valdaarhun <icegambit91@gmail.com>
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r-- | src/sys/socket/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index e789c116..e937e652 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -214,6 +214,13 @@ pub enum SockProtocol { #[cfg(any(target_os = "android", target_os = "linux"))] #[cfg_attr(docsrs, doc(cfg(all())))] NetlinkCrypto = libc::NETLINK_CRYPTO, + /// Non-DIX type protocol number defined for the Ethernet IEEE 802.3 interface that allows packets of all protocols + /// defined in the interface to be received. + /// ([ref](https://man7.org/linux/man-pages/man7/packet.7.html)) + // The protocol number is fed into the socket syscall in network byte order. + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + EthAll = libc::ETH_P_ALL.to_be(), } #[cfg(any(target_os = "linux"))] |