74 references to Interop
System.Net.NameResolution (74)
LibraryImports.g.cs (11)
71
private static partial int PathConf(string path, global::
Interop
.Sys.PathConfName name)
100
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.PathConfName __name_native);
109
internal static partial int FStat(global::System.Runtime.InteropServices.SafeHandle fd, out global::
Interop
.Sys.FileStatus output)
122
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
141
static extern unsafe int __PInvoke(nint __fd_native, global::
Interop
.Sys.FileStatus* __output_native);
150
internal static partial int Stat(string path, out global::
Interop
.Sys.FileStatus output)
163
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
182
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.FileStatus* __output_native);
191
internal static partial int LStat(string path, out global::
Interop
.Sys.FileStatus output)
204
fixed (global::
Interop
.Sys.FileStatus* __output_native = &output)
223
static extern unsafe int __PInvoke(byte* __path_native, global::
Interop
.Sys.FileStatus* __output_native);
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
124
_error =
Interop
.Sys.ConvertErrorPlatformToPal(errno);
141
get { return _rawErrno == -1 ? (_rawErrno =
Interop
.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; }
146
return
Interop
.Sys.StrError(RawErrno);
220
public static
Interop
.ErrorInfo Info(this
Interop
.Error error)
222
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)
34
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_AGAIN:
36
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_BADFLAGS:
37
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_BADARG:
39
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_FAIL:
41
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_FAMILY:
43
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_NONAME:
45
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_MEMORY:
47
case (int)
Interop
.Sys.GetAddrInfoErrorFlags.EAI_SYSTEM:
48
Debug.Fail($"Unexpected error: {error} errno: {
Interop
.Sys.GetErrNo()}");
56
private static unsafe void ParseHostEntry(
Interop
.Sys.HostEntry hostEntry, bool justAddresses, out string? hostName, out string[] aliases, out IPAddress[] addresses)
82
var nativeAddresses = new
Interop
.Sys.IPAddress[hostEntry.IPAddressCount];
85
Interop
.Sys.IPAddress* addressHandle = hostEntry.IPAddressList;
88
Interop
.Sys.IPAddress nativeAddr = addressHandle[i];
127
Interop
.Sys.FreeHostEntry(&hostEntry);
139
Interop
.Sys.HostEntry entry;
140
int result =
Interop
.Sys.GetHostEntryForName(name, addressFamily, &entry);
159
byte* buffer = stackalloc byte[
Interop
.Sys.NI_MAXHOST + 1 /*for null*/];
178
int error =
Interop
.Sys.GetNameInfo(
183
Interop
.Sys.NI_MAXHOST,
186
Interop
.Sys.GetNameInfoFlags.NI_NAMEREQD);
193
public static string GetHostName() =>
Interop
.Sys.GetHostName();