add a level and two devices

This commit is contained in:
Tim Young 2015-09-01 17:46:03 -05:00
parent c5ef5d7b89
commit fe37d98e9b
8 changed files with 1801 additions and 10 deletions

View File

@ -245,6 +245,7 @@
<None Include="Resources\Level3_Middle_Man_Out.enbx" /> <None Include="Resources\Level3_Middle_Man_Out.enbx" />
<None Include="Resources\Level3_NowhereToGo.enbx" /> <None Include="Resources\Level3_NowhereToGo.enbx" />
<None Include="Resources\Level3_PhoneyNetwork.enbx" /> <None Include="Resources\Level3_PhoneyNetwork.enbx" />
<None Include="Resources\Level3_TwoDHCPServers.enbx" />
<None Include="Resources\Level3_VPNify.enbx" /> <None Include="Resources\Level3_VPNify.enbx" />
<None Include="Resources\Level4_DualWans.enbx" /> <None Include="Resources\Level4_DualWans.enbx" />
<None Include="Resources\Level4_Internalhemorrhage.enbx" /> <None Include="Resources\Level4_Internalhemorrhage.enbx" />

View File

@ -32,7 +32,7 @@ namespace EduNetworkBuilder
public enum ResponseToPacket { none, accept, masq, drop, reject } public enum ResponseToPacket { none, accept, masq, drop, reject }
public enum DebugLevel { none=0, info=1, routing=2, switching=4, natting=8, filtering=16, debug=32 , packet=64, all=127} public enum DebugLevel { none=0, info=1, routing=2, switching=4, natting=8, filtering=16, debug=32 , packet=64, all=127}
public enum NetworkComponentType { none, router, net_switch, net_hub, laptop, pc, server, wap , public enum NetworkComponentType { none, router, net_switch, net_hub, laptop, pc, server, wap ,
wrouter, wbridge, wrepeater, link, firewall, ip_phone, printer, copier, microwave, fluorescent } wrouter, wbridge, wrepeater, link, firewall, ip_phone, printer, copier, microwave, fluorescent, cellphone, tablet }
public enum NicType { none, lo, eth, wlan, wan, vpn, tun, management_interface, port, wport } public enum NicType { none, lo, eth, wlan, wan, vpn, tun, management_interface, port, wport }
public enum IPAddressType { ip, gw, route, ip_only } public enum IPAddressType { ip, gw, route, ip_only }
public enum nb_direction { none, to_src, to_dst } public enum nb_direction { none, to_src, to_dst }
@ -62,6 +62,7 @@ namespace EduNetworkBuilder
Level2_VPN_woes, Level2_VPN_woes,
Level3_BlackHole, Level3_Busted, Level3_Middle_Man_Out, Level3_PhoneyNetwork, Level3_VPNify, Level3_EncryptionTroubles, Level3_BlackHole, Level3_Busted, Level3_Middle_Man_Out, Level3_PhoneyNetwork, Level3_VPNify, Level3_EncryptionTroubles,
Level3_NowhereToGo, Level3_GrandCentralStation, Level3_Dead, Level0_NetworkLoop2, Level0_BrokenLink, Level3_NowhereToGo, Level3_GrandCentralStation, Level3_Dead, Level0_NetworkLoop2, Level0_BrokenLink,
Level3_TwoDHCPServers,
Level4_DualWans, Level4_SinglesLife, Level4_SmallSubnets, Level4_OneRoute, Level4_RouterReplacement, Level4_DualWans, Level4_SinglesLife, Level4_SmallSubnets, Level4_OneRoute, Level4_RouterReplacement,
Level4_InternalSubnetting, Level4_Internalhemorrhage Level4_InternalSubnetting, Level4_Internalhemorrhage
} }

View File

