Rename IPAddress class to NB_IPAddress. We will be using the System.Net.IPAddress class and do not want to have a conflict.
This commit is contained in:
		@@ -46,7 +46,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
        private List<Packet> myPackets = new List<Packet>();
 | 
			
		||||
        private List<PacketMessage> myMessages = new List<PacketMessage>();
 | 
			
		||||
        private bool _isDirty = false;
 | 
			
		||||
        private IPAddress lastAddress = new IPAddress("0.0.0.0/24");
 | 
			
		||||
        private NB_IPAddress lastAddress = new NB_IPAddress("0.0.0.0/24");
 | 
			
		||||
        public string NetworkFilename = "";
 | 
			
		||||
        public List<NetTest> NetTests = new List<NetTest>();
 | 
			
		||||
        private bool AlreadyDisplayedMessage = false;
 | 
			
		||||
@@ -724,12 +724,12 @@ namespace EduNetworkBuilder
 | 
			
		||||
            _isDirty = true;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void StoreLastIP(IPAddress ip)
 | 
			
		||||
        public void StoreLastIP(NB_IPAddress ip)
 | 
			
		||||
        {
 | 
			
		||||
            lastAddress = ip;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public IPAddress RetrieveLastIP()
 | 
			
		||||
        public NB_IPAddress RetrieveLastIP()
 | 
			
		||||
        {
 | 
			
		||||
            return lastAddress;
 | 
			
		||||
        }
 | 
			
		||||
@@ -962,7 +962,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
        /// <param name="ToFind">The IP address to find</param>
 | 
			
		||||
        /// <param name="Source">The device that has it</param>
 | 
			
		||||
        /// <returns></returns>
 | 
			
		||||
        public bool HasUniqueIP(IPAddress ToFind, NetworkDevice Source)
 | 
			
		||||
        public bool HasUniqueIP(NB_IPAddress ToFind, NetworkDevice Source)
 | 
			
		||||
        {
 | 
			
		||||
            NetworkDevice ND;
 | 
			
		||||
            foreach (NetworkComponent nc in NetComponents)
 | 
			
		||||
@@ -1234,7 +1234,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
        /// <param name="packet_type">The type of packet that arrived</param>
 | 
			
		||||
        /// <param name="sHost">The host it originated from</param>
 | 
			
		||||
        /// <param name="dHost">The machine it went to</param>
 | 
			
		||||
        public void NotePacketArrived(PacketType packet_type, NetworkDevice source, IPAddress sIP, IPAddress dIP, int PacketID)
 | 
			
		||||
        public void NotePacketArrived(PacketType packet_type, NetworkDevice source, NB_IPAddress sIP, NB_IPAddress dIP, int PacketID)
 | 
			
		||||
        {
 | 
			
		||||
            string sHost = ReverseDNSLookup(source, sIP);
 | 
			
		||||
            string dHost = ReverseDNSLookup(source, dIP);
 | 
			
		||||
@@ -1267,7 +1267,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public bool HasCompletedPingTest(PacketType packet_type, NetworkDevice source, IPAddress sIP, IPAddress dIP, int PacketID)
 | 
			
		||||
        public bool HasCompletedPingTest(PacketType packet_type, NetworkDevice source, NB_IPAddress sIP, NB_IPAddress dIP, int PacketID)
 | 
			
		||||
        {
 | 
			
		||||
            if (packet_type != PacketType.ping_answer) return false; //This only works with pings.
 | 
			
		||||
            string sHost = ReverseDNSLookup(source, sIP);
 | 
			
		||||
@@ -1286,15 +1286,15 @@ namespace EduNetworkBuilder
 | 
			
		||||
        public bool NoteActionDone(NetTestType theTest, string sHost, string dHost)
 | 
			
		||||
        {
 | 
			
		||||
            bool OldVal = false;
 | 
			
		||||
            IPAddress sourceIP;
 | 
			
		||||
            NB_IPAddress sourceIP;
 | 
			
		||||
            string sourceIPstring;
 | 
			
		||||
            IPAddress destIP;
 | 
			
		||||
            NB_IPAddress destIP;
 | 
			
		||||
            string destIPstring;
 | 
			
		||||
            foreach (NetTest nt in NetTests)
 | 
			
		||||
            {
 | 
			
		||||
                sourceIP = new IPAddress(sHost);
 | 
			
		||||
                sourceIP = new NB_IPAddress(sHost);
 | 
			
		||||
                sourceIPstring = ReverseDNSLookup(null, sourceIP); //this will either be an ip address or the host name
 | 
			
		||||
                destIP = new IPAddress(dHost);
 | 
			
		||||
                destIP = new NB_IPAddress(dHost);
 | 
			
		||||
                destIPstring = ReverseDNSLookup(null, destIP); //this will either be an ip address or the host name             
 | 
			
		||||
                if ((nt.TheTest == NetTestType.HelpRequest || nt.TheTest == NetTestType.FailedPing || nt.TheTest == NetTestType.ReadContextHelp) && 
 | 
			
		||||
                    (sHost == nt.sHost || sourceIPstring == nt.sHost) && 
 | 
			
		||||
@@ -1736,7 +1736,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public IPAddress DNSLookup(NetworkDevice source, string toFind)
 | 
			
		||||
        public NB_IPAddress DNSLookup(NetworkDevice source, string toFind)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            foreach(NetworkComponent nc in NB.Randomize(NetComponents))
 | 
			
		||||
@@ -1747,7 +1747,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
                    nd = (NetworkDevice)nc;
 | 
			
		||||
                    if(nd.hostname == toFind)
 | 
			
		||||
                    {
 | 
			
		||||
                        IPAddress found = nd.BestIPForThis(source);
 | 
			
		||||
                        NB_IPAddress found = nd.BestIPForThis(source);
 | 
			
		||||
                        return found;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
@@ -1755,7 +1755,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public string ReverseDNSLookup(NetworkDevice source, IPAddress toFind)
 | 
			
		||||
        public string ReverseDNSLookup(NetworkDevice source, NB_IPAddress toFind)
 | 
			
		||||
        {
 | 
			
		||||
            if (source != null && source.HasIPAddress(toFind))
 | 
			
		||||
                return source.hostname; //if the host is 127.0.0.1 or something.
 | 
			
		||||
@@ -2041,7 +2041,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        public void DoAllPing(IPAddress destination)
 | 
			
		||||
        public void DoAllPing(NB_IPAddress destination)
 | 
			
		||||
        {
 | 
			
		||||
            NetworkDevice nd;
 | 
			
		||||
            foreach (NetworkComponent nc in NetComponents)
 | 
			
		||||
@@ -2164,7 +2164,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
 | 
			
		||||
            foreach (NetTest NT in NetTests)
 | 
			
		||||
            {
 | 
			
		||||
                IPAddress destination;
 | 
			
		||||
                NB_IPAddress destination;
 | 
			
		||||
                NetworkDevice src = null;
 | 
			
		||||
                //Here we do any pings or actions
 | 
			
		||||
                switch (NT.TheTest)
 | 
			
		||||
@@ -2177,7 +2177,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
                        if (src == null) continue;
 | 
			
		||||
                        destination = DNSLookup(src, NT.dHost);
 | 
			
		||||
                        if (destination == null || destination.GetIPString == NB.ZeroIPString)
 | 
			
		||||
                            destination = new IPAddress(NT.dHost);
 | 
			
		||||
                            destination = new NB_IPAddress(NT.dHost);
 | 
			
		||||
                        src.PingFromHere(destination);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case NetTestType.SuccessfullyArps:
 | 
			
		||||
@@ -2185,7 +2185,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
                        if (src == null) continue;
 | 
			
		||||
                        destination = DNSLookup(src, NT.dHost);
 | 
			
		||||
                        if (destination == null || destination.GetIPString == NB.ZeroIPString)
 | 
			
		||||
                            destination = new IPAddress(NT.dHost);
 | 
			
		||||
                            destination = new NB_IPAddress(NT.dHost);
 | 
			
		||||
                        src.AskArpFromHere(destination);
 | 
			
		||||
                        break;
 | 
			
		||||
                    case NetTestType.SuccessfullyTraceroutes:
 | 
			
		||||
@@ -2193,7 +2193,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
                        if (src == null) continue;
 | 
			
		||||
                        destination = DNSLookup(src, NT.dHost);
 | 
			
		||||
                        if (destination == null || destination.GetIPString == NB.ZeroIPString)
 | 
			
		||||
                            destination = new IPAddress(NT.dHost);
 | 
			
		||||
                            destination = new NB_IPAddress(NT.dHost);
 | 
			
		||||
                        src.TracerouteFromHere(destination);
 | 
			
		||||
                        break;
 | 
			
		||||
                }
 | 
			
		||||
@@ -2224,7 +2224,7 @@ namespace EduNetworkBuilder
 | 
			
		||||
            NB.RegisterInvisibleNetwork(this);
 | 
			
		||||
            NetworkDevice src = GetDeviceFromName(source);
 | 
			
		||||
            if (src == null) return null;
 | 
			
		||||
            IPAddress destination = DNSLookup(src, dest);
 | 
			
		||||
            NB_IPAddress destination = DNSLookup(src, dest);
 | 
			
		||||
            src.PingFromHere(destination);
 | 
			
		||||
            NonVisualProcessPacketsOnce();
 | 
			
		||||
            NB.UnregisterInvisibleNetwork();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user