184 references to Interop
System.Net.Primitives (184)
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
123
_error =
Interop
.Sys.ConvertErrorPlatformToPal(errno);
140
get { return _rawErrno == -1 ? (_rawErrno =
Interop
.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
145
return
Interop
.Sys.StrError(RawErrno);
219
public static
Interop
.ErrorInfo Info(this
Interop
.Error error)
221
return new
Interop
.ErrorInfo(error);
src\libraries\Common\src\System\Net\NetworkInformation\HostInformationPal.Unix.cs (2)
10
return
Interop
.Sys.GetHostName();
15
return
Interop
.Sys.GetDomainName();
src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (1)
64
return
Interop
.Sys.InterfaceNameToIndex(buffer);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (23)
26
Interop
.Error err =
Interop
.Sys.GetSocketAddressSizes(&ipv4, &ipv6, &uds, &max);
27
Debug.Assert(err ==
Interop
.Error.SUCCESS, $"Unexpected err: {err}");
39
private static void ThrowOnFailure(
Interop
.Error err)
43
case
Interop
.Error.SUCCESS:
46
case
Interop
.Error.EFAULT:
50
case
Interop
.Error.EAFNOSUPPORT:
63
Interop
.Error err;
66
err =
Interop
.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family);
75
Interop
.Error err;
81
err =
Interop
.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family);
91
Interop
.Error err;
94
err =
Interop
.Sys.GetPort(rawAddress, buffer.Length, &port);
103
Interop
.Error err;
106
err =
Interop
.Sys.SetPort(rawAddress, buffer.Length, port);
115
Interop
.Error err;
118
err =
Interop
.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress);
128
Interop
.Error err;
132
err =
Interop
.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope);
141
Interop
.Error err;
144
err =
Interop
.Sys.SetIPv4Address(rawAddress, buffer.Length, address);
167
Interop
.Error err;
170
err =
Interop
.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope);
src\libraries\Common\src\System\Net\Sockets\SocketErrorPal.Unix.cs (92)
34
private static readonly Dictionary<
Interop
.Error, SocketError> s_nativeErrorToSocketError = new Dictionary<
Interop
.Error, SocketError>(NativeErrorToSocketErrorCount)
36
{
Interop
.Error.EACCES, SocketError.AccessDenied },
37
{
Interop
.Error.EADDRINUSE, SocketError.AddressAlreadyInUse },
38
{
Interop
.Error.EADDRNOTAVAIL, SocketError.AddressNotAvailable },
39
{
Interop
.Error.EAFNOSUPPORT, SocketError.AddressFamilyNotSupported },
40
{
Interop
.Error.EAGAIN, SocketError.WouldBlock },
41
{
Interop
.Error.EALREADY, SocketError.AlreadyInProgress },
42
{
Interop
.Error.EBADF, SocketError.OperationAborted },
43
{
Interop
.Error.ECANCELED, SocketError.OperationAborted },
44
{
Interop
.Error.ECONNABORTED, SocketError.ConnectionAborted },
45
{
Interop
.Error.ECONNREFUSED, SocketError.ConnectionRefused },
46
{
Interop
.Error.ECONNRESET, SocketError.ConnectionReset },
47
{
Interop
.Error.EDESTADDRREQ, SocketError.DestinationAddressRequired },
48
{
Interop
.Error.EFAULT, SocketError.Fault },
49
{
Interop
.Error.EHOSTDOWN, SocketError.HostDown },
50
{
Interop
.Error.ENXIO, SocketError.HostNotFound }, // not perfect, but closest match available
51
{
Interop
.Error.EHOSTUNREACH, SocketError.HostUnreachable },
52
{
Interop
.Error.EINPROGRESS, SocketError.InProgress },
53
{
Interop
.Error.EINTR, SocketError.Interrupted },
54
{
Interop
.Error.EINVAL, SocketError.InvalidArgument },
55
{
Interop
.Error.EISCONN, SocketError.IsConnected },
56
{
Interop
.Error.EMFILE, SocketError.TooManyOpenSockets },
57
{
Interop
.Error.EMSGSIZE, SocketError.MessageSize },
58
{
Interop
.Error.ENETDOWN, SocketError.NetworkDown },
59
{
Interop
.Error.ENETRESET, SocketError.NetworkReset },
60
{
Interop
.Error.ENETUNREACH, SocketError.NetworkUnreachable },
61
{
Interop
.Error.ENFILE, SocketError.TooManyOpenSockets },
62
{
Interop
.Error.ENOBUFS, SocketError.NoBufferSpaceAvailable },
63
{
Interop
.Error.ENODATA, SocketError.NoData },
64
{
Interop
.Error.ENOENT, SocketError.AddressNotAvailable },
65
{
Interop
.Error.ENOPROTOOPT, SocketError.ProtocolOption },
66
{
Interop
.Error.ENOTCONN, SocketError.NotConnected },
67
{
Interop
.Error.ENOTSOCK, SocketError.NotSocket },
68
{
Interop
.Error.ENOTSUP, SocketError.OperationNotSupported },
69
{
Interop
.Error.EPERM, SocketError.AccessDenied },
70
{
Interop
.Error.EPIPE, SocketError.Shutdown },
71
{
Interop
.Error.EPFNOSUPPORT, SocketError.ProtocolFamilyNotSupported },
72
{
Interop
.Error.EPROTONOSUPPORT, SocketError.ProtocolNotSupported },
73
{
Interop
.Error.EPROTOTYPE, SocketError.ProtocolType },
74
{
Interop
.Error.ESOCKTNOSUPPORT, SocketError.SocketNotSupported },
75
{
Interop
.Error.ESHUTDOWN, SocketError.Disconnecting },
76
{
Interop
.Error.SUCCESS, SocketError.Success },
77
{
Interop
.Error.ETIMEDOUT, SocketError.TimedOut },
80
private static readonly Dictionary<SocketError,
Interop
.Error> s_socketErrorToNativeError = new Dictionary<SocketError,
Interop
.Error>(SocketErrorToNativeErrorCount)
88
{ SocketError.AccessDenied,
Interop
.Error.EACCES}, // could also have been EPERM
89
{ SocketError.AddressAlreadyInUse,
Interop
.Error.EADDRINUSE },
90
{ SocketError.AddressNotAvailable,
Interop
.Error.EADDRNOTAVAIL },
91
{ SocketError.AddressFamilyNotSupported,
Interop
.Error.EAFNOSUPPORT },
92
{ SocketError.AlreadyInProgress,
Interop
.Error.EALREADY },
93
{ SocketError.ConnectionAborted,
Interop
.Error.ECONNABORTED },
94
{ SocketError.ConnectionRefused,
Interop
.Error.ECONNREFUSED },
95
{ SocketError.ConnectionReset,
Interop
.Error.ECONNRESET },
96
{ SocketError.DestinationAddressRequired,
Interop
.Error.EDESTADDRREQ },
97
{ SocketError.Disconnecting,
Interop
.Error.ESHUTDOWN },
98
{ SocketError.Fault,
Interop
.Error.EFAULT },
99
{ SocketError.HostDown,
Interop
.Error.EHOSTDOWN },
100
{ SocketError.HostNotFound,
Interop
.Error.EHOSTNOTFOUND },
101
{ SocketError.HostUnreachable,
Interop
.Error.EHOSTUNREACH },
102
{ SocketError.InProgress,
Interop
.Error.EINPROGRESS },
103
{ SocketError.Interrupted,
Interop
.Error.EINTR },
104
{ SocketError.InvalidArgument,
Interop
.Error.EINVAL },
105
{ SocketError.IOPending,
Interop
.Error.EINPROGRESS },
106
{ SocketError.IsConnected,
Interop
.Error.EISCONN },
107
{ SocketError.MessageSize,
Interop
.Error.EMSGSIZE },
108
{ SocketError.NetworkDown,
Interop
.Error.ENETDOWN },
109
{ SocketError.NetworkReset,
Interop
.Error.ENETRESET },
110
{ SocketError.NetworkUnreachable,
Interop
.Error.ENETUNREACH },
111
{ SocketError.NoBufferSpaceAvailable,
Interop
.Error.ENOBUFS },
112
{ SocketError.NoData,
Interop
.Error.ENODATA },
113
{ SocketError.NotConnected,
Interop
.Error.ENOTCONN },
114
{ SocketError.NotSocket,
Interop
.Error.ENOTSOCK },
115
{ SocketError.OperationAborted,
Interop
.Error.ECANCELED },
116
{ SocketError.OperationNotSupported,
Interop
.Error.ENOTSUP },
117
{ SocketError.ProtocolFamilyNotSupported,
Interop
.Error.EPFNOSUPPORT },
118
{ SocketError.ProtocolNotSupported,
Interop
.Error.EPROTONOSUPPORT },
119
{ SocketError.ProtocolOption,
Interop
.Error.ENOPROTOOPT },
120
{ SocketError.ProtocolType,
Interop
.Error.EPROTOTYPE },
121
{ SocketError.Shutdown,
Interop
.Error.EPIPE },
122
{ SocketError.SocketNotSupported,
Interop
.Error.ESOCKTNOSUPPORT },
123
{ SocketError.Success,
Interop
.Error.SUCCESS },
124
{ SocketError.TimedOut,
Interop
.Error.ETIMEDOUT },
125
{ SocketError.TooManyOpenSockets,
Interop
.Error.ENFILE }, // could also have been EMFILE
126
{ SocketError.TryAgain,
Interop
.Error.EAGAIN }, // not a perfect mapping, but better than nothing
127
{ SocketError.WouldBlock,
Interop
.Error.EAGAIN },
128
{ SocketError.SocketError,
Interop
.Error.ESOCKETERROR },
131
internal static SocketError GetSocketErrorForNativeError(
Interop
.Error errno)
139
internal static
Interop
.Error GetNativeErrorForSocketError(SocketError error)
141
Interop
.Error errno;
145
errno = (
Interop
.Error)(int)error;
150
internal static bool TryGetNativeErrorForSocketError(SocketError error, out
Interop
.Error errno)
System\Net\SecureProtocols\SslEnumTypes.cs (55)
15
Ssl2 =
Interop
.SChannel.SP_PROT_SSL2,
17
Ssl3 =
Interop
.SChannel.SP_PROT_SSL3,
19
Tls =
Interop
.SChannel.SP_PROT_TLS1_0,
21
Tls11 =
Interop
.SChannel.SP_PROT_TLS1_1,
22
Tls12 =
Interop
.SChannel.SP_PROT_TLS1_2,
23
Tls13 =
Interop
.SChannel.SP_PROT_TLS1_3,
32
RsaSign = (
Interop
.Crypt32.ALG_CLASS_SIGNATURE |
Interop
.Crypt32.ALG_TYPE_RSA |
Interop
.Crypt32.ALG_CLASS_ANY),
33
RsaKeyX = (
Interop
.Crypt32.ALG_CLASS_KEY_EXCHANGE |
Interop
.Crypt32.ALG_TYPE_RSA |
Interop
.Crypt32.ALG_CLASS_ANY),
34
DiffieHellman = (
Interop
.Crypt32.ALG_CLASS_KEY_EXCHANGE |
Interop
.Crypt32.ALG_TYPE_DH |
Interop
.Crypt32.ALG_SID_DH_EPHEM),
41
Rc2 = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_BLOCK |
Interop
.Crypt32.ALG_SID_RC2),
42
Rc4 = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_STREAM |
Interop
.Crypt32.ALG_SID_RC4),
43
Des = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_BLOCK |
Interop
.Crypt32.ALG_SID_DES),
44
TripleDes = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_BLOCK |
Interop
.Crypt32.ALG_SID_3DES),
45
Aes = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_BLOCK |
Interop
.Crypt32.ALG_SID_AES),
46
Aes128 = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_BLOCK |
Interop
.Crypt32.ALG_SID_AES_128),
47
Aes192 = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_BLOCK |
Interop
.Crypt32.ALG_SID_AES_192),
48
Aes256 = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT |
Interop
.Crypt32.ALG_TYPE_BLOCK |
Interop
.Crypt32.ALG_SID_AES_256),
49
Null = (
Interop
.Crypt32.ALG_CLASS_ENCRYPT), // 0-bit NULL cipher algorithm
56
Md5 = (
Interop
.Crypt32.ALG_CLASS_HASH |
Interop
.Crypt32.ALG_CLASS_ANY |
Interop
.Crypt32.ALG_SID_MD5),
57
Sha1 = (
Interop
.Crypt32.ALG_CLASS_HASH |
Interop
.Crypt32.ALG_CLASS_ANY |
Interop
.Crypt32.ALG_SID_SHA),
58
Sha256 = (
Interop
.Crypt32.ALG_CLASS_HASH |
Interop
.Crypt32.ALG_CLASS_ANY |
Interop
.Crypt32.ALG_SID_SHA_256),
59
Sha384 = (
Interop
.Crypt32.ALG_CLASS_HASH |
Interop
.Crypt32.ALG_CLASS_ANY |
Interop
.Crypt32.ALG_SID_SHA_384),
60
Sha512 = (
Interop
.Crypt32.ALG_CLASS_HASH |
Interop
.Crypt32.ALG_CLASS_ANY |
Interop
.Crypt32.ALG_SID_SHA_512),
System\Net\SocketException.Unix.cs (3)
11
public SocketException() : this(
Interop
.Sys.GetLastErrorInfo())
20
private SocketException(
Interop
.ErrorInfo error) : this(SocketErrorPal.GetSocketErrorForNativeError(error.Error), (uint)error.RawErrno)
29
if (SocketErrorPal.TryGetNativeErrorForSocketError(error, out
Interop
.Error interopErr))
System\Net\Sockets\SocketError.cs (2)
62
IOPending = (int)
Interop
.Winsock.ERROR_IO_PENDING,
63
OperationAborted = (int)
Interop
.Winsock.ERROR_OPERATION_ABORTED,