diff --git a/src/Network/NWProtocolDefinition.cs b/src/Network/NWProtocolDefinition.cs index f8c86497e4f4..97a2be27c113 100644 --- a/src/Network/NWProtocolDefinition.cs +++ b/src/Network/NWProtocolDefinition.cs @@ -43,8 +43,7 @@ public NWProtocolDefinition (NativeHandle handle, bool owns) : base (handle, own #endif [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_protocol_definition_is_equal (OS_nw_protocol_definition definition1, OS_nw_protocol_definition definition2); + static extern byte nw_protocol_definition_is_equal (OS_nw_protocol_definition definition1, OS_nw_protocol_definition definition2); public bool Equals (object other) { @@ -52,7 +51,7 @@ public bool Equals (object other) return false; if (!(other is NWProtocolDefinition otherDefinition)) return false; - return nw_protocol_definition_is_equal (GetCheckedHandle (), otherDefinition.Handle); + return nw_protocol_definition_is_equal (GetCheckedHandle (), otherDefinition.Handle) != 0; } [DllImport (Constants.NetworkLibrary)] diff --git a/src/Network/NWProtocolIPOptions.cs b/src/Network/NWProtocolIPOptions.cs index 19c75f889349..d8b0f0baddea 100644 --- a/src/Network/NWProtocolIPOptions.cs +++ b/src/Network/NWProtocolIPOptions.cs @@ -47,13 +47,13 @@ public void SetHopLimit (nuint hopLimit) => nw_ip_options_set_hop_limit (GetCheckedHandle (), (byte) hopLimit); public void SetUseMinimumMtu (bool useMinimumMtu) - => nw_ip_options_set_use_minimum_mtu (GetCheckedHandle (), useMinimumMtu); + => nw_ip_options_set_use_minimum_mtu (GetCheckedHandle (), useMinimumMtu.AsByte ()); public void SetDisableFragmentation (bool disableFragmentation) - => nw_ip_options_set_disable_fragmentation (GetCheckedHandle (), disableFragmentation); + => nw_ip_options_set_disable_fragmentation (GetCheckedHandle (), disableFragmentation.AsByte ()); public void SetCalculateReceiveTime (bool shouldCalculateReceiveTime) - => nw_ip_options_set_calculate_receive_time (GetCheckedHandle (), shouldCalculateReceiveTime); + => nw_ip_options_set_calculate_receive_time (GetCheckedHandle (), shouldCalculateReceiveTime.AsByte ()); public void SetIPLocalAddressPreference (NWIPLocalAddressPreference localAddressPreference) => nw_ip_options_set_local_address_preference (GetCheckedHandle (), localAddressPreference); @@ -71,7 +71,7 @@ public void SetIPLocalAddressPreference (NWIPLocalAddressPreference localAddress [MacCatalyst (15, 0)] #endif [DllImport (Constants.NetworkLibrary)] - static extern void nw_ip_options_set_disable_multicast_loopback (OS_nw_protocol_options options, [MarshalAs (UnmanagedType.I1)] bool disableMulticastLoopback); + static extern void nw_ip_options_set_disable_multicast_loopback (OS_nw_protocol_options options, byte disableMulticastLoopback); #if NET [SupportedOSPlatform ("tvos15.0")] @@ -86,6 +86,6 @@ public void SetIPLocalAddressPreference (NWIPLocalAddressPreference localAddress [MacCatalyst (15, 0)] #endif public void DisableMulticastLoopback (bool disable) - => nw_ip_options_set_disable_multicast_loopback (GetCheckedHandle (), disable); + => nw_ip_options_set_disable_multicast_loopback (GetCheckedHandle (), disable.AsByte ()); } } diff --git a/src/Network/NWProtocolMetadata.cs b/src/Network/NWProtocolMetadata.cs index 61e4db896eee..9c4a9922445f 100644 --- a/src/Network/NWProtocolMetadata.cs +++ b/src/Network/NWProtocolMetadata.cs @@ -73,28 +73,24 @@ public NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) public NWProtocolDefinition ProtocolDefinition => new NWProtocolDefinition (nw_protocol_metadata_copy_definition (GetCheckedHandle ()), owns: true); [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - internal static extern bool nw_protocol_metadata_is_ip (OS_nw_protocol_metadata metadata); + internal static extern byte nw_protocol_metadata_is_ip (OS_nw_protocol_metadata metadata); - public bool IsIP => nw_protocol_metadata_is_ip (GetCheckedHandle ()); + public bool IsIP => nw_protocol_metadata_is_ip (GetCheckedHandle ()) != 0; [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - internal static extern bool nw_protocol_metadata_is_udp (OS_nw_protocol_metadata metadata); + internal static extern byte nw_protocol_metadata_is_udp (OS_nw_protocol_metadata metadata); - public bool IsUdp => nw_protocol_metadata_is_udp (GetCheckedHandle ()); + public bool IsUdp => nw_protocol_metadata_is_udp (GetCheckedHandle ()) != 0; [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - internal static extern bool nw_protocol_metadata_is_tls (OS_nw_protocol_metadata metadata); + internal static extern byte nw_protocol_metadata_is_tls (OS_nw_protocol_metadata metadata); - public bool IsTls => nw_protocol_metadata_is_tls (GetCheckedHandle ()); + public bool IsTls => nw_protocol_metadata_is_tls (GetCheckedHandle ()) != 0; [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - internal static extern bool nw_protocol_metadata_is_tcp (OS_nw_protocol_metadata metadata); + internal static extern byte nw_protocol_metadata_is_tcp (OS_nw_protocol_metadata metadata); - public bool IsTcp => nw_protocol_metadata_is_tcp (GetCheckedHandle ()); + public bool IsTcp => nw_protocol_metadata_is_tcp (GetCheckedHandle ()) != 0; #if NET [SupportedOSPlatform ("tvos15.0")] @@ -109,8 +105,7 @@ public NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) [MacCatalyst (15, 0)] #endif [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_protocol_metadata_is_quic (OS_nw_protocol_metadata metadata); + static extern byte nw_protocol_metadata_is_quic (OS_nw_protocol_metadata metadata); #if NET [SupportedOSPlatform ("tvos15.0")] @@ -124,7 +119,7 @@ public NWProtocolMetadata (NativeHandle handle, bool owns) : base (handle, owns) [iOS (15, 0)] [MacCatalyst (15, 0)] #endif - public bool IsQuic => nw_protocol_metadata_is_quic (GetCheckedHandle ()); + public bool IsQuic => nw_protocol_metadata_is_quic (GetCheckedHandle ()) != 0; [DllImport (Constants.NetworkLibrary)] internal static extern IntPtr nw_tls_copy_sec_protocol_metadata (IntPtr handle); @@ -253,8 +248,7 @@ public uint TcpGetAvailableSendBuffer () [iOS (13, 0)] #endif [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - internal static extern bool nw_protocol_metadata_is_framer_message (OS_nw_protocol_metadata metadata); + internal static extern byte nw_protocol_metadata_is_framer_message (OS_nw_protocol_metadata metadata); #if NET [SupportedOSPlatform ("tvos13.0")] @@ -265,7 +259,7 @@ public uint TcpGetAvailableSendBuffer () [TV (13, 0)] [iOS (13, 0)] #endif - public bool IsFramerMessage => nw_protocol_metadata_is_framer_message (GetCheckedHandle ()); + public bool IsFramerMessage => nw_protocol_metadata_is_framer_message (GetCheckedHandle ()) != 0; #if NET [SupportedOSPlatform ("tvos13.0")] @@ -277,8 +271,7 @@ public uint TcpGetAvailableSendBuffer () [iOS (13, 0)] #endif [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - internal static extern bool nw_protocol_metadata_is_ws (OS_nw_protocol_metadata metadata); + internal static extern byte nw_protocol_metadata_is_ws (OS_nw_protocol_metadata metadata); #if NET [SupportedOSPlatform ("tvos13.0")] @@ -289,6 +282,6 @@ public uint TcpGetAvailableSendBuffer () [TV (13, 0)] [iOS (13, 0)] #endif - public bool IsWebSocket => nw_protocol_metadata_is_ws (GetCheckedHandle ()); + public bool IsWebSocket => nw_protocol_metadata_is_ws (GetCheckedHandle ()) != 0; } } diff --git a/src/Network/NWProtocolOptions.cs b/src/Network/NWProtocolOptions.cs index e4df34d1081c..f63562f583d2 100644 --- a/src/Network/NWProtocolOptions.cs +++ b/src/Network/NWProtocolOptions.cs @@ -132,35 +132,35 @@ public void IPSetHopLimit (byte hopLimit) #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal static extern void nw_ip_options_set_use_minimum_mtu (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool use_minimum_mtu); + internal static extern void nw_ip_options_set_use_minimum_mtu (IntPtr options, byte use_minimum_mtu); #if !NET [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetUseMinimumMtu (bool useMinimumMtu) { - nw_ip_options_set_use_minimum_mtu (GetCheckedHandle (), useMinimumMtu); + nw_ip_options_set_use_minimum_mtu (GetCheckedHandle (), useMinimumMtu.AsByte ()); } #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal static extern void nw_ip_options_set_disable_fragmentation (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool disable_fragmentation); + internal static extern void nw_ip_options_set_disable_fragmentation (IntPtr options, byte disable_fragmentation); #if !NET [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetDisableFragmentation (bool disableFragmentation) { - nw_ip_options_set_disable_fragmentation (GetCheckedHandle (), disableFragmentation); + nw_ip_options_set_disable_fragmentation (GetCheckedHandle (), disableFragmentation.AsByte ()); } #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal static extern void nw_ip_options_set_calculate_receive_time (IntPtr options, [MarshalAs (UnmanagedType.I1)] bool calculateReceiveTime); + internal static extern void nw_ip_options_set_calculate_receive_time (IntPtr options, byte calculateReceiveTime); #if !NET [Obsolete ("Use the 'NWProtocolIPOptions' class instead.")] public void IPSetCalculateReceiveTime (bool calculateReceiveTime) { - nw_ip_options_set_calculate_receive_time (GetCheckedHandle (), calculateReceiveTime); + nw_ip_options_set_calculate_receive_time (GetCheckedHandle (), calculateReceiveTime.AsByte ()); } #endif // !NET @@ -190,35 +190,35 @@ public NWIPLocalAddressPreference IPLocalAddressPreference { // [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_no_delay (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noDelay); + internal extern static void nw_tcp_options_set_no_delay (IntPtr handle, byte noDelay); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetNoDelay (bool noDelay) => nw_tcp_options_set_no_delay (GetCheckedHandle (), noDelay); + public void TcpSetNoDelay (bool noDelay) => nw_tcp_options_set_no_delay (GetCheckedHandle (), noDelay.AsByte ()); #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_no_push (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noPush); + internal extern static void nw_tcp_options_set_no_push (IntPtr handle, byte noPush); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetNoPush (bool noPush) => nw_tcp_options_set_no_push (GetCheckedHandle (), noPush); + public void TcpSetNoPush (bool noPush) => nw_tcp_options_set_no_push (GetCheckedHandle (), noPush.AsByte ()); #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_no_options (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool noOptions); + internal extern static void nw_tcp_options_set_no_options (IntPtr handle, byte noOptions); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetNoOptions (bool noOptions) => nw_tcp_options_set_no_options (GetCheckedHandle (), noOptions); + public void TcpSetNoOptions (bool noOptions) => nw_tcp_options_set_no_options (GetCheckedHandle (), noOptions.AsByte ()); #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_enable_keepalive (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool enableKeepAlive); + internal extern static void nw_tcp_options_set_enable_keepalive (IntPtr handle, byte enableKeepAlive); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetEnableKeepAlive (bool enableKeepAlive) => nw_tcp_options_set_enable_keepalive (GetCheckedHandle (), enableKeepAlive); + public void TcpSetEnableKeepAlive (bool enableKeepAlive) => nw_tcp_options_set_enable_keepalive (GetCheckedHandle (), enableKeepAlive.AsByte ()); #endif // !NET [DllImport (Constants.NetworkLibrary)] @@ -278,46 +278,46 @@ public NWIPLocalAddressPreference IPLocalAddressPreference { #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_retransmit_fin_drop (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool retransmitFinDrop); + internal extern static void nw_tcp_options_set_retransmit_fin_drop (IntPtr handle, byte retransmitFinDrop); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetRetransmitFinDrop (bool retransmitFinDrop) => nw_tcp_options_set_retransmit_fin_drop (GetCheckedHandle (), retransmitFinDrop); + public void TcpSetRetransmitFinDrop (bool retransmitFinDrop) => nw_tcp_options_set_retransmit_fin_drop (GetCheckedHandle (), retransmitFinDrop.AsByte ()); #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_disable_ack_stretching (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool disableAckStretching); + internal extern static void nw_tcp_options_set_disable_ack_stretching (IntPtr handle, byte disableAckStretching); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetDisableAckStretching (bool disableAckStretching) => nw_tcp_options_set_disable_ack_stretching (GetCheckedHandle (), disableAckStretching); + public void TcpSetDisableAckStretching (bool disableAckStretching) => nw_tcp_options_set_disable_ack_stretching (GetCheckedHandle (), disableAckStretching.AsByte ()); #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_enable_fast_open (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool enableFastOpen); + internal extern static void nw_tcp_options_set_enable_fast_open (IntPtr handle, byte enableFastOpen); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetEnableFastOpen (bool enableFastOpen) => nw_tcp_options_set_enable_fast_open (GetCheckedHandle (), enableFastOpen); + public void TcpSetEnableFastOpen (bool enableFastOpen) => nw_tcp_options_set_enable_fast_open (GetCheckedHandle (), enableFastOpen.AsByte ()); #endif // !NET [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_tcp_options_set_disable_ecn (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool disableEcn); + internal extern static void nw_tcp_options_set_disable_ecn (IntPtr handle, byte disableEcn); #if !NET [Obsolete ("Use the 'NWProtocolTcpOptions' class instead.")] - public void TcpSetDisableEcn (bool disableEcn) => nw_tcp_options_set_disable_ecn (GetCheckedHandle (), disableEcn); + public void TcpSetDisableEcn (bool disableEcn) => nw_tcp_options_set_disable_ecn (GetCheckedHandle (), disableEcn.AsByte ()); #endif // !NET // // UDP Options // [DllImport (Constants.NetworkLibrary)] - internal extern static void nw_udp_options_set_prefer_no_checksum (IntPtr handle, [MarshalAs (UnmanagedType.U1)] bool preferNoChecksums); + internal extern static void nw_udp_options_set_prefer_no_checksum (IntPtr handle, byte preferNoChecksums); #if !NET [Obsolete ("Use the 'NWProtocolUdpOptions' class instead.")] - public void UdpSetPreferNoChecksum (bool preferNoChecksums) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksums); + public void UdpSetPreferNoChecksum (bool preferNoChecksums) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksums.AsByte ()); #endif // !NET // @@ -345,9 +345,8 @@ public NWIPLocalAddressPreference IPLocalAddressPreference { [MacCatalyst (15, 0)] #endif [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_protocol_options_is_quic (IntPtr options); + static extern byte nw_protocol_options_is_quic (IntPtr options); - public bool IsQuic => nw_protocol_options_is_quic (GetCheckedHandle ()); + public bool IsQuic => nw_protocol_options_is_quic (GetCheckedHandle ()) != 0; } } diff --git a/src/Network/NWProtocolQuicOptions.cs b/src/Network/NWProtocolQuicOptions.cs index f45fda98721b..53d91c881860 100644 --- a/src/Network/NWProtocolQuicOptions.cs +++ b/src/Network/NWProtocolQuicOptions.cs @@ -54,15 +54,14 @@ public SecProtocolOptions SecProtocolOptions => new SecProtocolOptions (nw_quic_copy_sec_protocol_options (GetCheckedHandle ()), true); [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_quic_get_stream_is_unidirectional (OS_nw_protocol_options options); + static extern byte nw_quic_get_stream_is_unidirectional (OS_nw_protocol_options options); [DllImport (Constants.NetworkLibrary)] - static extern void nw_quic_set_stream_is_unidirectional (OS_nw_protocol_options options, [MarshalAs (UnmanagedType.I1)] bool isUnidirectional); + static extern void nw_quic_set_stream_is_unidirectional (OS_nw_protocol_options options, byte isUnidirectional); public bool StreamIsUnidirectional { - get => nw_quic_get_stream_is_unidirectional (GetCheckedHandle ()); - set => nw_quic_set_stream_is_unidirectional (GetCheckedHandle (), value); + get => nw_quic_get_stream_is_unidirectional (GetCheckedHandle ()) != 0; + set => nw_quic_set_stream_is_unidirectional (GetCheckedHandle (), value.AsByte ()); } [DllImport (Constants.NetworkLibrary)] @@ -209,8 +208,7 @@ public ushort DatagramFrameSize { [Watch (9, 0)] #endif [DllImport (Constants.NetworkLibrary)] - [return: MarshalAs (UnmanagedType.I1)] - static extern bool nw_quic_get_stream_is_datagram (OS_nw_protocol_options options); + static extern byte nw_quic_get_stream_is_datagram (OS_nw_protocol_options options); #if NET [SupportedOSPlatform ("tvos16.0")] @@ -224,7 +222,7 @@ public ushort DatagramFrameSize { [Watch (9, 0)] #endif [DllImport (Constants.NetworkLibrary)] - static extern void nw_quic_set_stream_is_datagram (OS_nw_protocol_options options, [MarshalAs (UnmanagedType.I1)] bool is_datagram); + static extern void nw_quic_set_stream_is_datagram (OS_nw_protocol_options options, byte is_datagram); #if NET [SupportedOSPlatform ("tvos16.0")] @@ -238,8 +236,8 @@ public ushort DatagramFrameSize { [Watch (9, 0)] #endif public bool StreamIsDatagram { - get => nw_quic_get_stream_is_datagram (GetCheckedHandle ()); - set => nw_quic_set_stream_is_datagram (GetCheckedHandle (), value); + get => nw_quic_get_stream_is_datagram (GetCheckedHandle ()) != 0; + set => nw_quic_set_stream_is_datagram (GetCheckedHandle (), value.AsByte ()); } #if NET diff --git a/src/Network/NWProtocolTcpOptions.cs b/src/Network/NWProtocolTcpOptions.cs index 68715baa783e..90858c17ebfd 100644 --- a/src/Network/NWProtocolTcpOptions.cs +++ b/src/Network/NWProtocolTcpOptions.cs @@ -43,13 +43,13 @@ internal NWProtocolTcpOptions (NativeHandle handle, bool owns) : base (handle, o public NWProtocolTcpOptions () : this (nw_tcp_create_options (), owns: true) { } - public void SetNoDelay (bool noDelay) => nw_tcp_options_set_no_delay (GetCheckedHandle (), noDelay); + public void SetNoDelay (bool noDelay) => nw_tcp_options_set_no_delay (GetCheckedHandle (), noDelay.AsByte ()); - public void SetNoPush (bool noPush) => nw_tcp_options_set_no_push (GetCheckedHandle (), noPush); + public void SetNoPush (bool noPush) => nw_tcp_options_set_no_push (GetCheckedHandle (), noPush.AsByte ()); - public void SetNoOptions (bool noOptions) => nw_tcp_options_set_no_options (GetCheckedHandle (), noOptions); + public void SetNoOptions (bool noOptions) => nw_tcp_options_set_no_options (GetCheckedHandle (), noOptions.AsByte ()); - public void SetEnableKeepAlive (bool enableKeepAlive) => nw_tcp_options_set_enable_keepalive (GetCheckedHandle (), enableKeepAlive); + public void SetEnableKeepAlive (bool enableKeepAlive) => nw_tcp_options_set_enable_keepalive (GetCheckedHandle (), enableKeepAlive.AsByte ()); public void SetKeepAliveCount (uint keepAliveCount) => nw_tcp_options_set_keepalive_count (GetCheckedHandle (), keepAliveCount); @@ -71,14 +71,14 @@ public void SetPersistTimeout (TimeSpan persistTimeout) public void SetRetransmitConnectionDropTime (TimeSpan connectionDropTime) => nw_tcp_options_set_retransmit_connection_drop_time (GetCheckedHandle (), (uint) connectionDropTime.Seconds); - public void SetRetransmitFinDrop (bool retransmitFinDrop) => nw_tcp_options_set_retransmit_fin_drop (GetCheckedHandle (), retransmitFinDrop); + public void SetRetransmitFinDrop (bool retransmitFinDrop) => nw_tcp_options_set_retransmit_fin_drop (GetCheckedHandle (), retransmitFinDrop.AsByte ()); public void SetDisableAckStretching (bool disableAckStretching) - => nw_tcp_options_set_disable_ack_stretching (GetCheckedHandle (), disableAckStretching); + => nw_tcp_options_set_disable_ack_stretching (GetCheckedHandle (), disableAckStretching.AsByte ()); - public void SetEnableFastOpen (bool enableFastOpen) => nw_tcp_options_set_enable_fast_open (GetCheckedHandle (), enableFastOpen); + public void SetEnableFastOpen (bool enableFastOpen) => nw_tcp_options_set_enable_fast_open (GetCheckedHandle (), enableFastOpen.AsByte ()); - public void SetDisableEcn (bool disableEcn) => nw_tcp_options_set_disable_ecn (GetCheckedHandle (), disableEcn); + public void SetDisableEcn (bool disableEcn) => nw_tcp_options_set_disable_ecn (GetCheckedHandle (), disableEcn.AsByte ()); #if NET [SupportedOSPlatform ("tvos15.0")] diff --git a/src/Network/NWProtocolUdpOptions.cs b/src/Network/NWProtocolUdpOptions.cs index eb6a98fd21b8..caf63051b708 100644 --- a/src/Network/NWProtocolUdpOptions.cs +++ b/src/Network/NWProtocolUdpOptions.cs @@ -37,6 +37,6 @@ internal NWProtocolUdpOptions (NativeHandle handle, bool owns) : base (handle, o public NWProtocolUdpOptions () : this (nw_udp_create_options (), owns: true) { } - public void SetPreferNoChecksum (bool preferNoChecksum) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksum); + public void SetPreferNoChecksum (bool preferNoChecksum) => nw_udp_options_set_prefer_no_checksum (GetCheckedHandle (), preferNoChecksum.AsByte ()); } } diff --git a/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs b/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs index 7962081fef5f..367ed06cc37d 100644 --- a/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs +++ b/tests/cecil-tests/BlittablePInvokes.KnownFailures.cs @@ -72,17 +72,6 @@ public partial class BlittablePInvokes { "System.Boolean Network.NWPath::nw_path_is_equal(System.IntPtr,System.IntPtr)", "System.Boolean Network.NWPath::nw_path_is_expensive(System.IntPtr)", "System.Boolean Network.NWPath::nw_path_uses_interface_type(System.IntPtr,Network.NWInterfaceType)", - "System.Boolean Network.NWProtocolDefinition::nw_protocol_definition_is_equal(System.IntPtr,System.IntPtr)", - "System.Boolean Network.NWProtocolMetadata::nw_protocol_metadata_is_framer_message(System.IntPtr)", - "System.Boolean Network.NWProtocolMetadata::nw_protocol_metadata_is_ip(System.IntPtr)", - "System.Boolean Network.NWProtocolMetadata::nw_protocol_metadata_is_quic(System.IntPtr)", - "System.Boolean Network.NWProtocolMetadata::nw_protocol_metadata_is_tcp(System.IntPtr)", - "System.Boolean Network.NWProtocolMetadata::nw_protocol_metadata_is_tls(System.IntPtr)", - "System.Boolean Network.NWProtocolMetadata::nw_protocol_metadata_is_udp(System.IntPtr)", - "System.Boolean Network.NWProtocolMetadata::nw_protocol_metadata_is_ws(System.IntPtr)", - "System.Boolean Network.NWProtocolOptions::nw_protocol_options_is_quic(System.IntPtr)", - "System.Boolean Network.NWProtocolQuicOptions::nw_quic_get_stream_is_datagram(System.IntPtr)", - "System.Boolean Network.NWProtocolQuicOptions::nw_quic_get_stream_is_unidirectional(System.IntPtr)", "System.Boolean Network.NWTxtRecord::nw_txt_record_access_bytes(System.IntPtr,ObjCRuntime.BlockLiteral*)", "System.Boolean Network.NWTxtRecord::nw_txt_record_access_key(System.IntPtr,System.IntPtr,ObjCRuntime.BlockLiteral*)", "System.Boolean Network.NWTxtRecord::nw_txt_record_apply(System.IntPtr,ObjCRuntime.BlockLiteral*)", @@ -110,21 +99,6 @@ public partial class BlittablePInvokes { "System.Void Network.NWParameters::nw_parameters_set_requires_dnssec_validation(System.IntPtr,System.Boolean)", "System.Void Network.NWParameters::nw_parameters_set_reuse_local_address(System.IntPtr,System.Boolean)", "System.Void Network.NWPrivacyContext::nw_privacy_context_require_encrypted_name_resolution(System.IntPtr,System.Boolean,System.IntPtr)", - "System.Void Network.NWProtocolIPOptions::nw_ip_options_set_disable_multicast_loopback(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_ip_options_set_calculate_receive_time(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_ip_options_set_disable_fragmentation(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_ip_options_set_use_minimum_mtu(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_disable_ack_stretching(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_disable_ecn(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_enable_fast_open(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_enable_keepalive(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_no_delay(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_no_options(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_no_push(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_tcp_options_set_retransmit_fin_drop(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolOptions::nw_udp_options_set_prefer_no_checksum(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolQuicOptions::nw_quic_set_stream_is_datagram(System.IntPtr,System.Boolean)", - "System.Void Network.NWProtocolQuicOptions::nw_quic_set_stream_is_unidirectional(System.IntPtr,System.Boolean)", "System.Void Network.NWWebSocketOptions::nw_ws_options_set_auto_reply_ping(System.IntPtr,System.Boolean)", "System.Void Network.NWWebSocketOptions::nw_ws_options_set_skip_handshake(System.IntPtr,System.Boolean)", "System.Void ObjCRuntime.Messaging::void_objc_msgSend_GCDualSenseAdaptiveTriggerPositionalAmplitudes_float(System.IntPtr,System.IntPtr,GameController.GCDualSenseAdaptiveTriggerPositionalAmplitudes,System.Single)",