Initial regression testing logging. Shows changes being done for every step while solving the puzzle.
This commit is contained in:
parent
5b20dd671c
commit
38a6107cea
@ -62,12 +62,12 @@ namespace EduNetworkBuilder
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionClass RunAction(int WhichIndex)
|
public ActionClass RunAction(int WhichIndex, bool NoteAllChanges = false)
|
||||||
{
|
{
|
||||||
if (CurrentNetAction == null) return null;
|
if (CurrentNetAction == null) return null;
|
||||||
if (WhichIndex < CurrentNetAction.Actions.Count)
|
if (WhichIndex < CurrentNetAction.Actions.Count)
|
||||||
{
|
{
|
||||||
CurrentNetAction.Actions[WhichIndex].DoAction();
|
CurrentNetAction.Actions[WhichIndex].DoAction(NoteAllChanges);
|
||||||
return CurrentNetAction.Actions[WhichIndex];
|
return CurrentNetAction.Actions[WhichIndex];
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -180,19 +180,21 @@ namespace EduNetworkBuilder
|
|||||||
public NetworkComponentType newItemType = NetworkComponentType.none; //Making new device
|
public NetworkComponentType newItemType = NetworkComponentType.none; //Making new device
|
||||||
public NetworkComponent ChangedComponent = null;
|
public NetworkComponent ChangedComponent = null;
|
||||||
|
|
||||||
public void DoAction()
|
public void DoAction(bool NoteAllChanges=false)
|
||||||
{
|
{
|
||||||
Network myNet = NB.GetNetwork();
|
Network myNet = NB.GetNetwork();
|
||||||
NetworkDevice source = myNet.GetDeviceFromID(SourceID);
|
NetworkDevice source = myNet.GetDeviceFromID(SourceID);
|
||||||
NetworkComponent sourceC = myNet.GetComponentFromID(SourceID);
|
NetworkComponent sourceC = myNet.GetComponentFromID(SourceID);
|
||||||
NetworkLink sourceNL;
|
NetworkLink sourceNL;
|
||||||
|
string indent = " ";
|
||||||
switch (Action)
|
switch (Action)
|
||||||
{
|
{
|
||||||
case NBAction.changecomponent:
|
case NBAction.changecomponent:
|
||||||
//This could be a link or a device we are changing.
|
//This could be a link or a device we are changing.
|
||||||
if(ChangedComponent is NetworkDevice)
|
if(ChangedComponent is NetworkDevice)
|
||||||
{
|
{
|
||||||
source.UpdateFromComponent(ChangedComponent); //Copy any changes across
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_ChangeDevice") + " " + source.hostname); }
|
||||||
|
source.UpdateFromComponent(ChangedComponent, NoteAllChanges); //Copy any changes across
|
||||||
source.SetImageFromType(); //The image was not saved. Re-make it
|
source.SetImageFromType(); //The image was not saved. Re-make it
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -200,6 +202,7 @@ namespace EduNetworkBuilder
|
|||||||
if(source != null)
|
if(source != null)
|
||||||
myNet.RemoveComponent(source);
|
myNet.RemoveComponent(source);
|
||||||
sourceNL = (NetworkLink)ChangedComponent;
|
sourceNL = (NetworkLink)ChangedComponent;
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_Replace_Link") + " " + sourceNL.Src.HostName + " - " + sourceNL.Dst.HostName); }
|
||||||
myNet.MarkAsLinked(sourceNL.Src, sourceNL.GetUniqueIdentifier);
|
myNet.MarkAsLinked(sourceNL.Src, sourceNL.GetUniqueIdentifier);
|
||||||
myNet.MarkAsLinked(sourceNL.Dst, sourceNL.GetUniqueIdentifier);
|
myNet.MarkAsLinked(sourceNL.Dst, sourceNL.GetUniqueIdentifier);
|
||||||
myNet.AddItem(ChangedComponent);
|
myNet.AddItem(ChangedComponent);
|
||||||
@ -212,6 +215,7 @@ namespace EduNetworkBuilder
|
|||||||
source.ChangeLocation(Location);
|
source.ChangeLocation(Location);
|
||||||
source.UnHide(); //In case it was hidden
|
source.UnHide(); //In case it was hidden
|
||||||
if (NB.DebugActions) { Console.WriteLine("Changing location for: " + source + " " + Location.X + ":" +Location.Y); }
|
if (NB.DebugActions) { Console.WriteLine("Changing location for: " + source + " " + Location.X + ":" +Location.Y); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_MoveDevice") + " " + source.hostname + " - " +Location.X + ":" + Location.Y); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.deletecomponent:
|
case NBAction.deletecomponent:
|
||||||
@ -228,6 +232,7 @@ namespace EduNetworkBuilder
|
|||||||
}
|
}
|
||||||
myNet.RemoveComponent(source);
|
myNet.RemoveComponent(source);
|
||||||
if (NB.DebugActions) { Console.WriteLine("Deleting a device: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Deleting a device: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_DeleteDevice") + " " + source.hostname + " - " + source.myType.ToString()); }
|
||||||
} else if(sourceC != null && sourceC is NetworkLink)
|
} else if(sourceC != null && sourceC is NetworkLink)
|
||||||
{
|
{
|
||||||
if (myNet.ItemIsCritical(sourceC.hostname))
|
if (myNet.ItemIsCritical(sourceC.hostname))
|
||||||
@ -236,6 +241,7 @@ namespace EduNetworkBuilder
|
|||||||
SourceL.Destroy(); //Mark both ends as being deleted
|
SourceL.Destroy(); //Mark both ends as being deleted
|
||||||
myNet.RemoveComponent(SourceL); //Get rid of this link
|
myNet.RemoveComponent(SourceL); //Get rid of this link
|
||||||
if (NB.DebugActions) { Console.WriteLine("Deleting a link: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Deleting a link: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_DeleteLink") + " " + SourceL.Src.HostName + " - " + SourceL.Dst.HostName); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.newdevice:
|
case NBAction.newdevice:
|
||||||
@ -254,13 +260,15 @@ namespace EduNetworkBuilder
|
|||||||
if (myNet.BlockedByTree(BottomLeft)) CanDo = false;
|
if (myNet.BlockedByTree(BottomLeft)) CanDo = false;
|
||||||
if (CanDo)
|
if (CanDo)
|
||||||
{
|
{
|
||||||
ChangedComponent = (NetworkDevice)myNet.AddItem(newItemType, Location);
|
NetworkDevice newdevice = (NetworkDevice)myNet.AddItem(newItemType, Location);
|
||||||
if (NB.DebugActions && source != null) { Console.WriteLine("Adding a Device: " + source.hostname); }
|
|
||||||
|
if (NB.DebugActions && source != null) { Console.WriteLine("Adding a Device: " + newdevice.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_AddDevice") + " " + newdevice.hostname + " - " + newdevice.myType.ToString()); }
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NB.SetBuilderWindowStatis(NB.Translate("NB_TreePlacementError"));
|
NB.SetBuilderWindowStatis(NB.Translate("NB_TreePlacementError"));
|
||||||
if (NB.DebugActions) { Console.WriteLine("Unable to add device: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Unable to add device: " + ChangedComponent.hostname); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.dhcp:
|
case NBAction.dhcp:
|
||||||
@ -268,20 +276,25 @@ namespace EduNetworkBuilder
|
|||||||
{
|
{
|
||||||
source.DHCPRequestFromHere();
|
source.DHCPRequestFromHere();
|
||||||
if (NB.DebugActions) { Console.WriteLine("Requesting DHCP: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Requesting DHCP: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_RequestDHCP") + " " + source.hostname); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.arp:
|
case NBAction.arp:
|
||||||
if (source != null)
|
if (source != null)
|
||||||
{
|
{
|
||||||
|
//We have not implimented this well. But, here it is anyway. We would do this if showing ethernet stuff
|
||||||
source.AskArpFromHere(Destination);
|
source.AskArpFromHere(Destination);
|
||||||
if (NB.DebugActions) { Console.WriteLine("Requesting DHCP: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Requesting ARP: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_RequestARP") + " " + source.hostname + " - " + Destination.GetIPString); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.cleararp:
|
case NBAction.cleararp:
|
||||||
if (source != null)
|
if (source != null)
|
||||||
{
|
{
|
||||||
|
//We have not implimented this well. But, here it is anyway. We would do this if showing ethernet stuff
|
||||||
source.ClearArps();
|
source.ClearArps();
|
||||||
if (NB.DebugActions) { Console.WriteLine("Clearing ARP: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Clearing ARP: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_ClearArp") + " " + source.hostname + " - " + Destination.GetIPString); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.ping:
|
case NBAction.ping:
|
||||||
@ -289,6 +302,7 @@ namespace EduNetworkBuilder
|
|||||||
{
|
{
|
||||||
source.PingFromHere(Destination);
|
source.PingFromHere(Destination);
|
||||||
if (NB.DebugActions) { Console.WriteLine("Pinging " + Destination.GetIPString + " from " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Pinging " + Destination.GetIPString + " from " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_DoPing") + " " + source.hostname + " - " + Destination.GetIPString); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.traceroute:
|
case NBAction.traceroute:
|
||||||
@ -296,6 +310,7 @@ namespace EduNetworkBuilder
|
|||||||
{
|
{
|
||||||
source.TracerouteFromHere(Destination);
|
source.TracerouteFromHere(Destination);
|
||||||
if (NB.DebugActions) { Console.WriteLine("Traceroute: " + Destination.GetIPString + " from " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Traceroute: " + Destination.GetIPString + " from " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_DoTraceroute") + " " + source.hostname + " - " + Destination.GetIPString ); }
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.replace:
|
case NBAction.replace:
|
||||||
@ -310,6 +325,7 @@ namespace EduNetworkBuilder
|
|||||||
|
|
||||||
myNet.RegisterDeviceReplaced(source.hostname); //replace it.
|
myNet.RegisterDeviceReplaced(source.hostname); //replace it.
|
||||||
if (NB.DebugActions) { Console.WriteLine("Replacing device: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Replacing device: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_Replace_Device") + " " + source.hostname); }
|
||||||
}
|
}
|
||||||
else if (sourceC is NetworkLink)
|
else if (sourceC is NetworkLink)
|
||||||
{
|
{
|
||||||
@ -322,27 +338,32 @@ namespace EduNetworkBuilder
|
|||||||
myNet.RemoveComponent(sourceNL);
|
myNet.RemoveComponent(sourceNL);
|
||||||
NetworkLink nNL = new NetworkLink(sourceID, destID, LinkType.normal);
|
NetworkLink nNL = new NetworkLink(sourceID, destID, LinkType.normal);
|
||||||
myNet.AddItem(nNL);
|
myNet.AddItem(nNL);
|
||||||
if (NB.DebugActions) { Console.WriteLine("Replacing link: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Replacing link: " + sourceID.HostName + " - " + destID.HostName); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_Replace_Link") + " " + sourceID.HostName + " - " + destID.HostName); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NBAction.replaceUPS:
|
case NBAction.replaceUPS:
|
||||||
myNet.RegisterUPSAdded(source.hostname);
|
myNet.RegisterUPSAdded(source.hostname);
|
||||||
if (NB.DebugActions) { Console.WriteLine("Replacing UPS on: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Replacing UPS on: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_Replace_UPS") + " " + source.hostname); }
|
||||||
break;
|
break;
|
||||||
case NBAction.poweroff:
|
case NBAction.poweroff:
|
||||||
source.PowerOff = true;
|
source.PowerOff = true;
|
||||||
myNet.RegisterDeviceReset(source.hostname);
|
myNet.RegisterDeviceReset(source.hostname);
|
||||||
if (NB.DebugActions) { Console.WriteLine("Powering off: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Powering off: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_Powering_OFF") + " " + source.hostname); }
|
||||||
break;
|
break;
|
||||||
case NBAction.poweron:
|
case NBAction.poweron:
|
||||||
source.PowerOff = false;
|
source.PowerOff = false;
|
||||||
if (NB.DebugActions) { Console.WriteLine("Powering on: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Powering on: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_Powering_ON") + " " + source.hostname); }
|
||||||
//We might see about exploding the device here.
|
//We might see about exploding the device here.
|
||||||
break;
|
break;
|
||||||
case NBAction.reset:
|
case NBAction.reset:
|
||||||
source.ClearIPs(); //reset the device - IPs and VLANs
|
source.ClearIPs(); //reset the device - IPs and VLANs
|
||||||
if (NB.DebugActions) { Console.WriteLine("Resetting: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("Resetting: " + source.hostname); }
|
||||||
|
if (NoteAllChanges) { NB.AddNetMessage("", indent + NB.Translate("AC_Resetting") + " " + source.hostname); }
|
||||||
//We might see about exploding the device here.
|
//We might see about exploding the device here.
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="..\packages\WiX.3.11.2\build\wix.props" Condition="Exists('..\packages\WiX.3.11.2\build\wix.props')" />
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@ -28,11 +29,13 @@
|
|||||||
<PublisherName>Tim Young</PublisherName>
|
<PublisherName>Tim Young</PublisherName>
|
||||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||||
<WebPage>publish.htm</WebPage>
|
<WebPage>publish.htm</WebPage>
|
||||||
<ApplicationRevision>53</ApplicationRevision>
|
<ApplicationRevision>54</ApplicationRevision>
|
||||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||||
|
<NuGetPackageImportStamp>
|
||||||
|
</NuGetPackageImportStamp>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
@ -263,6 +266,7 @@
|
|||||||
<DependentUpon>VLANConfig.cs</DependentUpon>
|
<DependentUpon>VLANConfig.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="EduNetworkBuilder_TemporaryKey.pfx" />
|
<None Include="EduNetworkBuilder_TemporaryKey.pfx" />
|
||||||
|
<None Include="packages.config" />
|
||||||
<None Include="Properties\Settings.settings">
|
<None Include="Properties\Settings.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||||
@ -475,6 +479,12 @@
|
|||||||
<Content Include="Resources\NBIco.ico" />
|
<Content Include="Resources\NBIco.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WiX.3.11.2\build\wix.props'))" />
|
||||||
|
</Target>
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
<Target Name="BeforeBuild">
|
<Target Name="BeforeBuild">
|
||||||
|
@ -1078,6 +1078,14 @@ namespace EduNetworkBuilder
|
|||||||
return randomizedList;
|
return randomizedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void AddNetMessage(string host, string message)
|
||||||
|
{
|
||||||
|
Network thenet = GetNetwork();
|
||||||
|
//Console.WriteLine("Adding message: " + host + " : " + message);
|
||||||
|
if (thenet == null) return; //we cannot add it. do not blow up
|
||||||
|
thenet.AddMessage(new PacketMessage(host, message));
|
||||||
|
}
|
||||||
|
|
||||||
public static bool OpenURLInExternalBrowser(string URL)
|
public static bool OpenURLInExternalBrowser(string URL)
|
||||||
{
|
{
|
||||||
Uri uriResult;
|
Uri uriResult;
|
||||||
|
@ -1696,7 +1696,7 @@ namespace EduNetworkBuilder
|
|||||||
//We are doing a replay and enough time has passed from the last replay...
|
//We are doing a replay and enough time has passed from the last replay...
|
||||||
NBSettings Settings = NB.GetSettings();
|
NBSettings Settings = NB.GetSettings();
|
||||||
ActionCollection AC = Settings.GetUserActionCollection();
|
ActionCollection AC = Settings.GetUserActionCollection();
|
||||||
ActionClass Success = AC.RunAction(NextReplayIndex++);
|
ActionClass Success = AC.RunAction(NextReplayIndex++, true); //note all changes as we do them
|
||||||
|
|
||||||
|
|
||||||
NextReplayAction = DateTime.UtcNow.AddMilliseconds(NB.MillisecondsBetweenReplays);
|
NextReplayAction = DateTime.UtcNow.AddMilliseconds(NB.MillisecondsBetweenReplays);
|
||||||
|
@ -978,6 +978,17 @@ namespace EduNetworkBuilder
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string AllInterfacesString(bool UseCidr= false)
|
||||||
|
{
|
||||||
|
string thestring = "";
|
||||||
|
foreach (NetworkInterface oneIF in interfaces)
|
||||||
|
{
|
||||||
|
if (thestring != "") thestring += ",";
|
||||||
|
thestring += oneIF.InterfaceString(UseCidr);
|
||||||
|
}
|
||||||
|
return thestring;
|
||||||
|
}
|
||||||
|
|
||||||
public NB_IPAddress FirstIP()
|
public NB_IPAddress FirstIP()
|
||||||
{
|
{
|
||||||
List<NB_IPAddress> addresses = IPAddressList();
|
List<NB_IPAddress> addresses = IPAddressList();
|
||||||
|
@ -99,7 +99,7 @@ namespace EduNetworkBuilder
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void UpdateFromComponent(NetworkComponent CopyFrom)
|
public virtual void UpdateFromComponent(NetworkComponent CopyFrom, bool NoteAllChanges = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1518,28 +1518,109 @@ namespace EduNetworkBuilder
|
|||||||
return arps;
|
return arps;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateFromComponent(NetworkComponent CopyFrom)
|
public override void UpdateFromComponent(NetworkComponent CopyFrom, bool NoteAllChanges = false)
|
||||||
{
|
{
|
||||||
if (CopyFrom.GetType() != this.GetType()) return; //we cannot copy from it if it is different
|
if (CopyFrom.GetType() != this.GetType()) return; //we cannot copy from it if it is different
|
||||||
NetworkDevice ndCopyFrom = (NetworkDevice)CopyFrom;
|
NetworkDevice ndCopyFrom = (NetworkDevice)CopyFrom;
|
||||||
if (Object.ReferenceEquals(this, CopyFrom)) return; //No need to copy values to itself
|
if (Object.ReferenceEquals(this, CopyFrom)) return; //No need to copy values to itself
|
||||||
|
|
||||||
|
Network mainnet = NB.GetNetwork();
|
||||||
|
string indent = " ";
|
||||||
|
//if(NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + NB.Translate("NDUpdateComponent")));
|
||||||
|
|
||||||
|
if (hostname != ndCopyFrom.hostname)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "hostname: " + hostname + " -> " + ndCopyFrom.hostname));
|
||||||
hostname = ndCopyFrom.hostname;
|
hostname = ndCopyFrom.hostname;
|
||||||
|
}
|
||||||
|
|
||||||
Size = ndCopyFrom.Size;
|
Size = ndCopyFrom.Size;
|
||||||
|
if (DefaultGW.GetIPString != ndCopyFrom.DefaultGW.GetIPString)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "DefaultGW: " + DefaultGW.GetIPString + " -> " + ndCopyFrom.DefaultGW.GetIPString));
|
||||||
DefaultGW = ndCopyFrom.DefaultGW;
|
DefaultGW = ndCopyFrom.DefaultGW;
|
||||||
|
}
|
||||||
if (ndCopyFrom.MyImage != null)
|
if (ndCopyFrom.MyImage != null)
|
||||||
MyImage = new Bitmap(ndCopyFrom.MyImage);
|
MyImage = new Bitmap(ndCopyFrom.MyImage);
|
||||||
else
|
else
|
||||||
MyImage = null;
|
MyImage = null;
|
||||||
|
|
||||||
|
if (CanAddNics != ndCopyFrom.CanAddNics)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "CanAddNics: " + CanAddNics + " -> " + ndCopyFrom.CanAddNics));
|
||||||
CanAddNics = ndCopyFrom.CanAddNics;
|
CanAddNics = ndCopyFrom.CanAddNics;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CanServeDHCP != ndCopyFrom.CanServeDHCP)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "CanServeDHCP: " + CanServeDHCP + " -> " + ndCopyFrom.CanServeDHCP));
|
||||||
CanServeDHCP = ndCopyFrom.CanServeDHCP;
|
CanServeDHCP = ndCopyFrom.CanServeDHCP;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CanUseDHCP != ndCopyFrom.CanUseDHCP)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "CanUseDHCP: " + CanUseDHCP + " -> " + ndCopyFrom.CanUseDHCP));
|
||||||
CanUseDHCP = ndCopyFrom.CanUseDHCP;
|
CanUseDHCP = ndCopyFrom.CanUseDHCP;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (MustUseDHCP != ndCopyFrom.MustUseDHCP)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "MustUseDHCP: " + MustUseDHCP + " -> " + ndCopyFrom.MustUseDHCP));
|
||||||
MustUseDHCP = ndCopyFrom.MustUseDHCP;
|
MustUseDHCP = ndCopyFrom.MustUseDHCP;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDHCPServer != ndCopyFrom.isDHCPServer)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "IsDHCPServer: " + isDHCPServer + " -> " + ndCopyFrom.isDHCPServer));
|
||||||
isDHCPServer = ndCopyFrom.isDHCPServer;
|
isDHCPServer = ndCopyFrom.isDHCPServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isDNSServer != ndCopyFrom.isDNSServer)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "IsDNSserver: " + isDNSServer + " -> " + ndCopyFrom.isDNSServer));
|
||||||
isDNSServer = ndCopyFrom.isDNSServer;
|
isDNSServer = ndCopyFrom.isDNSServer;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HasAdvFirewall != ndCopyFrom.HasAdvFirewall)
|
||||||
|
{
|
||||||
|
if (NoteAllChanges && mainnet != null) mainnet.AddMessage(new PacketMessage("", indent + "HasAdvancedFirewall: " + HasAdvFirewall + " -> " + ndCopyFrom.HasAdvFirewall));
|
||||||
HasAdvFirewall = ndCopyFrom.HasAdvFirewall;
|
HasAdvFirewall = ndCopyFrom.HasAdvFirewall;
|
||||||
|
}
|
||||||
|
|
||||||
MyLocation = ndCopyFrom.MyLocation;
|
MyLocation = ndCopyFrom.MyLocation;
|
||||||
|
|
||||||
|
//Process NICs.
|
||||||
|
if (NoteAllChanges && mainnet != null)
|
||||||
|
{
|
||||||
|
//List all nics that we are dropping
|
||||||
|
foreach (NetworkCard nic in NICs)
|
||||||
|
{
|
||||||
|
NetworkCard foundnic = ndCopyFrom.NicFromName(nic.NicName());
|
||||||
|
if (foundnic == null)
|
||||||
|
mainnet.AddMessage(new PacketMessage("", indent + "DropNIC: " + nic.NicName()));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//The nic still exists. Note any major changes. IP, netmask
|
||||||
|
if((foundnic.myNicType == NicType.wport || foundnic.myNicType == NicType.wlan) && foundnic.SSID != nic.SSID)
|
||||||
|
mainnet.AddMessage(new PacketMessage("", indent + "SSID: " + nic.SSID + " -> " + foundnic.SSID));
|
||||||
|
if ((foundnic.myNicType == NicType.vpn || foundnic.myNicType == NicType.vpn) && foundnic.EncryptionKey != nic.EncryptionKey)
|
||||||
|
mainnet.AddMessage(new PacketMessage("", indent + "EncryptionKey: " + nic.EncryptionKey + " -> " + foundnic.EncryptionKey));
|
||||||
|
|
||||||
|
//Compare interfaces - should be done at nic level...
|
||||||
|
if (foundnic.AllInterfacesString() != nic.AllInterfacesString())
|
||||||
|
mainnet.AddMessage(new PacketMessage("", indent + "Interfaces: " + nic.AllInterfacesString(true) + " -> " + foundnic.AllInterfacesString(true)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//List all nics that we are dropping
|
||||||
|
foreach (NetworkCard nic in ndCopyFrom.NICs)
|
||||||
|
{
|
||||||
|
NetworkCard mynic = NicFromName(nic.NicName());
|
||||||
|
if (mynic == null)
|
||||||
|
mainnet.AddMessage(new PacketMessage("", indent + "AddNIC: " + nic.NicName() + " " +nic.AllInterfacesString()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Now, copy across the NICs
|
||||||
NICs.Clear();
|
NICs.Clear();
|
||||||
foreach(NetworkCard nic in ndCopyFrom.NICs)
|
foreach(NetworkCard nic in ndCopyFrom.NICs)
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Calibri;}}
|
{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033\deflangfe1033{\fonttbl{\f0\fswiss\fprq2\fcharset0 Calibri;}}
|
||||||
{\colortbl ;\red0\green0\blue255;}
|
{\colortbl ;\red0\green0\blue255;}
|
||||||
{\*\generator Riched20 10.0.22621}{\*\mmathPr\mdispDef1\mwrapIndent1440 }\viewkind4\uc1
|
{\*\generator Riched20 10.0.22621}{\*\mmathPr\mdispDef1\mwrapIndent1440 }\viewkind4\uc1
|
||||||
\pard\nowidctlpar\sa200\sl276\slmult1\b\f0\fs22\lang9 Version 1.0.52\par
|
\pard\nowidctlpar\sa200\sl276\slmult1\b\f0\fs22\lang9 Version 1.0.54\b0\par
|
||||||
|
* Minor changefor developers allowing more information about what is happening during regression testing. \par
|
||||||
|
\b Version 1.0.53\par
|
||||||
|
*\b0 Show a line between devices when dragging ethernet cables. Makes it easier to see.\par
|
||||||
|
* Tried highlighting what you are supposed to be filling out next, when creating network links.\b\par
|
||||||
|
Version 1.0.52\par
|
||||||
\b0 * Change publish URL to an actual domain.\b\par
|
\b0 * Change publish URL to an actual domain.\b\par
|
||||||
Version 1.0.51\par
|
Version 1.0.51\par
|
||||||
\b0 * Added small time-based delay when printing packets; on fast computers the packets would fly by too fast.\par
|
\b0 * Added small time-based delay when printing packets; on fast computers the packets would fly by too fast.\par
|
||||||
|
@ -2129,4 +2129,72 @@
|
|||||||
<value>Regression testing</value>
|
<value>Regression testing</value>
|
||||||
<comment>LBW_Regression_Testing = Regression testing</comment>
|
<comment>LBW_Regression_Testing = Regression testing</comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="AC_AddDevice" xml:space="preserve">
|
||||||
|
<value>Add Device</value>
|
||||||
|
<comment>AC_AddDevice = Add Device</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_ChangeDevice" xml:space="preserve">
|
||||||
|
<value>Change Device</value>
|
||||||
|
<comment>AC_ChangeDevice = Change Device</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_ClearArp" xml:space="preserve">
|
||||||
|
<value>Clear ARP</value>
|
||||||
|
<comment>AC_ClearArp = Clear ARP</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_DeleteDevice" xml:space="preserve">
|
||||||
|
<value>Delete Device</value>
|
||||||
|
<comment>AC_DeleteDevice = Delete Device</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_DeleteLink" xml:space="preserve">
|
||||||
|
<value>Delete link</value>
|
||||||
|
<comment>AC_DeleteLink = Delete link</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_DoPing" xml:space="preserve">
|
||||||
|
<value>Do ping</value>
|
||||||
|
<comment>AC_DoPing = Do ping</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_DoTraceroute" xml:space="preserve">
|
||||||
|
<value>Do Traceroute</value>
|
||||||
|
<comment>AC_DoTraceroute = Do Traceroute</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_MoveDevice" xml:space="preserve">
|
||||||
|
<value>Move Device</value>
|
||||||
|
<comment>AC_MoveDevice = Move Device</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_Powering_OFF" xml:space="preserve">
|
||||||
|
<value>Powering Off</value>
|
||||||
|
<comment>AC_Powering_OFF = Powering Off</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_Powering_ON" xml:space="preserve">
|
||||||
|
<value>Powering On</value>
|
||||||
|
<comment>AC_Powering_OFF - Powering On</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_Replace_Device" xml:space="preserve">
|
||||||
|
<value>Replace Device</value>
|
||||||
|
<comment>AC_Replace_Device = Replace Device</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_Replace_Link" xml:space="preserve">
|
||||||
|
<value>Replace Link</value>
|
||||||
|
<comment>AC_Replace_Link = Replace Link</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_Replace_UPS" xml:space="preserve">
|
||||||
|
<value>Replace UPS</value>
|
||||||
|
<comment>AC_Replace_UPS = Replace UPS</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_RequestARP" xml:space="preserve">
|
||||||
|
<value>Request ARP</value>
|
||||||
|
<comment>AC_RequestARP = Request ARP</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_RequestDHCP" xml:space="preserve">
|
||||||
|
<value>Request DHCP</value>
|
||||||
|
<comment>AC_RequestDHCP = Request DHCP</comment>
|
||||||
|
</data>
|
||||||
|
<data name="AC_Resetting" xml:space="preserve">
|
||||||
|
<value>Resetting</value>
|
||||||
|
<comment>AC_Resetting = Resetting</comment>
|
||||||
|
</data>
|
||||||
|
<data name="NDUpdateComponent" xml:space="preserve">
|
||||||
|
<value>Updating Device</value>
|
||||||
|
<comment>NDUpdateComponent = Update Device</comment>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
4
EduNetworkBuilder/packages.config
Normal file
4
EduNetworkBuilder/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="WiX" version="3.11.2" targetFramework="net45" />
|
||||||
|
</packages>
|
Loading…
Reference in New Issue
Block a user