diff --git a/EduNetworkBuilder/NB.cs b/EduNetworkBuilder/NB.cs
index bd505fc..5b6ef20 100644
--- a/EduNetworkBuilder/NB.cs
+++ b/EduNetworkBuilder/NB.cs
@@ -40,10 +40,12 @@ namespace EduNetworkBuilder
public enum GeneralComponentType { none, link, device }
public enum NBSoundType { none, success, saved_ok, saved_failed }
public enum RTFWindowContents { help, about, release_notes }
- public enum NetTestType { NeedsLocalIPTo, NeedsDefaultGW, NeedsLinkToDevice, NeedsRouteToNet,
+ public enum NetTestType { NeedsLocalIPTo, NeedsDefaultGW, NeedsLinkToDevice, NeedsRouteToNet,
+ NeedsUntaggedVLAN, NeedsTaggedVLAN, NeedsForbiddenVLAN,
SuccessfullyPings, SuccessfullyPingsAgain, SuccessfullyArps, SuccessfullyDHCPs, HelpRequest, ReadContextHelp, FailedPing,
DHCPServerEnabled,
- LockAll, LockIP, LockRoute, LockNic, LockDHCP, LockGateway
+ LockAll, LockIP, LockRoute, LockNic, LockDHCP, LockGateway,
+ LockVLAN, LockNicVLAN, LockInterfaceVLAN, LockVLANNames,
}
public enum NetTestVerbosity { none, basic, hints, full }
public enum LBContents { routes, messages, dhcp, puzzles }
diff --git a/EduNetworkBuilder/NetTest.cs b/EduNetworkBuilder/NetTest.cs
index c5aa546..ecc523e 100644
--- a/EduNetworkBuilder/NetTest.cs
+++ b/EduNetworkBuilder/NetTest.cs
@@ -70,6 +70,9 @@ namespace EduNetworkBuilder
case NetTestType.LockIP:
case NetTestType.LockNic:
case NetTestType.LockRoute:
+ case NetTestType.LockInterfaceVLAN:
+ case NetTestType.LockNicVLAN:
+ case NetTestType.LockVLANNames:
TaskWasDone = true;
break;
}
@@ -176,6 +179,27 @@ namespace EduNetworkBuilder
case NetTestType.LockGateway:
toreturn = NB.Translate("NT_TstDiscriptGteway");
break;
+ case NetTestType.LockVLANNames:
+ toreturn = NB.Translate("NT_TstDiscriptLockVLANNames");
+ break;
+ case NetTestType.LockVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptLockVLAN");
+ break;
+ case NetTestType.LockNicVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptLockNicVLAN");
+ break;
+ case NetTestType.LockInterfaceVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptLockInterfaceVLAN");
+ break;
+ case NetTestType.NeedsTaggedVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptNeedsTaggedVLAN");
+ break;
+ case NetTestType.NeedsUntaggedVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptNeedsUntaggedVLAN");
+ break;
+ case NetTestType.NeedsForbiddenVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptNeedsForbiddenVLAN");
+ break;
case NetTestType.ReadContextHelp:
toreturn = NB.Translate("_ReadContext");
break;
@@ -236,6 +260,27 @@ namespace EduNetworkBuilder
case NetTestType.LockGateway:
toreturn = NB.Translate("NT_TstDiscriptGteway") + ":";
break;
+ case NetTestType.LockVLANNames:
+ toreturn = NB.Translate("NT_TstDiscriptLockVLANNames") + ":";
+ break;
+ case NetTestType.LockVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptLockVLAN") + ":";
+ break;
+ case NetTestType.LockNicVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptLockNicVLAN") + ":";
+ break;
+ case NetTestType.LockInterfaceVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptLockInterfaceVLAN") + ":";
+ break;
+ case NetTestType.NeedsTaggedVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptNeedsTaggedVLAN") + ":";
+ break;
+ case NetTestType.NeedsUntaggedVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptNeedsUntaggedVLAN") + ":";
+ break;
+ case NetTestType.NeedsForbiddenVLAN:
+ toreturn = NB.Translate("NT_TstDiscriptNeedsForbiddenVLAN") + ":";
+ break;
case NetTestType.ReadContextHelp:
toreturn = NB.Translate("_ReadContext");
break;
@@ -446,6 +491,10 @@ namespace EduNetworkBuilder
case NetTestType.LockNic:
case NetTestType.LockRoute:
case NetTestType.LockGateway:
+ case NetTestType.LockInterfaceVLAN:
+ case NetTestType.LockNicVLAN:
+ case NetTestType.LockVLAN:
+ case NetTestType.LockVLANNames:
return true; //Nothing to solve. We just lock it so it cannot be changed.
}
return false;
diff --git a/EduNetworkBuilder/NetTestEditor.cs b/EduNetworkBuilder/NetTestEditor.cs
index e21492a..7f02f90 100644
--- a/EduNetworkBuilder/NetTestEditor.cs
+++ b/EduNetworkBuilder/NetTestEditor.cs
@@ -161,6 +161,11 @@ namespace EduNetworkBuilder
cbDest.Items.Add(nname);
}
}
+ else if(ToEdit.TheTest == NetTestType.LockVLANNames)
+ {
+ //No items for lockvlannames
+ cbDest.Items.Add(NB.Translate("_All"));
+ }
else
{ //List all the hosts
foreach (string host in HostNames)
diff --git a/EduNetworkBuilder/Network.cs b/EduNetworkBuilder/Network.cs
index dafde49..d1a63e2 100644
--- a/EduNetworkBuilder/Network.cs
+++ b/EduNetworkBuilder/Network.cs
@@ -744,6 +744,8 @@ namespace EduNetworkBuilder
{
if (nt.TheTest == NetTestType.LockAll)
return true;
+ if (WhatToCheck == nt.TheTest && WhatToCheck == NetTestType.LockVLANNames) //no dest to check
+ return true;
if (WhatToCheck == nt.TheTest && dest == nt.dHost)
return true;
}
diff --git a/EduNetworkBuilder/Resources/languages/edustrings.resx b/EduNetworkBuilder/Resources/languages/edustrings.resx
index 92388f8..721b07b 100644
--- a/EduNetworkBuilder/Resources/languages/edustrings.resx
+++ b/EduNetworkBuilder/Resources/languages/edustrings.resx
@@ -1573,4 +1573,32 @@
Enable VLANs on this network. Otherwise, the vlan configuration stuff is kept hidden to keep it simple
OW_OWVLANs = Enable VLANs on this network. Otherwise, the vlan configuration stuff is kept hidden to keep it simple
+
+ The VLAN on an interface is locked
+ NT_TstDiscriptLockInterfaceVLAN
+
+
+ The VLAN on a NIC is locked
+ NT_TstDiscriptLockNicVLAN
+
+
+ A VLAN is Locked
+ NT_TstDiscriptLockVLAN
+
+
+ VLAN Names and IDs are Locked
+ NT_TstDiscriptLockVLANNames = VLAN Names and IDs are Locked
+
+
+ The Interface needs a Forbidden VLAN
+ NT_TstDiscriptNeedsForbiddenVLAN
+
+
+ The Interface needs a Tagged VLAN
+ NT_TstDiscriptNeedsTaggedVLAN
+
+
+ The Interface needs an Untagged VLAN
+ NT_TstDiscriptNeedsUntaggedVLAN
+
\ No newline at end of file
diff --git a/EduNetworkBuilder/VLANConfig.cs b/EduNetworkBuilder/VLANConfig.cs
index 55c46d6..20e5b8b 100644
--- a/EduNetworkBuilder/VLANConfig.cs
+++ b/EduNetworkBuilder/VLANConfig.cs
@@ -19,6 +19,7 @@ namespace EduNetworkBuilder
List interfaces = new List();
BindingList StashedVLANNameList = new BindingList();
List LockedIFs = new List();
+ bool LockedNames = false;
bool processing = false;
@@ -32,6 +33,7 @@ namespace EduNetworkBuilder
processing = false;
dgv_VLANAssignments.DataBindingComplete += AssignmentsDataBindingComplete;
+ dgv_VLANNames.DataBindingComplete += NamesDataBindingComplete;
UpdateForm();
}
@@ -46,9 +48,23 @@ namespace EduNetworkBuilder
}
}
+ void NamesDataBindingComplete(object Sender, EventArgs e)
+ {
+ dgv_VLANNames.Columns[0].ReadOnly = LockedNames;
+ dgv_VLANNames.Columns[1].ReadOnly = LockedNames;
+ }
+
private void UpdateForm()
{
if (processing) return;
+ string hostname = "";
+
+ LockedNames = false;
+
+ if (TheDevice != null)
+ {
+ hostname = TheDevice.hostname;
+ }
LockedIFs.Clear();
UpdateNamesFromForm(); //Read in any changes so far
@@ -70,7 +86,13 @@ namespace EduNetworkBuilder
dgv_VLANNames.DataSource = StashedVLANNameList;
dgv_VLANNames.AllowUserToAddRows = true;
-
+ if (TheDevice != null)
+ {
+ if (theNet.ItemIsLocked(hostname, "", NetTestType.LockVLANNames))
+ LockedNames = true;
+ else
+ LockedNames = false;
+ }
VlanBindings.Columns.Clear();
VlanBindings.Columns.Add("IF", typeof(string));
foreach (VLANName vn in theNet.VlanNames)
@@ -92,17 +114,23 @@ namespace EduNetworkBuilder
if (NIC.GetNicType == NicType.none) continue;
if (NIC.GetNicType == NicType.tun) continue;
bool locked = false;
- string hostname = "";
- if (TheDevice != null) { hostname = TheDevice.hostname;
+
+ if (TheDevice != null) {
if (theNet.ItemIsLocked(hostname, oneNic, NetTestType.LockNic))
- {
locked = true;
- }
- }
+ if (theNet.ItemIsLocked(hostname, oneNic, NetTestType.LockAll))
+ locked = true;
+ if (theNet.ItemIsLocked(hostname, oneNic, NetTestType.LockNicVLAN))
+ locked = true;
+ }
for (int i = 0; i < NIC.IFCount; i++)
{
NetworkInterface nif = NIC.GetInterface(i);
-
+ if (TheDevice != null)
+ {
+ if (theNet.ItemIsLocked(hostname, nif.nic_name, NetTestType.LockInterfaceVLAN))
+ locked = true;
+ }
DataRow DR = VlanBindings.NewRow();
DR["IF"] = nif.nic_name;
foreach (VLANName vn in theNet.VlanNames)