if (status == QUIC_STATUS_INVALID_ADDRESS) return new SocketException((int)SocketError.AddressNotAvailable);
if (status == QUIC_STATUS_ADDRESS_IN_USE) return new SocketException((int)SocketError.AddressAlreadyInUse);
if (status == QUIC_STATUS_UNREACHABLE) return new SocketException((int)SocketError.HostUnreachable);
+ if (status == QUIC_STATUS_ADDRESS_NOT_AVAILABLE) return new SocketException((int)SocketError.AddressFamilyNotSupported);
//
// TLS and certificate errors throw AuthenticationException to match SslStream
public static int QUIC_STATUS_CERT_EXPIRED => OperatingSystem.IsWindows() ? MsQuic_Windows.QUIC_STATUS_CERT_EXPIRED : (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid()) ? MsQuic_Linux.QUIC_STATUS_CERT_EXPIRED : MsQuic_MacOS.QUIC_STATUS_CERT_EXPIRED;
public static int QUIC_STATUS_CERT_UNTRUSTED_ROOT => OperatingSystem.IsWindows() ? MsQuic_Windows.QUIC_STATUS_CERT_UNTRUSTED_ROOT : (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid()) ? MsQuic_Linux.QUIC_STATUS_CERT_UNTRUSTED_ROOT : MsQuic_MacOS.QUIC_STATUS_CERT_UNTRUSTED_ROOT;
public static int QUIC_STATUS_CERT_NO_CERT => OperatingSystem.IsWindows() ? MsQuic_Windows.QUIC_STATUS_CERT_NO_CERT : (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid()) ? MsQuic_Linux.QUIC_STATUS_CERT_NO_CERT : MsQuic_MacOS.QUIC_STATUS_CERT_NO_CERT;
+ public static int QUIC_STATUS_ADDRESS_NOT_AVAILABLE => OperatingSystem.IsWindows() ? MsQuic_Windows.QUIC_STATUS_ADDRESS_NOT_AVAILABLE : (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid()) ? MsQuic_Linux.QUIC_STATUS_ADDRESS_NOT_AVAILABLE : MsQuic_MacOS.QUIC_STATUS_ADDRESS_NOT_AVAILABLE;
public static int QUIC_ADDRESS_FAMILY_UNSPEC => OperatingSystem.IsWindows() ? MsQuic_Windows.QUIC_ADDRESS_FAMILY_UNSPEC : (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid()) ? MsQuic_Linux.QUIC_ADDRESS_FAMILY_UNSPEC : MsQuic_MacOS.QUIC_ADDRESS_FAMILY_UNSPEC;
public static int QUIC_ADDRESS_FAMILY_INET => OperatingSystem.IsWindows() ? MsQuic_Windows.QUIC_ADDRESS_FAMILY_INET : (OperatingSystem.IsLinux() || OperatingSystem.IsAndroid()) ? MsQuic_Linux.QUIC_ADDRESS_FAMILY_INET : MsQuic_MacOS.QUIC_ADDRESS_FAMILY_INET;
[NativeTypeName("#define QUIC_STATUS_CERT_NO_CERT QUIC_STATUS_CERT_ERROR(3)")]
public const int QUIC_STATUS_CERT_NO_CERT = ((int)(3) + 512 + 200000000);
+ [NativeTypeName("#define QUIC_STATUS_ADDRESS_NOT_AVAILABLE ((QUIC_STATUS)EADDRNOTAVAIL)")]
+ public const int QUIC_STATUS_ADDRESS_NOT_AVAILABLE = ((int)(0x63));
+
public const int QUIC_ADDRESS_FAMILY_UNSPEC = 0;
public const int QUIC_ADDRESS_FAMILY_INET = 2;
public const int QUIC_ADDRESS_FAMILY_INET6 = 10;
[NativeTypeName("#define QUIC_STATUS_CERT_NO_CERT QUIC_STATUS_CERT_ERROR(3)")]
public const int QUIC_STATUS_CERT_NO_CERT = ((int)(3) + 512 + 200000000);
+ [NativeTypeName("#define QUIC_STATUS_ADDRESS_NOT_AVAILABLE ((QUIC_STATUS)EADDRNOTAVAIL)")]
+ public const int QUIC_STATUS_ADDRESS_NOT_AVAILABLE = ((int)(0x31));
+
public const int QUIC_ADDRESS_FAMILY_UNSPEC = 0;
public const int QUIC_ADDRESS_FAMILY_INET = 2;
public const int QUIC_ADDRESS_FAMILY_INET6 = 30;
[NativeTypeName("#define QUIC_STATUS_CERT_NO_CERT SEC_E_NO_CREDENTIALS")]
public const int QUIC_STATUS_CERT_NO_CERT = unchecked((int)(0x8009030E));
+ [NativeTypeName("#define QUIC_STATUS_ADDRESS_NOT_AVAILABLE QUIC_STATUS_HRESULT_FROM_WIN32(WSAEAFNOSUPPORT)")]
+ public const int QUIC_STATUS_ADDRESS_NOT_AVAILABLE = unchecked((int)(((10047) & 0x0000FFFF) | (7 << 16) | 0x80000000));
+
public const int QUIC_ADDRESS_FAMILY_UNSPEC = 0;
public const int QUIC_ADDRESS_FAMILY_INET = 2;
public const int QUIC_ADDRESS_FAMILY_INET6 = 23;