Example #1
0
        private IPv4Record MakeIPv4Record(string[] row)
        {
            IPv4Record r = new IPv4Record();

            r.ip_from = uint.Parse(row[0]);
            r.ip_to   = uint.Parse(row[1]);
            SetGenericIPRecordFields(r, row);
            return(r);
        }
Example #2
0
 public IPv6Record(IPRecord copyFrom) : base(copyFrom)
 {
     if (copyFrom is IPv6Record)
     {
         IPv6Record v6 = copyFrom as IPv6Record;
         ip_from = v6.ip_from;
         ip_to   = v6.ip_to;
     }
     else if (copyFrom is IPv4Record)
     {
         IPv4Record v4 = copyFrom as IPv4Record;
         ip_from = (((ulong)v4.ip_from) | 0xFFFF00000000).ToString();
         ip_to   = (((ulong)v4.ip_to) | 0xFFFF00000000).ToString();
     }
 }
Example #3
0
 public IPv4Record(IPRecord copyFrom) : base(copyFrom)
 {
     if (copyFrom is IPv4Record)
     {
         IPv4Record v4 = copyFrom as IPv4Record;
         ip_from = v4.ip_from;
         ip_to   = v4.ip_to;
     }
     else if (copyFrom is IPv6Record)
     {
         IPv6Record v6 = copyFrom as IPv6Record;
         if (BigInteger.TryParse(v6.ip_from, out BigInteger from) && BigInteger.TryParse(v6.ip_to, out BigInteger to))
         {
             ip_from = (uint)(from & 0xFFFFFFFF);
             ip_to   = (uint)(to & 0xFFFFFFFF);
         }
     }
 }