Example #1
0
        public int Compare(SegmentIP iprange)
        {
            var bitcmp = Math.Max(_mask, iprange._mask);
            var rst    = IsByteArrMatch(_ipBs, iprange._ipBs, bitcmp);

            return(rst);
        }
Example #2
0
        List <SegmentIP> GetDistinct(List <SegmentIP> undistinct)
        {
            var       list = new List <SegmentIP>();
            SegmentIP last = undistinct[0];

            list.Add(last);
            for (int i = 1; i < undistinct.Count; i++)
            {
                var ipmask = undistinct[i];
                if (ipmask.Compare(last) == 0)
                {
                    continue;
                }

                list.Add(ipmask);
                last = ipmask;
            }
            return(list);
        }
Example #3
0
        public void Add(SegmentIP ipr)
        {
            IsOrdered = false;

            _list.Add(ipr);
        }