@ -288,6 +288,8 @@ namespace EduNetworkBuilder
BuildButton("btnWRouter", Properties.Resources.WRouter, "Add a Wireless Router to the network."); BuildButton("btnWRouter", Properties.Resources.WRouter, "Add a Wireless Router to the network.");
BuildButton("btnWBridge", Properties.Resources.WBridge, "Add a Wireless Bridge to the network."); BuildButton("btnWBridge", Properties.Resources.WBridge, "Add a Wireless Bridge to the network.");
BuildButton("btnWRepeater", Properties.Resources.WRepeater, "Add a Wireless Repeater to the network."); BuildButton("btnWRepeater", Properties.Resources.WRepeater, "Add a Wireless Repeater to the network.");
BuildButton("btnCellphone", Properties.Resources.cellphone, "Add a Cellhone to the network.");
BuildButton("btnTablet", Properties.Resources.tablet, "Add a Tablet to the network.");
BuildButton("btnLink", Properties.Resources.link, "Use a network cable to connect network components."); BuildButton("btnLink", Properties.Resources.link, "Use a network cable to connect network components.");
BuildButton("btnSelect", Properties.Resources.select, "Select items from the network."); BuildButton("btnSelect", Properties.Resources.select, "Select items from the network.");
} }
@ -802,6 +804,12 @@ namespace EduNetworkBuilder
case "btnWRouter": case "btnWRouter":
NC = myNetwork.AddItem(NetworkComponentType.wrouter, CenteredLocation); NC = myNetwork.AddItem(NetworkComponentType.wrouter, CenteredLocation);
break; break;
case "btnCellphone":
NC = myNetwork.AddItem(NetworkComponentType.cellphone, CenteredLocation);
break;
case "btnTablet":
NC = myNetwork.AddItem(NetworkComponentType.tablet, CenteredLocation);
break;
case "btnWBridge": case "btnWBridge":
NC = myNetwork.AddItem(NetworkComponentType.wbridge, CenteredLocation); NC = myNetwork.AddItem(NetworkComponentType.wbridge, CenteredLocation);
break; break;

View File

