// <auto-generated/>
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_EnumerateInterfaceAddresses", ExactSpelling = true)]
public static unsafe extern partial int EnumerateInterfaceAddresses(void* context, delegate* unmanaged<void*, byte*, global::Interop.Sys.IpAddressInfo*, void> ipv4Found, delegate* unmanaged<void*, byte*, global::Interop.Sys.IpAddressInfo*, uint*, void> ipv6Found, delegate* unmanaged<void*, byte*, global::Interop.Sys.LinkLayerAddressInfo*, void> linkLayerFound);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_EnumerateGatewayAddressesForInterface", ExactSpelling = true)]
public static unsafe extern partial int EnumerateGatewayAddressesForInterface(void* context, uint interfaceIndex, delegate* unmanaged<void*, global::Interop.Sys.IpAddressInfo*, void> onGatewayFound);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "12.0.15.7810")]
public static unsafe partial int GetNetworkInterfaces(int* count, global::Interop.Sys.NetworkInterfaceInfo** addrs, int* addressCount, global::Interop.Sys.IpAddressInfo** aa)
{
unsafe
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(count, addrs, addressCount, aa);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetNetworkInterfaces", ExactSpelling = true)]
static extern unsafe int __PInvoke(int* __count_native, global::Interop.Sys.NetworkInterfaceInfo** __addrs_native, int* __addressCount_native, global::Interop.Sys.IpAddressInfo** __aa_native);
}
}
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetDomainName", ExactSpelling = true)]
private static unsafe extern partial int GetDomainName(byte* name, int len);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "12.0.15.7810")]
private static unsafe partial int GetHostName(byte* name, int nameLength)
{
unsafe
{
int __lastError;
int __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(name, nameLength);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetHostName", ExactSpelling = true)]
static extern unsafe int __PInvoke(byte* __name_native, int __nameLength_native);
}
}
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_MapTcpState", ExactSpelling = true)]
internal static extern partial global::System.Net.NetworkInformation.TcpState MapTcpState(int nativeState);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPlatformToPal", ExactSpelling = true)]
internal static extern partial global::Interop.Error ConvertErrorPlatformToPal(int platformErrno);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ConvertErrorPalToPlatform", ExactSpelling = true)]
internal static extern partial int ConvertErrorPalToPlatform(global::Interop.Error error);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_StrErrorR", ExactSpelling = true)]
private static unsafe extern partial byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "12.0.15.7810")]
public static unsafe partial global::Interop.Error CreateNetworkChangeListenerSocket(nint* socket)
{
unsafe
{
int __lastError;
global::Interop.Error __retVal;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal = __PInvoke(socket);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_CreateNetworkChangeListenerSocket", ExactSpelling = true)]
static extern unsafe global::Interop.Error __PInvoke(nint* __socket_native);
}
}
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "12.0.15.7810")]
public static unsafe partial global::Interop.Error ReadEvents(global::System.Runtime.InteropServices.SafeHandle socket, delegate* unmanaged<nint, global::Interop.Sys.NetworkChangeKind, void> onNetworkChange)
{
unsafe
{
nint __socket_native = default;
global::Interop.Error __retVal = default;
// Setup - Perform required setup.
global::System.Runtime.InteropServices.Marshalling.SafeHandleMarshaller<global::System.Runtime.InteropServices.SafeHandle>.ManagedToUnmanagedIn __socket_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__socket_native__marshaller.FromManaged(socket);
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__socket_native = __socket_native__marshaller.ToUnmanaged();
__retVal = __PInvoke(__socket_native, onNetworkChange);
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__socket_native__marshaller.Free();
}
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_ReadEvents", ExactSpelling = true)]
static extern unsafe global::Interop.Error __PInvoke(nint __socket_native, delegate* unmanaged<nint, global::Interop.Sys.NetworkChangeKind, void> __onNetworkChange_native);
}
}
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetTcpGlobalStatistics", ExactSpelling = true)]
public static unsafe extern partial int GetTcpGlobalStatistics(global::Interop.Sys.TcpGlobalStatistics* statistics);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetIPv4GlobalStatistics", ExactSpelling = true)]
public static unsafe extern partial int GetIPv4GlobalStatistics(global::Interop.Sys.IPv4GlobalStatistics* statistics);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetUdpGlobalStatistics", ExactSpelling = true)]
public static unsafe extern partial int GetUdpGlobalStatistics(global::Interop.Sys.UdpGlobalStatistics* statistics);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetIcmpv4GlobalStatistics", ExactSpelling = true)]
public static unsafe extern partial int GetIcmpv4GlobalStatistics(global::Interop.Sys.Icmpv4GlobalStatistics* statistics);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetIcmpv6GlobalStatistics", ExactSpelling = true)]
public static unsafe extern partial int GetIcmpv6GlobalStatistics(global::Interop.Sys.Icmpv6GlobalStatistics* statistics);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "12.0.15.7810")]
public static partial int GetNativeIPInterfaceStatistics(string name, out global::Interop.Sys.NativeIPInterfaceStatistics stats)
{
unsafe
{
stats = default;
byte* __name_native = default;
int __retVal = default;
// Setup - Perform required setup.
scoped global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn __name_native__marshaller = new();
try
{
// Marshal - Convert managed data to native data.
__name_native__marshaller.FromManaged(name, stackalloc byte[global::System.Runtime.InteropServices.Marshalling.Utf8StringMarshaller.ManagedToUnmanagedIn.BufferSize]);
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (global::Interop.Sys.NativeIPInterfaceStatistics* __stats_native = &stats)
{
// PinnedMarshal - Convert managed data to native data that requires the managed data to be pinned.
__name_native = __name_native__marshaller.ToUnmanaged();
__retVal = __PInvoke(__name_native, __stats_native);
}
}
finally
{
// CleanupCallerAllocated - Perform cleanup of caller allocated resources.
__name_native__marshaller.Free();
}
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetNativeIPInterfaceStatistics", ExactSpelling = true)]
static extern unsafe int __PInvoke(byte* __name_native, global::Interop.Sys.NativeIPInterfaceStatistics* __stats_native);
}
}
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetNumRoutes", ExactSpelling = true)]
public static extern partial int GetNumRoutes();
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetEstimatedTcpConnectionCount", ExactSpelling = true)]
public static extern partial int GetEstimatedTcpConnectionCount();
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetActiveTcpConnectionInfos", ExactSpelling = true)]
public static unsafe extern partial int GetActiveTcpConnectionInfos(global::Interop.Sys.NativeTcpConnectionInformation* infos, int* infoCount);
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetEstimatedUdpListenerCount", ExactSpelling = true)]
public static extern partial int GetEstimatedUdpListenerCount();
}
}
internal static partial class Interop
{
internal static partial class Sys
{
[global::System.Runtime.InteropServices.DllImportAttribute("libSystem.Native", EntryPoint = "SystemNative_GetActiveUdpListeners", ExactSpelling = true)]
public static unsafe extern partial int GetActiveUdpListeners(global::Interop.Sys.IPEndPointInfo* infos, int* infoCount);
}
}