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; } }
/// <summary> /// Configure the IP address setup for a given network card /// </summary> /// <param name="nic">Network Device to configure</param> /// <param name="config">Configuration</param> public static void ConfigIP(HW.Network.NetworkDevice nic, IPv4Config config) { addressMap.Add(config.IPAddress.To32BitNumber(), nic); ipConfigs.Add(config); nic.DataReceived += HandlePacket; }