Update of /cvsroot/javanetsim/javaNetSim/core
In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv6886/core
Modified Files:
PC.java Simulation.java
Log Message:
Index: PC.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/PC.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** PC.java 26 Dec 2007 17:43:17 -0000 1.19
--- PC.java 9 Sep 2008 09:16:10 -0000 1.20
***************
*** 58,61 ****
--- 58,62 ----
import core.protocolsuite.tcp_ip.Echo;
+ import core.protocolsuite.tcp_ip.RIP;
import core.protocolsuite.tcp_ip.Telnet_server;
import core.protocolsuite.tcp_ip.Telnet_client;
***************
*** 99,103 ****
public final static int DHCP_CLIENT_ID = 68;
public final static int DNS_SERVER_ID = 90;
! public final static int DNS_CLIENT_ID = 91;
/**
--- 100,106 ----
public final static int DHCP_CLIENT_ID = 68;
public final static int DNS_SERVER_ID = 90;
! public final static int DNS_CLIENT_ID = 91;
! public final static int RIP_SERVER_ID = 520;
!
/**
***************
*** 113,116 ****
--- 116,121 ----
public void initApplications(){
super.initApplications();
+
+ RIP ripServer=new RIP(NodeProtocolStack,core.ProtocolStack.UIDGen++);
Echo echoServer = new Echo(NodeProtocolStack, 7, 1, core.ProtocolStack.UIDGen++);
***************
*** 133,136 ****
--- 138,143 ----
DNS dnsClient = new DNS(NodeProtocolStack, 91, 0, core.ProtocolStack.UIDGen++);
+ addApp(ripServer,RIP_SERVER_ID);
+
addApp(echoServer, ECHO_SERVER_ID);
addApp(echoClient, ECHO_CLIENT_ID);
Index: Simulation.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** Simulation.java 17 Nov 2007 21:38:58 -0000 1.26
--- Simulation.java 9 Sep 2008 09:16:10 -0000 1.27
***************
*** 403,406 ****
--- 403,427 ----
}
+ public void execCmd(String inNodeName, String cmd) throws InvalidNodeNameException, InvalidNetworkLayerDeviceException{
+ if(nodeTable.containsKey(inNodeName))
+ {
+ Node temp = (Node)nodeTable.get(inNodeName);
+ if (temp instanceof NetworkLayerDevice)
+ { //test if device is a network layer device
+ NetworkLayerDevice t = (NetworkLayerDevice)temp;
+ t.getConfig().executeCommand(cmd);
+ }
+ else
+ {
+ throw new InvalidNetworkLayerDeviceException("This device is not a network layered device");
+ }
+ }
+ else
+ {
+ throw new InvalidNodeNameException("Node does not exist");
+ }
+ }
+
+
/**
* Sets the Protocol Type to a global variable
|