Skip to content

Commit a75a349

Browse files
Merge #1848
1848: SockProtocol::Raw = libc::IPPROTO_RAW for raw sockets r=asomers a=StackOverflowExcept1on Hey, I wanna to make call like `socket(af_type, SOCK_RAW, IPPROTO_RAW)` but currently there is no way to do it with rust https://github.com/rickettm/SendIP/blob/aad12a001157489ab9053c8665e09aec24a2ff6d/sendip.c#L143 Update: Feel free to add `#[cfg]` attribute if I made mistakes that might cause errors on some platforms Co-authored-by: StackOverflowExcept1on <[email protected]>
2 parents 8522191 + 3859798 commit a75a349

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
3636
([#1853](https://github.com/nix-rust/nix/pull/1853))
3737
- Added `new_unnamed` and `is_unnamed` for `UnixAddr` on Linux and Android.
3838
([#1857](https://github.com/nix-rust/nix/pull/1857))
39+
- Added `SockProtocol::Raw` for raw sockets
40+
([#1848](https://github.com/nix-rust/nix/pull/1848))
3941

4042
### Changed
4143

src/sys/socket/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ pub enum SockProtocol {
118118
Tcp = libc::IPPROTO_TCP,
119119
/// UDP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html))
120120
Udp = libc::IPPROTO_UDP,
121+
/// Raw sockets ([raw(7)](https://man7.org/linux/man-pages/man7/raw.7.html))
122+
Raw = libc::IPPROTO_RAW,
121123
/// Allows applications and other KEXTs to be notified when certain kernel events occur
122124
/// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html))
123125
#[cfg(any(target_os = "ios", target_os = "macos"))]

0 commit comments

Comments
 (0)