@ -90,6 +90,22 @@ namespace EduNetworkBuilder
NICs.Add(tnic); NICs.Add(tnic);
} }
} }
if (what == NetworkComponentType.wap)
{
NICs.Clear();
tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.lo);
NICs.Add(tnic);
//tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.management_interface);
//NICs.Add(tnic); --we use the wlan port for this
tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname, NicType.eth); //Add a physical network card
NICs.Add(tnic);
//A bridge is a switch with an ethernet nic, add some wireless ports
for (int a = 0; a < 6; a++)
{
tnic = new NetworkCard(NICs.Count(), GetUniqueIdentifier, hostname, NicType.wport); //Add a wireless nic
NICs.Add(tnic);
}
}
if (what == NetworkComponentType.wrepeater) if (what == NetworkComponentType.wrepeater)
{ {
NICs.Clear(); NICs.Clear();
@ -135,7 +151,16 @@ namespace EduNetworkBuilder
//Add one wan port //Add one wan port
tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.wan); tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.wan);
NICs.Insert(1,tnic); //Make this first in the list NICs.Insert(1,tnic); //Make this first in the list
}
if (what == NetworkComponentType.cellphone || what == NetworkComponentType.tablet)
{
NICs.Clear();
tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.lo);
NICs.Add(tnic);
tnic = new NetworkCard(0, GetUniqueIdentifier, hostname, NicType.wlan);
NICs.Add(tnic);
} }
} }
ApplyRulesToDevice(); ApplyRulesToDevice();
} }
@ -178,7 +203,8 @@ namespace EduNetworkBuilder
setNicsCanUseDHCP(false); setNicsCanUseDHCP(false);
} }
if (myType == NetworkComponentType.pc || myType == NetworkComponentType.laptop || if (myType == NetworkComponentType.pc || myType == NetworkComponentType.laptop ||
myType == NetworkComponentType.copier || myType == NetworkComponentType.printer) myType == NetworkComponentType.copier || myType == NetworkComponentType.printer ||
myType == NetworkComponentType.tablet || myType == NetworkComponentType.cellphone)
{ {
CanServeDHCP = false; CanServeDHCP = false;
CanUseDHCP = true; CanUseDHCP = true;
@ -559,6 +585,12 @@ namespace EduNetworkBuilder
case NetworkComponentType.microwave: case NetworkComponentType.microwave:
MyImage = Properties.Resources.microwave; MyImage = Properties.Resources.microwave;
break; break;
case NetworkComponentType.cellphone:
MyImage = Properties.Resources.cellphone;
break;
case NetworkComponentType.tablet:
MyImage = Properties.Resources.tablet;
break;
} }
} }
@ -2438,7 +2470,7 @@ namespace EduNetworkBuilder
} }
foreach(ArpEntry dhcp in DHCPLeases) foreach(ArpEntry dhcp in DHCPLeases)
{ {
if (dhcp.MACAddress == MAC && dhcp.IPAddr != NB.ZeroIPString) if (dhcp.MACAddress == MAC && dhcp.IPAddr != NB.ZeroIPString && NIC_IP != null && gateway != null)
return new IPAddress(dhcp.IPAddr, NIC_IP.GetMask.ToIpString(), gateway.GetIP.ToIpString()); return new IPAddress(dhcp.IPAddr, NIC_IP.GetMask.ToIpString(), gateway.GetIP.ToIpString());
} }
return null; return null;

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.34209 // Runtime Version:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@ -578,6 +578,16 @@ namespace EduNetworkBuilder.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] Level3_TwoDHCPServers {
get {
object obj = ResourceManager.GetObject("Level3_TwoDHCPServers", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized resource of type System.Byte[]. /// Looks up a localized resource of type System.Byte[].
/// </summary> /// </summary>
@ -720,11 +730,13 @@ namespace EduNetworkBuilder.Properties {
/// <summary> /// <summary>
/// Looks up a localized string similar to {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}} /// Looks up a localized string similar to {\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Calibri;}}
///{\*\generator Riched20 6.3.9600}\viewkind4\uc1 ///{\*\generator Riched20 10.0.10240}\viewkind4\uc1
///\pard\sa200\sl276\slmult1\f0\fs22\lang9 Version 1.0.22\line Version 1.0.21 08/15/2015\par ///\pard\sa200\sl276\slmult1\b\f0\fs22\lang9 Version 1.0.22\b0\par
///* Added a microwave and fluorescent light. They corrupt data when packets run close to them.\par ///* Added ssid and keys for wireless links\par
///* Added some packet corruption puzzles\par ///* Wireless will auto-disconnect if link is too long\par
///* Fixed window resize-on-load issue where the help window popped up first, then the builder window resized over to hide the help windo [rest of string was truncated]&quot;;. ///* Wireless will auto-connect if ssid and key match, if link is short enough\par
///* Packets will drop on wireless links if distance is too great\par
///* wport has no interface (cannot edit IP address)\p [rest of string was truncated]&quot;;.
/// </summary> /// </summary>
internal static string ReleaseNotes { internal static string ReleaseNotes {
get { get {

View File

@ -352,4 +352,7 @@
<data name="tablet" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="tablet" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\tablet.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\tablet.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="Level3_TwoDHCPServers" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Level3_TwoDHCPServers.enbx;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,10 @@
* wireless router handles dhcp requests properly (both responds to it but also passes it on)\par * wireless router handles dhcp requests properly (both responds to it but also passes it on)\par
* right-clicking light and microwave no longer has ping, arp, edit, and other context menus\par * right-clicking light and microwave no longer has ping, arp, edit, and other context menus\par
* added net-test for DHCP server status (on/off)\par * added net-test for DHCP server status (on/off)\par
* If multiple DHCP servers, client randomly chooses which to keep.\line\b Version 1.0.21 08/15/2015\b0\par * If multiple DHCP servers, client randomly chooses which to keep.\par
*Add Wireless Puzzle\par
*Fix many wireless device bugs\par
\line\b Version 1.0.21 08/15/2015\b0\par
* Added a microwave and fluorescent light. They corrupt data when packets run close to them.\par * Added a microwave and fluorescent light. They corrupt data when packets run close to them.\par
* Added some packet corruption puzzles\par * Added some packet corruption puzzles\par
* Fixed window resize-on-load issue where the help window popped up first, then the builder window resized over to hide the help window. \par * Fixed window resize-on-load issue where the help window popped up first, then the builder window resized over to hide the help window. \par