javanetsim-cvs Mailing List for javaNetSim (Page 22)
Status: Beta
Brought to you by:
darkkey
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(120) |
Dec
(62) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(1) |
Feb
(69) |
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(76) |
Oct
(28) |
Nov
(77) |
Dec
(186) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(36) |
Oct
(61) |
Nov
(23) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(17) |
Oct
(105) |
Nov
(5) |
Dec
(1) |
2009 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(9) |
Nov
|
Dec
|
From: QweR <qw...@us...> - 2006-11-09 15:32:02
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv12749/core Modified Files: EthernetLink.java NetworkInterface.java Log Message: Index: EthernetLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetLink.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** EthernetLink.java 9 Sep 2006 13:43:58 -0000 1.10 --- EthernetLink.java 9 Nov 2006 15:31:55 -0000 1.11 *************** *** 88,92 **** if( ((sievingCoefficient)/100)>Math.random()) temp.receivePacket(inPacket); ! else throw new LowLinkException("(***) Packet lost due to physical link problems!"); /*int cat = FalseRandom.Kotochigov(); --- 88,100 ---- if( ((sievingCoefficient)/100)>Math.random()) temp.receivePacket(inPacket); ! else{ ! LayerInfo frameErrInfo = new LayerInfo(getClass().getName()); ! frameErrInfo.setObjectName(inSourceName); ! frameErrInfo.setDataType("Ethernet Packet"); ! frameErrInfo.setLayer("Link"); ! frameErrInfo.setDescription("(***) Packet lost due to physical link problems!"); ! Simulation.addLayerInfo(frameErrInfo); ! } ! // else throw new LowLinkException("(***) Packet lost due to physical link problems!"); /*int cat = FalseRandom.Kotochigov(); Index: NetworkInterface.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkInterface.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NetworkInterface.java 19 Nov 2005 21:53:51 -0000 1.3 --- NetworkInterface.java 9 Nov 2006 15:31:55 -0000 1.4 *************** *** 1,200 **** ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! package core; ! import java.io.Serializable; ! /** ! * A NetworkInterface represents the physical interface between ! * a Node and a physical Link (network cable). Think of it as the NIC ! * (Network Interface Card) of a Node. ! * ! * <P>Different Nodes can contain different numbers of NetworkInterfaces. ! * A client PC usually only has one NetworkInterface, whereas a Router contains ! * at least two. A Hub or a Switch often has 8 or 16.</P> ! * ! * <P>In order for a Node to be able to send or receive network information (packets), ! * there must be a Link (network cable) between at least 2 NetworkInterfaces.</P> ! * ! * <P>NetworkInterfaces receive and send packets to and from DatalinkProtocols and ! * the Link object they are connected to.</P> ! * ! * @author tristan_veness (Original Author) ! * @author bevan_calliess ! * @author luke_hamilton ! * @since 19 September 2004 ! * @version v0.20 ! */ ! ! abstract class NetworkInterface implements Serializable{ ! /** The NetworkInterface's name, eg "eth0" */ ! protected String name; ! /** The Link that this NetworkInterface is connected to */ ! protected Link connectedLink; ! protected Node parentNode; ! ! /** ! * Constructs a NetworkInterface object with the name inName and a reference to it's parent Node. ! * @author tristan_veness ! * @param inName - The name to give the NetworkInterface eg: eth0 ! * @param parent - The Node that the NetworkInterface is to be added to, it's parent. ! * @version v0.10 ! */ ! protected NetworkInterface(String inName, Node inParent) { ! name = inName; ! parentNode = inParent; ! } ! ! /** ! * This method reset the connected link to null ! * @author luke_hamilton ! * @version v0.20 ! */ ! protected void resetConnectedLink() { ! connectedLink = null; ! } ! ! /** ! * This method will call the disconnectLink method on the ! * Connected link, and then set the connected link to null ! * @author luke_hamilton ! * @version v0.20 ! */ ! protected void removeConnectedLink() { ! if(connectedLink != null){ ! connectedLink.disconnectLink(); ! connectedLink = null; ! } ! } ! ! /** ! * This method recevie a packet from a connected link and then pass it ! * to the node's protocolstack. Depending on the network any ! * testing of the packets headers may need to be inserted here. ! * This method is overridded by the subclasses on interface to suite ! * there requirements ! * @author baven_calliess ! * @param inPacket - A packet ! * @version v0.20 ! */ ! protected void receivePacket(Packet inPacket) throws LowLinkException {} ! ! /** ! * This method sends a packet to a connected link Depending on ! * @author bevan_calliess ! * @param inPacket ! * @version v0.20 ! */ ! protected void sendPacket(Packet outPacket) throws LowLinkException {} ! ! /** ! * Returns the NetworkInterface's name. ! * @author bevan_calliess ! * @return Name - The NetworkInterface's name ! * @version v0.20 ! */ ! ! protected String getName() { ! return name; ! } ! ! /** ! * This method is used by interfaces to uniquely identify themselves ! * in the simulation it will return a combination of the ! * Parent naodes name and the Interfaces name ! * eg. Node name PC1 interface eth0 will return "PC1eth0" ! * @author bevan_calliess ! * @return Name - The Source name of this Node Interface ! * @version v0.20 ! */ ! protected String getSourceName() { ! return parentNode.getName()+name; ! } ! ! /** ! * Sets the connectedLink attribute of the NetworkInterface with Link l. ! * ! * <P>This method should only be called by the Link class when an Interface is added or removed from the Link.</P> ! * @author tristan_veness ! * @param l - The Link connected with this NetworkInterface. ! * @version v0.10 ! */ ! protected void setConnectedLink(Link l)throws InvalidLinkConnectionException { ! if(connectedLink == null){ ! connectedLink = l; ! }else ! throw new InvalidLinkConnectionException("Network Interface is already connected. Delete Connected link first"); ! ! } ! ! /** ! * Returns the Link that this NetworkInterface is connected to. ! * @author tristan_veness ! * @return The Link object that this NetworkInterface is connected to. null if it is not connected. ! * @version v0.10 ! */ ! protected Link getConnectedLink() { ! return connectedLink; ! } ! ! protected String getConnectedLinkName() { ! if(connectedLink!=null) return connectedLink.getName(); ! else return null; ! } ! ! /** ! * This method returns the name of the network interface ! * @author tristan_veness ! * @return Name ! * @version v0.10 ! */ ! protected String getDetails(){ ! return name; ! } ! ! /** ! * This method returns a string of information about if the network interface is connected of not. ! * <P>This method is useful for a CLI or for debugging.</P> ! * @author tristan_veness ! * @return Name - Connection: link1 ! * @version v0.10 ! */ ! protected String getConnectLinkDetails(){ ! if(connectedLink != null){ ! return "Connection: "+ connectedLink.getName(); ! } ! return "Connection: Not connected"; ! } ! ! protected String getConnectLinkName() ! { ! if(connectedLink !=null) ! { ! return (String)connectedLink.getName(); ! } ! return "Not Connected"; ! } ! }//EOF --- 1,400 ---- ! /* ! ! Java Firewall Simulator (jFirewallSim) ! ! ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! ! ! Redistribution and use in source and binary forms, with or without modification, are ! ! permitted provided that the following conditions are met: ! ! ! ! - Redistributions of source code must retain the above copyright notice, this list ! ! of conditions and the following disclaimer. ! ! - Redistributions in binary form must reproduce the above copyright notice, this list ! ! of conditions and the following disclaimer in the documentation and/or other ! ! materials provided with the distribution. ! ! - Neither the name of the Canberra Institute of Technology nor the names of its ! ! contributors may be used to endorse or promote products derived from this software ! ! without specific prior written permission. ! ! ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! ! */ ! ! package core; ! ! import java.io.Serializable; ! ! /** ! ! * A NetworkInterface represents the physical interface between ! ! * a Node and a physical Link (network cable). Think of it as the NIC ! ! * (Network Interface Card) of a Node. ! ! * ! ! * <P>Different Nodes can contain different numbers of NetworkInterfaces. ! ! * A client PC usually only has one NetworkInterface, whereas a Router contains ! ! * at least two. A Hub or a Switch often has 8 or 16.</P> ! ! * ! ! * <P>In order for a Node to be able to send or receive network information (packets), ! ! * there must be a Link (network cable) between at least 2 NetworkInterfaces.</P> ! ! * ! ! * <P>NetworkInterfaces receive and send packets to and from DatalinkProtocols and ! ! * the Link object they are connected to.</P> ! ! * ! ! * @author tristan_veness (Original Author) ! ! * @author bevan_calliess ! ! * @author luke_hamilton ! ! * @since 19 September 2004 ! ! * @version v0.20 ! ! */ ! ! ! ! abstract class NetworkInterface implements Serializable{ ! ! /** The NetworkInterface's name, eg "eth0" */ ! ! protected String name; ! ! /** The Link that this NetworkInterface is connected to */ ! ! protected Link connectedLink; ! ! protected Node parentNode; ! ! ! ! /** ! ! * Constructs a NetworkInterface object with the name inName and a reference to it's parent Node. ! ! * @author tristan_veness ! ! * @param inName - The name to give the NetworkInterface eg: eth0 ! ! * @param parent - The Node that the NetworkInterface is to be added to, it's parent. ! ! * @version v0.10 ! ! */ ! ! protected NetworkInterface(String inName, Node inParent) { ! ! name = inName; ! ! parentNode = inParent; ! ! } ! ! ! ! /** ! ! * This method reset the connected link to null ! ! * @author luke_hamilton ! ! * @version v0.20 ! ! */ ! ! protected void resetConnectedLink() { ! ! connectedLink = null; ! ! } ! ! ! ! /** ! ! * This method will call the disconnectLink method on the ! ! * Connected link, and then set the connected link to null ! ! * @author luke_hamilton ! ! * @version v0.20 ! ! */ ! ! protected void removeConnectedLink() { ! ! if(connectedLink != null){ ! ! connectedLink.disconnectLink(); ! ! connectedLink = null; ! ! } ! ! } ! ! ! ! /** ! ! * This method recevie a packet from a connected link and then pass it ! ! * to the node's protocolstack. Depending on the network any ! ! * testing of the packets headers may need to be inserted here. ! ! * This method is overridded by the subclasses on interface to suite ! ! * there requirements ! ! * @author baven_calliess ! ! * @param inPacket - A packet ! ! * @version v0.20 ! ! */ ! ! protected void receivePacket(Packet inPacket) throws LowLinkException {} ! ! ! ! /** ! ! * This method sends a packet to a connected link Depending on ! ! * @author bevan_calliess ! ! * @param inPacket ! ! * @version v0.20 ! ! */ ! ! protected void sendPacket(Packet outPacket) throws LowLinkException {} ! ! ! ! /** ! ! * Returns the NetworkInterface's name. ! ! * @author bevan_calliess ! ! * @return Name - The NetworkInterface's name ! ! * @version v0.20 ! ! */ ! ! ! ! protected String getName() { ! ! return name; ! ! } ! ! ! ! /** ! ! * This method is used by interfaces to uniquely identify themselves ! ! * in the simulation it will return a combination of the ! ! * Parent naodes name and the Interfaces name ! ! * eg. Node name PC1 interface eth0 will return "PC1eth0" ! ! * @author bevan_calliess ! ! * @return Name - The Source name of this Node Interface ! ! * @version v0.20 ! ! */ ! ! protected String getSourceName() { ! ! return parentNode.getName()+":"+name; ! ! } ! ! ! ! /** ! ! * Sets the connectedLink attribute of the NetworkInterface with Link l. ! ! * ! ! * <P>This method should only be called by the Link class when an Interface is added or removed from the Link.</P> ! ! * @author tristan_veness ! ! * @param l - The Link connected with this NetworkInterface. ! ! * @version v0.10 ! ! */ ! ! protected void setConnectedLink(Link l)throws InvalidLinkConnectionException { ! ! if(connectedLink == null){ ! ! connectedLink = l; ! ! }else ! ! throw new InvalidLinkConnectionException("Network Interface is already connected. Delete Connected link first"); ! ! ! ! } ! ! ! ! /** ! ! * Returns the Link that this NetworkInterface is connected to. ! ! * @author tristan_veness ! ! * @return The Link object that this NetworkInterface is connected to. null if it is not connected. ! ! * @version v0.10 ! ! */ ! ! protected Link getConnectedLink() { ! ! return connectedLink; ! ! } ! ! ! ! protected String getConnectedLinkName() { ! ! if(connectedLink!=null) return connectedLink.getName(); ! ! else return null; ! ! } ! ! ! ! /** ! ! * This method returns the name of the network interface ! ! * @author tristan_veness ! ! * @return Name ! ! * @version v0.10 ! ! */ ! ! protected String getDetails(){ ! ! return name; ! ! } ! ! ! ! /** ! ! * This method returns a string of information about if the network interface is connected of not. ! ! * <P>This method is useful for a CLI or for debugging.</P> ! ! * @author tristan_veness ! ! * @return Name - Connection: link1 ! ! * @version v0.10 ! ! */ ! ! protected String getConnectLinkDetails(){ ! ! if(connectedLink != null){ ! ! return "Connection: "+ connectedLink.getName(); ! ! } ! ! return "Connection: Not connected"; ! ! } ! ! ! ! protected String getConnectLinkName() ! ! { ! ! if(connectedLink !=null) ! ! { ! ! return (String)connectedLink.getName(); ! ! } ! ! return "Not Connected"; ! ! } ! ! }//EOF ! |
From: Alexander B. <da...@us...> - 2006-11-09 11:55:59
|
Update of /cvsroot/javanetsim/javaNetSim/images/simulation In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv19597/images/simulation Added Files: network_local.png Log Message: --- NEW FILE: network_local.png --- (This appears to be a binary file; contents omitted.) |
From: QweR <qw...@us...> - 2006-11-08 21:38:02
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29061/guiUI Modified Files: SetTCPIPPropertiesDialog.java Log Message: Index: SetTCPIPPropertiesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SetTCPIPPropertiesDialog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SetTCPIPPropertiesDialog.java 8 Nov 2006 14:27:29 -0000 1.4 --- SetTCPIPPropertiesDialog.java 8 Nov 2006 21:37:47 -0000 1.5 *************** *** 1,582 **** ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. [...1173 lines suppressed...] ! private void checkForDefaultSubnet(){ ! String tempip = txtIpAddress.getText(); ! ! //if(Simulation.validateDecIP(tempip)){ ! if(txtSubnetMask.getText().equals("Enter Subnet Mask") || txtSubnetMask.getText() == null || txtSubnetMask.getText().equals("0.0.0.0")){ ! String tempSubnet = Simulation.getDefaultSubnetMask(tempip); ! txtSubnetMask.setText(tempSubnet); ! ! txtSubnetMask.setEnabled(true); ! } ! btnOk.setEnabled(true); ! ! /*}else{ ! txtSubnetMask.setText("Enter Subnet Mask"); ! txtSubnetMask.setEnabled(false); ! }*/ ! } ! ! } ! |
From: Alexander B. <da...@us...> - 2006-11-08 14:27:42
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1984 Modified Files: TODO.txt Log Message: Index: TODO.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/TODO.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TODO.txt 26 Oct 2006 13:36:53 -0000 1.21 --- TODO.txt 8 Nov 2006 14:27:29 -0000 1.22 *************** *** 5,8 **** --- 5,9 ---- 1. SOA interfaces? Script language to operate sockets? Middleware emulation? + 2. NAT gateway to external network. *** Documentation *************** *** 13,16 **** --- 14,18 ---- *** GUI Related + 1. Check changing/saving netmask in SET TCP/IP Properties dialog. 2. Create _normal_ route table edit form (instead of route command). Use as template EditRoutesDialog.java. Note, that "route" command is only for ugly testing purposes! |
From: Alexander B. <da...@us...> - 2006-11-08 14:27:37
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1984/core Modified Files: PC.java Simulation.java Added Files: ExternalNAT.java Log Message: Index: PC.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/PC.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PC.java 25 Feb 2006 00:00:02 -0000 1.10 --- PC.java 8 Nov 2006 14:27:29 -0000 1.11 *************** *** 61,64 **** --- 61,65 ---- import core.protocolsuite.tcp_ip.Telnet_client; import core.protocolsuite.tcp_ip.Echo_tcp; + import core.protocolsuite.tcp_ip.PosixTelnetClient; import core.protocolsuite.tcp_ip.SNMP; *************** *** 119,124 **** --- 120,129 ---- Telnet_client telnetClient = new Telnet_client((ApplicationLayerDevice)this, NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); + + PosixTelnetClient ptc = new PosixTelnetClient(NodeProtocolStack, core.ProtocolStack.UIDGen++); addApp(echoServer, 7); + + addApp(ptc, 10023); addApp(echoClient, 30007); --- NEW FILE: ExternalNAT.java --- /* Java Firewall Simulator (jFirewallSim) Copyright (c) 2004, jFirewallSim development team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Canberra Institute of Technology nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package core; import core.protocolsuite.tcp_ip.*; import java.util.*; import java.io.*; import java.net.*; /** * Represents a Router Node in a network. A Router is the backbone of the internet. Routers * are responsible for Packets being able to reach their final destination. * @author tristan_veness * @since 13 June 2004 * @version v0.10 **/ public class ExternalNAT extends NetworkLayerDevice { int externalPort; String externalIP; NATEcho_tcp NE; boolean busy; protected Hashtable Apps = null; public void addApp(Object app, int code){ Apps.put(code, app); } public Object getApp(int code){ return Apps.get(code); } /** * Constructs a new Router with the specified name and is given two * Network Interfaces * @author tristan_veness * @param inName A name to give the new Router Node eg: Router1. * @version v0.10 **/ protected ExternalNAT(String inName) { super(inName,3); NodeProtocolStack.initNAT(); addNetworkInterface("eth0"); externalIP = null; Apps = new Hashtable(); busy = false; } public void NATDisconnect(Object application){ externalIP = null; } public void receivePacket(Packet inPacket) throws LowLinkException { if(inPacket instanceof IP_packet){ if(busy) return; IP_packet IPP = (IP_packet) inPacket; if(!NodeProtocolStack.isInternalIP(IPP.getDestIPAddress())){ System.out.println("Activating NAT when recieving..."); if(IPP instanceof TCP_packet){ busy = true; if(externalIP == null){ externalIP = IPP.getDestIPAddress(); externalPort = ((TCP_packet) IPP).get_destPort(); try { Socket NAT = new Socket(externalIP, externalPort); NE = null; NE = new NATEcho_tcp(NodeProtocolStack, this, NAT, externalIP, externalPort, core.ProtocolStack.UIDGen++); System.out.println("NAT step 2"); //addApp(NE, 1); ((TCP_packet) IPP).setDestIPAddress(NodeProtocolStack.getIPAddress("eth0")); NodeProtocolStack.recieveTCP_packet((TCP_packet) IPP); busy = false; }catch (IOException e) { e.printStackTrace(); externalIP = null; } }else{ ((TCP_packet) IPP).setDestIPAddress(NodeProtocolStack.getIPAddress("eth0")); NodeProtocolStack.recieveTCP_packet((TCP_packet) IPP); busy = false; } } }else{ NodeProtocolStack.receivePacket(inPacket); } }else{ NodeProtocolStack.receivePacket(inPacket); } } public void sendPacket(String inDestMACAddress, Packet inPacket, String inInterfaceKey) throws InvalidNetworkInterfaceNameException, CommunicationException, LowLinkException{ if (NetworkInterfacetable.containsKey(inInterfaceKey)) { EthernetNetworkInterface temp = (EthernetNetworkInterface)NetworkInterfacetable.get(inInterfaceKey); if(inPacket instanceof IP_packet){ IP_packet IPP = (IP_packet) inPacket; System.out.println("Activating NAT when sending..."); //if(!NodeProtocolStack.isInternalIP(IPP.getSourceIPAddress())){ //System.out.println("Activating NAT when sending..."); if(IPP instanceof TCP_packet){ ((TCP_packet) IPP).setSourceIPAddress(externalIP); } //} } temp.sendPacket(inPacket,inDestMACAddress); } else { throw new InvalidNetworkInterfaceNameException("Inteface does not exist."); } } }//EOF Index: Simulation.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Simulation.java 12 Oct 2006 17:38:41 -0000 1.11 --- Simulation.java 8 Nov 2006 14:27:29 -0000 1.12 *************** *** 919,922 **** --- 919,931 ---- } + public void addExternalNAT(String inRouterName)throws InvalidNodeNameException { + if (!nodeTable.containsKey(inRouterName)) { + nodeTable.put(inRouterName, new ExternalNAT(inRouterName)); + } else { + throw new InvalidNodeNameException("Node already exists with same name"); + } + return; + } + /** * This method is for creating a PC within the simulation. |
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1984/core/protocolsuite/tcp_ip Modified Files: Echo_tcp.java ProtocolStack.java Tcp.java Telnet_server.java Added Files: NATEcho_tcp.java PosixTelnetClient.java Log Message: --- NEW FILE: NATEcho_tcp.java --- (This appears to be a binary file; contents omitted.) Index: Telnet_server.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_server.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Telnet_server.java 5 Sep 2006 21:04:36 -0000 1.10 --- Telnet_server.java 8 Nov 2006 14:27:29 -0000 1.11 *************** *** 100,118 **** public void DisconnectEvent(){ connected = false; printInfo("Server: client closed connection"); ! // try{ ! // printInfo("Server: closing connection"); ! // Close(); ! // try{ ! // Listen(); ! // printInfo("Server: listening on port " + listenPort); ! // } ! // catch(TransportLayerException e){ ! // printInfo("Server: can not listen on port " + listenPort); ! // } ! // } ! // catch(TransportLayerException e){ ! // printInfo("Server: can not close connection"); ! // } } --- 100,116 ---- public void DisconnectEvent(){ connected = false; + printInfo("Server: client closed connection"); ! try{ ! Listen(); ! }catch(Exception e){ ! LayerInfo protInfo = new LayerInfo(getClass().getName()); ! protInfo.setObjectName(mParentStack.getParentNodeName()); ! protInfo.setDataType("Echo Protocol Data"); ! protInfo.setLayer("Application "); ! protInfo.setDescription("Cannot listen on port: " + e.toString()); ! Simulation.addLayerInfo(protInfo); ! protInfo = null; ! } } Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** ProtocolStack.java 26 Oct 2006 17:06:11 -0000 1.52 --- ProtocolStack.java 8 Nov 2006 14:27:29 -0000 1.53 *************** *** 147,151 **** if(inProtocolStackLayers == 3){//create a layer 3 protocol stack ! mRARPprotocol = new RARP(); --- 147,151 ---- if(inProtocolStackLayers == 3){//create a layer 3 protocol stack ! mRARPprotocol = new RARP(); *************** *** 181,184 **** --- 181,191 ---- } + + public void initNAT(){ + mTCPprotocol = new Tcp(this); //gift (sourceforge.net user) 25 Nov 2005 + + mUDPprotocol = new Udp(this); //gift (sourceforge.net user) 17 Nov 2005 + } + /** *************** *** 1025,1029 **** } ! /** --- 1032,1054 ---- } ! public void recieveTCP_packet(TCP_packet temp) throws LowLinkException{ ! try{ ! mTCPprotocol.receiveTCPPacket(temp); ! }catch(TransportLayerException te){} ! catch(NullPointerException e){ ! System.out.println("ProtocolStack.java: " + e.toString()); ! } ! catch (CommunicationException ce) {} ! catch(TransportLayerPortException tpe){ ! ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); ! TCP_Info.setObjectName(getParentNodeName()); ! TCP_Info.setDataType("TCP Packet"); ! TCP_Info.setLayer("Transport"); ! TCP_Info.setDescription("TCP port packet receiving: \""+ tpe.toString() + "\"."); ! Simulation.addLayerInfo(TCP_Info); ! ! } ! } /** *************** *** 1695,1704 **** } catch (TransportLayerException te) { ! LayerInfo TCP_Info = new LayerInfo(getClass().getName()); TCP_Info.setObjectName(getParentNodeName()); TCP_Info.setDataType("TCP Protocol"); TCP_Info.setLayer("Transport"); TCP_Info.setDescription("TCP port closing: \""+ te.toString() + "\"."); ! Simulation.addLayerInfo(TCP_Info); } } --- 1720,1729 ---- } catch (TransportLayerException te) { ! /*LayerInfo TCP_Info = new LayerInfo(getClass().getName()); TCP_Info.setObjectName(getParentNodeName()); TCP_Info.setDataType("TCP Protocol"); TCP_Info.setLayer("Transport"); TCP_Info.setDescription("TCP port closing: \""+ te.toString() + "\"."); ! Simulation.addLayerInfo(TCP_Info); */ } } Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** Tcp.java 23 Sep 2006 07:31:48 -0000 1.87 --- Tcp.java 8 Nov 2006 14:27:29 -0000 1.88 *************** *** 582,586 **** public void ListenPort(Object application, int in_Port) throws TransportLayerException { int lsPort=PORT_INIT; ! Integer inPort = new Integer(in_Port); if ( (lsPort=AlreadyListens(application)) == PORT_INIT ) { --- 582,586 ---- public void ListenPort(Object application, int in_Port) throws TransportLayerException { int lsPort=PORT_INIT; ! Integer inPort = new Integer(in_Port); if ( (lsPort=AlreadyListens(application)) == PORT_INIT ) { *************** *** 1261,1267 **** Application serv; serv=(Application)Elm.application; ! ClosePort(serv); //FIN sent and confirmed!!! Closing connection in case isPassive==true serv.DisconnectEvent(); - serv.Listen(); } --- 1261,1267 ---- Application serv; serv=(Application)Elm.application; ! ClosePort(serv); //FIN sent and confirmed!!! Closing connection in case isPassive==true ! //serv.Listen(); serv.DisconnectEvent(); } --- NEW FILE: PosixTelnetClient.java --- package core.protocolsuite.tcp_ip; import core.TransportLayerException; import core.InvalidNetworkLayerDeviceException; import core.CommunicationException; import core.LowLinkException; import core.LayerInfo; import core.Packet; import core.Error; import core.Simulation; import guiUI.PosixTelnetClientGUI; /** * * @author key * @author gift (sourceforge.net user) */ public class PosixTelnetClient extends Application{ private byte ConnectionAttempts=1; private PosixTelnetClientGUI ptcGUI; /** Creates a new instance of Echo */ public PosixTelnetClient(ProtocolStack inParentStack, int UID) { super(inParentStack, 0, 0, UID); } /** * This method start to listen on application port * @author key * @version v0.01 */ public void Listen() throws TransportLayerException{ } /** * This method stop listening on application port * @author key * @param Protocol Stack * @return Nothing. * @version v0.01 */ public void Close() throws TransportLayerException { mParentStack.FreeTCPApplication(this); } /** * This method connects to server on the other side (imaginations from the other side.... :+) * @author key * @author gift (sourceforge.net user) * @param Host - hostname or ip of server. * @param port - server's port * @version v0.03 */ public boolean ClientConnect(String Host, int port) throws TransportLayerException, InvalidNetworkLayerDeviceException, CommunicationException, LowLinkException { sdHost = Host; sdPort = port; LayerInfo protInfo2 = new LayerInfo(getClass().getName()); protInfo2.setObjectName(mParentStack.getParentNodeName()); protInfo2.setDataType("Telnet Protocol Data"); protInfo2.setLayer("Application "); protInfo2.setDescription("Connecting to host " + Host + ":"+ port +". Please wait..."); Simulation.addLayerInfo(protInfo2); do { ConnectionAttempts--; clientPort = mParentStack.ConnectTCP(this, sdHost, sdPort); } while (ConnectionAttempts>0 && clientPort==-1); if (clientPort>-1) return true; else return false; } /** * This method should be called from UDP when client connects to server * @author key * @version v0.01 */ public void Connected(String Host, int port){ sdHost = Host; sdPort = port; } /** * This method disconnects from server. * @author key * @version v0.01 */ public void Disconnect() throws TransportLayerException, LowLinkException{ try { mParentStack.FinalizeTCP(this); //will close client connection }catch(Exception e){ ///*TODO*: here to catch } LayerInfo protInfo3 = new LayerInfo(getClass().getName()); protInfo3.setObjectName(mParentStack.getParentNodeName()); protInfo3.setDataType("Telnet Protocol Data"); protInfo3.setLayer("Application "); if(appType==0){ protInfo3.setDescription("Application closing connection."); }else{ protInfo3.setDescription("Application closing connection. Now listening on " + listenPort + "."); } Simulation.addLayerInfo(protInfo3); mParentStack.CloseTCP(this); //mParentStack.freeTCPPort(this); } /** * This method is called when client disconnected from server. * @author key * @version v0.01 */ public void DisconnectEvent() { } /** * This method sends data to the other side. * @param data to send * @author key * @version v0.01 */ public void SendData(String Data) throws LowLinkException, TransportLayerException, CommunicationException { mParentStack.SendTCP(this, Data,-1); //processing the protocol doings. } /** * This method recieves data from the other side. * @param data to recv * @author key * @author gift (sourceforge.net user) * @version v0.02 */ public void RecvData(String Data) throws LowLinkException, TransportLayerException { //processing the protocol doings. //client processing recieve // printing some ... LayerInfo protInfo = new LayerInfo(getClass().getName()); protInfo.setObjectName(mParentStack.getParentNodeName()); protInfo.setDataType("Telnet Protocol Data"); protInfo.setLayer("Application "); protInfo.setDescription("Recieving telnet data '" + Data + "' from server."); Simulation.addLayerInfo(protInfo); protInfo = null; while(ptcGUI.busy); ptcGUI.recvData(Data); } /** * This method processes a echo sending by client * @param data to send * @param server host * @param server port * @author key * @author gift (sourceforge.net user) * @version v0.02 */ public void Telnet(PosixTelnetClientGUI ptcGUI, String Host, int port) throws CommunicationException, LowLinkException, InvalidNetworkLayerDeviceException, TransportLayerException{ this.ptcGUI = ptcGUI; mParentStack.FreeTCPApplication(this); if (ClientConnect(Host, port)) { LayerInfo protInfo = new LayerInfo(getClass().getName()); protInfo.setObjectName(mParentStack.getParentNodeName()); protInfo.setDataType("Telnet Protocol Data"); protInfo.setLayer("Application "); protInfo.setDescription("Starting telnet connection to " + Host + ":" + port); Simulation.addLayerInfo(protInfo); } else { LayerInfo protInfo = new LayerInfo(getClass().getName()); protInfo.setObjectName(mParentStack.getParentNodeName()); protInfo.setDataType("Telnet Protocol Data"); protInfo.setLayer("Application "); protInfo.setDescription("Error: can not connect to " + Host + ":" + port + "!"); Simulation.addLayerInfo(protInfo); } } /** * This method recieves source IP of a packet * @param data to receive * @author gift (sourceforge.net user) * @version v0.01 */ public void RecvIP(String IP) throws LowLinkException, TransportLayerException { } /** * This method recieves source port number of a packet * @param data to receive * @author gift (sourceforge.net user) * @version v0.01 */ public void RecvPrt(int port_num) throws LowLinkException, TransportLayerException { } } Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** Echo_tcp.java 9 Sep 2006 13:43:58 -0000 1.29 --- Echo_tcp.java 8 Nov 2006 14:27:29 -0000 1.30 *************** *** 149,153 **** */ ! public void DisconnectEvent() { } /** --- 149,165 ---- */ ! public void DisconnectEvent() { ! try{ ! Listen(); ! }catch(Exception e){ ! LayerInfo protInfo = new LayerInfo(getClass().getName()); ! protInfo.setObjectName(mParentStack.getParentNodeName()); ! protInfo.setDataType("Echo Protocol Data"); ! protInfo.setLayer("Application "); ! protInfo.setDescription("Cannot listen on port: " + e.toString()); ! Simulation.addLayerInfo(protInfo); ! protInfo = null; ! } ! } /** |
From: Alexander B. <da...@us...> - 2006-11-08 14:27:35
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1984/guiUI Modified Files: ApplicationLayerDevice.java MainScreen.java MenuBar.java SandBox.java SetTCPIPPropertiesDialog.java TelnetEmulator.java Added Files: GuiExternalNAT.java PosixTelnetClientGUI.java Log Message: --- NEW FILE: GuiExternalNAT.java --- /* Java Firewall Simulator (jFirewallSim) Copyright (c) 2004, jFirewallSim development team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Canberra Institute of Technology nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package guiUI; /** * <P>The GuiRouter class is used to instantiate new Routers on the GUI</P> * * @author VC2 Team. * @since 15th November 2004 * @version v0.20 */ public class GuiExternalNAT extends NetworkLayerDevice { /** * @param inName The name of the router * @param inMainscreen The JFrame that the router will be created on */ public GuiExternalNAT(String inName, MainScreen inMainScreen){ super(inName, inMainScreen,"images/simulation/network_local.png"); } } Index: ApplicationLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/ApplicationLayerDevice.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ApplicationLayerDevice.java 25 Feb 2006 22:48:34 -0000 1.8 --- ApplicationLayerDevice.java 8 Nov 2006 14:27:29 -0000 1.9 *************** *** 29,32 **** --- 29,33 ---- private JMenuItem mnuTelnetNoListen = new JMenuItem("Stop telnet server."); private JMenuItem mnuTelnetConnect = new JMenuItem("Telnet client."); + private JMenuItem mnuPosixTelnet = new JMenuItem("RFC(line) telnet client."); private JMenu mnuAppLayer = new JMenu("Applications"); private JMenuItem mnuSNMPStartAgent = new JMenuItem("Start SNMP agent"); *************** *** 104,107 **** --- 105,115 ---- } }); + + mnuPosixTelnet.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.PosixTelnet(lblNodeName.getText()); + } + }); + mnuAppLayer.addSeparator(); mnuAppLayer.add(mnuSNMPStartAgent); *************** *** 112,115 **** --- 120,125 ---- mnuAppLayer.add(mnuTelnetNoListen); mnuAppLayer.add(mnuTelnetConnect); + mnuAppLayer.addSeparator(); + mnuAppLayer.add(mnuPosixTelnet); } } Index: TelnetEmulator.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/TelnetEmulator.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TelnetEmulator.java 5 Sep 2006 21:04:36 -0000 1.8 --- TelnetEmulator.java 8 Nov 2006 14:27:29 -0000 1.9 *************** *** 87,90 **** --- 87,92 ---- private JTextArea terminal; private String text; + private String Host; + private int Port; private KeyListener kl; MainScreen parent; *************** *** 95,98 **** --- 97,102 ---- this.telnet = telnet; this.parent = parent; + this.Host = Host; + this.Port = Port; *************** *** 143,146 **** --- 147,155 ---- scrollpane.setViewportView(terminal); + + } + + + public void start(){ try{ this.telnet.TelnetConnect(this, Host, Port); *************** *** 169,177 **** /// ! } ! } - - public void recvData(String Data){ --- 178,183 ---- /// ! } } public void recvData(String Data){ Index: SetTCPIPPropertiesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SetTCPIPPropertiesDialog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SetTCPIPPropertiesDialog.java 26 Oct 2006 17:06:11 -0000 1.3 --- SetTCPIPPropertiesDialog.java 8 Nov 2006 14:27:29 -0000 1.4 *************** *** 372,376 **** try { ! if(NodeName != null && Interface != null && IPAddress != null){ Sim.setIPAddress(NodeName,Interface,IPAddress); controller.addToConsole(NodeName +"'s IP Address has been set to " + IPAddress + " on interface "+Interface+"\n"); --- 372,376 ---- try { ! if(NodeName != null && Interface != null && IPAddress != null && !ErrorFlag){ Sim.setIPAddress(NodeName,Interface,IPAddress); controller.addToConsole(NodeName +"'s IP Address has been set to " + IPAddress + " on interface "+Interface+"\n"); *************** *** 380,391 **** controller.addToConsole(NodeName +"'s Subnet Address has been set to " + SubnetMask + " on interface "+Interface+"\n"); ! } ! ! if(NodeName != null){ Sim.setDefaultGateway(NodeName,DefaultGWAddress); controller.addToConsole(NodeName +"'s Default Gateway Address has been set to " + DefaultGWAddress +"\n"); ! } ! ! this.dispose(); } catch (Exception e) { e.printStackTrace(); --- 380,391 ---- controller.addToConsole(NodeName +"'s Subnet Address has been set to " + SubnetMask + " on interface "+Interface+"\n"); ! ! if(NodeName != null){ Sim.setDefaultGateway(NodeName,DefaultGWAddress); controller.addToConsole(NodeName +"'s Default Gateway Address has been set to " + DefaultGWAddress +"\n"); ! } ! ! this.dispose(); ! } } catch (Exception e) { e.printStackTrace(); *************** *** 566,580 **** String tempip = txtIpAddress.getText(); ! if(Simulation.validateDecIP(tempip)){ if(txtSubnetMask.getText().equals("Enter Subnet Mask") || txtSubnetMask.getText() == null || txtSubnetMask.getText().equals("0.0.0.0")){ String tempSubnet = Simulation.getDefaultSubnetMask(tempip); txtSubnetMask.setText(tempSubnet); txtSubnetMask.setEnabled(true); } btnOk.setEnabled(true); ! }else{ txtSubnetMask.setText("Enter Subnet Mask"); txtSubnetMask.setEnabled(false); ! } } } --- 566,582 ---- String tempip = txtIpAddress.getText(); ! //if(Simulation.validateDecIP(tempip)){ if(txtSubnetMask.getText().equals("Enter Subnet Mask") || txtSubnetMask.getText() == null || txtSubnetMask.getText().equals("0.0.0.0")){ String tempSubnet = Simulation.getDefaultSubnetMask(tempip); txtSubnetMask.setText(tempSubnet); + txtSubnetMask.setEnabled(true); } btnOk.setEnabled(true); ! ! /*}else{ txtSubnetMask.setText("Enter Subnet Mask"); txtSubnetMask.setEnabled(false); ! }*/ } } Index: SandBox.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SandBox.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SandBox.java 8 Nov 2005 04:04:23 -0000 1.1.1.1 --- SandBox.java 8 Nov 2006 14:27:29 -0000 1.2 *************** *** 50,53 **** --- 50,54 ---- public static final int SWITCH_CURSOR = 2; public static final int HUB_CURSOR = 3; + public static final int EXTERNALNAT_CURSOR = 4; private Cursor csrDefault = new Cursor(Cursor.DEFAULT_CURSOR); *************** *** 73,76 **** --- 74,80 ---- Image hubImage = Toolkit.getDefaultToolkit().getImage(cl.getResource("images/simulation/hub_large.gif")); Cursor customHubCursor = Toolkit.getDefaultToolkit().createCustomCursor(hubImage, cursorLocation, "hubCursor"); + + Image externalnatImage = Toolkit.getDefaultToolkit().getImage(cl.getResource("images/simulation/network_local.png")); + Cursor customExternalNATCursor = Toolkit.getDefaultToolkit().createCustomCursor(externalnatImage, cursorLocation, "externalnatCursor"); public SandBox(MainScreen inMainScreen){ *************** *** 188,191 **** --- 192,199 ---- Point NodeLocation = new Point(e.getX(), e.getY()); controller.addHub(NodeLocation); + }else if(this.getCursor() == customExternalNATCursor){ + this.setCursor(csrDefault); + Point NodeLocation = new Point(e.getX(), e.getY()); + controller.addExternalNAT(NodeLocation); } } *************** *** 209,212 **** --- 217,222 ---- }else if(cursorType == HUB_CURSOR){ this.setCursor(customHubCursor); + }else if(cursorType == EXTERNALNAT_CURSOR){ + this.setCursor(customExternalNATCursor); } Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** MainScreen.java 26 Oct 2006 17:06:11 -0000 1.49 --- MainScreen.java 8 Nov 2006 14:27:29 -0000 1.50 *************** *** 716,720 **** } ! /** --- 716,780 ---- } ! /** ! ! * This method will create a Hub within the simulation and add it to the sandbox ! ! * @author Luke Hamilton ! ! * ! ! */ ! ! public void addExternalNAT(Point inPoint){ ! ! String result = JOptionPane.showInputDialog(this,"Please enter a NAT Gateway to External network name:","Create New NAT Gateway to External network", JOptionPane.PLAIN_MESSAGE); ! ! if(result != null){ ! ! result = result.trim(); ! ! if (!result.equalsIgnoreCase("")){ ! ! try { ! ! Sim.addExternalNAT(result); ! ! GuiExternalNAT tempEN = new GuiExternalNAT(result,this); ! ! tempEN.setNodeLocation(inPoint); ! ! GUInodeTable.put(result,tempEN); ! ! this.Sandbox.add(tempEN); ! ! Sandbox.setLayer(tempEN,3,0); ! ! isDirty = true; ! ! this.setAllHighlightsOff(); ! ! pnlConsole.append("Added Hub "+result+" to simulation\n"); ! ! } catch (InvalidNodeNameException e) { ! ! JOptionPane.showMessageDialog(this, "Invalid name entered. Node with name: '" + result+"' all ready exist within Simulation","Invalid Hub name", JOptionPane.ERROR_MESSAGE); ! ! } ! ! ! ! }else{ ! ! JOptionPane.showMessageDialog(this, "Device name not entered","Name not entered",JOptionPane.WARNING_MESSAGE); ! ! } ! ! } ! ! this.setAllHighlightsOff(); ! ! this.refreshNodeInformationTab(); ! ! } /** *************** *** 2153,2156 **** --- 2213,2232 ---- GUInodeTable.put(strNodeName,tempRouter); + }else if(strClassName.contains("GuiExternalNAT")){ + + deviceType = 2; + + Sim.addExternalNAT(strNodeName); + + GuiExternalNAT tempRouter = new GuiExternalNAT(strNodeName,this); + + tempRouter.setNodeLocation(pnt); + + Sandbox.add(tempRouter); + + Sandbox.setLayer(tempRouter,3,0); + + GUInodeTable.put(strNodeName,tempRouter); + } *************** *** 3327,3330 **** --- 3403,3407 ---- t.pack(); t.setVisible(true); + t.start(); }catch(Exception e){ addToConsole(e.toString()); *************** *** 3336,3339 **** --- 3413,3436 ---- } + + public void PosixTelnet(String inNodeName){ + String ip = JOptionPane.showInputDialog(this, "Server IP:", "Telnet connect to...", JOptionPane.QUESTION_MESSAGE); + if(ip!=null){ + String port = JOptionPane.showInputDialog(this, "Server Port:", "Telnet connect to...", JOptionPane.QUESTION_MESSAGE); + if(port!=null) { + try{ + printNetworkStart(); + PosixTelnetClientGUI t = new PosixTelnetClientGUI(this, ((core.ApplicationLayerDevice)Sim.getNode(inNodeName)),ip,Integer.valueOf(port).intValue()); + t.pack(); + t.setVisible(true); + t.start(); + }catch(Exception e){ + addToConsole(e.toString()); + } + addHeader(); + printLayerInfo(false); + } + } + } /** * Print routes table on throws node *************** *** 3370,3374 **** try{ ! if(Sim.getNode(inNodeName) instanceof core.NetworkLayerDevice){ msg = "Counters: \n\n Recieved IP Packets: " + Integer.valueOf(inIPCount).toString() + "\n Sent IP Packets: " + Integer.valueOf(outIPCount).toString() + --- 3467,3471 ---- try{ ! if(Sim.getNode(inNodeName) instanceof core.NetworkLayerDevice && !(Sim.getNode(inNodeName) instanceof core.ApplicationLayerDevice)){ msg = "Counters: \n\n Recieved IP Packets: " + Integer.valueOf(inIPCount).toString() + "\n Sent IP Packets: " + Integer.valueOf(outIPCount).toString() + --- NEW FILE: PosixTelnetClientGUI.java --- /* * TelnetEmulator.java * * Created on 22 Feb 2006, 16:38 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package guiUI; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.GridBagLayout; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JTextField; import javax.swing.JScrollPane; import javax.swing.JTextArea; import java.awt.Insets; import java.awt.GridBagConstraints; import java.awt.BorderLayout; import javax.swing.JButton; import java.awt.Dimension; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JComboBox; import core.Simulation; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.Color; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.util.Arrays; import java.awt.Component; import javax.swing.SwingConstants; import core.protocolsuite.tcp_ip.Telnet_client; import core.CommunicationException; import core.LowLinkException; import core.InvalidNetworkLayerDeviceException; import core.TransportLayerException; import java.awt.Font; import java.awt.event.KeyListener; import java.util.regex.*; import core.protocolsuite.tcp_ip.*; import java.util.Vector; /** * * @author key */ public class PosixTelnetClientGUI extends JFrame { private JPanel panel; private JScrollPane scrollpane; private JTextArea terminal; private JTextField cmdline; private String text; private KeyListener kl; private core.NetworkLayerDevice device; MainScreen parent; private Vector<String> history = new Vector<String>(0); private int pos_history=0; private final static int max_history = 128; private PosixTelnetClient ptc; private String Host; private int port; public boolean busy; /** Creates a new instance of TelnetEmulator */ public PosixTelnetClientGUI(MainScreen parent, core.ApplicationLayerDevice dev, String Host, int port) { super("Console: " + dev.NodeProtocolStack.getParentNodeName()); device = dev; this.Host = Host; this.port = port; this.parent = parent; ptc = (PosixTelnetClient) dev.getApp(10023); text = "Connecting to " + Host + ":" + port + "...\n"; panel = new JPanel(); scrollpane = new JScrollPane(); terminal = new JTextArea(text); cmdline = new JTextField(); this.setContentPane(panel); panel.setLayout(new java.awt.BorderLayout()); panel.add(scrollpane); panel.add(cmdline, BorderLayout.SOUTH); panel.setPreferredSize(new java.awt.Dimension(600,500)); scrollpane.setViewportView(terminal); terminal.setEnabled(true); terminal.setEditable(false); terminal.setBackground(Color.BLACK); terminal.setForeground(Color.WHITE); terminal.setFont(new Font("Courier New", Font.PLAIN, 12)); cmdline.setFocusable(true); cmdline.addKeyListener( kl = new KeyAdapter(){ // terminal.addKeyListener( kl = new KeyAdapter(){ public void keyPressed(KeyEvent e) { char c = e.getKeyChar(); switch(c) { case 0x0A: { if(cmdline.getText().compareTo("")!=0) { if(history.size()>=max_history) history.remove(0); history.add(cmdline.getText()); pos_history = history.size(); } String toSend = cmdline.getText() + "\n"; try{ ptc.SendData(toSend); }catch(Exception exc){ } text += cmdline.getText() + "\n"; cmdline.setText(""); printInfo(); break; } case 0x04: { exitWindow(); break; } case 0x1B: { cmdline.setText(""); break; } default: { if(c>=65535) { int i = e.getKeyCode(); switch(i) { case 0x26: { if(history.size()>0) { if(pos_history == history.size() && cmdline.getText().compareTo("")!=0) { if(history.size()>=max_history) history.remove(0); history.add(cmdline.getText()); pos_history = history.size()-1; } if(pos_history>0) { cmdline.setText(history.get(--pos_history)); } else if(pos_history>0) { cmdline.setText(history.get(pos_history-1)); } } break; } case 0x28: { if(history.size()>0) { if(pos_history+1<history.size()) { cmdline.setText(history.get(++pos_history)); } } break; } default: //terminal.setText(text+"\n"+Integer.toHexString(i)); } } else { pos_history = history.size(); } break; } } } }); this.addWindowListener( new java.awt.event.WindowAdapter() { public void windowClosing(WindowEvent winEvt) { printInfo(); } }); } public void start(){ try{ ptc.Telnet(this, Host, port); }catch(Exception e){ } } public void recvData(String Data){ busy = true; text += Data + "\n"; terminal.setText(text); busy = false; //try{ // ptc.SendData(""); //}catch(Exception e){ //} } public void exitWindow() { printInfo(); this.dispose(); } public void printInfo(){ parent.printLayerInfo(false); //!!!!!: add more headers here } private String removeSpaces(String s) { while(s.startsWith(" ")) s = s.substring(1); while(s.endsWith(" ")) s = s.substring(0, s.length()-1); return s; } } Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** MenuBar.java 12 Oct 2006 17:26:26 -0000 1.7 --- MenuBar.java 8 Nov 2006 14:27:29 -0000 1.8 *************** *** 55,58 **** --- 55,59 ---- private JMenuItem mnuHub = new JMenuItem("Hub ..."); private JMenuItem mnuSwitch = new JMenuItem("Switch ..."); + private JMenuItem mnuExternalNAT = new JMenuItem("NAT Gateway to External Network..."); //Tools submenu *************** *** 125,128 **** --- 126,130 ---- mnuAdd.add(mnuHub); mnuAdd.add(mnuSwitch); + //mnuAdd.add(mnuExternalNAT); mnuSimulation.add(mnuTools); *************** *** 214,217 **** --- 216,227 ---- }); + //Add action listener to new hub + mnuExternalNAT.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.setAllHighlightsOff(); + controller.addingNode(SandBox.EXTERNALNAT_CURSOR); + } + }); + mnuMsgLinkLayer.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ |
From: Alexander B. <da...@us...> - 2006-10-26 18:47:42
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23335/core/protocolsuite/tcp_ip Modified Files: IpV4.java Log Message: Index: IpV4.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/IpV4.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** IpV4.java 26 Oct 2006 17:06:11 -0000 1.9 --- IpV4.java 26 Oct 2006 18:47:38 -0000 1.10 *************** *** 305,309 **** r.destIP = "default"; r.gateway = inGatewayIPAddress; ! r.genMask = IPV4Address.getDefaultSubnetMask(inGatewayIPAddress); r.iFace = "eth0"; r.Type = 0; --- 305,309 ---- r.destIP = "default"; r.gateway = inGatewayIPAddress; ! r.genMask = "0.0.0.0"; r.iFace = "eth0"; r.Type = 0; |
From: Alexander B. <da...@us...> - 2006-10-26 17:06:16
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13119/core/protocolsuite/tcp_ip Modified Files: IpV4.java ProtocolStack.java Log Message: Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** ProtocolStack.java 26 Oct 2006 15:04:38 -0000 1.51 --- ProtocolStack.java 26 Oct 2006 17:06:11 -0000 1.52 *************** *** 1114,1121 **** --- 1114,1124 ---- public void addToARPStatic(String IPAddress, String MACAddress) + { + //if(mIPprotocol.isLocalNetwork(IPAddress)){ mARPprotocol.addToArpTable(IPAddress, MACAddress,"Static"); //} + } Index: IpV4.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/IpV4.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** IpV4.java 26 Oct 2006 13:36:54 -0000 1.8 --- IpV4.java 26 Oct 2006 17:06:11 -0000 1.9 *************** *** 175,179 **** FLAG[1] = "GW"; }catch(InvalidIPAddressException e){ ! System.out.println("Unrecoverable exception in IPV4.getIntergace: " + e.toString()); e.printStackTrace(); } --- 175,179 ---- FLAG[1] = "GW"; }catch(InvalidIPAddressException e){ ! System.out.println("Unrecoverable exception in IPV4.getInterface: " + e.toString()); e.printStackTrace(); } *************** *** 297,300 **** --- 297,303 ---- */ public void setDefaultGateway(String inGatewayIPAddress)throws InvalidDefaultGatewayException { + if(inGatewayIPAddress == null){ + removeRoute("default"); + }else{ try { defaultGateway = IPV4Address.toBinaryString(inGatewayIPAddress); *************** *** 308,312 **** } catch (InvalidIPAddressException e) { throw new InvalidDefaultGatewayException("Invaild Default Gateway Address."); ! } } --- 311,316 ---- } catch (InvalidIPAddressException e) { throw new InvalidDefaultGatewayException("Invaild Default Gateway Address."); ! } ! } } |
From: Alexander B. <da...@us...> - 2006-10-26 17:06:16
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13119/guiUI Modified Files: MainScreen.java SetTCPIPPropertiesDialog.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** MainScreen.java 26 Oct 2006 15:04:38 -0000 1.48 --- MainScreen.java 26 Oct 2006 17:06:11 -0000 1.49 *************** *** 69,72 **** --- 69,74 ---- import java.util.ArrayList; + import java.util.Date; + import java.util.Enumeration; *************** *** 231,235 **** ! --- 233,241 ---- ! private JLabel statusBar; ! ! private Timer statusTimer = new Timer(); ! ! *************** *** 317,320 **** --- 323,328 ---- StandardToolBar StandardToolBar = new StandardToolBar(this); + + statusBar = new JLabel(); SimToolBar = new SimulationToolBar(this); *************** *** 367,373 **** pContentPane.add(pSplit); ! ! ! //setup frame --- 375,383 ---- pContentPane.add(pSplit); ! ! pContentPane.add(statusBar, BorderLayout.PAGE_END); ! ! statusBar.setText(" "); ! //setup frame *************** *** 393,397 **** ! /** --- 403,433 ---- ! public class clearStatusTask extends TimerTask ! { ! private JLabel lbl; ! ! public clearStatusTask (JLabel lbl) ! { ! this.lbl = lbl; ! ! } ! ! ! public void run() ! { ! lbl.setText(" "); ! } ! } ! ! public void setStatus(String status){ ! Date d = new Date(); ! statusBar.setText(d.toString() + ": " + status); ! ! statusTimer.cancel(); ! statusTimer = null; ! statusTimer = new Timer(); ! statusTimer.schedule(new clearStatusTask(statusBar),4000); ! } ! /** *************** *** 1083,1086 **** --- 1119,1124 ---- public void printNetworkStart(){ + + setStatus("Starting network transfer..."); pnlConsole.append("**************************************************************************************************************** \n"); *************** *** 1909,1912 **** --- 1947,1952 ---- isDirty=false; + + setStatus("Simulation was saved succesfully."); }catch(IOException e){ Index: SetTCPIPPropertiesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SetTCPIPPropertiesDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SetTCPIPPropertiesDialog.java 12 Oct 2006 15:21:24 -0000 1.2 --- SetTCPIPPropertiesDialog.java 26 Oct 2006 17:06:11 -0000 1.3 *************** *** 50,53 **** --- 50,54 ---- import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; + import java.awt.event.KeyListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; *************** *** 317,320 **** --- 318,331 ---- } }); + txtDefaultGW.addKeyListener(new KeyListener() { + public void keyTyped(KeyEvent e) {} + public void keyReleased(KeyEvent e) {} + public void keyPressed(KeyEvent e) { + int key = e.getKeyCode(); + if (key == KeyEvent.VK_ENTER) { + setDefaultGW(); + } + } + }); txtDefaultGW.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { *************** *** 371,375 **** } ! if(NodeName != null && DefaultGWAddress != null){ Sim.setDefaultGateway(NodeName,DefaultGWAddress); controller.addToConsole(NodeName +"'s Default Gateway Address has been set to " + DefaultGWAddress +"\n"); --- 382,386 ---- } ! if(NodeName != null){ Sim.setDefaultGateway(NodeName,DefaultGWAddress); controller.addToConsole(NodeName +"'s Default Gateway Address has been set to " + DefaultGWAddress +"\n"); *************** *** 527,532 **** private void setDefaultGW(){ String GW = txtDefaultGW.getText(); ! if(!GW.equalsIgnoreCase("Enter Default Gateway")){ ! if(!Simulation.validateDecIP(GW)){ lblError.setText("Invalid Default Gateway Address"); lblError.setForeground(Color.RED); --- 538,543 ---- private void setDefaultGW(){ String GW = txtDefaultGW.getText(); ! if(!GW.equalsIgnoreCase("Enter Default Gateway")){ ! if(!Simulation.validateDecIP(GW) && !GW.equals("")){ lblError.setText("Invalid Default Gateway Address"); lblError.setForeground(Color.RED); *************** *** 536,540 **** }else{ lblError.setVisible(false); ! DefaultGWAddress = txtDefaultGW.getText(); ErrorFlag = false; } --- 547,553 ---- }else{ lblError.setVisible(false); ! GW = txtDefaultGW.getText(); ! if(GW.equals("")) GW = null; ! DefaultGWAddress = GW; ErrorFlag = false; } |
From: Alexander B. <da...@us...> - 2006-10-26 17:06:15
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13119 Modified Files: README.txt linux.sh Log Message: Index: linux.sh =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/linux.sh,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** linux.sh 8 Nov 2005 04:04:22 -0000 1.1.1.1 --- linux.sh 26 Oct 2006 17:06:10 -0000 1.2 *************** *** 1,2 **** #!/bin/sh ! java -jar jNetSim.jar \ No newline at end of file --- 1,2 ---- #!/bin/sh ! java -jar javaNetSim.jar \ No newline at end of file Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/README.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** README.txt 26 Oct 2006 15:04:38 -0000 1.7 --- README.txt 26 Oct 2006 17:06:10 -0000 1.8 *************** *** 3,7 **** ################################### ! Version: Public Release Version 0.32 Website: http://sf.net/projects/javanetsim Authors: See 'About' menu. --- 3,7 ---- ################################### ! Version: Public Release Version 0.32.1 Website: http://sf.net/projects/javanetsim Authors: See 'About' menu. *************** *** 31,35 **** ********************* ! ***** Release Version V 0.32.1 26th October 2006 ***** Fixed --- 31,35 ---- ********************* ! ***** Release Version 0.32.1 26th October 2006 ***** Fixed *************** *** 40,43 **** --- 40,45 ---- 1. Fixed "route removed" message in console. 2. Removed feature, that disables adding arp entry when ip is not on local network and/or incorrect. + 3. Fixed removing default gateway in "Set TCP/IP Properties" dialog. + 4. Fixed bug of no changing default gateway when clicking enter on text field in "Set TCP/IP Properties" dialog. Simulation Issues - *************** *** 49,54 **** 1. Added tooltips with node information. ! ***** Release Version V 0.32 12th October 2006 ***** Fixed --- 51,57 ---- 1. Added tooltips with node information. + 2. Added status bar. ! ***** Release Version 0.32 12th October 2006 ***** Fixed *************** *** 75,79 **** ! ***** Release Version V 0.22.1 6th November 2005 ***** Fixed --- 78,82 ---- ! ***** Release Version 0.22.1 6th November 2005 ***** Fixed *************** *** 101,105 **** ! ***** Release Version V 0.22 5th November 2005 ***** Project got new maintainer and new name! The fork calls javaNetSim (Java Network Simulator). --- 104,108 ---- ! ***** Release Version 0.22 5th November 2005 ***** Project got new maintainer and new name! The fork calls javaNetSim (Java Network Simulator). *************** *** 129,133 **** ! ***** Release Version V 0.20 November 2004 ***** Fixed --- 132,136 ---- ! ***** Release Version 0.20 November 2004 ***** Fixed |
From: Alexander B. <da...@us...> - 2006-10-26 17:06:15
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv13119/core Modified Files: Version.java Log Message: Index: Version.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Version.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Version.java 26 Oct 2006 15:04:38 -0000 1.8 --- Version.java 26 Oct 2006 17:06:10 -0000 1.9 *************** *** 49,53 **** "Ilgar Alekperov [Gift]", "Developer / Configuration Developer", "Konstantin Karpov [QweR]", "Developer / Tester", ! "", "" /*, "Semester 2, 2004", "", "Angela Brown " , "Project Manager / Documentation Manager / Developer ", --- 49,53 ---- "Ilgar Alekperov [Gift]", "Developer / Configuration Developer", "Konstantin Karpov [QweR]", "Developer / Tester", ! "", "Get information about latest releases at rss:", "http://sourceforge.net/export/rss2_projfiles.php?group_id=152576", "and about latest news at rss:", "http://sourceforge.net/export/rss2_projnews.php?group_id=152576&rss_fulltext=1" /*, "Semester 2, 2004", "", "Angela Brown " , "Project Manager / Documentation Manager / Developer ", |
From: Alexander B. <da...@us...> - 2006-10-26 15:05:01
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18179/core Modified Files: Version.java Log Message: Index: Version.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Version.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Version.java 26 Oct 2006 13:36:54 -0000 1.7 --- Version.java 26 Oct 2006 15:04:38 -0000 1.8 *************** *** 39,47 **** */ public class Version { ! public final static String CORE_VERSION = "v0.32"; //version of the simulation core public final static String YEARS = "2005 - 2006"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 12 Oct 2006", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", --- 39,47 ---- */ public class Version { ! public final static String CORE_VERSION = "v0.32.1"; //version of the simulation core public final static String YEARS = "2005 - 2006"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 26 Oct 2006", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", |
From: Alexander B. <da...@us...> - 2006-10-26 15:04:52
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18179/core/protocolsuite/tcp_ip Modified Files: ProtocolStack.java Log Message: Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** ProtocolStack.java 26 Oct 2006 13:36:54 -0000 1.50 --- ProtocolStack.java 26 Oct 2006 15:04:38 -0000 1.51 *************** *** 1114,1130 **** public void addToARPStatic(String IPAddress, String MACAddress) - { ! ! if(mIPprotocol.isLocalNetwork(IPAddress)) ! ! { ! ! mARPprotocol.addToArpTable(IPAddress, MACAddress,"Static"); ! ! } ! ! ! } --- 1114,1121 ---- public void addToARPStatic(String IPAddress, String MACAddress) { ! //if(mIPprotocol.isLocalNetwork(IPAddress)){ ! mARPprotocol.addToArpTable(IPAddress, MACAddress,"Static"); ! //} } |
From: Alexander B. <da...@us...> - 2006-10-26 15:04:46
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18179/guiUI Modified Files: GuiNode.java MainScreen.java RunCMD.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** MainScreen.java 26 Oct 2006 13:36:54 -0000 1.47 --- MainScreen.java 26 Oct 2006 15:04:38 -0000 1.48 *************** *** 643,648 **** GuiHub tempHub = new GuiHub(result,this); ! ! tempHub.setNodeLocation(inPoint); GUInodeTable.put(result,tempHub); --- 643,648 ---- GuiHub tempHub = new GuiHub(result,this); ! ! tempHub.setNodeLocation(inPoint); GUInodeTable.put(result,tempHub); *************** *** 3356,3359 **** --- 3356,3410 ---- } + + public String getNodeTooltipText(String inNodeName){ + //core.protocolsuite.tcp_ip.ProtocolStack PS = Sim.getTCPProtocolStack(inNodeName); + + String htmlText = "<html>"; + + try{ + //DataLinkLayerDevice dev = Sim.getNode(inNodeName); + Vector VectorMasterList = Sim.getAllNodeInformation(inNodeName); + /*ArrayList aryColumnNames = new ArrayList(); + aryColumnNames.add("Name"); + aryColumnNames.add("Gateway"); + aryColumnNames.add("Interface Name"); + aryColumnNames.add("MAC Address"); + aryColumnNames.add("IP Address"); + aryColumnNames.add("Subnet Mask"); + aryColumnNames.add("Link Name");*/ + + + Vector vec1 = (Vector) VectorMasterList.get(0); + + htmlText = htmlText + "Name: " + vec1.get(0) + "<br>"; + htmlText = htmlText + "Default Gateway: " + vec1.get(1) + "<br>"; + + htmlText = htmlText + "<table border='0' cellpadding='1' cellspacing='5'>"; + + htmlText = htmlText + "<tr><td>Interface</td><td>MAC</td><td>IP</td><td>Netmask</td><td>Link To</td></tr>"; + + for(int i=0; i<VectorMasterList.size(); i++){ + htmlText = htmlText + "<tr>"; + Vector vecInterfaceInfo = (Vector) VectorMasterList.get(i); + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(2) + "</td>"; + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(3) + "</td>"; + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(4) + "</td>"; + htmlText = htmlText + "<td>" + vecInterfaceInfo.get(5) + "</td>"; + String lnk = (String) vecInterfaceInfo.get(6); + lnk = lnk.replaceAll("-TO-" + inNodeName,""); + lnk = lnk.replaceAll(inNodeName + "-TO-",""); + htmlText = htmlText + "<td>" + lnk + "</td>"; + htmlText = htmlText + "</tr>"; + } + + htmlText = htmlText + "</table>"; + + }catch(Exception e){} + + //System.out.println(htmlText); + + return htmlText + "</html>"; + } + /** Index: GuiNode.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiNode.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** GuiNode.java 8 Nov 2005 04:04:25 -0000 1.1.1.1 --- GuiNode.java 26 Oct 2006 15:04:38 -0000 1.2 *************** *** 292,296 **** //because of the abstract class MouseListener and MouseMotionListener needs them public void dropActionChanged(DragSourceDragEvent e) {} ! public void mouseMoved(MouseEvent e){} public void mouseClicked(MouseEvent e){} public void mouseExited(MouseEvent e) {} --- 292,298 ---- //because of the abstract class MouseListener and MouseMotionListener needs them public void dropActionChanged(DragSourceDragEvent e) {} ! public void mouseMoved(MouseEvent e){ ! this.setToolTipText(controller.getNodeTooltipText(strNodeName)); ! } public void mouseClicked(MouseEvent e){} public void mouseExited(MouseEvent e) {} Index: RunCMD.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/RunCMD.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** RunCMD.java 3 Mar 2006 02:28:34 -0000 1.3 --- RunCMD.java 26 Oct 2006 15:04:38 -0000 1.4 *************** *** 246,250 **** else if((m=Pattern.compile(" +del +([^ ]+)$").matcher(cmd)).find()) { device.NodeProtocolStack.removeRoute(m.group(1)); ! out+="Route to " + tokens[2] + "removed.\n"; } else{ --- 246,250 ---- else if((m=Pattern.compile(" +del +([^ ]+)$").matcher(cmd)).find()) { device.NodeProtocolStack.removeRoute(m.group(1)); ! out+="Route to " + tokens[2] + " removed.\n"; } else{ |
From: Alexander B. <da...@us...> - 2006-10-26 15:04:45
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18179 Modified Files: README.txt Log Message: Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/README.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** README.txt 12 Oct 2006 17:26:25 -0000 1.6 --- README.txt 26 Oct 2006 15:04:38 -0000 1.7 *************** *** 31,35 **** ********************* ! ***** Release Version V 0.32 12th November 2006 ***** Fixed --- 31,54 ---- ********************* ! ***** Release Version V 0.32.1 26th October 2006 ***** ! ! Fixed ! ----- ! ! GUI Issues - ! ! 1. Fixed "route removed" message in console. ! 2. Removed feature, that disables adding arp entry when ip is not on local network and/or incorrect. ! ! Simulation Issues - ! ! 1. Fixed "no gateway" route bug: when no default gw set, no packet forwarding was processed. ! ! New Features ! ------------ ! ! 1. Added tooltips with node information. ! ! ***** Release Version V 0.32 12th October 2006 ***** Fixed |
From: Alexander B. <da...@us...> - 2006-10-26 13:37:07
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4759/core Modified Files: Version.java Log Message: Index: Version.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Version.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Version.java 12 Oct 2006 17:26:26 -0000 1.6 --- Version.java 26 Oct 2006 13:36:54 -0000 1.7 *************** *** 43,47 **** public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 25 Sep 2006", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", --- 43,47 ---- public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 12 Oct 2006", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", |
From: Alexander B. <da...@us...> - 2006-10-26 13:37:04
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4759 Modified Files: TODO.txt Log Message: Index: TODO.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/TODO.txt,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TODO.txt 2 Sep 2006 07:53:15 -0000 1.20 --- TODO.txt 26 Oct 2006 13:36:53 -0000 1.21 *************** *** 4,8 **** *** Whole Project ! *** Documentation --- 4,8 ---- *** Whole Project ! 1. SOA interfaces? Script language to operate sockets? Middleware emulation? *** Documentation *************** *** 16,31 **** that "route" command is only for ugly testing purposes! 5. App setting SAVE/LOAD! - 6. App level in S/L. 7. Fix LinkProperties Dialog: safe using (check for correct input values) (!!!, Gift!). *** Simulation Related - 8. Cannot route to another Node if sending from the Application layer of a Router (SENDAPPDATA router1 pc2 - message1 data). This would be because there's no IP Forwarding decisions on the receivePacket() method in IP when receiving a - Packet from the upper layer (UDP). The Routing table needs to be checked and a decision made as to which interface to send the data to. - 16. TCP(Gift && Key) - TCP Server disconnect after timeout - Problems with massive amount of packets. - *** Command Line Interface (CLI) Related (useless tasks, CLI shall be removed in future) --- 16,24 ---- that "route" command is only for ugly testing purposes! 5. App setting SAVE/LOAD! 7. Fix LinkProperties Dialog: safe using (check for correct input values) (!!!, Gift!). + 8. Add show switch cache dialog. *** Simulation Related *** Command Line Interface (CLI) Related (useless tasks, CLI shall be removed in future) |
From: Alexander B. <da...@us...> - 2006-10-26 13:37:03
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4759/guiUI Modified Files: MainScreen.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** MainScreen.java 12 Oct 2006 17:38:41 -0000 1.46 --- MainScreen.java 26 Oct 2006 13:36:54 -0000 1.47 *************** *** 1938,1942 **** /** ! * Currently not implements but will eventually open a saved Simulation. * --- 1938,1942 ---- /** ! * Opens a saved Simulation. * |
From: Alexander B. <da...@us...> - 2006-10-26 13:37:02
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4759/core/protocolsuite/tcp_ip Modified Files: IpV4.java ProtocolStack.java Log Message: Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** ProtocolStack.java 12 Oct 2006 15:21:23 -0000 1.49 --- ProtocolStack.java 26 Oct 2006 13:36:54 -0000 1.50 *************** *** 392,398 **** // ! String outInterface[] = mIPprotocol.router(inPacket.getDestIPAddress()); ! ! String GatewayAddress = null; //test if on local of remote network --- 392,398 ---- // ! String outInterface[] = mIPprotocol.router(inPacket.getDestIPAddress()); ! ! String GatewayAddress = null; //test if on local of remote network *************** *** 999,1003 **** String myName = mParentNode.getName(); ! // System.out.println(myName + " unable to forward packet due to the following error: " + ex.toString()); }catch(LowLinkException ex){ --- 999,1003 ---- String myName = mParentNode.getName(); ! System.out.println(myName + " unable to forward packet due to the following error: " + ex.toString()); }catch(LowLinkException ex){ Index: IpV4.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/IpV4.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IpV4.java 24 Feb 2006 10:20:11 -0000 1.7 --- IpV4.java 26 Oct 2006 13:36:54 -0000 1.8 *************** *** 170,174 **** } ! //else return GW if (FLAG[0] == null){ --- 170,182 ---- } ! if(FLAG[0] == null){ ! try{ ! FLAG[0]= getInterface(inDestIPAddress); ! FLAG[1] = "GW"; ! }catch(InvalidIPAddressException e){ ! System.out.println("Unrecoverable exception in IPV4.getIntergace: " + e.toString()); ! e.printStackTrace(); ! } ! } //else return GW if (FLAG[0] == null){ *************** *** 193,197 **** }catch(NullPointerException e){ System.out.println("IPV4.java: route 1 " + e.toString()); - } --- 201,204 ---- |
From: Alexander B. <da...@us...> - 2006-10-12 17:55:15
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22112/core Modified Files: Switch.java Log Message: Index: Switch.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Switch.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Switch.java 12 Oct 2006 17:38:41 -0000 1.4 --- Switch.java 12 Oct 2006 17:55:11 -0000 1.5 *************** *** 86,89 **** --- 86,100 ---- public void Reset(){ sz = 0; + Enumeration it, it2; + String nic = ""; + + it = NetworkInterfacetable.elements(); + + while(it.hasMoreElements()){ + NetworkInterface tempInterface = (NetworkInterface)it.nextElement(); + nic = tempInterface.getName(); + Hashtable outInt = (Hashtable) IntCaches.get(nic); + outInt.clear(); + } } |
From: Alexander B. <da...@us...> - 2006-10-12 17:38:47
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15817/core Modified Files: Simulation.java Switch.java Log Message: Index: Switch.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Switch.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Switch.java 12 Oct 2006 17:26:26 -0000 1.3 --- Switch.java 12 Oct 2006 17:38:41 -0000 1.4 *************** *** 92,96 **** } ! public String getSwitchCache(){ Enumeration it, it2; String nic = ""; --- 92,96 ---- } ! public String getCache(){ Enumeration it, it2; String nic = ""; *************** *** 148,152 **** try{ tempInterface.sendPacket(copyPacket); - System.out.println("\n\n" + getSwitchCache() + "\n\n"); }catch(NullPointerException e){ System.out.println("Switch.java: " + e.toString()); --- 148,151 ---- *************** *** 164,168 **** try{ tempInterface.sendPacket(copyPacket); - System.out.println("\n\n" + getSwitchCache() + "\n\n"); }catch(NullPointerException e){ System.out.println("Switch.java: " + e.toString()); --- 163,166 ---- Index: Simulation.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Simulation.java 12 Oct 2006 16:14:14 -0000 1.10 --- Simulation.java 12 Oct 2006 17:38:41 -0000 1.11 *************** *** 727,730 **** --- 727,737 ---- } + public String getCache(String inNodeName) { + if (nodeTable.containsKey(inNodeName)) { + return ((Switch)((Node)nodeTable.get(inNodeName))).getCache(); + } + return ""; + } + public void Reset(String inNodeName) { if (nodeTable.containsKey(inNodeName)) { |
From: Alexander B. <da...@us...> - 2006-10-12 17:38:44
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15817/guiUI Modified Files: MainScreen.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** MainScreen.java 12 Oct 2006 17:26:26 -0000 1.45 --- MainScreen.java 12 Oct 2006 17:38:41 -0000 1.46 *************** *** 2356,2377 **** public void ShowHubState(String InNodeName){ ! int state = Sim.getState(InNodeName); ! ! if(state==-1){ JOptionPane.showMessageDialog(this,"There are currently no node's within the simulation","Warning!",JOptionPane.WARNING_MESSAGE); ! }else if(state==0){ JOptionPane.showMessageDialog(this,"Device state: normal",InNodeName + ": device state",JOptionPane.INFORMATION_MESSAGE); ! }else if(state==1){ JOptionPane.showMessageDialog(this,"Device state: freezed","Warning! "+ InNodeName + ": device state",JOptionPane.WARNING_MESSAGE); ! } ! } --- 2356,2400 ---- public void ShowHubState(String InNodeName){ ! int state = Sim.getState(InNodeName); ! ! try{ ! if(Sim.getNode(InNodeName) instanceof core.Switch){ ! ! String cache = Sim.getCache(InNodeName); ! ! if(state==-1){ ! JOptionPane.showMessageDialog(this,"There are currently no node's within the simulation","Warning!",JOptionPane.WARNING_MESSAGE); ! }else if(state==0){ ! ! JOptionPane.showMessageDialog(this,"Device state: normal\n\nSwitch cache:\n-----------\n" + cache,InNodeName + ": device state",JOptionPane.INFORMATION_MESSAGE); ! ! }else if(state==1){ ! ! JOptionPane.showMessageDialog(this,"Device state: freezed","Warning! "+ InNodeName + ": device state",JOptionPane.WARNING_MESSAGE); ! ! } ! ! }else{ ! ! if(state==-1){ JOptionPane.showMessageDialog(this,"There are currently no node's within the simulation","Warning!",JOptionPane.WARNING_MESSAGE); ! }else if(state==0){ JOptionPane.showMessageDialog(this,"Device state: normal",InNodeName + ": device state",JOptionPane.INFORMATION_MESSAGE); ! }else if(state==1){ JOptionPane.showMessageDialog(this,"Device state: freezed","Warning! "+ InNodeName + ": device state",JOptionPane.WARNING_MESSAGE); ! } } ! }catch(Exception e){ ! ! JOptionPane.showMessageDialog(this,"There are currently no node's within the simulation","Warning!",JOptionPane.WARNING_MESSAGE); ! ! } } |
From: Alexander B. <da...@us...> - 2006-10-12 17:26:32
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11183/guiUI Modified Files: MainScreen.java MenuBar.java SimulationToolBar.java SplashWindow.java Log Message: Index: SplashWindow.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SplashWindow.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SplashWindow.java 8 Nov 2005 04:04:29 -0000 1.1.1.1 --- SplashWindow.java 12 Oct 2006 17:26:26 -0000 1.2 *************** *** 52,56 **** --- 52,58 ---- ClassLoader cl = this.getClass().getClassLoader(); JLabel l = new JLabel(new ImageIcon(cl.getResource(filename))); + JLabel v = new JLabel(core.Version.CORE_VERSION + ", copyright(¿) " + core.Version.YEARS); getContentPane().add(l, BorderLayout.CENTER); + getContentPane().add(v, BorderLayout.AFTER_LAST_LINE); pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); *************** *** 76,80 **** public void run() { try { ! Thread.sleep(pause); SwingUtilities.invokeAndWait(closerRunner); } catch (Exception e) { --- 78,82 ---- public void run() { try { ! Thread.sleep(pause); SwingUtilities.invokeAndWait(closerRunner); } catch (Exception e) { Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** MainScreen.java 12 Oct 2006 15:21:24 -0000 1.44 --- MainScreen.java 12 Oct 2006 17:26:26 -0000 1.45 *************** *** 716,720 **** Sandbox.setLayer(tempSwitch,3,0); ! JOptionPane.showMessageDialog(this,"Switch protocols are not yet implemented within the core of the system","Not Implemented",JOptionPane.WARNING_MESSAGE); isDirty = true; --- 716,720 ---- Sandbox.setLayer(tempSwitch,3,0); ! //JOptionPane.showMessageDialog(this,"Switch protocols are not yet implemented within the core of the system","Not Implemented",JOptionPane.WARNING_MESSAGE); isDirty = true; *************** *** 2049,2054 **** ! ! if(strClassName.contains("GuiHub")){ deviceType = 1; --- 2049,2053 ---- ! if(strClassName.contains("GuiHub")){ deviceType = 1; *************** *** 2066,2069 **** --- 2065,2084 ---- GUInodeTable.put(strNodeName,tempHub); + }else if(strClassName.contains("GuiSwitch")){ + + deviceType = 1; + + Sim.addSwitch(strNodeName); + + GuiSwitch tempSwitch = new GuiSwitch(strNodeName,this); + + tempSwitch.setNodeLocation(pnt); + + Sandbox.add(tempSwitch); + + Sandbox.setLayer(tempSwitch,3,0); + + GUInodeTable.put(strNodeName,tempSwitch); + }else if(strClassName.contains("GuiPC")){ Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MenuBar.java 12 Oct 2006 16:14:14 -0000 1.6 --- MenuBar.java 12 Oct 2006 17:26:26 -0000 1.7 *************** *** 54,58 **** private JMenuItem mnuRouter = new JMenuItem("Router ..."); private JMenuItem mnuHub = new JMenuItem("Hub ..."); ! // private JMenuItem mnuSwitch = new JMenuItem("Switch ..."); //Tools submenu --- 54,58 ---- private JMenuItem mnuRouter = new JMenuItem("Router ..."); private JMenuItem mnuHub = new JMenuItem("Hub ..."); ! private JMenuItem mnuSwitch = new JMenuItem("Switch ..."); //Tools submenu *************** *** 96,99 **** --- 96,100 ---- mnuRouter.setAccelerator(KeyStroke.getKeyStroke("ctrl R")); mnuHub.setAccelerator(KeyStroke.getKeyStroke("ctrl H")); + mnuSwitch.setAccelerator(KeyStroke.getKeyStroke("ctrl W")); mnuClearConsole.setAccelerator(KeyStroke.getKeyStroke("F3")); *************** *** 123,127 **** mnuAdd.add(mnuRouter); mnuAdd.add(mnuHub); ! //mnuAdd.add(mnuSwitch); mnuSimulation.add(mnuTools); --- 124,128 ---- mnuAdd.add(mnuRouter); mnuAdd.add(mnuHub); ! mnuAdd.add(mnuSwitch); mnuSimulation.add(mnuTools); *************** *** 256,269 **** //Add action listener to new switch ! /* mnuSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.setAllHighlightsOff(); ! JOptionPane.showMessageDialog(null,"Sorry switches are not yet implemented.","Switch Dialog Message", ! JOptionPane.INFORMATION_MESSAGE); ! //controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! */ //Add action listener to exit --- 257,268 ---- //Add action listener to new switch ! mnuSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.setAllHighlightsOff(); ! controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! //Add action listener to exit Index: SimulationToolBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SimulationToolBar.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SimulationToolBar.java 8 Nov 2005 04:04:29 -0000 1.1.1.1 --- SimulationToolBar.java 12 Oct 2006 17:26:26 -0000 1.2 *************** *** 48,52 **** private JButton btnNewPC = new JButton(new ImageIcon(cl.getResource("images/simulation/PC_small.gif"))); private JButton btnNewRouter = new JButton(new ImageIcon(cl.getResource("images/simulation/router_small.gif"))); ! //private JButton btnNewSwitch = new JButton(new ImageIcon(cl.getResource("images/simulation/switch_small.gif"))); private JButton btnNewHub = new JButton(new ImageIcon(cl.getResource("images/simulation/hub_small.gif"))); private JButton btnNewLink = new JButton(new ImageIcon(cl.getResource("images/simulation/link.gif"))); --- 48,52 ---- private JButton btnNewPC = new JButton(new ImageIcon(cl.getResource("images/simulation/PC_small.gif"))); private JButton btnNewRouter = new JButton(new ImageIcon(cl.getResource("images/simulation/router_small.gif"))); ! private JButton btnNewSwitch = new JButton(new ImageIcon(cl.getResource("images/simulation/switch_small.gif"))); private JButton btnNewHub = new JButton(new ImageIcon(cl.getResource("images/simulation/hub_small.gif"))); private JButton btnNewLink = new JButton(new ImageIcon(cl.getResource("images/simulation/link.gif"))); *************** *** 82,86 **** btnNewRouter.setToolTipText("Creats a new Router"); btnNewLink.setToolTipText("Creates a new Link between two nodes"); ! //btnNewSwitch.setToolTipText("Creates a new Switch"); btnNewHub.setToolTipText("Creates a new Hub"); --- 82,86 ---- btnNewRouter.setToolTipText("Creats a new Router"); btnNewLink.setToolTipText("Creates a new Link between two nodes"); ! btnNewSwitch.setToolTipText("Creates a new Switch"); btnNewHub.setToolTipText("Creates a new Hub"); *************** *** 89,93 **** btnNewRouter.setBorderPainted(false); btnNewLink.setBorderPainted(false); ! //btnNewSwitch.setBorderPainted(false); btnNewHub.setBorderPainted(false); --- 89,93 ---- btnNewRouter.setBorderPainted(false); btnNewLink.setBorderPainted(false); ! btnNewSwitch.setBorderPainted(false); btnNewHub.setBorderPainted(false); *************** *** 120,134 **** //Set action listener for Switch toolbar item ! /* btnNewSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ ! JOptionPane.showMessageDialog(null,"Sorry switches are not yet implemented.","Switch Dialog Message", ! JOptionPane.INFORMATION_MESSAGE); ! //setHighlightsOff(); //Clean out any buttons that may have been highlighted previously. ! //highlightButton(btnNewSwitch, true); ! //controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! */ btnNewLink.addActionListener(new ActionListener(){ --- 120,132 ---- //Set action listener for Switch toolbar item ! btnNewSwitch.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ ! setHighlightsOff(); //Clean out any buttons that may have been highlighted previously. ! highlightButton(btnNewSwitch, true); ! controller.addingNode(SandBox.SWITCH_CURSOR); } }); ! btnNewLink.addActionListener(new ActionListener(){ *************** *** 144,149 **** this.add(btnNewPC); this.add(btnNewRouter); - //this.add(btnNewSwitch); this.add(btnNewHub); this.add(btnNewLink); } --- 142,147 ---- this.add(btnNewPC); this.add(btnNewRouter); this.add(btnNewHub); + this.add(btnNewSwitch); this.add(btnNewLink); } *************** *** 195,199 **** btnNewPC.setBackground(deactivatedColor); btnNewRouter.setBackground(deactivatedColor); ! //btnNewSwitch.setBackground(deactivatedColor); btnNewHub.setBackground(deactivatedColor); btnNewLink.setBackground(deactivatedColor); --- 193,197 ---- btnNewPC.setBackground(deactivatedColor); btnNewRouter.setBackground(deactivatedColor); ! btnNewSwitch.setBackground(deactivatedColor); btnNewHub.setBackground(deactivatedColor); btnNewLink.setBackground(deactivatedColor); |
From: Alexander B. <da...@us...> - 2006-10-12 17:26:32
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11183 Modified Files: README.txt Log Message: Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/README.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** README.txt 12 Oct 2006 16:14:14 -0000 1.5 --- README.txt 12 Oct 2006 17:26:25 -0000 1.6 *************** *** 38,49 **** GUI Issues - ! 1. Fixed changing mask when changing IP and existing mask isn't null/illegal 2. Added confirm when deleting an object. 3. Fixed showing counters on router. Simulation Issues - 1. Now showing information about accepting/dropping ethernet packet on interface (it depends on dest MAC comparison). ! 2. Fixed resetting counters on router. New Features --- 38,50 ---- GUI Issues - ! 1. Fixed changing mask when changing IP and existing mask isn't null/illegal. 2. Added confirm when deleting an object. 3. Fixed showing counters on router. + 4. Added version label to the splash screen. Simulation Issues - 1. Now showing information about accepting/dropping ethernet packet on interface (it depends on dest MAC comparison). ! 2. Fixed resetting counters on router. New Features *************** *** 52,55 **** --- 53,57 ---- 1. Added hotkeys. 2. Added 'readme/changelog' window and menu item. + 3. Added switches(experimental). |