@@ -128,82 +128,82 @@ macro_rules! getsockopt_impl {
128128/// * `$getter:ty`: `Get` implementation; optional; only for `GetOnly` and `Both`.
129129/// * `$setter:ty`: `Set` implementation; optional; only for `SetOnly` and `Both`.
130130macro_rules! sockopt_impl {
131- ( GetOnly , $name: ident, $level: expr, $flag: path, bool ) => {
132- sockopt_impl!( GetOnly , $name, $level, $flag, bool , GetBool ) ;
131+ ( $name: ident, GetOnly , $level: expr, $flag: path, bool ) => {
132+ sockopt_impl!( $name, GetOnly , $level, $flag, bool , GetBool ) ;
133133 } ;
134134
135- ( GetOnly , $name: ident, $level: expr, $flag: path, u8 ) => {
136- sockopt_impl!( GetOnly , $name, $level, $flag, u8 , GetU8 ) ;
135+ ( $name: ident, GetOnly , $level: expr, $flag: path, u8 ) => {
136+ sockopt_impl!( $name, GetOnly , $level, $flag, u8 , GetU8 ) ;
137137 } ;
138138
139- ( GetOnly , $name: ident, $level: expr, $flag: path, usize ) => {
140- sockopt_impl!( GetOnly , $name, $level, $flag, usize , GetUsize ) ;
139+ ( $name: ident, GetOnly , $level: expr, $flag: path, usize ) => {
140+ sockopt_impl!( $name, GetOnly , $level, $flag, usize , GetUsize ) ;
141141 } ;
142142
143- ( SetOnly , $name: ident, $level: expr, $flag: path, bool ) => {
144- sockopt_impl!( SetOnly , $name, $level, $flag, bool , SetBool ) ;
143+ ( $name: ident, SetOnly , $level: expr, $flag: path, bool ) => {
144+ sockopt_impl!( $name, SetOnly , $level, $flag, bool , SetBool ) ;
145145 } ;
146146
147- ( SetOnly , $name: ident, $level: expr, $flag: path, u8 ) => {
148- sockopt_impl!( SetOnly , $name, $level, $flag, u8 , SetU8 ) ;
147+ ( $name: ident, SetOnly , $level: expr, $flag: path, u8 ) => {
148+ sockopt_impl!( $name, SetOnly , $level, $flag, u8 , SetU8 ) ;
149149 } ;
150150
151- ( SetOnly , $name: ident, $level: expr, $flag: path, usize ) => {
152- sockopt_impl!( SetOnly , $name, $level, $flag, usize , SetUsize ) ;
151+ ( $name: ident, SetOnly , $level: expr, $flag: path, usize ) => {
152+ sockopt_impl!( $name, SetOnly , $level, $flag, usize , SetUsize ) ;
153153 } ;
154154
155- ( Both , $name: ident, $level: expr, $flag: path, bool ) => {
156- sockopt_impl!( Both , $name, $level, $flag, bool , GetBool , SetBool ) ;
155+ ( $name: ident, Both , $level: expr, $flag: path, bool ) => {
156+ sockopt_impl!( $name, Both , $level, $flag, bool , GetBool , SetBool ) ;
157157 } ;
158158
159- ( Both , $name: ident, $level: expr, $flag: path, u8 ) => {
160- sockopt_impl!( Both , $name, $level, $flag, u8 , GetU8 , SetU8 ) ;
159+ ( $name: ident, Both , $level: expr, $flag: path, u8 ) => {
160+ sockopt_impl!( $name, Both , $level, $flag, u8 , GetU8 , SetU8 ) ;
161161 } ;
162162
163- ( Both , $name: ident, $level: expr, $flag: path, usize ) => {
164- sockopt_impl!( Both , $name, $level, $flag, usize , GetUsize , SetUsize ) ;
163+ ( $name: ident, Both , $level: expr, $flag: path, usize ) => {
164+ sockopt_impl!( $name, Both , $level, $flag, usize , GetUsize , SetUsize ) ;
165165 } ;
166166
167- ( Both , $name: ident, $level: expr, $flag: path, OsString <$array: ty>) => {
168- sockopt_impl!( Both , $name, $level, $flag, OsString , GetOsString <$array>, SetOsString ) ;
167+ ( $name: ident, Both , $level: expr, $flag: path, OsString <$array: ty>) => {
168+ sockopt_impl!( $name, Both , $level, $flag, OsString , GetOsString <$array>, SetOsString ) ;
169169 } ;
170170
171171 /*
172172 * Matchers with generic getter types must be placed at the end, so
173173 * they'll only match _after_ specialized matchers fail
174174 */
175- ( GetOnly , $name: ident, $level: expr, $flag: path, $ty: ty) => {
176- sockopt_impl!( GetOnly , $name, $level, $flag, $ty, GetStruct <$ty>) ;
175+ ( $name: ident, GetOnly , $level: expr, $flag: path, $ty: ty) => {
176+ sockopt_impl!( $name, GetOnly , $level, $flag, $ty, GetStruct <$ty>) ;
177177 } ;
178178
179- ( GetOnly , $name: ident, $level: expr, $flag: path, $ty: ty, $getter: ty) => {
179+ ( $name: ident, GetOnly , $level: expr, $flag: path, $ty: ty, $getter: ty) => {
180180 #[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
181181 pub struct $name;
182182
183183 getsockopt_impl!( $name, $level, $flag, $ty, $getter) ;
184184 } ;
185185
186- ( SetOnly , $name: ident, $level: expr, $flag: path, $ty: ty) => {
187- sockopt_impl!( SetOnly , $name, $level, $flag, $ty, SetStruct <$ty>) ;
186+ ( $name: ident, SetOnly , $level: expr, $flag: path, $ty: ty) => {
187+ sockopt_impl!( $name, SetOnly , $level, $flag, $ty, SetStruct <$ty>) ;
188188 } ;
189189
190- ( SetOnly , $name: ident, $level: expr, $flag: path, $ty: ty, $setter: ty) => {
190+ ( $name: ident, SetOnly , $level: expr, $flag: path, $ty: ty, $setter: ty) => {
191191 #[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
192192 pub struct $name;
193193
194194 setsockopt_impl!( $name, $level, $flag, $ty, $setter) ;
195195 } ;
196196
197- ( Both , $name: ident, $level: expr, $flag: path, $ty: ty, $getter: ty, $setter: ty) => {
197+ ( $name: ident, Both , $level: expr, $flag: path, $ty: ty, $getter: ty, $setter: ty) => {
198198 #[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
199199 pub struct $name;
200200
201201 setsockopt_impl!( $name, $level, $flag, $ty, $setter) ;
202202 getsockopt_impl!( $name, $level, $flag, $ty, $getter) ;
203203 } ;
204204
205- ( Both , $name: ident, $level: expr, $flag: path, $ty: ty) => {
206- sockopt_impl!( Both , $name, $level, $flag, $ty, GetStruct <$ty>, SetStruct <$ty>) ;
205+ ( $name: ident, Both , $level: expr, $flag: path, $ty: ty) => {
206+ sockopt_impl!( $name, Both , $level, $flag, $ty, GetStruct <$ty>, SetStruct <$ty>) ;
207207 } ;
208208}
209209
@@ -213,17 +213,17 @@ macro_rules! sockopt_impl {
213213 *
214214 */
215215
216- sockopt_impl ! ( Both , ReuseAddr , libc:: SOL_SOCKET , libc:: SO_REUSEADDR , bool ) ;
216+ sockopt_impl ! ( ReuseAddr , Both , libc:: SOL_SOCKET , libc:: SO_REUSEADDR , bool ) ;
217217#[ cfg( not( any( target_os = "illumos" , target_os = "solaris" ) ) ) ]
218- sockopt_impl ! ( Both , ReusePort , libc:: SOL_SOCKET , libc:: SO_REUSEPORT , bool ) ;
219- sockopt_impl ! ( Both , TcpNoDelay , libc:: IPPROTO_TCP , libc:: TCP_NODELAY , bool ) ;
220- sockopt_impl ! ( Both , Linger , libc:: SOL_SOCKET , libc:: SO_LINGER , libc:: linger) ;
221- sockopt_impl ! ( SetOnly , IpAddMembership , libc:: IPPROTO_IP , libc:: IP_ADD_MEMBERSHIP , super :: IpMembershipRequest ) ;
222- sockopt_impl ! ( SetOnly , IpDropMembership , libc:: IPPROTO_IP , libc:: IP_DROP_MEMBERSHIP , super :: IpMembershipRequest ) ;
218+ sockopt_impl ! ( ReusePort , Both , libc:: SOL_SOCKET , libc:: SO_REUSEPORT , bool ) ;
219+ sockopt_impl ! ( TcpNoDelay , Both , libc:: IPPROTO_TCP , libc:: TCP_NODELAY , bool ) ;
220+ sockopt_impl ! ( Linger , Both , libc:: SOL_SOCKET , libc:: SO_LINGER , libc:: linger) ;
221+ sockopt_impl ! ( IpAddMembership , SetOnly , libc:: IPPROTO_IP , libc:: IP_ADD_MEMBERSHIP , super :: IpMembershipRequest ) ;
222+ sockopt_impl ! ( IpDropMembership , SetOnly , libc:: IPPROTO_IP , libc:: IP_DROP_MEMBERSHIP , super :: IpMembershipRequest ) ;
223223cfg_if ! {
224224 if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
225- sockopt_impl!( SetOnly , Ipv6AddMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_ADD_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
226- sockopt_impl!( SetOnly , Ipv6DropMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_DROP_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
225+ sockopt_impl!( Ipv6AddMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_ADD_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
226+ sockopt_impl!( Ipv6DropMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_DROP_MEMBERSHIP , super :: Ipv6MembershipRequest ) ;
227227 } else if #[ cfg( any( target_os = "dragonfly" ,
228228 target_os = "freebsd" ,
229229 target_os = "illumos" ,
@@ -232,93 +232,93 @@ cfg_if! {
232232 target_os = "netbsd" ,
233233 target_os = "openbsd" ,
234234 target_os = "solaris" ) ) ] {
235- sockopt_impl!( SetOnly , Ipv6AddMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_JOIN_GROUP , super :: Ipv6MembershipRequest ) ;
236- sockopt_impl!( SetOnly , Ipv6DropMembership , libc:: IPPROTO_IPV6 , libc:: IPV6_LEAVE_GROUP , super :: Ipv6MembershipRequest ) ;
235+ sockopt_impl!( Ipv6AddMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_JOIN_GROUP , super :: Ipv6MembershipRequest ) ;
236+ sockopt_impl!( Ipv6DropMembership , SetOnly , libc:: IPPROTO_IPV6 , libc:: IPV6_LEAVE_GROUP , super :: Ipv6MembershipRequest ) ;
237237 }
238238}
239- sockopt_impl ! ( Both , IpMulticastTtl , libc:: IPPROTO_IP , libc:: IP_MULTICAST_TTL , u8 ) ;
240- sockopt_impl ! ( Both , IpMulticastLoop , libc:: IPPROTO_IP , libc:: IP_MULTICAST_LOOP , bool ) ;
239+ sockopt_impl ! ( IpMulticastTtl , Both , libc:: IPPROTO_IP , libc:: IP_MULTICAST_TTL , u8 ) ;
240+ sockopt_impl ! ( IpMulticastLoop , Both , libc:: IPPROTO_IP , libc:: IP_MULTICAST_LOOP , bool ) ;
241241#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
242- sockopt_impl ! ( Both , IpFreebind , libc:: IPPROTO_IP , libc:: IP_FREEBIND , bool ) ;
243- sockopt_impl ! ( Both , ReceiveTimeout , libc:: SOL_SOCKET , libc:: SO_RCVTIMEO , TimeVal ) ;
244- sockopt_impl ! ( Both , SendTimeout , libc:: SOL_SOCKET , libc:: SO_SNDTIMEO , TimeVal ) ;
245- sockopt_impl ! ( Both , Broadcast , libc:: SOL_SOCKET , libc:: SO_BROADCAST , bool ) ;
246- sockopt_impl ! ( Both , OobInline , libc:: SOL_SOCKET , libc:: SO_OOBINLINE , bool ) ;
247- sockopt_impl ! ( GetOnly , SocketError , libc:: SOL_SOCKET , libc:: SO_ERROR , i32 ) ;
248- sockopt_impl ! ( Both , KeepAlive , libc:: SOL_SOCKET , libc:: SO_KEEPALIVE , bool ) ;
242+ sockopt_impl ! ( IpFreebind , Both , libc:: IPPROTO_IP , libc:: IP_FREEBIND , bool ) ;
243+ sockopt_impl ! ( ReceiveTimeout , Both , libc:: SOL_SOCKET , libc:: SO_RCVTIMEO , TimeVal ) ;
244+ sockopt_impl ! ( SendTimeout , Both , libc:: SOL_SOCKET , libc:: SO_SNDTIMEO , TimeVal ) ;
245+ sockopt_impl ! ( Broadcast , Both , libc:: SOL_SOCKET , libc:: SO_BROADCAST , bool ) ;
246+ sockopt_impl ! ( OobInline , Both , libc:: SOL_SOCKET , libc:: SO_OOBINLINE , bool ) ;
247+ sockopt_impl ! ( SocketError , GetOnly , libc:: SOL_SOCKET , libc:: SO_ERROR , i32 ) ;
248+ sockopt_impl ! ( KeepAlive , Both , libc:: SOL_SOCKET , libc:: SO_KEEPALIVE , bool ) ;
249249#[ cfg( any(
250250 target_os = "dragonfly" ,
251251 target_os = "freebsd" ,
252252 target_os = "macos" ,
253253 target_os = "ios"
254254) ) ]
255255// Get the credentials of the peer process of a connected unix domain socket.
256- sockopt_impl ! ( GetOnly , LocalPeerCred , 0 , libc:: LOCAL_PEERCRED , super :: XuCred ) ;
256+ sockopt_impl ! ( LocalPeerCred , GetOnly , 0 , libc:: LOCAL_PEERCRED , super :: XuCred ) ;
257257#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
258- sockopt_impl ! ( GetOnly , PeerCredentials , libc:: SOL_SOCKET , libc:: SO_PEERCRED , super :: UnixCredentials ) ;
258+ sockopt_impl ! ( PeerCredentials , GetOnly , libc:: SOL_SOCKET , libc:: SO_PEERCRED , super :: UnixCredentials ) ;
259259#[ cfg( any( target_os = "ios" ,
260260 target_os = "macos" ) ) ]
261- sockopt_impl ! ( Both , TcpKeepAlive , libc:: IPPROTO_TCP , libc:: TCP_KEEPALIVE , u32 ) ;
261+ sockopt_impl ! ( TcpKeepAlive , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPALIVE , u32 ) ;
262262#[ cfg( any( target_os = "android" ,
263263 target_os = "dragonfly" ,
264264 target_os = "freebsd" ,
265265 target_os = "linux" ,
266266 target_os = "nacl" ) ) ]
267- sockopt_impl ! ( Both , TcpKeepIdle , libc:: IPPROTO_TCP , libc:: TCP_KEEPIDLE , u32 ) ;
267+ sockopt_impl ! ( TcpKeepIdle , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPIDLE , u32 ) ;
268268cfg_if ! {
269269 if #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ] {
270- sockopt_impl!( Both , TcpMaxSeg , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
270+ sockopt_impl!( TcpMaxSeg , Both , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
271271 } else {
272- sockopt_impl!( GetOnly , TcpMaxSeg , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
272+ sockopt_impl!( TcpMaxSeg , GetOnly , libc:: IPPROTO_TCP , libc:: TCP_MAXSEG , u32 ) ;
273273 }
274274}
275275#[ cfg( not( target_os = "openbsd" ) ) ]
276- sockopt_impl ! ( Both , TcpKeepCount , libc:: IPPROTO_TCP , libc:: TCP_KEEPCNT , u32 ) ;
276+ sockopt_impl ! ( TcpKeepCount , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPCNT , u32 ) ;
277277#[ cfg( any( target_os = "android" ,
278278 target_os = "fuchsia" ,
279279 target_os = "linux" ) ) ]
280- sockopt_impl ! ( Both , TcpRepair , libc:: IPPROTO_TCP , libc:: TCP_REPAIR , u32 ) ;
280+ sockopt_impl ! ( TcpRepair , Both , libc:: IPPROTO_TCP , libc:: TCP_REPAIR , u32 ) ;
281281#[ cfg( not( target_os = "openbsd" ) ) ]
282- sockopt_impl ! ( Both , TcpKeepInterval , libc:: IPPROTO_TCP , libc:: TCP_KEEPINTVL , u32 ) ;
282+ sockopt_impl ! ( TcpKeepInterval , Both , libc:: IPPROTO_TCP , libc:: TCP_KEEPINTVL , u32 ) ;
283283#[ cfg( any( target_os = "fuchsia" , target_os = "linux" ) ) ]
284- sockopt_impl ! ( Both , TcpUserTimeout , libc:: IPPROTO_TCP , libc:: TCP_USER_TIMEOUT , u32 ) ;
285- sockopt_impl ! ( Both , RcvBuf , libc:: SOL_SOCKET , libc:: SO_RCVBUF , usize ) ;
286- sockopt_impl ! ( Both , SndBuf , libc:: SOL_SOCKET , libc:: SO_SNDBUF , usize ) ;
284+ sockopt_impl ! ( TcpUserTimeout , Both , libc:: IPPROTO_TCP , libc:: TCP_USER_TIMEOUT , u32 ) ;
285+ sockopt_impl ! ( RcvBuf , Both , libc:: SOL_SOCKET , libc:: SO_RCVBUF , usize ) ;
286+ sockopt_impl ! ( SndBuf , Both , libc:: SOL_SOCKET , libc:: SO_SNDBUF , usize ) ;
287287#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
288- sockopt_impl ! ( SetOnly , RcvBufForce , libc:: SOL_SOCKET , libc:: SO_RCVBUFFORCE , usize ) ;
288+ sockopt_impl ! ( RcvBufForce , SetOnly , libc:: SOL_SOCKET , libc:: SO_RCVBUFFORCE , usize ) ;
289289#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
290- sockopt_impl ! ( SetOnly , SndBufForce , libc:: SOL_SOCKET , libc:: SO_SNDBUFFORCE , usize ) ;
291- sockopt_impl ! ( GetOnly , SockType , libc:: SOL_SOCKET , libc:: SO_TYPE , super :: SockType ) ;
292- sockopt_impl ! ( GetOnly , AcceptConn , libc:: SOL_SOCKET , libc:: SO_ACCEPTCONN , bool ) ;
290+ sockopt_impl ! ( SndBufForce , SetOnly , libc:: SOL_SOCKET , libc:: SO_SNDBUFFORCE , usize ) ;
291+ sockopt_impl ! ( SockType , GetOnly , libc:: SOL_SOCKET , libc:: SO_TYPE , super :: SockType ) ;
292+ sockopt_impl ! ( AcceptConn , GetOnly , libc:: SOL_SOCKET , libc:: SO_ACCEPTCONN , bool ) ;
293293#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
294- sockopt_impl ! ( Both , BindToDevice , libc:: SOL_SOCKET , libc:: SO_BINDTODEVICE , OsString <[ u8 ; libc:: IFNAMSIZ ] >) ;
294+ sockopt_impl ! ( BindToDevice , Both , libc:: SOL_SOCKET , libc:: SO_BINDTODEVICE , OsString <[ u8 ; libc:: IFNAMSIZ ] >) ;
295295#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
296- sockopt_impl ! ( GetOnly , OriginalDst , libc:: SOL_IP , libc:: SO_ORIGINAL_DST , libc:: sockaddr_in) ;
296+ sockopt_impl ! ( OriginalDst , GetOnly , libc:: SOL_IP , libc:: SO_ORIGINAL_DST , libc:: sockaddr_in) ;
297297#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
298- sockopt_impl ! ( GetOnly , Ip6tOriginalDst , libc:: SOL_IPV6 , libc:: IP6T_SO_ORIGINAL_DST , libc:: sockaddr_in6) ;
299- sockopt_impl ! ( Both , ReceiveTimestamp , libc:: SOL_SOCKET , libc:: SO_TIMESTAMP , bool ) ;
298+ sockopt_impl ! ( Ip6tOriginalDst , GetOnly , libc:: SOL_IPV6 , libc:: IP6T_SO_ORIGINAL_DST , libc:: sockaddr_in6) ;
299+ sockopt_impl ! ( ReceiveTimestamp , Both , libc:: SOL_SOCKET , libc:: SO_TIMESTAMP , bool ) ;
300300#[ cfg( all( target_os = "linux" ) ) ]
301- sockopt_impl ! ( Both , ReceiveTimestampns , libc:: SOL_SOCKET , libc:: SO_TIMESTAMPNS , bool ) ;
301+ sockopt_impl ! ( ReceiveTimestampns , Both , libc:: SOL_SOCKET , libc:: SO_TIMESTAMPNS , bool ) ;
302302#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
303- sockopt_impl ! ( Both , IpTransparent , libc:: SOL_IP , libc:: IP_TRANSPARENT , bool ) ;
303+ sockopt_impl ! ( IpTransparent , Both , libc:: SOL_IP , libc:: IP_TRANSPARENT , bool ) ;
304304#[ cfg( target_os = "openbsd" ) ]
305- sockopt_impl ! ( Both , BindAny , libc:: SOL_SOCKET , libc:: SO_BINDANY , bool ) ;
305+ sockopt_impl ! ( BindAny , Both , libc:: SOL_SOCKET , libc:: SO_BINDANY , bool ) ;
306306#[ cfg( target_os = "freebsd" ) ]
307- sockopt_impl ! ( Both , BindAny , libc:: IPPROTO_IP , libc:: IP_BINDANY , bool ) ;
307+ sockopt_impl ! ( BindAny , Both , libc:: IPPROTO_IP , libc:: IP_BINDANY , bool ) ;
308308#[ cfg( target_os = "linux" ) ]
309- sockopt_impl ! ( Both , Mark , libc:: SOL_SOCKET , libc:: SO_MARK , u32 ) ;
309+ sockopt_impl ! ( Mark , Both , libc:: SOL_SOCKET , libc:: SO_MARK , u32 ) ;
310310#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
311- sockopt_impl ! ( Both , PassCred , libc:: SOL_SOCKET , libc:: SO_PASSCRED , bool ) ;
311+ sockopt_impl ! ( PassCred , Both , libc:: SOL_SOCKET , libc:: SO_PASSCRED , bool ) ;
312312#[ cfg( any( target_os = "freebsd" , target_os = "linux" ) ) ]
313- sockopt_impl ! ( Both , TcpCongestion , libc:: IPPROTO_TCP , libc:: TCP_CONGESTION , OsString <[ u8 ; TCP_CA_NAME_MAX ] >) ;
313+ sockopt_impl ! ( TcpCongestion , Both , libc:: IPPROTO_TCP , libc:: TCP_CONGESTION , OsString <[ u8 ; TCP_CA_NAME_MAX ] >) ;
314314#[ cfg( any(
315315 target_os = "android" ,
316316 target_os = "ios" ,
317317 target_os = "linux" ,
318318 target_os = "macos" ,
319319 target_os = "netbsd" ,
320320) ) ]
321- sockopt_impl ! ( Both , Ipv4PacketInfo , libc:: IPPROTO_IP , libc:: IP_PKTINFO , bool ) ;
321+ sockopt_impl ! ( Ipv4PacketInfo , Both , libc:: IPPROTO_IP , libc:: IP_PKTINFO , bool ) ;
322322#[ cfg( any(
323323 target_os = "android" ,
324324 target_os = "freebsd" ,
@@ -328,38 +328,38 @@ sockopt_impl!(Both, Ipv4PacketInfo, libc::IPPROTO_IP, libc::IP_PKTINFO, bool);
328328 target_os = "netbsd" ,
329329 target_os = "openbsd" ,
330330) ) ]
331- sockopt_impl ! ( Both , Ipv6RecvPacketInfo , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVPKTINFO , bool ) ;
331+ sockopt_impl ! ( Ipv6RecvPacketInfo , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVPKTINFO , bool ) ;
332332#[ cfg( any(
333333 target_os = "freebsd" ,
334334 target_os = "ios" ,
335335 target_os = "macos" ,
336336 target_os = "netbsd" ,
337337 target_os = "openbsd" ,
338338) ) ]
339- sockopt_impl ! ( Both , Ipv4RecvIf , libc:: IPPROTO_IP , libc:: IP_RECVIF , bool ) ;
339+ sockopt_impl ! ( Ipv4RecvIf , Both , libc:: IPPROTO_IP , libc:: IP_RECVIF , bool ) ;
340340#[ cfg( any(
341341 target_os = "freebsd" ,
342342 target_os = "ios" ,
343343 target_os = "macos" ,
344344 target_os = "netbsd" ,
345345 target_os = "openbsd" ,
346346) ) ]
347- sockopt_impl ! ( Both , Ipv4RecvDstAddr , libc:: IPPROTO_IP , libc:: IP_RECVDSTADDR , bool ) ;
347+ sockopt_impl ! ( Ipv4RecvDstAddr , Both , libc:: IPPROTO_IP , libc:: IP_RECVDSTADDR , bool ) ;
348348#[ cfg( target_os = "linux" ) ]
349- sockopt_impl ! ( Both , UdpGsoSegment , libc:: SOL_UDP , libc:: UDP_SEGMENT , libc:: c_int) ;
349+ sockopt_impl ! ( UdpGsoSegment , Both , libc:: SOL_UDP , libc:: UDP_SEGMENT , libc:: c_int) ;
350350#[ cfg( target_os = "linux" ) ]
351- sockopt_impl ! ( Both , UdpGroSegment , libc:: IPPROTO_UDP , libc:: UDP_GRO , bool ) ;
351+ sockopt_impl ! ( UdpGroSegment , Both , libc:: IPPROTO_UDP , libc:: UDP_GRO , bool ) ;
352352#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
353- sockopt_impl ! ( Both , RxqOvfl , libc:: SOL_SOCKET , libc:: SO_RXQ_OVFL , libc:: c_int) ;
354- sockopt_impl ! ( Both , Ipv6V6Only , libc:: IPPROTO_IPV6 , libc:: IPV6_V6ONLY , bool ) ;
353+ sockopt_impl ! ( RxqOvfl , Both , libc:: SOL_SOCKET , libc:: SO_RXQ_OVFL , libc:: c_int) ;
354+ sockopt_impl ! ( Ipv6V6Only , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_V6ONLY , bool ) ;
355355#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
356- sockopt_impl ! ( Both , Ipv4RecvErr , libc:: IPPROTO_IP , libc:: IP_RECVERR , bool ) ;
356+ sockopt_impl ! ( Ipv4RecvErr , Both , libc:: IPPROTO_IP , libc:: IP_RECVERR , bool ) ;
357357#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
358- sockopt_impl ! ( Both , Ipv6RecvErr , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVERR , bool ) ;
358+ sockopt_impl ! ( Ipv6RecvErr , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_RECVERR , bool ) ;
359359#[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux" ) ) ]
360- sockopt_impl ! ( Both , Ipv4Ttl , libc:: IPPROTO_IP , libc:: IP_TTL , libc:: c_int) ;
360+ sockopt_impl ! ( Ipv4Ttl , Both , libc:: IPPROTO_IP , libc:: IP_TTL , libc:: c_int) ;
361361#[ cfg( any( target_os = "android" , target_os = "freebsd" , target_os = "linux" ) ) ]
362- sockopt_impl ! ( Both , Ipv6Ttl , libc:: IPPROTO_IPV6 , libc:: IPV6_UNICAST_HOPS , libc:: c_int) ;
362+ sockopt_impl ! ( Ipv6Ttl , Both , libc:: IPPROTO_IPV6 , libc:: IPV6_UNICAST_HOPS , libc:: c_int) ;
363363
364364#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
365365#[ derive( Copy , Clone , Debug ) ]
0 commit comments