macro_rules! getsockopt_impl {
($name:ident, $level:expr, $flag:path, $ty:ty, $getter:ty) => { ... };
}Expand description
Helper for implementing GetSockOpt for a given socket option. See
::sys::socket::GetSockOpt.
This macro aims to help implementing GetSockOpt for different socket options that accept
different kinds of data to be use with getsockopt.
Instead of using this macro directly consider using sockopt_impl!,
especially if the option you are implementing represents a simple type.
ยงArguments
- Name of the type you want to implement
GetSockOptfor. - Socket layer, or a
protocol level: could be raw sockets (lic::SOL_SOCKET), ip protocol (libc::IPPROTO_IP), tcp protocol (libc::IPPROTO_TCP), and more. Please refer to your system manual for more options. Will be passed as the second argument (level) to thegetsockoptcall. - A flag to set. Some examples:
libc::SO_REUSEADDR,libc::TCP_NODELAY,libc::SO_ORIGINAL_DSTand others. Will be passed as the third argument (option_name) to thegetsockoptcall. - Type of the value that you are going to get.
- Type that implements the
Gettrait for the type from the previous item (GetBoolforbool,GetUsizeforusize, etc.).