コード例 #1
0
ファイル: ARPCache.cs プロジェクト: ChrisJamesSadler/IL2CPU
        public static HW.Network.MACAddress Resolve(IPv4Address ipAddress)
        {
            ensureCacheExists();
            if (cache.ContainsKey(ipAddress.To32BitNumber()) == false)
            {
                return(null);
            }

            return(cache[ipAddress.To32BitNumber()]);
        }
コード例 #2
0
ファイル: ARPCache.cs プロジェクト: ChrisJamesSadler/IL2CPU
        public static void Update(IPv4Address ipAddress, HW.Network.MACAddress macAddress)
        {
            ensureCacheExists();
            UInt32 ip_hash = ipAddress.To32BitNumber();

            if (ip_hash == 0)
            {
                return;
            }

            if (cache.ContainsKey(ip_hash) == false)
            {
                cache.Add(ip_hash, macAddress);
            }
            else
            {
                cache[ip_hash] = macAddress;
            }
        }
コード例 #3
0
ファイル: ARPCache.cs プロジェクト: ChrisJamesSadler/IL2CPU
 public static bool Contains(IPv4Address ipAddress)
 {
     ensureCacheExists();
     return(cache.ContainsKey(ipAddress.To32BitNumber()));
 }