[Javanetsim-cvs] javaNetSim/core ApplicationLayerDevice.java, 1.5, 1.6 CSUDSU.java, 1.1, 1.2 DataLi
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2007-10-19 08:52:42
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11211/core Modified Files: ApplicationLayerDevice.java CSUDSU.java DataLinkLayerDevice.java ExternalProxy.java Hub.java NetworkInterface.java NetworkLayerDevice.java Node.java PC.java ProtocolStack.java Router.java SerialNetworkInterface.java Simulation.java Switch.java WANNetworkInterface.java Log Message: New save file format; import. Index: PC.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/PC.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PC.java 15 Oct 2007 21:41:42 -0000 1.15 --- PC.java 19 Oct 2007 08:52:26 -0000 1.16 *************** *** 104,119 **** * @version v0.10 */ ! protected PC(String inName) { ! super(inName,7); //initApplications() have been called in ApplicaitonLayerDevice addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "0", NetworkInterface.Ethernet10T, true); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Console) + "0", NetworkInterface.Console, false); //addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Wireless) + "0", NetworkInterface.Wireless, true); ! //addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.WAN) + "0" + "_" + (int)(Math.random()*1000), NetworkInterface.WAN, true); ! } public void initApplications(){ ! super.initApplications(); Echo echoServer = new Echo(NodeProtocolStack, 7, 1, core.ProtocolStack.UIDGen++); --- 104,118 ---- * @version v0.10 */ ! protected PC(String inName, boolean inOn) { ! super(inName,7, inOn); //initApplications() have been called in ApplicaitonLayerDevice addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "0", NetworkInterface.Ethernet10T, true); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Console) + "0", NetworkInterface.Console, false); //addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Wireless) + "0", NetworkInterface.Wireless, true); ! //addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.WAN) + "0" + "_" + (int)(Math.random()*1000), NetworkInterface.WAN, true); } public void initApplications(){ ! super.initApplications(); Echo echoServer = new Echo(NodeProtocolStack, 7, 1, core.ProtocolStack.UIDGen++); Index: Node.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Node.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Node.java 16 Oct 2007 23:02:31 -0000 1.14 --- Node.java 19 Oct 2007 08:52:26 -0000 1.15 *************** *** 151,163 **** */ ! protected Node(String inName, int inProtocolStackLayers) { ! NetworkInterfacetable = new Hashtable(); ! name=inName; ! ProtocolStackLayers = inProtocolStackLayers; ! init(inProtocolStackLayers); } --- 151,165 ---- */ ! protected Node(String inName, int inProtocolStackLayers, boolean inOn) { ! NetworkInterfacetable = new Hashtable(); ! name=inName; ! ProtocolStackLayers = inProtocolStackLayers; ! init(inProtocolStackLayers); ! ! this.On = inOn; } Index: SerialNetworkInterface.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/SerialNetworkInterface.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SerialNetworkInterface.java 15 Oct 2007 12:04:32 -0000 1.3 --- SerialNetworkInterface.java 19 Oct 2007 08:52:26 -0000 1.4 *************** *** 29,33 **** package core; ! class SerialNetworkInterface extends NetworkInterface{ /** * FrameRelay ClockRate --- 29,33 ---- package core; ! public class SerialNetworkInterface extends NetworkInterface{ /** * FrameRelay ClockRate *************** *** 47,51 **** LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); ! pingInfo.setDataType("FrameRelay Packet"); pingInfo.setLayer("Link"); pingInfo.setDescription("Recieved and accepted packet at interface " + name); --- 47,51 ---- LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); ! pingInfo.setDataType("HDLC Packet"); pingInfo.setLayer("Link"); pingInfo.setDescription("Recieved and accepted packet at interface " + name); *************** *** 57,61 **** LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); ! pingInfo.setDataType("FrameRelay Packet"); pingInfo.setLayer("Link"); pingInfo.setDescription("Recieved signal at interface " + name + " dropped due to invalid Clock rate."); --- 57,61 ---- LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); ! pingInfo.setDataType("HDLC Packet"); pingInfo.setLayer("Link"); pingInfo.setDescription("Recieved signal at interface " + name + " dropped due to invalid Clock rate."); *************** *** 77,81 **** LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); ! pingInfo.setDataType("FrameRelay Packet"); pingInfo.setLayer("Link"); pingInfo.setDescription("Sending packet from interface "+ name); --- 77,81 ---- LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); ! pingInfo.setDataType("HDLC Packet"); pingInfo.setLayer("Link"); pingInfo.setDescription("Sending packet from interface "+ name); *************** *** 88,92 **** LayerInfo frameErrInfo = new LayerInfo(getClass().getName()); frameErrInfo.setObjectName(parentNode.getName()); ! frameErrInfo.setDataType("FrameRelay Packet"); frameErrInfo.setLayer("Link"); frameErrInfo.setDescription(ex.toString()); --- 88,92 ---- LayerInfo frameErrInfo = new LayerInfo(getClass().getName()); frameErrInfo.setObjectName(parentNode.getName()); ! frameErrInfo.setDataType("HDLC Packet"); frameErrInfo.setLayer("Link"); frameErrInfo.setDescription(ex.toString()); *************** *** 103,107 **** * @version v0.20 */ ! protected int getClockRate() { return ClockRate; } --- 103,107 ---- * @version v0.20 */ ! public int getClockRate() { return ClockRate; } *************** *** 111,115 **** } ! protected final void setClockRate(int ClockRate){ this.ClockRate = ClockRate; } --- 111,115 ---- } ! public final void setClockRate(int ClockRate){ this.ClockRate = ClockRate; } Index: Simulation.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Simulation.java 18 Oct 2007 22:22:09 -0000 1.20 --- Simulation.java 19 Oct 2007 08:52:26 -0000 1.21 *************** *** 934,938 **** modifiedInterface.removeConnectedLink(); ! //Remove any disconnected links from the simulation Enumeration keys = linkTable.keys(); --- 934,938 ---- modifiedInterface.removeConnectedLink(); ! //Remove any disconnected links from the simulation Enumeration keys = linkTable.keys(); *************** *** 982,988 **** * @version v0.20 **/ ! public void addRouter(String inRouterName)throws InvalidNodeNameException { if (!nodeTable.containsKey(inRouterName)) { ! nodeTable.put(inRouterName, new Router(inRouterName)); } else { throw new InvalidNodeNameException("Node already exists with same name"); --- 982,988 ---- * @version v0.20 **/ ! public void addRouter(String inRouterName, boolean inOn)throws InvalidNodeNameException { if (!nodeTable.containsKey(inRouterName)) { ! nodeTable.put(inRouterName, new Router(inRouterName, inOn)); } else { throw new InvalidNodeNameException("Node already exists with same name"); *************** *** 991,997 **** } ! public void addExternalNAT(String inRouterName)throws InvalidNodeNameException { if (!nodeTable.containsKey(inRouterName)) { ! nodeTable.put(inRouterName, new ExternalProxy(inRouterName)); } else { throw new InvalidNodeNameException("Node already exists with same name"); --- 991,997 ---- } ! public void addExternalNAT(String inRouterName, boolean inOn)throws InvalidNodeNameException { if (!nodeTable.containsKey(inRouterName)) { ! nodeTable.put(inRouterName, new ExternalProxy(inRouterName, inOn)); } else { throw new InvalidNodeNameException("Node already exists with same name"); *************** *** 1008,1014 **** * @version v0.20 **/ ! public void addPC(String inPCName) throws InvalidNodeNameException { if (!nodeTable.containsKey(inPCName)) { ! nodeTable.put(inPCName, new PC(inPCName)); } else { throw new InvalidNodeNameException("Node already exists with same name"); --- 1008,1014 ---- * @version v0.20 **/ ! public void addPC(String inPCName, boolean inOn) throws InvalidNodeNameException { if (!nodeTable.containsKey(inPCName)) { ! nodeTable.put(inPCName, new PC(inPCName, inOn)); } else { throw new InvalidNodeNameException("Node already exists with same name"); *************** *** 1026,1032 **** * @version v0.20 **/ ! public void addHub(String inNodeName) throws InvalidNodeNameException { if (!nodeTable.containsKey(inNodeName)) { ! nodeTable.put(inNodeName, new Hub(inNodeName)); } else { throw new InvalidNodeNameException("Node already exists with same name"); --- 1026,1032 ---- * @version v0.20 **/ ! public void addHub(String inNodeName, boolean inOn) throws InvalidNodeNameException { if (!nodeTable.containsKey(inNodeName)) { ! nodeTable.put(inNodeName, new Hub(inNodeName, inOn)); } else { throw new InvalidNodeNameException("Node already exists with same name"); *************** *** 1034,1040 **** } ! public void addCSUDSU(String inNodeName) throws InvalidNodeNameException { if (!nodeTable.containsKey(inNodeName)) { ! nodeTable.put(inNodeName, new CSUDSU(inNodeName)); } else { throw new InvalidNodeNameException("Node already exists with same name"); --- 1034,1040 ---- } ! public void addCSUDSU(String inNodeName, boolean inOn) throws InvalidNodeNameException { if (!nodeTable.containsKey(inNodeName)) { ! nodeTable.put(inNodeName, new CSUDSU(inNodeName, inOn)); } else { throw new InvalidNodeNameException("Node already exists with same name"); *************** *** 1050,1056 **** * @version v0.20 **/ ! public void addSwitch(String inNodeName) throws InvalidNodeNameException { if(!nodeTable.containsKey(inNodeName)){ ! nodeTable.put(inNodeName, new Switch(inNodeName)); }else{ throw new InvalidNodeNameException("Node already exists with same name"); --- 1050,1056 ---- * @version v0.20 **/ ! public void addSwitch(String inNodeName, boolean inOn) throws InvalidNodeNameException { if(!nodeTable.containsKey(inNodeName)){ ! nodeTable.put(inNodeName, new Switch(inNodeName, inOn)); }else{ throw new InvalidNodeNameException("Node already exists with same name"); Index: Hub.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Hub.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Hub.java 13 Oct 2007 12:57:00 -0000 1.6 --- Hub.java 19 Oct 2007 08:52:26 -0000 1.7 *************** *** 55,60 **** ! public Hub(String inName) { ! super(inName, 1); //pass name and protocolstack layer addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "0", NetworkInterface.Ethernet10T, false); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "1", NetworkInterface.Ethernet10T, false); --- 55,60 ---- ! public Hub(String inName, boolean inOn) { ! super(inName, 1, inOn); //pass name and protocolstack layer addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "0", NetworkInterface.Ethernet10T, false); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "1", NetworkInterface.Ethernet10T, false); Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/ProtocolStack.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ProtocolStack.java 13 Oct 2007 12:57:00 -0000 1.7 --- ProtocolStack.java 19 Oct 2007 08:52:26 -0000 1.8 *************** *** 150,153 **** --- 150,154 ---- + public abstract void intUP(String iface); }//EOF Index: DataLinkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/DataLinkLayerDevice.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DataLinkLayerDevice.java 13 Oct 2007 12:57:00 -0000 1.3 --- DataLinkLayerDevice.java 19 Oct 2007 08:52:26 -0000 1.4 *************** *** 43,48 **** * @version v0.20 */ ! public DataLinkLayerDevice(String inName, int inProtocolStackLayers) { ! super(inName, inProtocolStackLayers); } --- 43,48 ---- * @version v0.20 */ ! public DataLinkLayerDevice(String inName, int inProtocolStackLayers, boolean inOn) { ! super(inName, inProtocolStackLayers, inOn); } Index: NetworkInterface.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkInterface.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** NetworkInterface.java 16 Oct 2007 23:02:31 -0000 1.9 --- NetworkInterface.java 19 Oct 2007 08:52:26 -0000 1.10 *************** *** 115,118 **** --- 115,128 ---- protected boolean up; + protected boolean dhcp; + + public boolean getDHCP(){ + return dhcp; + } + + public void setDHCP(boolean inDHÑP){ + dhcp = inDHÑP; + } + protected String description = ""; *************** *** 124,128 **** pingInfo.setLayer("Link"); pingInfo.setDescription("Interface " + name + " state set to up!"); ! Simulation.addLayerInfo(pingInfo); } --- 134,141 ---- pingInfo.setLayer("Link"); pingInfo.setDescription("Interface " + name + " state set to up!"); ! Simulation.addLayerInfo(pingInfo); ! if( parentNode.NodeProtocolStack != null){ ! parentNode.NodeProtocolStack.intUP(name); ! } } Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkLayerDevice.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NetworkLayerDevice.java 15 Oct 2007 12:04:32 -0000 1.11 --- NetworkLayerDevice.java 19 Oct 2007 08:52:26 -0000 1.12 *************** *** 58,63 **** * @version v0.20 */ ! public NetworkLayerDevice(String inName, int inProtocolStackLayers) { ! super(inName, inProtocolStackLayers); //set default startup-config config.working_config = DeviceConfig.STARTUP_CONFIG; --- 58,63 ---- * @version v0.20 */ ! public NetworkLayerDevice(String inName, int inProtocolStackLayers, boolean inOn) { ! super(inName, inProtocolStackLayers, inOn); //set default startup-config config.working_config = DeviceConfig.STARTUP_CONFIG; Index: Router.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Router.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Router.java 15 Oct 2007 12:04:32 -0000 1.5 --- Router.java 19 Oct 2007 08:52:26 -0000 1.6 *************** *** 45,50 **** * @version v0.10 **/ ! protected Router(String inName) { ! super(inName,3); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "0", NetworkInterface.Ethernet10T, true); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "1", NetworkInterface.Ethernet10T, true); --- 45,50 ---- * @version v0.10 **/ ! protected Router(String inName, boolean inOn) { ! super(inName,3, inOn); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "0", NetworkInterface.Ethernet10T, true); addNetworkInterface(NetworkInterface.getIntName(NetworkInterface.Ethernet10T) + "1", NetworkInterface.Ethernet10T, true); Index: Switch.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Switch.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Switch.java 13 Oct 2007 12:57:00 -0000 1.6 --- Switch.java 19 Oct 2007 08:52:26 -0000 1.7 *************** *** 57,62 **** ! public Switch(String inName) { ! super(inName, 1); //pass name and protocolstack layer IntCaches = new Hashtable(); --- 57,62 ---- ! public Switch(String inName, boolean inOn) { ! super(inName, 1, inOn); //pass name and protocolstack layer IntCaches = new Hashtable(); Index: CSUDSU.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/CSUDSU.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CSUDSU.java 15 Oct 2007 18:25:54 -0000 1.1 --- CSUDSU.java 19 Oct 2007 08:52:26 -0000 1.2 *************** *** 36,41 **** int sz = 0; ! public CSUDSU(String inName) { ! super(inName, 1); //pass name and protocolstack layer lanPort = "ser0"; --- 36,41 ---- int sz = 0; ! public CSUDSU(String inName, boolean inOn) { ! super(inName, 1, inOn); //pass name and protocolstack layer lanPort = "ser0"; Index: WANNetworkInterface.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/WANNetworkInterface.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WANNetworkInterface.java 15 Oct 2007 18:25:54 -0000 1.2 --- WANNetworkInterface.java 19 Oct 2007 08:52:26 -0000 1.3 *************** *** 95,102 **** } ! public void UP(){ ! super.UP(); up = listen(); up &= connect(); } --- 95,102 ---- } ! public void UP(){ up = listen(); up &= connect(); + super.UP(); } Index: ApplicationLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/ApplicationLayerDevice.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ApplicationLayerDevice.java 15 Oct 2007 21:41:42 -0000 1.5 --- ApplicationLayerDevice.java 19 Oct 2007 08:52:24 -0000 1.6 *************** *** 19,26 **** protected Hashtable Apps = null; /** Creates a new instance of ApplicationLayerDevice */ ! public ApplicationLayerDevice(String inName, int inProtocolStackLayers) { ! super(inName, inProtocolStackLayers); Apps = new Hashtable(); ! initApplications(); } --- 19,26 ---- protected Hashtable Apps = null; /** Creates a new instance of ApplicationLayerDevice */ ! public ApplicationLayerDevice(String inName, int inProtocolStackLayers, boolean inOn) { ! super(inName, inProtocolStackLayers, inOn); Apps = new Hashtable(); ! if(inOn) initApplications(); } Index: ExternalProxy.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/ExternalProxy.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExternalProxy.java 13 Oct 2007 12:57:00 -0000 1.2 --- ExternalProxy.java 19 Oct 2007 08:52:26 -0000 1.3 *************** *** 66,71 **** * @version v0.10 **/ ! protected ExternalProxy(String inName) { ! super(inName,3); NodeProtocolStack.initNAT(); addNetworkInterface("eth0", NetworkInterface.Ethernet10T, true ); --- 66,71 ---- * @version v0.10 **/ ! protected ExternalProxy(String inName, boolean inOn) { ! super(inName,3, inOn); NodeProtocolStack.initNAT(); addNetworkInterface("eth0", NetworkInterface.Ethernet10T, true ); |