63 references to Interop
System.Net.NameResolution (63)
src\libraries\Common\src\Interop\Unix\Interop.Errors.cs (6)
123_error = Interop.Sys.ConvertErrorPlatformToPal(errno); 140get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } 145return Interop.Sys.StrError(RawErrno); 219public static Interop.ErrorInfo Info(this Interop.Error error) 221return 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)
11public static unsafe Interop.Sys.IPAddress GetNativeIPAddress(this IPAddress ipAddress) 13var nativeIPAddress = default(Interop.Sys.IPAddress); 15ipAddress.TryWriteBytes(new Span<byte>(nativeIPAddress.Address, Interop.Sys.IPv6AddressBytes), out int bytesWritten); 16Debug.Assert(bytesWritten == sizeof(uint) || bytesWritten == Interop.Sys.IPv6AddressBytes, $"Unexpected length: {bytesWritten}"); 27public static unsafe IPAddress GetIPAddress(this Interop.Sys.IPAddress nativeIPAddress) 37new ReadOnlySpan<byte>(nativeIPAddress.Address, Interop.Sys.IPv6AddressBytes),
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (23)
26Interop.Error err = Interop.Sys.GetSocketAddressSizes(&ipv4, &ipv6, &uds, &max); 27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 39private static void ThrowOnFailure(Interop.Error err) 43case Interop.Error.SUCCESS: 46case Interop.Error.EFAULT: 50case Interop.Error.EAFNOSUPPORT: 63Interop.Error err; 66err = Interop.Sys.GetAddressFamily(rawAddress, buffer.Length, (int*)&family); 75Interop.Error err; 81err = Interop.Sys.SetAddressFamily(rawAddress, buffer.Length, (int)family); 91Interop.Error err; 94err = Interop.Sys.GetPort(rawAddress, buffer.Length, &port); 103Interop.Error err; 106err = Interop.Sys.SetPort(rawAddress, buffer.Length, port); 115Interop.Error err; 118err = Interop.Sys.GetIPv4Address(rawAddress, buffer.Length, &ipAddress); 128Interop.Error err; 132err = Interop.Sys.GetIPv6Address(rawAddress, buffer.Length, ipAddress, address.Length, &localScope); 141Interop.Error err; 144err = Interop.Sys.SetIPv4Address(rawAddress, buffer.Length, address); 167Interop.Error err; 170err = Interop.Sys.SetIPv6Address(rawAddress, buffer.Length, address, addressLength, scope);
src\libraries\Common\src\System\Net\SocketProtocolSupportPal.Unix.cs (5)
25Interop.Error result = Interop.Sys.Socket((int)af, DgramSocketType, 0, &socket); 27return result != Interop.Error.EAFNOSUPPORT && result != Interop.Error.EPROTONOSUPPORT; 33Interop.Sys.Close(socket);
System\Net\NameResolutionPal.Unix.cs (21)
33case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_AGAIN: 35case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_BADFLAGS: 36case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_BADARG: 38case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_FAIL: 40case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_FAMILY: 42case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_NONAME: 44case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_MEMORY: 46case (int)Interop.Sys.GetAddrInfoErrorFlags.EAI_SYSTEM: 47Debug.Fail($"Unexpected error: {error} errno: {Interop.Sys.GetErrNo()}"); 55private static unsafe void ParseHostEntry(Interop.Sys.HostEntry hostEntry, bool justAddresses, out string? hostName, out string[] aliases, out IPAddress[] addresses) 81var nativeAddresses = new Interop.Sys.IPAddress[hostEntry.IPAddressCount]; 84Interop.Sys.IPAddress* addressHandle = hostEntry.IPAddressList; 87Interop.Sys.IPAddress nativeAddr = addressHandle[i]; 126Interop.Sys.FreeHostEntry(&hostEntry); 138Interop.Sys.HostEntry entry; 139int result = Interop.Sys.GetHostEntryForName(name, addressFamily, &entry); 158byte* buffer = stackalloc byte[Interop.Sys.NI_MAXHOST + 1 /*for null*/]; 177int error = Interop.Sys.GetNameInfo( 182Interop.Sys.NI_MAXHOST, 185Interop.Sys.GetNameInfoFlags.NI_NAMEREQD); 192public static string GetHostName() => Interop.Sys.GetHostName();