@@ -3098,11 +3098,28 @@ impl crate::Socket {
30983098 }
30993099 }
31003100
3101+ /// This method is deprecated, use [`crate::Socket::ip_transparent_v4`].
3102+ #[ cfg( all(
3103+ feature = "all" ,
3104+ any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
3105+ ) ) ]
3106+ #[ cfg_attr(
3107+ docsrs,
3108+ doc( cfg( all(
3109+ feature = "all" ,
3110+ any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
3111+ ) ) )
3112+ ) ]
3113+ #[ deprecated = "Use `Socket::ip_transparent_v4` instead" ]
3114+ pub fn ip_transparent ( & self ) -> io:: Result < bool > {
3115+ self . ip_transparent_v4 ( )
3116+ }
3117+
31013118 /// Get the value of the `IP_TRANSPARENT` option on this socket.
31023119 ///
3103- /// For more information about this option, see [`set_ip_transparent `].
3120+ /// For more information about this option, see [`set_ip_transparent_v4 `].
31043121 ///
3105- /// [`set_ip_transparent `]: Socket::set_ip_transparent
3122+ /// [`set_ip_transparent_v4 `]: Socket::set_ip_transparent_v4
31063123 #[ cfg( all(
31073124 feature = "all" ,
31083125 any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
@@ -3114,13 +3131,30 @@ impl crate::Socket {
31143131 any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
31153132 ) ) )
31163133 ) ]
3117- pub fn ip_transparent ( & self ) -> io:: Result < bool > {
3134+ pub fn ip_transparent_v4 ( & self ) -> io:: Result < bool > {
31183135 unsafe {
31193136 getsockopt :: < c_int > ( self . as_raw ( ) , libc:: IPPROTO_IP , libc:: IP_TRANSPARENT )
31203137 . map ( |transparent| transparent != 0 )
31213138 }
31223139 }
31233140
3141+ /// This method is deprecated, use [`crate::Socket::set_ip_transparent_v4`].
3142+ #[ cfg( all(
3143+ feature = "all" ,
3144+ any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
3145+ ) ) ]
3146+ #[ cfg_attr(
3147+ docsrs,
3148+ doc( cfg( all(
3149+ feature = "all" ,
3150+ any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
3151+ ) ) )
3152+ ) ]
3153+ #[ deprecated = "Use `Socket::set_ip_transparent_v4` instead" ]
3154+ pub fn set_ip_transparent ( & self , transparent : bool ) -> io:: Result < ( ) > {
3155+ self . set_ip_transparent_v4 ( transparent)
3156+ }
3157+
31243158 /// Set the value of the `IP_TRANSPARENT` option on this socket.
31253159 ///
31263160 /// Setting this boolean option enables transparent proxying
@@ -3147,7 +3181,7 @@ impl crate::Socket {
31473181 any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
31483182 ) ) )
31493183 ) ]
3150- pub fn set_ip_transparent ( & self , transparent : bool ) -> io:: Result < ( ) > {
3184+ pub fn set_ip_transparent_v4 ( & self , transparent : bool ) -> io:: Result < ( ) > {
31513185 unsafe {
31523186 setsockopt (
31533187 self . as_raw ( ) ,
0 commit comments