@@ -220,104 +220,11 @@ fn f17(a0: i32, a1: i32) -> i32 {
220220}
221221
222222fn f7 ( a0 : i32 , a1 : i32 , a2 : i32 , a3 : AnyPtr , a4 : u32 ) -> i32 {
223- let __res = match ( a1, a2) {
224- ( :: libc:: IPPROTO_TCP , :: libc:: TCP_NODELAY ) => {
225- let __v = a3. reinterpret_cast :: < i32 > ( ) . read ( ) != 0 ;
226- FdRegistry :: with_fd ( a0, |__fd| {
227- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: TcpNoDelay , & __v)
228- } )
229- }
230- ( :: libc:: SOL_SOCKET , :: libc:: SO_KEEPALIVE ) => {
231- let __v = a3. reinterpret_cast :: < i32 > ( ) . read ( ) != 0 ;
232- FdRegistry :: with_fd ( a0, |__fd| {
233- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: KeepAlive , & __v)
234- } )
235- }
236- ( :: libc:: IPPROTO_TCP , :: libc:: TCP_KEEPINTVL ) => {
237- let __v = a3. reinterpret_cast :: < u32 > ( ) . read ( ) ;
238- FdRegistry :: with_fd ( a0, |__fd| {
239- nix:: sys:: socket:: setsockopt (
240- & __fd,
241- nix:: sys:: socket:: sockopt:: TcpKeepInterval ,
242- & __v,
243- )
244- } )
245- }
246- ( :: libc:: IPPROTO_TCP , :: libc:: TCP_KEEPCNT ) => {
247- let __v = a3. reinterpret_cast :: < u32 > ( ) . read ( ) ;
248- FdRegistry :: with_fd ( a0, |__fd| {
249- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: TcpKeepCount , & __v)
250- } )
251- }
252- #[ cfg( target_os = "linux" ) ]
253- ( :: libc:: IPPROTO_IP , :: libc:: IP_TOS ) => {
254- let __v = a3. reinterpret_cast :: < i32 > ( ) . read ( ) ;
255- FdRegistry :: with_fd ( a0, |__fd| {
256- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: Ipv4Tos , & __v)
257- } )
258- }
259- #[ cfg( target_os = "linux" ) ]
260- ( :: libc:: IPPROTO_IPV6 , :: libc:: IPV6_TCLASS ) => {
261- let __v = a3. reinterpret_cast :: < i32 > ( ) . read ( ) ;
262- FdRegistry :: with_fd ( a0, |__fd| {
263- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: Ipv6TClass , & __v)
264- } )
265- }
266- #[ cfg( target_os = "linux" ) ]
267- ( :: libc:: IPPROTO_TCP , :: libc:: TCP_KEEPIDLE ) => {
268- let __v = a3. reinterpret_cast :: < u32 > ( ) . read ( ) ;
269- FdRegistry :: with_fd ( a0, |__fd| {
270- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: TcpKeepIdle , & __v)
271- } )
272- }
273- #[ cfg( target_os = "linux" ) ]
274- ( :: libc:: SOL_SOCKET , :: libc:: SO_BINDTODEVICE ) => {
275- let __v = :: std:: ffi:: OsString :: from ( a3. reinterpret_cast :: < u8 > ( ) . to_rust_string ( ) ) ;
276- FdRegistry :: with_fd ( a0, |__fd| {
277- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: BindToDevice , & __v)
278- } )
279- }
280- #[ cfg( target_os = "linux" ) ]
281- ( :: libc:: IPPROTO_IP , :: libc:: IP_BIND_ADDRESS_NO_PORT ) => {
282- let __v = a3. reinterpret_cast :: < i32 > ( ) . read ( ) != 0 ;
283- FdRegistry :: with_fd ( a0, |__fd| {
284- nix:: sys:: socket:: setsockopt (
285- & __fd,
286- nix:: sys:: socket:: sockopt:: IpBindAddressNoPort ,
287- & __v,
288- )
289- } )
290- }
291- #[ cfg( target_os = "linux" ) ]
292- ( :: libc:: IPPROTO_TCP , :: libc:: TCP_FASTOPEN_CONNECT ) => {
293- let __v = a3. reinterpret_cast :: < i32 > ( ) . read ( ) != 0 ;
294- FdRegistry :: with_fd ( a0, |__fd| {
295- nix:: sys:: socket:: setsockopt (
296- & __fd,
297- nix:: sys:: socket:: sockopt:: TcpFastOpenConnect ,
298- & __v,
299- )
300- } )
301- }
302- #[ cfg( target_os = "linux" ) ]
303- ( :: libc:: SOL_SOCKET , :: libc:: SO_PRIORITY ) => {
304- let __v = a3. reinterpret_cast :: < i32 > ( ) . read ( ) ;
305- FdRegistry :: with_fd ( a0, |__fd| {
306- nix:: sys:: socket:: setsockopt ( & __fd, nix:: sys:: socket:: sockopt:: Priority , & __v)
307- } )
308- }
309- ( __l, __o) => panic ! (
310- "setsockopt: unsupported option (level={}, optname={})" ,
311- __l, __o
312- ) ,
313- } ;
314- match __res {
315- Ok ( ( ) ) => 0 ,
316- Err ( __e) => {
317- libcc2rs:: cpp2rust_errno ( ) . write ( __e as i32 ) ;
318- -1
319- }
320- }
223+ let __a0 = a0;
224+ let __a1 = a1;
225+ let __a2 = a2;
226+ let __a3 = a3;
227+ libcc2rs:: setsockopt_refcount ( __a0, __a1, __a2, __a3)
321228}
322229
323230fn f8 ( a0 : i32 , a1 : i32 , a2 : i32 , a3 : AnyPtr , a4 : Ptr < u32 > ) -> i32 {
0 commit comments