scripts
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace System.Net.NetworkInformation
|
||||
{
|
||||
// Token: 0x0200015D RID: 349
|
||||
internal class Win32IPAddressCollection : IPAddressCollection
|
||||
{
|
||||
// Token: 0x06000BBD RID: 3005 RVA: 0x00023F28 File Offset: 0x00022128
|
||||
private Win32IPAddressCollection()
|
||||
{
|
||||
}
|
||||
|
||||
// Token: 0x06000BBE RID: 3006 RVA: 0x00023F30 File Offset: 0x00022130
|
||||
public Win32IPAddressCollection(params IntPtr[] heads)
|
||||
{
|
||||
foreach (IntPtr intPtr in heads)
|
||||
{
|
||||
this.AddSubsequentlyString(intPtr);
|
||||
}
|
||||
this.is_readonly = true;
|
||||
}
|
||||
|
||||
// Token: 0x06000BBF RID: 3007 RVA: 0x00023F6C File Offset: 0x0002216C
|
||||
public Win32IPAddressCollection(params Win32_IP_ADDR_STRING[] al)
|
||||
{
|
||||
foreach (Win32_IP_ADDR_STRING win32_IP_ADDR_STRING in al)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(win32_IP_ADDR_STRING.IpAddress))
|
||||
{
|
||||
this.Add(IPAddress.Parse(win32_IP_ADDR_STRING.IpAddress));
|
||||
this.AddSubsequentlyString(win32_IP_ADDR_STRING.Next);
|
||||
}
|
||||
}
|
||||
this.is_readonly = true;
|
||||
}
|
||||
|
||||
// Token: 0x06000BC1 RID: 3009 RVA: 0x00024004 File Offset: 0x00022204
|
||||
public static Win32IPAddressCollection FromAnycast(IntPtr ptr)
|
||||
{
|
||||
Win32IPAddressCollection win32IPAddressCollection = new Win32IPAddressCollection();
|
||||
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));
|
||||
win32IPAddressCollection.Add(win32_IP_ADAPTER_ANYCAST_ADDRESS.Address.GetIPAddress());
|
||||
intPtr = win32_IP_ADAPTER_ANYCAST_ADDRESS.Next;
|
||||
}
|
||||
win32IPAddressCollection.is_readonly = true;
|
||||
return win32IPAddressCollection;
|
||||
}
|
||||
|
||||
// Token: 0x06000BC2 RID: 3010 RVA: 0x00024068 File Offset: 0x00022268
|
||||
public static Win32IPAddressCollection FromDnsServer(IntPtr ptr)
|
||||
{
|
||||
Win32IPAddressCollection win32IPAddressCollection = new Win32IPAddressCollection();
|
||||
IntPtr intPtr = ptr;
|
||||
while (intPtr != IntPtr.Zero)
|
||||
{
|
||||
Win32_IP_ADAPTER_DNS_SERVER_ADDRESS win32_IP_ADAPTER_DNS_SERVER_ADDRESS = (Win32_IP_ADAPTER_DNS_SERVER_ADDRESS)Marshal.PtrToStructure(intPtr, typeof(Win32_IP_ADAPTER_DNS_SERVER_ADDRESS));
|
||||
win32IPAddressCollection.Add(win32_IP_ADAPTER_DNS_SERVER_ADDRESS.Address.GetIPAddress());
|
||||
intPtr = win32_IP_ADAPTER_DNS_SERVER_ADDRESS.Next;
|
||||
}
|
||||
win32IPAddressCollection.is_readonly = true;
|
||||
return win32IPAddressCollection;
|
||||
}
|
||||
|
||||
// Token: 0x06000BC3 RID: 3011 RVA: 0x000240CC File Offset: 0x000222CC
|
||||
private void AddSubsequentlyString(IntPtr head)
|
||||
{
|
||||
IntPtr intPtr = head;
|
||||
while (intPtr != IntPtr.Zero)
|
||||
{
|
||||
Win32_IP_ADDR_STRING win32_IP_ADDR_STRING = (Win32_IP_ADDR_STRING)Marshal.PtrToStructure(intPtr, typeof(Win32_IP_ADDR_STRING));
|
||||
this.Add(IPAddress.Parse(win32_IP_ADDR_STRING.IpAddress));
|
||||
intPtr = win32_IP_ADDR_STRING.Next;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x170002F3 RID: 755
|
||||
// (get) Token: 0x06000BC4 RID: 3012 RVA: 0x00024120 File Offset: 0x00022320
|
||||
public override bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.is_readonly;
|
||||
}
|
||||
}
|
||||
|
||||
// Token: 0x04000B9E RID: 2974
|
||||
public static readonly Win32IPAddressCollection Empty = new Win32IPAddressCollection(new IntPtr[] { IntPtr.Zero });
|
||||
|
||||
// Token: 0x04000B9F RID: 2975
|
||||
private bool is_readonly;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user