Fix a bug where resetting a switch did not reset the vlans on the switch
This commit is contained in:
parent
f2c2f9bb96
commit
17b127d69d
@ -340,6 +340,12 @@ namespace EduNetworkBuilder
|
|||||||
if (NB.DebugActions) { Console.WriteLine("Powering on: " + source.hostname); }
|
if (NB.DebugActions) { Console.WriteLine("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:
|
||||||
|
source.ClearIPs(); //reset the device - IPs and VLANs
|
||||||
|
if (NB.DebugActions) { Console.WriteLine("Resetting: " + source.hostname); }
|
||||||
|
//We might see about exploding the device here.
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ namespace EduNetworkBuilder
|
|||||||
StaticRouteCorrupt, VLANChange, VPNChangeEndpoint, VPNChangeKey, BreakDevice }
|
StaticRouteCorrupt, VLANChange, VPNChangeEndpoint, VPNChangeKey, BreakDevice }
|
||||||
public enum NBAction { none, newdevice, changelocation, changecomponent, deletecomponent,
|
public enum NBAction { none, newdevice, changelocation, changecomponent, deletecomponent,
|
||||||
ping, traceroute, arp, cleararp, dhcp,
|
ping, traceroute, arp, cleararp, dhcp,
|
||||||
replaceUPS, replace, poweroff, poweron,
|
replaceUPS, replace, poweroff, poweron, reset,
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
@ -1529,6 +1529,16 @@ namespace EduNetworkBuilder
|
|||||||
|
|
||||||
AC.DoAction();
|
AC.DoAction();
|
||||||
}
|
}
|
||||||
|
public static void DoActionResetDevice(int HostID)
|
||||||
|
{
|
||||||
|
ActionClass AC = new ActionClass();
|
||||||
|
AC.Action = NBAction.reset;
|
||||||
|
AC.SourceID = HostID;
|
||||||
|
|
||||||
|
RegisterAction(AC);
|
||||||
|
|
||||||
|
AC.DoAction();
|
||||||
|
}
|
||||||
public static void DoActionReplaceDeviceUPS(int HostID)
|
public static void DoActionReplaceDeviceUPS(int HostID)
|
||||||
{
|
{
|
||||||
ActionClass AC = new ActionClass();
|
ActionClass AC = new ActionClass();
|
||||||
|
@ -1350,7 +1350,8 @@ namespace EduNetworkBuilder
|
|||||||
private void pbNetworkView_Reset_Click(object sender, EventArgs e)
|
private void pbNetworkView_Reset_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (ItemClickedOn == null) return;
|
if (ItemClickedOn == null) return;
|
||||||
ItemClickedOn.ClearIPs(); //reset the device
|
//ItemClickedOn.ClearIPs(); //reset the device
|
||||||
|
NB.DoActionResetDevice(ItemClickedOn.GetUniqueIdentifier);
|
||||||
UpdateVisuals();
|
UpdateVisuals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -917,7 +917,8 @@ namespace EduNetworkBuilder
|
|||||||
{
|
{
|
||||||
if (myNicType != NicType.lo)
|
if (myNicType != NicType.lo)
|
||||||
{
|
{
|
||||||
nf.myIP = new NB_IPAddress(NB.ZeroIPString);
|
if(myNicType != NicType.port)
|
||||||
|
nf.myIP = new NB_IPAddress(NB.ZeroIPString); //do not do this for ports (have no IP)
|
||||||
nf.SetVLANTag(1, VLANTagType.Untagged);
|
nf.SetVLANTag(1, VLANTagType.Untagged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3138,7 +3138,7 @@ namespace EduNetworkBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clear out all the IP addresses on the device
|
/// Clear out all the IP addresses and VLANs on the device
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void ClearIPs()
|
public void ClearIPs()
|
||||||
{
|
{
|
||||||
@ -3147,8 +3147,7 @@ namespace EduNetworkBuilder
|
|||||||
DefaultGW = new NB_IPAddress(NB.ZeroIPString);
|
DefaultGW = new NB_IPAddress(NB.ZeroIPString);
|
||||||
foreach(NetworkCard nic in NICs)
|
foreach(NetworkCard nic in NICs)
|
||||||
{
|
{
|
||||||
if(nic.GetNicType != NicType.port)
|
nic.ClearIPs(); //Clear IPs and reset all vlans.
|
||||||
nic.ClearIPs();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user