60 lines
2.3 KiB
C#
60 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Net.NetworkInformation
|
|
{
|
|
// Token: 0x02000161 RID: 353
|
|
internal class IPAddressInformationImplCollection : IPAddressInformationCollection
|
|
{
|
|
// Token: 0x06000BD8 RID: 3032 RVA: 0x00024268 File Offset: 0x00022468
|
|
private IPAddressInformationImplCollection(bool isReadOnly)
|
|
{
|
|
this.is_readonly = isReadOnly;
|
|
}
|
|
|
|
// Token: 0x170002FD RID: 765
|
|
// (get) Token: 0x06000BDA RID: 3034 RVA: 0x00024288 File Offset: 0x00022488
|
|
public override bool IsReadOnly
|
|
{
|
|
get
|
|
{
|
|
return this.is_readonly;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000BDB RID: 3035 RVA: 0x00024290 File Offset: 0x00022490
|
|
public static IPAddressInformationCollection Win32FromAnycast(IntPtr ptr)
|
|
{
|
|
IPAddressInformationImplCollection ipaddressInformationImplCollection = new IPAddressInformationImplCollection(false);
|
|
IntPtr intPtr = ptr;
|
|
while (intPtr != IntPtr.Zero)
|
|
{
|
|
Win32_IP_ADAPTER_ANYCAST_ADDRESS win32_IP_ADAPTER_ANYCAST_ADDRESS = (Win32_IP_ADAPTER_ANYCAST_ADDRESS)Marshal.PtrToStructure(intPtr, typeof(Win32_IP_ADAPTER_ANYCAST_ADDRESS));
|
|
ipaddressInformationImplCollection.Add(new IPAddressInformationImpl(win32_IP_ADAPTER_ANYCAST_ADDRESS.Address.GetIPAddress(), win32_IP_ADAPTER_ANYCAST_ADDRESS.LengthFlags.IsDnsEligible, win32_IP_ADAPTER_ANYCAST_ADDRESS.LengthFlags.IsTransient));
|
|
intPtr = win32_IP_ADAPTER_ANYCAST_ADDRESS.Next;
|
|
}
|
|
ipaddressInformationImplCollection.is_readonly = true;
|
|
return ipaddressInformationImplCollection;
|
|
}
|
|
|
|
// Token: 0x06000BDC RID: 3036 RVA: 0x00024310 File Offset: 0x00022510
|
|
public static IPAddressInformationImplCollection LinuxFromAnycast(IList<IPAddress> addresses)
|
|
{
|
|
IPAddressInformationImplCollection ipaddressInformationImplCollection = new IPAddressInformationImplCollection(false);
|
|
foreach (IPAddress ipaddress in addresses)
|
|
{
|
|
ipaddressInformationImplCollection.Add(new IPAddressInformationImpl(ipaddress, false, false));
|
|
}
|
|
ipaddressInformationImplCollection.is_readonly = true;
|
|
return ipaddressInformationImplCollection;
|
|
}
|
|
|
|
// Token: 0x04000BA4 RID: 2980
|
|
public static readonly IPAddressInformationImplCollection Empty = new IPAddressInformationImplCollection(true);
|
|
|
|
// Token: 0x04000BA5 RID: 2981
|
|
private bool is_readonly;
|
|
}
|
|
}
|