63 references to Interop
System.Net.NameResolution (63)
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\Interop\Unix\System.Native\Interop.ErrNo.cs (2)
11
[LibraryImport(
Interop
.Libraries.SystemNative, EntryPoint = "SystemNative_GetErrNo")]
15
[LibraryImport(
Interop
.Libraries.SystemNative, EntryPoint = "SystemNative_SetErrNo")]
src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (6)
11
public static unsafe
Interop
.Sys.IPAddress GetNativeIPAddress(this IPAddress ipAddress)
13
var nativeIPAddress = default(
Interop
.Sys.IPAddress);
15
ipAddress.TryWriteBytes(new Span<byte>(nativeIPAddress.Address,
Interop
.Sys.IPv6AddressBytes), out int bytesWritten);
16
Debug.Assert(bytesWritten == sizeof(uint) || bytesWritten ==
Interop
.Sys.IPv6AddressBytes, $"Unexpected length: {bytesWritten}");
27
public static unsafe IPAddress GetIPAddress(this
Interop
.Sys.IPAddress nativeIPAddress)
37
new ReadOnlySpan<byte>(nativeIPAddress.Address,
Interop
.Sys.IPv6AddressBytes),
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\SocketProtocolSupportPal.Unix.cs (5)
25
Interop
.Error result =
Interop
.Sys.Socket((int)af, DgramSocketType, 0, &socket);
27
return result !=
Interop
.Error.EAFNOSUPPORT && result !=
Interop
.Error.EPROTONOSUPPORT;
33
Interop
.Sys.Close(socket);
System\Net\NameResolutionPal.Unix.cs (21)
33
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_AGAIN:
35
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_BADFLAGS:
36
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_BADARG:
38
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_FAIL:
40
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_FAMILY:
42
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_NONAME:
44
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_MEMORY:
46
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_SYSTEM:
47
Debug.Fail($"Unexpected error: {error} errno: {
Interop
.Sys.GetErrNo()}");
55
private static unsafe void ParseHostEntry(
Interop
.Sys.HostEntry hostEntry, bool justAddresses, out string? hostName, out string[] aliases, out IPAddress[] addresses)
81
var nativeAddresses = new
Interop
.Sys.IPAddress[hostEntry.IPAddressCount];
84
Interop
.Sys.IPAddress* addressHandle = hostEntry.IPAddressList;
87
Interop
.Sys.IPAddress nativeAddr = addressHandle[i];
126
Interop
.Sys.FreeHostEntry(&hostEntry);
138
Interop
.Sys.HostEntry entry;
139
int result =
Interop
.Sys.GetHostEntryForName(name, addressFamily, &entry);
158
byte* buffer = stackalloc byte[
Interop
.Sys.NI_MAXHOST + 1 /*for null*/];
177
int error =
Interop
.Sys.GetNameInfo(
182
Interop
.Sys.NI_MAXHOST,
185
Interop
.Sys.GetNameInfoFlags.NI_NAMEREQD);
192
public static string GetHostName() =>
Interop
.Sys.GetHostName();