Example #1
0
        /// <summary>
        /// Add all addresses associated with the given nif in the
        /// given subnet to the given list.
        /// </summary>
        private static void AddMatchingAddrs(NetworkInterface nif, SubnetUtils.SubnetInfo
                                             subnetInfo, IList <IPAddress> addrs)
        {
            Enumeration <IPAddress> ifAddrs = nif.GetInetAddresses();

            while (ifAddrs.MoveNext())
            {
                IPAddress ifAddr = ifAddrs.Current;
                if (subnetInfo.IsInRange(ifAddr.GetHostAddress()))
                {
                    addrs.AddItem(ifAddr);
                }
            }
        }
Example #2
0
 private CIDRMatch(AccessPrivilege accessPrivilege, SubnetUtils.SubnetInfo subnetInfo
                   )
     : base(accessPrivilege)
 {
     this.subnetInfo = subnetInfo;
 }