summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-11-21 18:35:42 +0000
committerGitHub <noreply@github.com>2022-11-21 18:35:42 +0000
commita75a3494cebde67764f523930b77ddceb902f57f (patch)
tree865b6f492664c8a868858ebb15c257f8452493a3 /src/sys
parent852219119ec5f3533ea22a7e07f41f61b158bf90 (diff)
parent38597988f4d62357d0670fe0d3f4134b291be030 (diff)
downloadnix-a75a3494cebde67764f523930b77ddceb902f57f.zip
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 <109800286+StackOverflowExcept1on@users.noreply.github.com>
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/socket/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs
index af19c52d..37a4037c 100644
--- a/src/sys/socket/mod.rs
+++ b/src/sys/socket/mod.rs
@@ -118,6 +118,8 @@ pub enum SockProtocol {
Tcp = libc::IPPROTO_TCP,
/// UDP protocol ([ip(7)](https://man7.org/linux/man-pages/man7/ip.7.html))
Udp = libc::IPPROTO_UDP,
+ /// Raw sockets ([raw(7)](https://man7.org/linux/man-pages/man7/raw.7.html))
+ Raw = libc::IPPROTO_RAW,
/// Allows applications and other KEXTs to be notified when certain kernel events occur
/// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html))
#[cfg(any(target_os = "ios", target_os = "macos"))]