summaryrefslogtreecommitdiff
path: root/src/sys/socket/sockopt.rs
AgeCommit message (Collapse)Author
2022-07-11Add DontRoute SockOptLeo Lu
2022-06-06Cleanup cfg blocksRyan Zoeller
Remove obsolete references to target_env = wasi, target_os = nacl, target_os = osx, and a typo'd target_os = fushsia that didn't compile when fixed. - target_env = wasi is dead: https://github.com/rust-lang/rust/pull/60117 - target_os = nacl is dead: https://github.com/rust-lang/rust/pull/45041 - target_os = osx is dead, but I can't find a link.
2022-05-14add haiku supportAl Hoang
* enabled as much functionality and defines that match updated libc definitions for haiku
2022-05-13Fix "unused_macro_rules" warnings with the latest nightly compiler.Alan Somers
It just so happens that Redox, OpenBSD, Dragonfly, and uclibc don't use some of the rules for two internal macros.
2022-04-07Add IP_DONTFRAG and IPV6_DONTFRAG SockOptsJunho Choi
IP_DONTFRAG: iOS, macOS IPV6_DONTFRAG: android, iOS, linux and macOS Test: `cargo test --test test dontfrag_opts` Some CI tests running ENOPROTOOPT are disabled (qemu-based).
2021-12-29Add support for the SO_TXTIME sockopt and SCM_TXTIME control messageAlessandro Ghedini
2021-12-23feat: Add glibc::SOF_TIMESTAMPING_* supportMichael Baikov
2021-12-20feature-gate most Nix functionsVincent Dagonneau
Using features reduces build time and size for consumer crates. By default all features are enabled.
2021-10-09sockopt's Set and Get traits are not unsafeAlan Somers
They were properly marked as unsafe as originally written. However, when the internal mem::zeroed() was replaced by mem::uninitialized(), these traits actually became safe. Only Get::assume_init() is actually unsafe. Fixes a warning with the latest Clippy.
2021-09-12Add docs for all sockopts that are documented by their respective OSesAlan Somers
2021-09-12Add the ability to set doc strings in sockopts' definitionsAlan Somers
2021-09-12Switch the argument order of sockopt_impl!Alan Somers
This macro is not exported outside of the crate, so there's no danger.
2021-09-07Add IP_TTL/IPV6_UNICAST_HOPS SockOptsConrad Meyer
Test: `cargo test --test test test_ttl_opts`
2021-09-07Merge branch 'master' into socket-mssAlan Somers
2021-09-06Add support for IP_RECVERR and IPV6_RECVERRConrad Meyer
Setting these options enables receiving errors, such as ICMP errors from the network, via `recvmsg()` with `MSG_ERRQUEUE`. Adds new `Ipv{4,6}RecvErr` variants to `ControlMessageOwned`. These control messages are produced when `Ipv4RecvErr` or `Ipv6RecvErr` options are enabled on a raw or datagram socket. New tests for the functionality can be run with `cargo test --test test test_recverr`. This commit builds on an earlier draft of the functionality authored by Matthew McPherrin <git@mcpherrin.ca>.
2021-09-04Merge branch 'master' into socket-msseaon
2021-09-04Support for `TCP_MAXSEG` TCP MSS socket optioneaon
2021-08-26add `TcpRepair` to sockopt0/0
2021-08-12feat: add libc::IP6T_SO_ORIGINAL_DST supportIcemic
2021-08-10Add support for LOCAL_PEER_CREDAlan Somers
On FreeBSD and its derivatives, this socket option gets the credentials of the connected peer.
2021-07-16Add the IPV6_V6ONLY sockoptDaniel Dulaney
2021-07-08Support SO_RXQ_OVFL socket option (android/fuchsia/linux)Junho Choi
This PR implements support of RXQ_OVFL flag and parsing ControlMessage to get the packet drop counter of UDP socket.
2021-07-05Add TcpUserTimeout socket optionAnthony Ramine
2021-06-23Add IpFreebind socket optionAnthony Ramine
2021-04-08Support TIMESTAMPNS for linuxLu, Wangshan
2021-03-21illumos and Solaris supportJason King
Co-authored-by: Dominik Hassler <hadfl@omnios.org> Co-authored-by: Joshua M. Clulow <josh@sysmgr.org>
2020-10-18KEEPCNT/KEEPINTVL aren't available on OpenBSD.Laurence Tratt
Without this commit, nix doesn't currently compile on OpenBSD. Some keepalive settings can be set globally, but not per-socket (see e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=970550 for some digging into this). Since it seems that NetBSD and DragonflyBSD have these settings, it makes more sense to only exclude them on OpenBSD rather than include them on (pretty much every) other operating systems.
2020-10-10Add support for TCP_KEEPCNT and TCP_KEEPINTVL TCP keepalive options.Yoav Steinberg
2020-05-31Convert the crate to edition 2018Alan Somers
2020-05-08Add SO_BINDTODEVICE sockoptJean Pierre Dudey
This is available only on Linux as far I know, [socket(7)](https://linux.die.net/man/7/socket) has some information about the `SO_BINDTODEVICE` sockopt. In simple words it binds a socket to an specific network device (specified as an string like "wlo1", "eth0", etc.), to only process packets from that device. Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
2020-04-25Support UDP GSO and GRO on linuxGleb Pomykalov
2020-04-12Fix UB in getsockoptAlan Somers
The old code tried to zero-initialize an enum for which 0 is not a valid value. That worked for older compilers, but triggers a panic with Rust 1.44.0. The correct technique is to use mem::MaybeUninit. Fixes #1212
2019-09-19Where relevant, replace equality checks in assert! with assert_eq!Xavier L'Heureux
`assert_eq!` gives more debug info when the test fails by default than `assert!`. This should help make debugging easier.
2019-08-29Clippy cleanupAlan Somers
2019-06-09Add extra traits for all typesBryant Mairs
Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all traits are supported by all types, which is why many are missing some.
2019-06-06Fix the is_so_mark_functional test in Linux containersAlan Somers
It's not sufficient to check for root privileges. In a container, the euid may be root even though the user lacks some capabilities. Replace this test's root check with a check for the CAP_NET_ADMIN capability instead.
2019-06-03Check euid, not uid, for socket testsAlan Somers
2019-05-31libc::uint8_t deprecated in favor of rust u8Johannes Schilling
2019-03-12Support AF_ALGGleb Pomykalov
2019-01-23Add IP_RECVIF & IP_RECVDSTADDR.Tom Pusateri
Include IP_PKTINFO and IP6_PKTINFO on netbsd/openbsd.
2018-12-17Merge #990bors[bot]
990: Add cmsg PKTINFO for IPv4 and IPv6. r=asomers a=pusateri Replaces #891 and attempts to address all previous concerns. Co-authored-by: Tom Pusateri <pusateri@bangj.com>
2018-12-15Add cmsg PKTINFO for IPv4 and IPv6.Tom Pusateri
ignore pktinfo tests on qemu mips,mips64,powerpc64 Original work by @mcginty.
2018-12-08Replace try! with ?Alan Somers
try! is not available in Rust 2018
2018-12-06Add support of TCP_CONGESTION for setsockoptFensteer
2018-07-27Fix *decoding* of cmsgs and add `ScmCredentials`.Jonas Schievink
2018-07-05Get `SO_PEERCRED` working on all Linux targetsJonas Schievink
2018-05-22TypoXavier Bestel
2018-03-21add SO_MARK SetSockOpt for LinuxJake McGinty
2018-02-15socket get-/setsockopt: document internal macros, types and traitsmexus
2018-01-11Add socket options for IP_TRANSPARENT / BIND_ANYJustin Latimer