Skip to content

Commit

Permalink
Reorganize sockopts code and add several more socket options (#855)
Browse files Browse the repository at this point in the history
Reorganize the sockopts code:
 - Split the `sockopt` modules out of the syscalls.rs files into their own files
 - Instead of duplicating all the documentation links for each socket option function, add a module-level documentation comment with all the links and just have the function documentation link to that.
 - Reorganize the sockopt tests so that the socket and tcp options are tested on both ipv4 and ipv6 sockets.
 - Adjust the bindings to reduce the amount of `as _` casting needed.

And, implement several more sockopt functions:
 - Add `*_ifindex` variations of `IP_ADD_MEMBERSHIP` and `IP_DROP_MEMBERSHIP`
 - Implement `IP_DROP_SOURCE_MEMBERSHIP`, `TCP_USER_TIMEOUT`, `IP_TOS`, `IPV6_RECVTCLASS`, `IP_RECVTOS`, `IP_ADD_SOURCE_MEMBERSHIP`, and `SO_OOBINLINE`.
  • Loading branch information
sunfishcode authored Sep 28, 2023
1 parent abd6686 commit 77c4aae
Show file tree
Hide file tree
Showing 9 changed files with 2,399 additions and 3,089 deletions.
2 changes: 2 additions & 0 deletions src/backend/libc/net/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ pub(crate) mod ext;
pub(crate) mod msghdr;
pub(crate) mod read_sockaddr;
pub(crate) mod send_recv;
#[cfg(not(any(target_os = "redox", target_os = "wasi")))]
pub(crate) mod sockopt;
pub(crate) mod syscalls;
pub(crate) mod write_sockaddr;
Loading

0 comments on commit 77c4aae

Please sign in to comment.