From 183be1b776a2baa3dee111ad2e9ce54b851d1b0d Mon Sep 17 00:00:00 2001 From: nat-rix Date: Sat, 26 Aug 2023 21:24:21 +0200 Subject: [PATCH] Add NFLOG and generic netlink families (#2092) * Add NFLOG and generic netlink families * Add netlink sock protocol changes to CHANGELOG --- CHANGELOG.md | 2 ++ src/sys/socket/mod.rs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32a603beba..b99255ca82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](https://semver.org/). (#[1662](https://github.com/nix-rust/nix/pull/1662)) - Added `CanRaw` to `SockProtocol` and `CanBcm` as a separate `SocProtocol` constant. ([#1912](https://github.com/nix-rust/nix/pull/1912)) +- Added `Generic` and `NFLOG` to `SockProtocol`. + ([#2092](https://github.com/nix-rust/nix/pull/2092)) - Added `mq_timedreceive` to `::nix::mqueue`. ([#1966])(https://github.com/nix-rust/nix/pull/1966) - Added `LocalPeerPid` to `nix::sys::socket::sockopt` for macOS. ([#1967](https://github.com/nix-rust/nix/pull/1967)) diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index e13485ac1b..78dd617c55 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -158,6 +158,11 @@ pub enum SockProtocol { #[cfg(any(target_os = "android", target_os = "linux"))] #[cfg_attr(docsrs, doc(cfg(all())))] NetlinkSockDiag = libc::NETLINK_SOCK_DIAG, + /// Netfilter/iptables ULOG. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkNFLOG = libc::NETLINK_NFLOG, /// SELinux event notifications. /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) #[cfg(any(target_os = "android", target_os = "linux"))] @@ -208,6 +213,11 @@ pub enum SockProtocol { #[cfg(any(target_os = "android", target_os = "linux"))] #[cfg_attr(docsrs, doc(cfg(all())))] NetlinkKObjectUEvent = libc::NETLINK_KOBJECT_UEVENT, + /// Generic netlink family for simplified netlink usage. + /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html)) + #[cfg(any(target_os = "android", target_os = "linux"))] + #[cfg_attr(docsrs, doc(cfg(all())))] + NetlinkGeneric = libc::NETLINK_GENERIC, /// Netlink interface to request information about ciphers registered with the kernel crypto API as well as allow /// configuration of the kernel crypto API. /// ([ref](https://www.man7.org/linux/man-pages/man7/netlink.7.html))