From 5702a8e9b0af3f7692dbc837d68dfe4ce2599f7c Mon Sep 17 00:00:00 2001 From: Maerten Farya Date: Fri, 4 Sep 2026 12:49:24 +0200 Subject: [PATCH] qnx: add missing definitions for io-sock For reference, the QNX io-sock networking stack is based on FreeBSD 13.2 release: https://www.qnx.com/developers/docs/relnotes8.0/com.qnx.doc.release_notes/topic/sdp8_rn.html See `What's new in QNX SDP? > Networking` for details Following under are the references to the FreeBSD headers: - `ip_mreqn`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/in.h#L549 - `ip_mreq_source`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/in.h#L558 - `TCP_KEEPIDLE`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/tcp.h#L208 - `TCP_KEEPINTVL`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/tcp.h#L209 - `TCP_KEEPCNT`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/tcp.h#L210 - `IP_RECVTOS`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/in.h#L487 - `IP_ADD_SOURCE_MEMBERSHIP`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3e/sys/netinet/in.h#L490 - `IP_DROP_SOURCE_MEMBERSHIP`: https://github.com/freebsd/freebsd-src/blob/f0cf0b8266eef39b13917f7bed808daf6d6a2d3esys/netinet/in.h#L491 --- src/unix/nto/io_sock/mod.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/unix/nto/io_sock/mod.rs b/src/unix/nto/io_sock/mod.rs index 303f5ca4c44b5..5d0e435a65fa6 100644 --- a/src/unix/nto/io_sock/mod.rs +++ b/src/unix/nto/io_sock/mod.rs @@ -50,6 +50,18 @@ s! { pub sdl_slen: c_uchar, pub sdl_data: [c_char; 46], } + + pub struct ip_mreqn { + pub imr_multiaddr: crate::in_addr, + pub imr_address: crate::in_addr, + pub imr_ifindex: c_int, + } + + pub struct ip_mreq_source { + pub imr_multiaddr: crate::in_addr, + pub imr_sourceaddr: crate::in_addr, + pub imr_interface: crate::in_addr, + } } pub const SCM_CREDS: c_int = 0x03; @@ -89,6 +101,12 @@ pub const PF_NATM: c_int = AF_NATM; pub const pseudo_AF_HDRCMPLT: c_int = 31; pub const SIOCGIFADDR: c_int = u32_cast_int(0xc0206921); pub const SO_SETFIB: c_int = 0x1014; +pub const TCP_KEEPIDLE: c_int = 256; +pub const TCP_KEEPINTVL: c_int = 512; +pub const TCP_KEEPCNT: c_int = 1024; +pub const IP_RECVTOS: c_int = 68; +pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 70; +pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 71; extern "C" { pub fn sendmmsg(