@@ -3098,11 +3098,28 @@ impl crate::Socket {
3098
3098
}
3099
3099
}
3100
3100
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
+
3101
3118
/// Get the value of the `IP_TRANSPARENT` option on this socket.
3102
3119
///
3103
- /// For more information about this option, see [`set_ip_transparent `].
3120
+ /// For more information about this option, see [`set_ip_transparent_v4 `].
3104
3121
///
3105
- /// [`set_ip_transparent `]: Socket::set_ip_transparent
3122
+ /// [`set_ip_transparent_v4 `]: Socket::set_ip_transparent_v4
3106
3123
#[ cfg( all(
3107
3124
feature = "all" ,
3108
3125
any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
@@ -3114,13 +3131,30 @@ impl crate::Socket {
3114
3131
any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
3115
3132
) ) )
3116
3133
) ]
3117
- pub fn ip_transparent ( & self ) -> io:: Result < bool > {
3134
+ pub fn ip_transparent_v4 ( & self ) -> io:: Result < bool > {
3118
3135
unsafe {
3119
3136
getsockopt :: < c_int > ( self . as_raw ( ) , sys:: IPPROTO_IP , libc:: IP_TRANSPARENT )
3120
3137
. map ( |transparent| transparent != 0 )
3121
3138
}
3122
3139
}
3123
3140
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 ( )
3156
+ }
3157
+
3124
3158
/// Set the value of the `IP_TRANSPARENT` option on this socket.
3125
3159
///
3126
3160
/// Setting this boolean option enables transparent proxying
@@ -3147,7 +3181,7 @@ impl crate::Socket {
3147
3181
any( target_os = "android" , target_os = "linux" , target_os = "fuchsia" )
3148
3182
) ) )
3149
3183
) ]
3150
- pub fn set_ip_transparent ( & self , transparent : bool ) -> io:: Result < ( ) > {
3184
+ pub fn set_ip_transparent_v4 ( & self , transparent : bool ) -> io:: Result < ( ) > {
3151
3185
unsafe {
3152
3186
setsockopt (
3153
3187
self . as_raw ( ) ,
0 commit comments