public int Compare(SegmentIP iprange) { var bitcmp = Math.Max(_mask, iprange._mask); var rst = IsByteArrMatch(_ipBs, iprange._ipBs, bitcmp); return(rst); }
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); }
public void Add(SegmentIP ipr) { IsOrdered = false; _list.Add(ipr); }