DHCP as action

This commit is contained in:
Tim Young 2018-05-14 15:09:19 -05:00
parent 3ba3023ef0
commit bc1c994bbd
3 changed files with 24 additions and 6 deletions

View File

@ -225,17 +225,23 @@ namespace EduNetworkBuilder
} }
break; break;
case NBAction.dhcp: case NBAction.dhcp:
if(source != null)
source.DHCPRequestFromHere();
break; break;
case NBAction.arp: case NBAction.arp:
if (source != null)
source.AskArpFromHere(Destination); source.AskArpFromHere(Destination);
break; break;
case NBAction.cleararp: case NBAction.cleararp:
if (source != null)
source.ClearArps(); source.ClearArps();
break; break;
case NBAction.ping: case NBAction.ping:
if (source != null)
source.PingFromHere(Destination) ; source.PingFromHere(Destination) ;
break; break;
case NBAction.traceroute: case NBAction.traceroute:
if (source != null)
source.TracerouteFromHere(Destination); source.TracerouteFromHere(Destination);
break; break;
} }

View File

@ -1435,6 +1435,17 @@ namespace EduNetworkBuilder
AC.DoAction(); AC.DoAction();
}
public static void DoActionDHCP(int HostID)
{
ActionClass AC = new ActionClass();
AC.Action = NBAction.dhcp;
AC.SourceID = HostID;
RegisterAction(AC);
AC.DoAction();
} }
public static void DoActionArpDevice(int HostID, NB_IPAddress Destination) public static void DoActionArpDevice(int HostID, NB_IPAddress Destination)
{ {

View File

@ -1329,7 +1329,8 @@ namespace EduNetworkBuilder
private void pbNetworkView_DHCPRequest_Click(object sender, EventArgs e) private void pbNetworkView_DHCPRequest_Click(object sender, EventArgs e)
{ {
ItemClickedOn.DHCPRequestFromHere(); //ItemClickedOn.DHCPRequestFromHere();
NB.DoActionDHCP(ItemClickedOn.GetUniqueIdentifier);
myNetwork.ProcessPackets(); myNetwork.ProcessPackets();
UpdateMessages(); UpdateMessages();
pbNetworkView.Update(); pbNetworkView.Update();