示例#1
0
        public Win32IPv4InterfaceProperties(Win32_IP_ADAPTER_INFO ainfo, Win32_MIB_IFROW mib)
        {
            this.ainfo = ainfo;
            this.mib   = mib;
            int pOutBufLen = 0;

            GetPerAdapterInfo(mib.Index, null, ref pOutBufLen);
            painfo = new Win32_IP_PER_ADAPTER_INFO();
            int perAdapterInfo = GetPerAdapterInfo(mib.Index, painfo, ref pOutBufLen);

            if (perAdapterInfo != 0)
            {
                throw new NetworkInformationException(perAdapterInfo);
            }
        }
示例#2
0
        public Win32IPv4InterfaceProperties(Win32_IP_ADAPTER_INFO ainfo, Win32_MIB_IFROW mib)
        {
            this.ainfo = ainfo;
            this.mib   = mib;

            // get per-adapter info.
            int size = 0;

            GetPerAdapterInfo(mib.Index, null, ref size);
            painfo = new Win32_IP_PER_ADAPTER_INFO();
            int ret = GetPerAdapterInfo(mib.Index, painfo, ref size);

            if (ret != 0)
            {
                throw new NetworkInformationException(ret);
            }
        }
示例#3
0
 internal Win32NetworkInterface2(Win32_IP_ADAPTER_ADDRESSES addr)
 {
     this.addr  = addr;
     mib4       = default(Win32_MIB_IFROW);
     mib4.Index = addr.Alignment.IfIndex;
     if (GetIfEntry(ref mib4) != 0)
     {
         mib4.Index = -1;                 // unavailable;
     }
     mib6       = default(Win32_MIB_IFROW);
     mib6.Index = addr.Ipv6IfIndex;
     if (GetIfEntry(ref mib6) != 0)
     {
         mib6.Index = -1;                 // unavailable;
     }
     ip4stats    = new Win32IPv4InterfaceStatistics(mib4);
     ip_if_props = new Win32IPInterfaceProperties2(addr, mib4, mib6);
 }
 private Win32NetworkInterface2(Win32_IP_ADAPTER_ADDRESSES addr)
 {
     this.addr       = addr;
     this.mib4       = default(Win32_MIB_IFROW);
     this.mib4.Index = addr.Alignment.IfIndex;
     if (Win32NetworkInterface2.GetIfEntry(ref this.mib4) != 0)
     {
         this.mib4.Index = -1;
     }
     this.mib6       = default(Win32_MIB_IFROW);
     this.mib6.Index = addr.Ipv6IfIndex;
     if (Win32NetworkInterface2.GetIfEntry(ref this.mib6) != 0)
     {
         this.mib6.Index = -1;
     }
     this.ip4stats    = new Win32IPv4InterfaceStatistics(this.mib4);
     this.ip_if_props = new Win32IPInterfaceProperties2(addr, this.mib4, this.mib6);
 }
		public Win32IPv4InterfaceProperties (Win32_IP_ADAPTER_INFO ainfo, Win32_MIB_IFROW mib)
		{
			this.ainfo = ainfo;
			this.mib = mib;

			// get per-adapter info.
			int size = 0;
			GetPerAdapterInfo (mib.Index, null, ref size);
			painfo = new Win32_IP_PER_ADAPTER_INFO ();
			int ret = GetPerAdapterInfo (mib.Index, painfo, ref size);
			if (ret != 0)
				throw new NetworkInformationException (ret);
		}
示例#6
0
 static extern int GetIfEntry(ref Win32_MIB_IFROW row);
示例#7
0
		public Win32IPInterfaceProperties2 (Win32_IP_ADAPTER_ADDRESSES addr, Win32_MIB_IFROW mib4, Win32_MIB_IFROW mib6)
		{
			this.addr = addr;
			this.mib4 = mib4;
			this.mib6 = mib6;
		}
示例#8
0
		Win32NetworkInterface2 (Win32_IP_ADAPTER_ADDRESSES addr)
		{
			this.addr = addr;
			mib4 = default (Win32_MIB_IFROW);
			mib4.Index = addr.Alignment.IfIndex;
			if (GetIfEntry (ref mib4) != 0)
				mib4.Index = -1; // unavailable;
			mib6 = default (Win32_MIB_IFROW);
			mib6.Index = addr.Ipv6IfIndex;
			if (GetIfEntry (ref mib6) != 0)
				mib6.Index = -1; // unavailable;
			ip4stats = new Win32IPv4InterfaceStatistics (mib4);
			ip_if_props = new Win32IPInterfaceProperties2 (addr, mib4, mib6);
		}
示例#9
0
		static extern int GetIfEntry (ref Win32_MIB_IFROW row);
示例#10
0
 static int GetIfEntry(ref Win32_MIB_IFROW row)
 {
     throw new System.NotImplementedException();
 }
示例#11
0
 public Win32IPInterfaceProperties2(Win32_IP_ADAPTER_ADDRESSES addr, Win32_MIB_IFROW mib4, Win32_MIB_IFROW mib6)
 {
     this.addr = addr;
     this.mib4 = mib4;
     this.mib6 = mib6;
 }
 public Win32IPv6InterfaceProperties(Win32_MIB_IFROW mib)
 {
     this.mib = mib;
 }
		static int GetIfEntry (ref Win32_MIB_IFROW row)
		{
			throw new System.NotImplementedException();
		}
 public Win32IPv4InterfaceStatistics(Win32_MIB_IFROW info)
 {
     this.info = info;
 }