Esempio n. 1
0
        public static void TestCount()
        {
            for (int i = 0; i < IPv6.BitCount; i++)
            {
                IPv6 addr = IPv6.NetMask(i);
                if (IPv6.GetMaskLength(addr) != i)
                {
                    throw new TestFailedException(
                              String.Format("TestCount {0}", i)
                              );
                }

                IPv6 addrDup = IPv6.Parse(addr.ToString());
                if (addrDup != addr)
                {
                    throw new TestFailedException(
                              String.Format("TestCountDup {0}", i)
                              );
                }
            }
        }
Esempio n. 2
0
 public IPv6Network(IPv6 networkAddress, IPv6 networkMask)
 {
     this.maskLength = IPv6.GetMaskLength(networkMask);
     this.ipNetwork  = networkAddress & IPv6.NetMask(this.maskLength);
 }