From de91c5fb728be7d7b699b4c4726f24679470ff03 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 7 Dec 2024 20:25:35 +0000 Subject: [PATCH] sys::socket adding GetOnly `TCP_FUNCTION_ALIAS` for freebsd. to complete `TCP_FUNCTION_BLK` as to get the alias name, if existent, of the TCP stack. --- src/sys/socket/sockopt.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 9515541b57..c01259fb6a 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -330,6 +330,19 @@ sockopt_impl!( libc::TCP_FUNCTION_BLK, libc::tcp_function_set ); +#[cfg(target_os = "freebsd")] +#[cfg(feature = "net")] +sockopt_impl!( + #[cfg_attr(docsrs, doc(cfg(feature = "net")))] + /// Query the alias name of the set of function of the socket's TCP stack. + /// Uses the same field for the main name when getting from TCP_FUNCTION_BLK. + /// Empty if no alias. + TcpFunctionAlias, + GetOnly, + libc::IPPROTO_TCP, + libc::TCP_FUNCTION_ALIAS, + libc::tcp_function_set +); sockopt_impl!( #[cfg_attr(docsrs, doc(cfg(feature = "net")))] /// Used to disable Nagle's algorithm.