diff --git a/EduNetworkBuilder/NetworkCard.cs b/EduNetworkBuilder/NetworkCard.cs index a50c60c..30554fc 100644 --- a/EduNetworkBuilder/NetworkCard.cs +++ b/EduNetworkBuilder/NetworkCard.cs @@ -103,6 +103,9 @@ namespace EduNetworkBuilder if (MAC != compareWith.MAC) return false; //List interfaces = new List(); + if (interfaces.Count != compareWith.interfaces.Count) return false; + for (int i = 0; i < interfaces.Count; i++) + if (!interfaces[i].Equals(compareWith.interfaces[i])) return false; if (UsesDHCP != compareWith.UsesDHCP) return false; if (CanUseDHCP != compareWith.CanUseDHCP) return false; if (MustUseDHCP != compareWith.MustUseDHCP) return false; diff --git a/EduNetworkBuilder/NetworkInterface.cs b/EduNetworkBuilder/NetworkInterface.cs index 140fa72..3136e7e 100644 --- a/EduNetworkBuilder/NetworkInterface.cs +++ b/EduNetworkBuilder/NetworkInterface.cs @@ -66,6 +66,17 @@ namespace EduNetworkBuilder return null; } + public bool Equals(NetworkInterface CompareWith) + { + if (!myIP.Equals(CompareWith.myIP)) return false; + if (nic_name != CompareWith.nic_name) return false; + if (!AttachedToHostNic.Equals(CompareWith.AttachedToHostNic)) return false; + if (VLANs.Count != CompareWith.VLANs.Count) return false; + for (int i = 0; i < VLANs.Count; i++) + if (!VLANs[i].Equals(CompareWith.VLANs[i])) return false; + return true; + } + public VLANTagType GetVLANTag(int id) { VLANInfo vli = GetVLANInfo(id);