javanetsim-cvs Mailing List for javaNetSim (Page 26)
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: Alexander B. <da...@us...> - 2006-09-02 11:39:33
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22082/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** Tcp.java 2 Sep 2006 10:33:49 -0000 1.48 --- Tcp.java 2 Sep 2006 11:39:19 -0000 1.49 *************** *** 481,488 **** else { //nothing to resend, but numRepeat>0 ! System.out.println("Timer cancel - part1!"); try{ ! Elm.timer.cancel(); ! this.cancel(); Elm.timer = null; }catch(Exception e){ --- 481,491 ---- else { //nothing to resend, but numRepeat>0 ! System.out.println("Timer cancel - part1! NumRepeat = " + numRepeat); try{ ! if(Elm.ApplicationStatus==0) System.out.println(0); ! if(Elm.timer!=null){ ! Elm.timer.cancel(); ! this.cancel(); // ??? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ! } Elm.timer = null; }catch(Exception e){ |
From: Alexander B. <da...@us...> - 2006-09-02 11:22:56
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15419/guiUI Modified Files: MainScreen.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** MainScreen.java 2 Sep 2006 11:21:34 -0000 1.41 --- MainScreen.java 2 Sep 2006 11:22:52 -0000 1.42 *************** *** 3118,3122 **** } ! printLayerInfo(true); --- 3118,3122 ---- } ! printLayerInfo(true); |
From: Alexander B. <da...@us...> - 2006-09-02 11:21:37
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14975/guiUI Modified Files: MainScreen.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** MainScreen.java 2 Sep 2006 10:55:00 -0000 1.40 --- MainScreen.java 2 Sep 2006 11:21:34 -0000 1.41 *************** *** 3109,3115 **** printNetworkStart(); //=<150 - ((Echo)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30007)).SendEcho(msg, ip, Integer.valueOf(port).intValue(), Integer.valueOf(cnt).intValue()); - this.addToConsole("Trying to send echo message '" + msg + "' from " + inNodeName + " to " + ip + ":" + port + "\n"); }catch(Exception e){ --- 3109,3115 ---- printNetworkStart(); //=<150 this.addToConsole("Trying to send echo message '" + msg + "' from " + inNodeName + " to " + ip + ":" + port + "\n"); + ((Echo)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30007)).SendEcho(msg, ip, Integer.valueOf(port).intValue(), Integer.valueOf(cnt).intValue()); + }catch(Exception e){ *************** *** 3220,3226 **** timer.schedule(new TTask(this, 1),4000,4000); //=<150*/ ((Echo_tcp)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30017)).SendEcho(msg, ip, Integer.valueOf(port).intValue(), Integer.valueOf(cnt).intValue()); ! this.addToConsole("Trying to send echo message '" + msg + "' from " + inNodeName + " to " + ip + ":" + port + "\n"); }catch(Exception e){ --- 3220,3227 ---- timer.schedule(new TTask(this, 1),4000,4000); //=<150*/ + this.addToConsole("Trying to send echo message '" + msg + "' from " + inNodeName + " to " + ip + ":" + port + "\n"); ((Echo_tcp)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30017)).SendEcho(msg, ip, Integer.valueOf(port).intValue(), Integer.valueOf(cnt).intValue()); ! }catch(Exception e){ |
From: Alexander B. <da...@us...> - 2006-09-02 10:55:05
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4314/guiUI Modified Files: MainScreen.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** MainScreen.java 2 Mar 2006 13:37:04 -0000 1.39 --- MainScreen.java 2 Sep 2006 10:55:00 -0000 1.40 *************** *** 255,258 **** --- 255,275 ---- */ + + public class LayerInfoTask extends TimerTask + { + private MainScreen ms; + + public LayerInfoTask (MainScreen ms) + { + this.ms=ms; + + } + + + public void run() + { + ms.printLayerInfo(false); + } + } public MainScreen() { *************** *** 267,271 **** buildGUI(); ! } --- 284,291 ---- buildGUI(); ! ! Timer timer = null; ! timer=new Timer(); ! timer.schedule(new LayerInfoTask(this),1000,1000); } *************** *** 3142,3146 **** ! public class TTask extends TimerTask { --- 3162,3166 ---- ! /* public class TTask extends TimerTask { *************** *** 3164,3169 **** } } ! } /** --- 3184,3191 ---- } } ! }*/ + + /** *************** *** 3194,3201 **** printNetworkStart(); ! Timer timer = null; timer=new Timer(); timer.schedule(new TTask(this, 1),4000,4000); ! //=<150 ((Echo_tcp)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30017)).SendEcho(msg, ip, Integer.valueOf(port).intValue(), Integer.valueOf(cnt).intValue()); --- 3216,3223 ---- printNetworkStart(); ! /*Timer timer = null; timer=new Timer(); timer.schedule(new TTask(this, 1),4000,4000); ! //=<150*/ ((Echo_tcp)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30017)).SendEcho(msg, ip, Integer.valueOf(port).intValue(), Integer.valueOf(cnt).intValue()); |
From: Alexander B. <da...@us...> - 2006-09-02 10:55:05
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4314/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.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** ProtocolStack.java 2 Sep 2006 10:33:48 -0000 1.44 --- ProtocolStack.java 2 Sep 2006 10:55:00 -0000 1.45 *************** *** 79,83 **** import core.protocolsuite.tcp_ip.ospf.*; ! --- 79,83 ---- import core.protocolsuite.tcp_ip.ospf.*; ! import core.Error; *************** *** 1906,1909 **** --- 1906,1910 ---- TCP_Info.setDescription("TCP sending error: \""+ e.toString() + "\"."); Simulation.addLayerInfo(TCP_Info); + Error.Report(e); return false; /* mTCPprotocol.ClosePort(application); |
From: gift <gi...@us...> - 2006-09-02 10:34:10
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28090/core/protocolsuite/tcp_ip Modified Files: ProtocolStack.java Tcp.java Log Message: Refactoring Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ProtocolStack.java 24 Feb 2006 15:41:44 -0000 1.43 --- ProtocolStack.java 2 Sep 2006 10:33:48 -0000 1.44 *************** *** 1888,1896 **** { //let's get first interface IP address ! SourceIPAddress=getIPAddress(FirstInterfaceName); ! System.out.println("try to send..."); ! TCP_packet tosend = mTCPprotocol.sendTCPPacket(DestIPAddress,SourceIPAddress,destPort,srcPort,inTCPMessage,flags,acknow_num); ! System.out.println("never be here..."); ! //and sending out ;) sendPacket(tosend); }else --- 1888,1894 ---- { //let's get first interface IP address ! SourceIPAddress=getIPAddress(FirstInterfaceName); ! TCP_packet tosend = mTCPprotocol.getTCPPacket_tosend(DestIPAddress,SourceIPAddress,destPort,srcPort,inTCPMessage,flags,acknow_num); ! //and sending out ;) sendPacket(tosend); }else Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Tcp.java 2 Sep 2006 09:22:17 -0000 1.47 --- Tcp.java 2 Sep 2006 10:33:49 -0000 1.48 *************** *** 998,1002 **** */ ! public TCP_packet sendTCPPacket(String inDestIPAddress,String inSourceIPAddress, int indestPort, int insrcPort, String inMessage, boolean flags[], int acknow_num) throws TransportLayerException, LowLinkException { //check if window is available --- 998,1002 ---- */ ! public TCP_packet getTCPPacket_tosend(String inDestIPAddress,String inSourceIPAddress, int indestPort, int insrcPort, String inMessage, boolean flags[], int acknow_num) throws TransportLayerException, LowLinkException { //check if window is available |
From: Alexander B. <da...@us...> - 2006-09-02 09:22:20
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30465/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Tcp.java 2 Sep 2006 09:19:58 -0000 1.46 --- Tcp.java 2 Sep 2006 09:22:17 -0000 1.47 *************** *** 488,491 **** --- 488,492 ---- }catch(Exception e){ System.out.println("Timer cancel error."); + Error.Report(e); } System.out.println("Timer cancel - part2!"); |
From: Alexander B. <da...@us...> - 2006-09-02 09:20:02
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29310/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Tcp.java 2 Sep 2006 09:13:49 -0000 1.45 --- Tcp.java 2 Sep 2006 09:19:58 -0000 1.46 *************** *** 218,221 **** --- 218,222 ---- }catch(Exception e){ System.out.println("Elm.reset: Timer cancel error."); + Error.Report(e); } System.out.println("Elm.reset: Timer cancel - part 2!"); *************** *** 271,274 **** --- 272,276 ---- { System.out.println("TCP Element.SentACKs reset error: " + e.toString()); + Error.Report(e); } *************** *** 296,299 **** --- 298,302 ---- { System.out.println("TCP Element.SegmentsToResend reset error: " + e.toString()); + Error.Report(e); } *************** *** 489,493 **** } } ! }catch(Exception e){ System.out.println(e.toString()); } } } --- 492,498 ---- } } ! }catch(Exception e){ ! Error.Report(e); ! } } } |
From: Alexander B. <da...@us...> - 2006-09-02 09:13:53
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26910/core Added Files: Error.java Log Message: --- NEW FILE: Error.java --- package core; import java.io.*; public class Error{ public static void Report(Exception e){ System.out.println("\tError>>\t" + e.toString() + "\n"); e.printStackTrace(); } } |
From: Alexander B. <da...@us...> - 2006-09-02 09:13:52
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26910/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Tcp.java 25 Feb 2006 22:00:04 -0000 1.44 --- Tcp.java 2 Sep 2006 09:13:49 -0000 1.45 *************** *** 68,71 **** --- 68,73 ---- import core.LayerInfo; + import core.Error; + import core.Simulation; *************** *** 214,218 **** try{ this.timer.cancel(); ! }catch(Exception e){ System.out.println("Elm.reset: Timer cancel error."); } --- 216,220 ---- try{ this.timer.cancel(); ! }catch(Exception e){ System.out.println("Elm.reset: Timer cancel error."); } *************** *** 226,230 **** this.Servertimer.cancel(); }catch(Exception e){ ! System.out.println("Elm.reset: Servertimer cancel error."); } System.out.println("Elm.reset: Servertimer cancel - part 2!"); --- 228,233 ---- this.Servertimer.cancel(); }catch(Exception e){ ! System.out.println("Elm.reset: Server timer cancel error."); ! Error.Report(e); } System.out.println("Elm.reset: Servertimer cancel - part 2!"); |
From: Alexander B. <da...@us...> - 2006-09-02 07:53:19
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv27262 Modified Files: README.txt TODO.txt Log Message: Index: TODO.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/TODO.txt,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TODO.txt 8 Dec 2005 18:07:38 -0000 1.19 --- TODO.txt 2 Sep 2006 07:53:15 -0000 1.20 *************** *** 4,8 **** *** Whole Project ! 1. Fix Version.java: add new developers. *** Documentation --- 4,8 ---- *** Whole Project ! *** Documentation *************** *** 23,36 **** 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. ! 12. 2Fedor: OSPF. ! 15. UDP (Gift) ! pretty done 16. TCP(Gift && Key) TCP Server disconnect after timeout ! 17. SNMP (QweR, Key, Gift) ! 18. Telnet (QweR) ! 19. Echo Protocol Editing. *** Command Line Interface (CLI) Related --- 23,30 ---- 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 Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/README.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README.txt 8 Dec 2005 19:04:23 -0000 1.3 --- README.txt 2 Sep 2006 07:53:15 -0000 1.4 *************** *** 3,7 **** ################################### ! Version: Public Release Version 0.22 Website: (none) --- 3,7 ---- ################################### ! Version: Public Release Version 0.30 Website: (none) *************** *** 158,168 **** 4 : Console output is not in a True Space font, resulting in some funny output occasionally. - 5 : No saving / loading from the Graphical User Interface. - - 6 : Some issues when 2 jFirewallSim's are running concurrently and drawing links between a node on the first - jFirewallSim and a node on the second jFirewallSim. - - 7 : When drawing links, the right mouse button can be used. - ***** Release Version V 0.10 June 2004 ***** --- 158,161 ---- |
From: QweR <qw...@us...> - 2006-03-03 02:28:41
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25756/guiUI Modified Files: RunCMD.java Log Message: Index: RunCMD.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/RunCMD.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** RunCMD.java 28 Feb 2006 16:55:35 -0000 1.2 --- RunCMD.java 3 Mar 2006 02:28:34 -0000 1.3 *************** *** 115,123 **** panel.setPreferredSize(new java.awt.Dimension(600,500)); scrollpane.setViewportView(terminal); ! terminal.setEnabled(false); terminal.setEditable(false); terminal.setBackground(Color.BLACK); terminal.setForeground(Color.WHITE); terminal.setFont(new Font("Courier New", Font.PLAIN, 12)); cmdline.addKeyListener( kl = new KeyAdapter(){ --- 115,124 ---- 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(){ |
From: Alexander B. <da...@us...> - 2006-03-02 13:37:15
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6667/core Modified Files: EthernetLink.java Log Message: Index: EthernetLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetLink.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** EthernetLink.java 28 Feb 2006 18:25:27 -0000 1.6 --- EthernetLink.java 2 Mar 2006 13:37:04 -0000 1.7 *************** *** 73,81 **** * that is stored within the NetworkInterface Layer. If it is send inPacket * off to NetworkInterface. - * @author bevan_calliess - * @author luke_hamilton * @param inPacket - Ethernet Packet * @param inSourceName - Source name of node ! * @version v0.20 */ public void transportPacket(Ethernet_packet inPacket,String inSourceName) throws LowLinkException --- 73,79 ---- * that is stored within the NetworkInterface Layer. If it is send inPacket * off to NetworkInterface. * @param inPacket - Ethernet Packet * @param inSourceName - Source name of node ! * @throws core.LowLinkException */ public void transportPacket(Ethernet_packet inPacket,String inSourceName) throws LowLinkException |
From: Alexander B. <da...@us...> - 2006-03-02 13:37:15
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6667/guiUI Modified Files: MainScreen.java MenuBar.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** MainScreen.java 27 Feb 2006 16:54:49 -0000 1.38 --- MainScreen.java 2 Mar 2006 13:37:04 -0000 1.39 *************** *** 182,185 **** --- 182,186 ---- //filters private boolean[] filters = new boolean[8]; + private boolean[] filters2 = new boolean[2]; //Toolbar *************** *** 262,265 **** --- 263,269 ---- filters[i] =true; + filters2[0] = true; + filters2[1] = true; + buildGUI(); *************** *** 417,420 **** --- 421,445 ---- } + /* + * This method set value of filter. + * @author Key + * @param filter index + * @param filter value + * + */ + public void setFilter2(int i, boolean value){ + filters2[i] = value; + } + + /* + * This method get value of filter. + * @author Key + * @param filter index + * @returns filter value + * + */ + public boolean getFilter2(int i){ + return filters2[i]; + } /** *************** *** 1076,1084 **** String recording[] = (String[])it.next(); ! //Very UGLY but works. ;) if(!(((String)recording[4]).contains("Network") && !filters[2]) && !(((String)recording[4]).contains("Link") && !filters[0]) && !(((String)recording[4]).contains("Transport") && !filters[3]) && !(((String)recording[4]).contains("Application") && !filters[4])){ // && !(((String)recording[4]).contains("ARP") && !filters[1]) ! pnlConsole.append(pad(recording[1],15,' ')+pad(recording[2],25,' ')+pad(recording[3],15,' ')+pad(recording[4],10,' ')+recording[5]+ "\n"); } --- 1101,1115 ---- String recording[] = (String[])it.next(); ! String packet=""; ! String layer=""; //Very UGLY but works. ;) if(!(((String)recording[4]).contains("Network") && !filters[2]) && !(((String)recording[4]).contains("Link") && !filters[0]) && !(((String)recording[4]).contains("Transport") && !filters[3]) && !(((String)recording[4]).contains("Application") && !filters[4])){ // && !(((String)recording[4]).contains("ARP") && !filters[1]) ! ! if(filters2[0]) packet = pad(recording[2],25,' '); ! else packet=""; ! if(filters2[1]) layer = pad(recording[4],15,' '); ! else layer=""; ! pnlConsole.append(pad(recording[1],15,' ')+packet+pad(recording[3],10,' ')+layer+recording[5]+ "\n"); } Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** MenuBar.java 23 Feb 2006 14:37:09 -0000 1.3 --- MenuBar.java 2 Mar 2006 13:37:04 -0000 1.4 *************** *** 34,39 **** private JMenuItem mnuClearNodeInformation = new JMenuItem("Clear Node Information"); private JMenu mnuFilters = new JMenu("Show simulation messages for:"); ! //Filters menu private JCheckBoxMenuItem mnuMsgLinkLayer = new JCheckBoxMenuItem("Link and DataLink Layers",true); private JCheckBoxMenuItem mnuMsgARP = new JCheckBoxMenuItem("ARP",true); --- 34,43 ---- private JMenuItem mnuClearNodeInformation = new JMenuItem("Clear Node Information"); private JMenu mnuFilters = new JMenu("Show simulation messages for:"); ! private JMenu mnuFilters2 = new JMenu("Show headers:"); //Filters menu + + private JCheckBoxMenuItem mnuLayers = new JCheckBoxMenuItem("for Layers",true); + private JCheckBoxMenuItem mnuPackets = new JCheckBoxMenuItem("for Packet Names",true); + private JCheckBoxMenuItem mnuMsgLinkLayer = new JCheckBoxMenuItem("Link and DataLink Layers",true); private JCheckBoxMenuItem mnuMsgARP = new JCheckBoxMenuItem("ARP",true); *************** *** 109,112 **** --- 113,120 ---- mnuEnvironment.add(mnuClearNodeInformation); mnuEnvironment.add(mnuFilters); + mnuEnvironment.add(mnuFilters2); + + mnuFilters2.add(mnuLayers); + mnuFilters2.add(mnuPackets); mnuFilters.add(mnuMsgLinkLayer); *************** *** 186,189 **** --- 194,209 ---- }); + mnuLayers.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.setFilter2(1,!controller.getFilter2(1)); + } + }); + + mnuPackets.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.setFilter2(0,!controller.getFilter2(0)); + } + }); + mnuMsgARP.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ |
From: Alexander B. <da...@us...> - 2006-02-28 18:25:30
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2239/core Modified Files: EthernetLink.java Log Message: Index: EthernetLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetLink.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EthernetLink.java 24 Feb 2006 15:41:43 -0000 1.5 --- EthernetLink.java 28 Feb 2006 18:25:27 -0000 1.6 *************** *** 87,91 **** if (!temp.getSourceName().equals(inSourceName)) { ! if( ((sievingCoefficient+10)/100)>Math.random()) temp.receivePacket(inPacket); else throw new LowLinkException("Packet lost due to physical link problems!"); --- 87,91 ---- if (!temp.getSourceName().equals(inSourceName)) { ! if( ((sievingCoefficient)/100)>Math.random()) temp.receivePacket(inPacket); else throw new LowLinkException("Packet lost due to physical link problems!"); |
From: Alexander B. <da...@us...> - 2006-02-28 18:14:26
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26083/core/protocolsuite/tcp_ip Modified Files: Echo.java Echo_tcp.java Log Message: Index: Echo_tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo_tcp.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Echo_tcp.java 24 Feb 2006 15:41:44 -0000 1.22 --- Echo_tcp.java 28 Feb 2006 18:14:22 -0000 1.23 *************** *** 31,34 **** --- 31,36 ---- private byte ConnectionAttempts=1; private int counts; + private long + utc1; /** Creates a new instance of Echo */ *************** *** 187,191 **** --- 189,200 ---- if(this.counts==0){ + Disconnect(); + LayerInfo protInfo2 = new LayerInfo(getClass().getName()); + protInfo2.setObjectName(mParentStack.getParentNodeName()); + protInfo2.setDataType("Echo Protocol Data"); + protInfo2.setLayer("Application "); + protInfo2.setDescription("Connection time: " + (long)(System.currentTimeMillis () - utc1) + " ms."); + Simulation.addLayerInfo(protInfo2); }else{ this.counts--; *************** *** 237,240 **** --- 246,251 ---- this.counts = counts; + utc1 = System.currentTimeMillis (); + if (ClientConnect(Host, port)) { Index: Echo.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Echo.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Echo.java 24 Feb 2006 10:20:11 -0000 1.19 --- Echo.java 28 Feb 2006 18:14:22 -0000 1.20 *************** *** 28,31 **** --- 28,33 ---- public class Echo extends Application{ + long utc1; + /** Creates a new instance of Echo */ public Echo(ProtocolStack inParentStack, int listenPort, int appType, int UID) { *************** *** 147,150 **** --- 149,153 ---- Simulation.addLayerInfo(protInfo);*/ Disconnect(); + }else{ //server processing recieve *************** *** 192,195 **** --- 195,200 ---- mParentStack.FreeUDPApplication(this); + utc1 = System.currentTimeMillis () ; + for(int c=0; c<counts; c++){ if (ClientConnect(Host, port)) *************** *** 214,217 **** --- 219,228 ---- } } + LayerInfo protInfo2 = new LayerInfo(getClass().getName()); + protInfo2.setObjectName(mParentStack.getParentNodeName()); + protInfo2.setDataType("Echo Protocol Data"); + protInfo2.setLayer("Application "); + protInfo2.setDescription("Connection time: " + (long)(System.currentTimeMillis () - utc1) + " ms."); + Simulation.addLayerInfo(protInfo2); } |
From: QweR <qw...@us...> - 2006-02-28 16:55:42
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4475/guiUI Modified Files: NetworkLayerDevice.java RunCMD.java Log Message: Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/NetworkLayerDevice.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** NetworkLayerDevice.java 27 Feb 2006 16:54:49 -0000 1.7 --- NetworkLayerDevice.java 28 Feb 2006 16:55:35 -0000 1.8 *************** *** 119,123 **** ! private JMenuItem mnuRunCmd = new JMenuItem("Run low-level command..."); private JMenuItem mnuPR = new JMenuItem("Print route table"); --- 119,123 ---- ! private JMenuItem mnuRunCmd = new JMenuItem("Console"); private JMenuItem mnuPR = new JMenuItem("Print route table"); Index: RunCMD.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/RunCMD.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RunCMD.java 27 Feb 2006 16:54:49 -0000 1.1 --- RunCMD.java 28 Feb 2006 16:55:35 -0000 1.2 *************** *** 90,94 **** private JTextArea terminal; private JTextField cmdline; ! private String text=""; private KeyListener kl; private core.NetworkLayerDevice device; --- 90,94 ---- private JTextArea terminal; private JTextField cmdline; ! private String text; private KeyListener kl; private core.NetworkLayerDevice device; *************** *** 100,110 **** /** Creates a new instance of TelnetEmulator */ public RunCMD(MainScreen parent, core.NetworkLayerDevice dev) { ! super("Terminal"); device = dev; this.parent = parent; panel = new JPanel(); scrollpane = new JScrollPane(); ! terminal = new JTextArea(); cmdline = new JTextField(); this.setContentPane(panel); --- 100,111 ---- /** Creates a new instance of TelnetEmulator */ public RunCMD(MainScreen parent, core.NetworkLayerDevice dev) { ! super("Console: " + dev.NodeProtocolStack.getParentNodeName()); device = dev; this.parent = parent; + text = runcmd(""); panel = new JPanel(); scrollpane = new JScrollPane(); ! terminal = new JTextArea(text); cmdline = new JTextField(); this.setContentPane(panel); *************** *** 115,119 **** scrollpane.setViewportView(terminal); terminal.setEnabled(false); ! terminal.setEditable(true); terminal.setBackground(Color.BLACK); terminal.setForeground(Color.WHITE); --- 116,120 ---- scrollpane.setViewportView(terminal); terminal.setEnabled(false); ! terminal.setEditable(false); terminal.setBackground(Color.BLACK); terminal.setForeground(Color.WHITE); *************** *** 215,219 **** out += " counters\t show network counters\n"; out += " quit \t close terminal session\n"; ! out += " ? \t show this screen\n"; } else if(cmd.compareToIgnoreCase("quit")==0) { --- 216,220 ---- out += " counters\t show network counters\n"; out += " quit \t close terminal session\n"; ! out += " ? or help\tshow this screen\n"; } else if(cmd.compareToIgnoreCase("quit")==0) { |
From: QweR <qw...@us...> - 2006-02-28 16:55:41
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4475/core/protocolsuite/tcp_ip Modified Files: Telnet_server.java Log Message: Index: Telnet_server.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_server.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Telnet_server.java 27 Feb 2006 16:54:48 -0000 1.8 --- Telnet_server.java 28 Feb 2006 16:55:35 -0000 1.9 *************** *** 308,312 **** out += " passwd \t change password\n"; out += " quit \t close terminal session\n"; ! out += " ? \t show this screen\n"; } else if(cmd.compareToIgnoreCase("quit")==0) { --- 308,312 ---- out += " passwd \t change password\n"; out += " quit \t close terminal session\n"; ! out += " ? or help\tshow this screen\n"; } else if(cmd.compareToIgnoreCase("quit")==0) { |
From: Alouette <alo...@us...> - 2006-02-27 21:33:41
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4749/core/protocolsuite/tcp_ip/ospf Modified Files: OSPF.java Log Message: Index: OSPF.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPF.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** OSPF.java 27 Feb 2006 17:33:45 -0000 1.10 --- OSPF.java 27 Feb 2006 21:33:33 -0000 1.11 *************** *** 523,528 **** */ ! ! --- 523,537 ---- */ ! // declaration element of vector, store path and correct length ! public class PathStorage ! { ! public int PathCost; // path length ! public Vector PathVertex = new Vector(); // vertex correct composing this path ! PathStorage() ! { ! PathCost = 0; ! } ! ! } // End PathStorage *************** *** 538,552 **** ! // declaration element of vector, store path and correct length ! public class PathStorage ! { ! public int PathCost; // path length ! public Vector PathVertex = new Vector(); // vertex correct composing this path ! PathStorage() ! { ! PathCost = 0; ! } ! ! } // End PathStorage --- 547,552 ---- ! ! *************** *** 574,579 **** --- 574,593 ---- + + } + public PathStorage MyClone(PathStorage inpar1) + { + PathStorage tmp = new PathStorage(); + tmp.PathCost=inpar1.PathCost; + int i=0; + for (i=0; i<inpar1.PathVertex.size(); i++) + { + tmp.PathVertex.insertElementAt(inpar1.PathVertex.elementAt(i),i); + } + return tmp; + } + public void SPF() { *************** *** 589,595 **** } } - // add all path consist of one rib to vector - // save current order :path with least cost add first } --- 603,668 ---- } } + // add all start path + i=0; + int flag=0; + while ((i<Graf.size()) && (flag==0)) // find line router neighbors + { + if (((RouterRecord)Graf.elementAt(i)).RouterID.equals(this.RouterID)) + { + flag=1; + int j=0; + for (j=0; j<((RouterRecord)Graf.elementAt(i)).NeighborRouters.size(); j++) + { + PathStorage a = new PathStorage(); // create element + a.PathVertex.insertElementAt(this.RouterID, 1); // add router + a.PathVertex.insertElementAt( ((RouterLink)((RouterRecord)Graf.elementAt(i)).NeighborRouters.elementAt(j)).RouterID, a.PathVertex.size()+1); + a.PathCost= ((RouterLink)((RouterRecord)Graf.elementAt(i)).NeighborRouters.elementAt(j)).Metric; + solution.AddPath(a); + } + } + i++; + } + // start algorithm + while (solution.Pathfinder.size()!=0) // not all path operated + { + PathStorage t = (PathStorage)solution.Pathfinder.elementAt(1); + if (!solution.Operated.contains(t.PathVertex.lastElement())) + { + // this path is shortest + // update table !!! + + // go on this path add all neighbors of last vertex + i=0; + int flag2=0; + while ((i<Graf.size()) && (flag2==0)) // find line router neighbors + { + if (((RouterRecord)Graf.elementAt(i)).RouterID.equals(t.PathVertex.lastElement())) + { + flag2=1; + int k=0; + for (k=0; k<((RouterRecord)Graf.elementAt(i)).NeighborRouters.size(); k++) + { + PathStorage v = MyClone(t); + v.PathVertex.insertElementAt(((RouterLink)((RouterRecord)Graf.elementAt(i)).NeighborRouters.elementAt(k)).RouterID, v.PathVertex.size()+1); + v.PathCost+=((RouterLink)((RouterRecord)Graf.elementAt(i)).NeighborRouters.elementAt(k)).Metric; + solution.AddPath(v); + } + + + } + i++; + } + + + + solution.Operated.addElement(t.PathVertex.lastElement()); //add vertex to vector + solution.Missed.removeElement(t.PathVertex.lastElement()); // remove vertex from vector + } + + solution.Pathfinder.removeElement(t); // remove path this step + } + + } |
From: Alouette <alo...@us...> - 2006-02-27 17:33:53
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27061/core/protocolsuite/tcp_ip/ospf Modified Files: OSPF.java Log Message: Index: OSPF.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPF.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** OSPF.java 24 Feb 2006 13:05:57 -0000 1.9 --- OSPF.java 27 Feb 2006 17:33:45 -0000 1.10 *************** *** 522,525 **** *this method to receive link statereqiest */ ! } --- 522,596 ---- *this method to receive link statereqiest */ ! ! ! ! ! ! public class SPFtable ! { ! public Vector Operated = new Vector(); // contains vertex, that have been already seen ! public Vector Missed = new Vector(); // vertex, that have not been already seen ! public Vector Pathfinder = new Vector(); // vector conatins all pathes ! SPFtable() ! { ! ! } ! ! ! // declaration element of vector, store path and correct length ! public class PathStorage ! { ! public int PathCost; // path length ! public Vector PathVertex = new Vector(); // vertex correct composing this path ! PathStorage() ! { ! PathCost = 0; ! } ! ! } // End PathStorage ! ! ! public void AddPath(PathStorage toadd) // add element to correct number ! { ! int a; // path cost ! int i=0;// counter ! int flag=0; // flag that element was added ! while ((i<Pathfinder.size()) && (flag==0)) ! { ! if ( (toadd.PathCost) < ((PathStorage)Pathfinder.elementAt(i)).PathCost) //!!! ! { ! Pathfinder.insertElementAt(toadd, i); ! flag=1; ! } ! i++; ! } ! if (flag==0) ! { ! Pathfinder.insertElementAt(toadd, i); ! } ! } ! ! ! ! ! } ! ! public void SPF() ! { ! // start position ! SPFtable solution = new SPFtable(); ! solution.Operated.addElement(this.RouterID); // add to vector router id ! int i=0; ! for (i=0; i<Graf.size(); i++) //add to vector all vertex except current ! { ! if (!((RouterRecord)Graf.elementAt(i)).RouterID.equals(this.RouterID)) ! { ! solution.Missed.addElement(((RouterRecord)Graf.elementAt(i)).RouterID); ! } ! } ! ! // add all path consist of one rib to vector ! // save current order :path with least cost add first ! ! } } |
From: QweR <qw...@us...> - 2006-02-27 16:54:52
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2508/guiUI Modified Files: MainScreen.java NetworkLayerDevice.java Added Files: RunCMD.java Log Message: Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/NetworkLayerDevice.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NetworkLayerDevice.java 23 Feb 2006 11:56:00 -0000 1.6 --- NetworkLayerDevice.java 27 Feb 2006 16:54:49 -0000 1.7 *************** *** 1,166 **** ! /* ! 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; ! ! ! import java.awt.Dimension; ! import java.awt.event.ActionEvent; ! import java.awt.event.ActionListener; ! ! import javax.swing.JMenuItem; ! import javax.swing.JMenu; ! ! /** ! * <P>The NetworkLayerDevice class is an abstract class used for further classification of Network </P> ! * <P>layer devices such as PC's and Routers. ! * ! * @author VC2 Team. ! * @since 15th November 2004 ! * @version v0.20 ! */ ! ! public abstract class NetworkLayerDevice extends GuiNode { ! ! private JMenuItem mnuSetTCPIPProperties = new JMenuItem("Set TCP/IP Properties ..."); ! private JMenuItem mnuSendPing = new JMenuItem("Send Ping ..."); ! private JMenuItem mnuProperties = new JMenuItem("Properties ..."); ! private JMenu mnuARPMenu = new JMenu("ARP"); ! private JMenu mnuCountersMenu = new JMenu("Counters"); ! ! private JMenuItem mnuShowCounters = new JMenuItem("Show Packet Counters"); ! private JMenuItem mnuResetCounters = new JMenuItem("Reset Packet Counters"); ! ! private JMenuItem mnuArpStaticAdd = new JMenuItem("Add static entry to ARP table..."); ! private JMenuItem mnuArpRemove = new JMenuItem("Remove entry from ARP table..."); ! ! private JMenuItem mnuRunCmd = new JMenuItem("Run low-level command..."); ! private JMenuItem mnuPR = new JMenuItem("Print route table"); ! private JMenuItem mnuArp = new JMenuItem("Print ARP Table"); ! private JMenuItem mnuLink = new JMenuItem("Links properties"); ! private JMenuItem mnuBreakLink = new JMenuItem("Break link"); ! ! ! /** ! * @param inName The name of the Network Layer Device ! * @param inMainscreen The JFrame that the router will be created on ! * @param imageLocation Location of the Image used on the GUI ! */ ! ! public NetworkLayerDevice(String inName, MainScreen inMainScreen, String imageLocation) { ! super(inName, inMainScreen, imageLocation); ! ! mnuSetTCPIPProperties.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.setTCPIPProperties(lblNodeName.getText()); ! ! ! } ! }); ! mnuSendPing.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.SendPing(lblNodeName.getText()); ! } ! }); ! mnuArp.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.printARP(lblNodeName.getText()); ! } ! }); ! ! mnuArpStaticAdd.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.addStaticARP(lblNodeName.getText()); ! } ! }); ! mnuArpRemove.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.removeARP(lblNodeName.getText()); ! } ! }); ! mnuRunCmd.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.RunCmd(lblNodeName.getText()); ! } ! }); ! mnuProperties.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.showPropertiesDialog(lblNodeName.getText()); ! } ! }); ! mnuBreakLink.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.showBreakLinkDialog(lblNodeName.getText()); ! } ! }); ! ! mnuPR.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.PrintRouteTable(lblNodeName.getText()); ! } ! }); ! mnuLink.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.showLinkDialog(lblNodeName.getText()); ! } ! }); ! ! ! mnuShowCounters.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.showCounters(lblNodeName.getText()); ! } ! }); ! mnuResetCounters.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.resetCounters(lblNodeName.getText()); ! } ! }); ! ! ! GuiNodePopMenu.add(mnuSetTCPIPProperties); ! GuiNodePopMenu.add(mnuSendPing); ! GuiNodePopMenu.add(mnuARPMenu); ! mnuARPMenu.add(mnuArpStaticAdd); ! mnuARPMenu.add(mnuArpRemove); ! mnuARPMenu.add(mnuArp); ! GuiNodePopMenu.add(mnuCountersMenu); ! mnuCountersMenu.add(mnuShowCounters); ! mnuCountersMenu.add(mnuResetCounters); ! GuiNodePopMenu.add(mnuRunCmd); ! GuiNodePopMenu.add(mnuPR); ! GuiNodePopMenu.add(mnuBreakLink); ! GuiNodePopMenu.add(mnuLink); ! GuiNodePopMenu.add(mnuProperties); ! ! ! } ! ! ! ! ! } --- 1,332 ---- ! /* ! ! 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; ! ! ! ! ! ! import java.awt.Dimension; ! ! import java.awt.event.ActionEvent; ! ! import java.awt.event.ActionListener; ! ! ! ! import javax.swing.JMenuItem; ! ! import javax.swing.JMenu; ! ! ! ! /** ! ! * <P>The NetworkLayerDevice class is an abstract class used for further classification of Network </P> ! ! * <P>layer devices such as PC's and Routers. ! ! * ! ! * @author VC2 Team. ! ! * @since 15th November 2004 ! ! * @version v0.20 ! ! */ ! ! ! ! public abstract class NetworkLayerDevice extends GuiNode { ! ! ! ! private JMenuItem mnuSetTCPIPProperties = new JMenuItem("Set TCP/IP Properties ..."); ! ! private JMenuItem mnuSendPing = new JMenuItem("Send Ping ..."); ! ! private JMenuItem mnuProperties = new JMenuItem("Properties ..."); ! ! private JMenu mnuARPMenu = new JMenu("ARP"); ! ! private JMenu mnuCountersMenu = new JMenu("Counters"); ! ! ! ! private JMenuItem mnuShowCounters = new JMenuItem("Show Packet Counters"); ! ! private JMenuItem mnuResetCounters = new JMenuItem("Reset Packet Counters"); ! ! ! ! private JMenuItem mnuArpStaticAdd = new JMenuItem("Add static entry to ARP table..."); ! ! private JMenuItem mnuArpRemove = new JMenuItem("Remove entry from ARP table..."); ! ! ! ! private JMenuItem mnuRunCmd = new JMenuItem("Run low-level command..."); ! ! private JMenuItem mnuPR = new JMenuItem("Print route table"); ! ! private JMenuItem mnuArp = new JMenuItem("Print ARP Table"); ! ! private JMenuItem mnuLink = new JMenuItem("Links properties"); ! ! private JMenuItem mnuBreakLink = new JMenuItem("Break link"); ! ! ! ! ! ! /** ! ! * @param inName The name of the Network Layer Device ! ! * @param inMainscreen The JFrame that the router will be created on ! ! * @param imageLocation Location of the Image used on the GUI ! ! */ ! ! ! ! public NetworkLayerDevice(String inName, MainScreen inMainScreen, String imageLocation) { ! ! super(inName, inMainScreen, imageLocation); ! ! ! ! mnuSetTCPIPProperties.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.setTCPIPProperties(lblNodeName.getText()); ! ! ! ! ! ! } ! ! }); ! ! mnuSendPing.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.SendPing(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuArp.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.printARP(lblNodeName.getText()); ! ! } ! ! }); ! ! ! ! mnuArpStaticAdd.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.addStaticARP(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuArpRemove.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.removeARP(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuRunCmd.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.RunCmd(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuProperties.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.showPropertiesDialog(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuBreakLink.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.showBreakLinkDialog(lblNodeName.getText()); ! ! } ! ! }); ! ! ! ! mnuPR.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.PrintRouteTable(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuLink.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.showLinkDialog(lblNodeName.getText()); ! ! } ! ! }); ! ! ! ! ! ! mnuShowCounters.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.showCounters(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuResetCounters.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.resetCounters(lblNodeName.getText()); ! ! } ! ! }); ! ! ! ! ! ! GuiNodePopMenu.add(mnuSetTCPIPProperties); ! ! GuiNodePopMenu.add(mnuSendPing); ! ! GuiNodePopMenu.add(mnuARPMenu); ! ! mnuARPMenu.add(mnuArpStaticAdd); ! ! mnuARPMenu.add(mnuArpRemove); ! ! mnuARPMenu.add(mnuArp); ! ! GuiNodePopMenu.add(mnuCountersMenu); ! ! mnuCountersMenu.add(mnuShowCounters); ! ! mnuCountersMenu.add(mnuResetCounters); ! ! GuiNodePopMenu.add(mnuRunCmd); ! ! GuiNodePopMenu.add(mnuPR); ! ! GuiNodePopMenu.add(mnuBreakLink); ! ! GuiNodePopMenu.add(mnuLink); ! ! GuiNodePopMenu.add(mnuProperties); ! ! ! ! ! ! } ! ! ! ! ! ! ! ! ! ! } ! Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** MainScreen.java 27 Feb 2006 00:49:10 -0000 1.37 --- MainScreen.java 27 Feb 2006 16:54:49 -0000 1.38 *************** *** 124,127 **** --- 124,128 ---- import core.protocolsuite.tcp_ip.Telnet_server; import core.protocolsuite.tcp_ip.Telnet_client; + import guiUI.RunCMD; *************** *** 3273,3355 **** public void RunCmd(String inNodeName){ ! ! String cmd = JOptionPane.showInputDialog(this, "Command (e.g. route print):", "Run network configure command.", JOptionPane.QUESTION_MESSAGE); ! ! if(cmd!=null){ ! ! String tokens[]=cmd.split(" "); ! ! ! ! if(tokens[0].contains("route")){ ! ! try{ ! ! if(tokens[1].contains("print")){ ! ! String routes[] = Sim.getRouteTableEntries(inNodeName); ! ! this.addToConsole("IP routing table:\n" + "Destination" + "\t" + "Gateway" + "\t" + "Genmask" + "\t" + "Type" + "\t" + "Iface\n"); ! ! for(int i=0; i<routes.length - 1; i++){ ! ! Route_entry r = Sim.getRouteEntry(inNodeName, routes[i]); ! ! this.addToConsole(routes[i] + "\t" + r.gateway + "\t" + r.genMask + "\t" + r.Type + "\t" + r.iFace + "\n"); ! ! } ! ! }else if(tokens[1].contains("add")){ ! ! String gw = ""; ! ! if(tokens.length > 5) gw = tokens[5]; ! ! Route_entry r = new Route_entry(tokens[2], gw, tokens[4], tokens[3], 0); ! ! Sim.addRoute(inNodeName, r); ! ! this.addToConsole("Route added.\n"); ! ! }else if(tokens[1].contains("del")){ ! ! Sim.removeRoute(inNodeName, tokens[2]); ! ! this.addToConsole("Route to " + tokens[2] + "removed.\n"); ! ! }else{ ! ! this.addToConsole("Unknown route command. Usage:\n"); ! ! this.addToConsole("route add (host_ip|network_ip) target_interface netmask (gateway|*) \n"); ! ! this.addToConsole("route del (host_ip|network_ip) \n"); ! ! this.addToConsole("route print \n"); ! ! } ! ! }catch(ArrayIndexOutOfBoundsException e){ ! ! this.addToConsole("Unknown route command. Usage:\n"); ! ! this.addToConsole("route add (host_ip|network_ip) target_interface netmask (gateway|*) \n"); ! ! this.addToConsole("route del (host_ip|network_ip) \n"); ! ! this.addToConsole("route print \n"); ! ! } ! ! ! ! }else{ ! ! this.addToConsole("Unknown or invalid command.\n"); ! ! } ! ! } ! } --- 3274,3322 ---- public void RunCmd(String inNodeName){ ! try{ ! RunCMD r = new RunCMD(this, (core.NetworkLayerDevice)Sim.getNode(inNodeName)); ! r.pack(); ! r.setVisible(true); ! } ! catch(InvalidNodeNameException e) { ! System.out.print(e.toString() + ": You change non-existent device!"); ! } ! // String cmd = JOptionPane.showInputDialog(this, "Command (e.g. route print):", "Run network configure command.", JOptionPane.QUESTION_MESSAGE); ! // if(cmd!=null){ ! // String tokens[]=cmd.split(" "); ! // if(tokens[0].contains("route")){ ! // try{ ! // if(tokens[1].contains("print")){ ! // String routes[] = Sim.getRouteTableEntries(inNodeName); ! // this.addToConsole("IP routing table:\n" + "Destination" + "\t" + "Gateway" + "\t" + "Genmask" + "\t" + "Type" + "\t" + "Iface\n"); ! // for(int i=0; i<routes.length - 1; i++){ ! // Route_entry r = Sim.getRouteEntry(inNodeName, routes[i]); ! // this.addToConsole(routes[i] + "\t" + r.gateway + "\t" + r.genMask + "\t" + r.Type + "\t" + r.iFace + "\n"); ! // } ! // }else if(tokens[1].contains("add")){ ! // String gw = ""; ! // if(tokens.length > 5) gw = tokens[5]; ! // Route_entry r = new Route_entry(tokens[2], gw, tokens[4], tokens[3], 0); ! // Sim.addRoute(inNodeName, r); ! // this.addToConsole("Route added.\n"); ! // }else if(tokens[1].contains("del")){ ! // Sim.removeRoute(inNodeName, tokens[2]); ! // this.addToConsole("Route to " + tokens[2] + "removed.\n"); ! // }else{ ! // this.addToConsole("Unknown route command. Usage:\n"); ! // this.addToConsole("route add (host_ip|network_ip) target_interface netmask (gateway|*) \n"); ! // this.addToConsole("route del (host_ip|network_ip) \n"); ! // this.addToConsole("route print \n"); ! // } ! // }catch(ArrayIndexOutOfBoundsException e){ ! // this.addToConsole("Unknown route command. Usage:\n"); ! // this.addToConsole("route add (host_ip|network_ip) target_interface netmask (gateway|*) \n"); ! // this.addToConsole("route del (host_ip|network_ip) \n"); ! // this.addToConsole("route print \n"); ! // } ! // }else{ ! // this.addToConsole("Unknown or invalid command.\n"); ! // } ! // } } --- NEW FILE: RunCMD.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 RunCMD 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; /** Creates a new instance of TelnetEmulator */ public RunCMD(MainScreen parent, core.NetworkLayerDevice dev) { super("Terminal"); device = dev; this.parent = parent; panel = new JPanel(); scrollpane = new JScrollPane(); terminal = new JTextArea(); 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(false); terminal.setEditable(true); terminal.setBackground(Color.BLACK); terminal.setForeground(Color.WHITE); terminal.setFont(new Font("Courier New", Font.PLAIN, 12)); 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(); } text += cmdline.getText() + "\n"; terminal.setText(text); text += runcmd(removeSpaces(cmdline.getText())); terminal.setText(text); 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 exitWindow() { printInfo(); this.dispose(); } public void printInfo(){ parent.printLayerInfo(false); //!!!!!: add more headers here } private String runcmd(String cmd) { String out=""; if(cmd.compareTo("")==0) { //nothing } else if(cmd.compareTo("?")==0 || cmd.compareToIgnoreCase("help")==0) { out += " route \t show/edit route table\n"; out += " arp \t show/edit arp table\n"; out += " snmp \t on/off snmp agent\n"; out += " counters\t show network counters\n"; out += " quit \t close terminal session\n"; out += " ? \t show this screen\n"; } else if(cmd.compareToIgnoreCase("quit")==0) { this.dispose(); } else { String tokens[]=cmd.split(" "); Matcher m; if(tokens[0].compareTo("route")==0){ if((m=Pattern.compile(" +print$").matcher(cmd)).find()) { String routes[] = device.NodeProtocolStack.getRouteTableEntries(); out += "IP routing table:\n" + "Destination" + "\t" + "Gateway" + "\t" + "Genmask" + "\t" + "Type" + "\t" + "Iface\n"; for(int i=0; i<routes.length - 1; i++){ Route_entry r = device.NodeProtocolStack.getRouteTableEntry(routes[i]); out += routes[i] + "\t" + r.gateway + "\t" + r.genMask + "\t" + r.Type + "\t" + r.iFace + "\n"; } } else if((m=Pattern.compile(" +add +([^ ]+) +([^ ]+) +([^ ]+)( +([^ ]+|\\*))?$").matcher(cmd)).find()) { if(m.group(5)!=null) { device.NodeProtocolStack.addRoute(new Route_entry(m.group(1), m.group(5), m.group(3), m.group(2), 0)); } else { device.NodeProtocolStack.addRoute(new Route_entry(m.group(1), "", m.group(3), m.group(2), 0)); } out+="Route added.\n"; } else if((m=Pattern.compile(" +del +([^ ]+)$").matcher(cmd)).find()) { device.NodeProtocolStack.removeRoute(m.group(1)); out+="Route to " + tokens[2] + "removed.\n"; } else{ out+="Unknown route command. Usage:\n"; out+=" route add (<host ip>|<network ip>) <target interface> <netmask> [<gateway>|*]\n" + " add new route record\n"; out+=" route del (<host ip>|<network ip>) delete route record\n"; out+=" route print print route table\n"; } } else if(tokens[0].compareTo("snmp")==0){ if(device instanceof core.ApplicationLayerDevice) { if((m=Pattern.compile(" +(on|\\d+)( +([^ ]+))?$").matcher(cmd)).find()) { int l_port=161; String l_pass="public"; if(m.group(1).compareTo("on")!=0) l_port = Integer.parseInt(m.group(1)); if(m.group(3)!=null) { if(m.group(3).compareTo("")!=0) l_pass = m.group(3); } SNMP snmpa = (SNMP) ((core.ApplicationLayerDevice)device).getApp(161); try{ snmpa.Close(); snmpa.Disconnect(); out+="SNMP agent stoped\n"; snmpa.setPassword(l_pass); snmpa.setPort(l_port); try{ snmpa.Listen(); out+="Now SNMP agent listen on port " + String.valueOf(l_port) + "\n"; } catch(TransportLayerException e) { out+="Unable to open connection on SNMP agent\n"; } } catch(TransportLayerException e) { out+="Unable to close connection on SNMP agent\n"; } } else if((m=Pattern.compile(" +off$").matcher(cmd)).find()) { SNMP snmpa = (SNMP) ((core.ApplicationLayerDevice)device).getApp(161); try{ snmpa.Close(); out+="SNMP agent stoped\n"; } catch(TransportLayerException e) { out+="Unable to close connection on SNMP agent\n"; } } else { out+="Unknown snmp command. Usage:\n"; out+=" snmp (on|<port number>) [community name] Start SNMP agent\n"; out+=" snmp off Stop SNMP agent\n"; } } else { out += "Sorry, but this device not supported SNMP.\n"; } } else if(tokens[0].compareTo("counters")==0){ out += " Recieved IP Packets: " + Integer.valueOf(device.NodeProtocolStack.getinputIPCount()).toString() + "\n Sent IP Packets: " + Integer.valueOf(device.NodeProtocolStack.getoutputIPCount()).toString() + "\n ARP Packets: " + Integer.valueOf(device.NodeProtocolStack.getARPCount()).toString() + "\n Recieved TCP segments: " + Integer.valueOf(device.NodeProtocolStack.getTCPinputCount()).toString() + "\n Sent TCP segments: " + Integer.valueOf(device.NodeProtocolStack.getTCPoutputCount()).toString() + "\n Sent TCP ACK's: " + Integer.valueOf(device.NodeProtocolStack.getTCPACKCount()).toString() + "\n Sent TCP Dublicates: " + Integer.valueOf(device.NodeProtocolStack.getTCPSDCount()).toString() + "\n Recieved TCP Dublicates: " + Integer.valueOf(device.NodeProtocolStack.getTCPRDCount()).toString() + "\n Recieved UDP segments: " + Integer.valueOf(device.NodeProtocolStack.getUDPinputCount()).toString() + "\n Sent UDP segments: " + Integer.valueOf(device.NodeProtocolStack.getUDPoutputCount()).toString() + "\n"; } else if(tokens[0].compareTo("arp")==0){ if((m=Pattern.compile(" +-a$").matcher(cmd)).find()) { try{ String ArpTable[] = device.NodeProtocolStack.getARPTable(); for(int i=0;i<ArpTable.length;i++) { out += ArpTable[i] + "\n"; } } catch(Exception e) { //Should never get here. } } else if((m=Pattern.compile(" +-d +([^ ]+)$").matcher(cmd)).find()) { device.NodeProtocolStack.removeARP(m.group(1)); out += "Removed ARP entry for ip " + m.group(1) + "\n"; } else if((m=Pattern.compile(" +-s +([^ ]+) +([^ ]+)$").matcher(cmd)).find()) { device.NodeProtocolStack.addToARPStatic(m.group(1), m.group(2)); out += "Created new static ARP entry: " + m.group(1) + " is " + m.group(2) + "\n"; } else { out+="Unknown arp command. Usage:\n"; out+=" arp -a print ARP table\n"; out+=" arp -d <ip address> delete record from ARP table\n"; out+=" arp -s <ip address> <MAC address> add new ARP record\n"; } } else out = tokens[0] + ": command not found\n"; } out+=device.NodeProtocolStack.getParentNodeName() + " # "; return out; } private String removeSpaces(String s) { while(s.startsWith(" ")) s = s.substring(1); while(s.endsWith(" ")) s = s.substring(0, s.length()-1); return s; } } |
From: QweR <qw...@us...> - 2006-02-27 16:54:52
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2508/core/protocolsuite/tcp_ip Modified Files: Telnet_server.java Log Message: Index: Telnet_server.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_server.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Telnet_server.java 27 Feb 2006 00:49:09 -0000 1.7 --- Telnet_server.java 27 Feb 2006 16:54:48 -0000 1.8 *************** *** 301,305 **** //nothing } ! else if(cmd.compareTo("?")==0) { out += " route \t show/edit route table\n"; out += " arp \t show/edit arp table\n"; --- 301,305 ---- //nothing } ! else if(cmd.compareTo("?")==0 || cmd.compareToIgnoreCase("help")==0) { out += " route \t show/edit route table\n"; out += " arp \t show/edit arp table\n"; *************** *** 358,361 **** --- 358,362 ---- try{ snmpa.Close(); + snmpa.Disconnect(); out+="SNMP agent stoped\n"; snmpa.setPassword(l_pass); |
From: QweR <qw...@us...> - 2006-02-27 00:49:20
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4214/guiUI Modified Files: MainScreen.java TelnetEmulator.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** MainScreen.java 25 Feb 2006 22:48:34 -0000 1.36 --- MainScreen.java 27 Feb 2006 00:49:10 -0000 1.37 *************** *** 3003,3015 **** public void TelnetListen(String inNodeName){ ! String port = JOptionPane.showInputDialog(this, "Port:", "Set Telnet Server listening on port.", JOptionPane.QUESTION_MESSAGE); if(port!=null){ ! try{ ! Telnet_server telnet1 = ((Telnet_server)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(23)); ! telnet1.setPort(Integer.valueOf(port).intValue()); ! telnet1.Listen(); ! printLayerInfo(true); ! }catch(Exception e){ ! addToConsole(e.toString()); } } --- 3003,3019 ---- public void TelnetListen(String inNodeName){ ! String port = JOptionPane.showInputDialog(this, "Port:", "Set Telnet Server listening on port...", JOptionPane.QUESTION_MESSAGE); if(port!=null){ ! String pass = JOptionPane.showInputDialog(this, "Password:", "Set Telnet Server listening on port "+port+" with password...", JOptionPane.QUESTION_MESSAGE); ! if(pass!=null){ ! try{ ! Telnet_server telnet1 = ((Telnet_server)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(23)); ! telnet1.setPort(Integer.valueOf(port).intValue()); ! telnet1.setPassword(pass); ! telnet1.Listen(); ! printLayerInfo(true); ! }catch(Exception e){ ! addToConsole(e.toString()); ! } } } *************** *** 3186,3200 **** try{ printNetworkStart(); - //Timer timer = null; - //timer=new Timer(); - //timer.schedule(new TTask(this, 1),4000,4000); - //=<150 - //((Echo_tcp)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30021)).SendEcho(msg, ip, Integer.valueOf(port).intValue(), Integer.valueOf(cnt).intValue()); TelnetEmulator t = new TelnetEmulator(this, ((Telnet_client)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30023)),ip,Integer.valueOf(port).intValue()); t.pack(); t.setVisible(true); - // - //this.addToConsole("Trying to send echo message '" + msg + "' from " + inNodeName + " to " + ip + ":" + port + "\n"); - }catch(Exception e){ addToConsole(e.toString()); --- 3190,3196 ---- Index: TelnetEmulator.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/TelnetEmulator.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TelnetEmulator.java 25 Feb 2006 22:48:34 -0000 1.6 --- TelnetEmulator.java 27 Feb 2006 00:49:10 -0000 1.7 *************** *** 102,113 **** //terminal = new JLabel(text); terminal = new JTextArea(text); - terminal.setBackground(new Color(0)); - terminal.setForeground(Color.WHITE); terminal.setEnabled(false); terminal.setFont(new Font("Courier New", Font.PLAIN, 12)); panel = new JPanel(); scrollpane = new JScrollPane(); ! this.addKeyListener( kl = new KeyAdapter(){ public void keyPressed(KeyEvent e) { char c = e.getKeyChar(); --- 102,115 ---- //terminal = new JLabel(text); terminal = new JTextArea(text); terminal.setEnabled(false); + terminal.setEditable(false); + terminal.setBackground(Color.BLACK); + terminal.setForeground(Color.WHITE); terminal.setFont(new Font("Courier New", Font.PLAIN, 12)); panel = new JPanel(); scrollpane = new JScrollPane(); ! this.addKeyListener( kl = new KeyAdapter(){ ! // terminal.addKeyListener( kl = new KeyAdapter(){ public void keyPressed(KeyEvent e) { char c = e.getKeyChar(); *************** *** 117,125 **** printInfo(); } ! // else { // String s = String.valueOf(e.getKeyCode()).toString(); // sendData(s); // printInfo(); ! // } } }); --- 119,127 ---- printInfo(); } ! else { // String s = String.valueOf(e.getKeyCode()).toString(); // sendData(s); // printInfo(); ! } } }); |
From: QweR <qw...@us...> - 2006-02-27 00:49:16
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4214/core/protocolsuite/tcp_ip Modified Files: SNMP.java Telnet_client.java Telnet_server.java Log Message: Index: Telnet_client.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_client.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Telnet_client.java 25 Feb 2006 22:48:34 -0000 1.6 --- Telnet_client.java 27 Feb 2006 00:49:09 -0000 1.7 *************** *** 186,190 **** if(Data.compareTo("\nQUIT")==0) { Disconnect(); ! terminal.recvData("\nClient: closing connection\n"); } terminal.recvData(Data); --- 186,190 ---- if(Data.compareTo("\nQUIT")==0) { Disconnect(); ! // terminal.recvData("Client: closing connection\n"); } terminal.recvData(Data); Index: Telnet_server.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_server.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Telnet_server.java 25 Feb 2006 22:48:34 -0000 1.6 --- Telnet_server.java 27 Feb 2006 00:49:09 -0000 1.7 *************** *** 233,238 **** } else { ! cmdline = removeSpaces(cmdline); ! outData = "\n" + runcmd(cmdline); } cmdline = ""; --- 233,237 ---- } else { ! outData = "\n" + runcmd(removeSpaces(cmdline)); } cmdline = ""; *************** *** 252,256 **** } else { ! outData = "<" + ( ch < 16 ? "0" : "" ) + Integer.toHexString(ch) + ">"; } } --- 251,255 ---- } else { ! // outData = "<" + ( ch < 16 ? "0" : "" ) + Integer.toHexString(ch) + ">"; } } *************** *** 357,368 **** } SNMP snmpa = (SNMP) mDevice.getApp(161); - snmpa.setPassword(l_pass); - snmpa.setPort(l_port); try{ ! snmpa.Listen(); ! out+="Now SNMP agent listen on port " + String.valueOf(l_port) + "\n"; } catch(TransportLayerException e) { ! out+="Unable to open connection on SNMP agent\n"; } } --- 356,374 ---- } SNMP snmpa = (SNMP) mDevice.getApp(161); try{ ! snmpa.Close(); ! out+="SNMP agent stoped\n"; ! snmpa.setPassword(l_pass); ! snmpa.setPort(l_port); ! try{ ! snmpa.Listen(); ! out+="Now SNMP agent listen on port " + String.valueOf(l_port) + "\n"; ! } ! catch(TransportLayerException e) { ! out+="Unable to open connection on SNMP agent\n"; ! } } catch(TransportLayerException e) { ! out+="Unable to close connection on SNMP agent\n"; } } *************** *** 451,454 **** --- 457,468 ---- Simulation.addLayerInfo(protInfo3); } + + public void setPassword(String s) { + password = s; + } + + public String getPassword() { + return password; + } } Index: SNMP.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/SNMP.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SNMP.java 25 Feb 2006 22:48:33 -0000 1.12 --- SNMP.java 27 Feb 2006 00:49:09 -0000 1.13 *************** *** 978,982 **** } else { ! m_errorstatus=SNMP_ERROR_wrongEncoding; return false; } --- 978,982 ---- } else { ! m_errorstatus=SNMP_ERROR_genErr; return false; } *************** *** 1028,1032 **** } else { ! m_errorstatus = SNMP_ERROR_wrongEncoding; return false; } --- 1028,1032 ---- } else { ! m_errorstatus = SNMP_ERROR_genErr; return false; } |
From: QweR <qw...@us...> - 2006-02-25 22:48:41
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19142/core/protocolsuite/tcp_ip Modified Files: SNMP.java Telnet_client.java Telnet_server.java Log Message: Index: Telnet_client.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_client.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Telnet_client.java 25 Feb 2006 00:00:03 -0000 1.5 --- Telnet_client.java 25 Feb 2006 22:48:34 -0000 1.6 *************** *** 79,88 **** 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 --- 79,83 ---- sdPort = port; ! printInfo("Client: connecting to host " + Host + ":"+ port +". Please wait..."); do *************** *** 113,118 **** */ ! public void DisconnectEvent(){ ! System.out.print("\n---------------------------\n\nIT WORKS!!!\n\n----------------------------------\n"); } --- 108,124 ---- */ ! public void DisconnectEvent(){ ! try{ ! Disconnect(); ! } ! catch(TransportLayerException e) { ! printInfo("Client: can not disconnected: transport problem"); ! } ! catch(LowLinkException e) { ! printInfo("Client: can not disconnected: low link problem"); ! } ! printInfo("\nClient: receive disconnect event\n"); ! terminal.recvData("\nServer closed connection.\n"); ! terminal.recvData("\nQUIT"); } *************** *** 130,144 **** } - 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); --- 136,144 ---- } if(appType==0){ ! printInfo("Client: closing connection."); }else{ ! printInfo("Client: closing connection. Now listening on " + listenPort + "."); ! } mParentStack.CloseTCP(this); //mParentStack.freeTCPPort(this); *************** *** 175,184 **** //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 echo message '" + Data + "' from server."); ! Simulation.addLayerInfo(protInfo); /* LayerInfo protInfo = new LayerInfo(getClass().getName()); --- 175,179 ---- //client processing recieve // printing some ... ! printInfo("Recieving echo message '" + Data + "' from server."); /* LayerInfo protInfo = new LayerInfo(getClass().getName()); *************** *** 191,210 **** if(Data.compareTo("\nQUIT")==0) { Disconnect(); } ! terminal.recvData(Data); ! ! //if(this.counts==0){ ! //Disconnect(); ! //}else{ ! // this.counts--; ! // try { ! // SendData(Data); ! //}catch(Exception e){ ! ///*TODO*: here to catch ! //} ! //} ! ! ! } } --- 186,192 ---- if(Data.compareTo("\nQUIT")==0) { Disconnect(); + terminal.recvData("\nClient: closing connection\n"); } ! terminal.recvData(Data); } } *************** *** 241,251 **** } 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); ! terminal.recvData("Error: cannot connect to " + Host + ":" + port + "!"); this.counts=0; } --- 223,228 ---- } else { ! printInfo("Client: error: can not connect to " + Host + ":" + port + "!"); ! terminal.recvData("Client: error: cannot connect to " + Host + ":" + port + "!"); this.counts=0; } *************** *** 274,277 **** --- 251,262 ---- } + private void printInfo(String s) { + LayerInfo protInfo2 = new LayerInfo(getClass().getName()); + protInfo2.setObjectName(mParentStack.getParentNodeName()); + protInfo2.setDataType("Telnet Protocol Data"); + protInfo2.setLayer("Application "); + protInfo2.setDescription(s); + Simulation.addLayerInfo(protInfo2); + } } Index: Telnet_server.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Telnet_server.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Telnet_server.java 25 Feb 2006 00:00:03 -0000 1.5 --- Telnet_server.java 25 Feb 2006 22:48:34 -0000 1.6 *************** *** 37,41 **** private boolean islogin=false; private boolean ispass=false; ! private boolean isprompt=true; private boolean isnewpass=false; private String password = "123"; --- 37,41 ---- private boolean islogin=false; private boolean ispass=false; ! // private boolean isprompt=true; private boolean isnewpass=false; private String password = "123"; *************** *** 63,66 **** --- 63,67 ---- } + isenter = true; } *************** *** 75,78 **** --- 76,80 ---- { mParentStack.FreeTCPApplication(this); + isenter = true; } *************** *** 98,115 **** public void DisconnectEvent(){ ! LayerInfo protInfo3 = new LayerInfo(getClass().getName()); try{ Close(); ! printInfo("Server closing connection"); 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,117 ---- public void DisconnectEvent(){ ! printInfo("Server: client closed connection"); try{ Close(); ! printInfo("Server: closing connection"); 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"); } } *************** *** 129,135 **** if(appType==0){ ! printInfo("Application closing connection."); }else{ ! printInfo("Application closing connection. Now listening on port" + listenPort + "."); } --- 131,137 ---- if(appType==0){ ! printInfo("Server: closing connection."); }else{ ! printInfo("Server: closing connection. Now listening on port" + listenPort + "."); } *************** *** 167,172 **** //server processing recieve ! printInfo("Recieving echo message '" + Data + "' from client."); String outData=""; if(isenter && Data.compareTo("\n")==0) { --- 169,175 ---- //server processing recieve ! printInfo("Server: recieving echo message '" + Data + "' from client."); + while(Data.length()>0) { String outData=""; if(isenter && Data.compareTo("\n")==0) { *************** *** 254,262 **** } try { ! printInfo("Sending echo message '" + outData + "' to client."); SendData(outData); if(outData.compareTo("\nQUIT")==0) { Close(); Listen(); isenter = true; } --- 257,267 ---- } try { ! printInfo("Server: sending message '" + outData + "' to client."); SendData(outData); if(outData.compareTo("\nQUIT")==0) { Close(); Listen(); + printInfo("Server: closing connection"); + printInfo("Server: listening on port " + listenPort); isenter = true; } *************** *** 265,268 **** --- 270,275 ---- ///*TODO*: here to catch } + Data = Data.substring(1); + } } *************** *** 296,306 **** } else if(cmd.compareTo("?")==0) { ! out += "route \t\t show/edit route table\n"; ! out += "arp \t\t show/edit arp table"; ! out += "snmp \t\t on/off snmp agent\n"; ! out += "counters \t\t show network counters\n"; ! out += "passwd \t\t change password\n"; ! out += "quit \t\t close terminal session\n"; ! out += "? \t\t show this screen\n"; } else if(cmd.compareToIgnoreCase("quit")==0) { --- 303,313 ---- } else if(cmd.compareTo("?")==0) { ! out += " route \t show/edit route table\n"; ! out += " arp \t show/edit arp table\n"; ! out += " snmp \t on/off snmp agent\n"; ! out += " counters\t show network counters\n"; ! out += " passwd \t change password\n"; ! out += " quit \t close terminal session\n"; ! out += " ? \t show this screen\n"; } else if(cmd.compareToIgnoreCase("quit")==0) { *************** *** 310,316 **** String tokens[]=cmd.split(" "); Matcher m; - // if(m.find()) { - // if(m.group(1).compareTo("route")==0); - // } if(tokens[0].compareTo("route")==0){ if((m=Pattern.compile(" +print$").matcher(cmd)).find()) { --- 317,320 ---- *************** *** 324,331 **** } else if((m=Pattern.compile(" +add +([^ ]+) +([^ ]+) +([^ ]+)( +([^ ]+|\\*))?$").matcher(cmd)).find()) { ! String a = m.group(5); ! String b = m.group(4); ! Route_entry r = new Route_entry(m.group(1), m.group(5), m.group(3), m.group(2), 0); ! mParentStack.addRoute(r); out+="Route added.\n"; } --- 328,337 ---- } else if((m=Pattern.compile(" +add +([^ ]+) +([^ ]+) +([^ ]+)( +([^ ]+|\\*))?$").matcher(cmd)).find()) { ! if(m.group(5)!=null) { ! mParentStack.addRoute(new Route_entry(m.group(1), m.group(5), m.group(3), m.group(2), 0)); ! } ! else { ! mParentStack.addRoute(new Route_entry(m.group(1), "", m.group(3), m.group(2), 0)); ! } out+="Route added.\n"; } *************** *** 336,342 **** else{ out+="Unknown route command. Usage:\n"; ! out+="route add (host_ip|network_ip) target_interface netmask (gateway|*) \n"; ! out+="route del (host_ip|network_ip) \n"; ! out+="route print \n"; } } --- 342,349 ---- else{ out+="Unknown route command. Usage:\n"; ! out+=" route add (<host ip>|<network ip>) <target interface> <netmask> [<gateway>|*]\n" + ! " add new route record\n"; ! out+=" route del (<host ip>|<network ip>) delete route record\n"; ! out+=" route print print route table\n"; } } *************** *** 346,350 **** String l_pass="public"; if(m.group(1).compareTo("on")!=0) l_port = Integer.parseInt(m.group(1)); ! if(m.group(2).compareTo("")!=0) l_pass = m.group(2); SNMP snmpa = (SNMP) mDevice.getApp(161); snmpa.setPassword(l_pass); --- 353,359 ---- String l_pass="public"; if(m.group(1).compareTo("on")!=0) l_port = Integer.parseInt(m.group(1)); ! if(m.group(3)!=null) { ! if(m.group(3).compareTo("")!=0) l_pass = m.group(3); ! } SNMP snmpa = (SNMP) mDevice.getApp(161); snmpa.setPassword(l_pass); *************** *** 352,355 **** --- 361,365 ---- try{ snmpa.Listen(); + out+="Now SNMP agent listen on port " + String.valueOf(l_port) + "\n"; } catch(TransportLayerException e) { *************** *** 361,364 **** --- 371,375 ---- try{ snmpa.Close(); + out+="SNMP agent stoped\n"; } catch(TransportLayerException e) { *************** *** 366,369 **** --- 377,385 ---- } } + else { + out+="Unknown snmp command. Usage:\n"; + out+=" snmp (on|<port number>) [community name] Start SNMP agent\n"; + out+=" snmp off Stop SNMP agent\n"; + } } else if(tokens[0].compareTo("passwd")==0){ *************** *** 387,391 **** } else if(tokens[0].compareTo("arp")==0){ ! } else out = tokens[0] + ": command not found\n"; --- 403,433 ---- } else if(tokens[0].compareTo("arp")==0){ ! if((m=Pattern.compile(" +-a$").matcher(cmd)).find()) { ! try{ ! String ArpTable[] = mParentStack.getARPTable(); ! for(int i=0;i<ArpTable.length;i++) ! { ! out += ArpTable[i] + "\n"; ! } ! } ! catch(Exception e) ! { ! //Should never get here. ! } ! } ! else if((m=Pattern.compile(" +-d +([^ ]+)$").matcher(cmd)).find()) { ! mParentStack.removeARP(m.group(1)); ! out += "Removed ARP entry for ip " + m.group(1) + "\n"; ! } ! else if((m=Pattern.compile(" +-s +([^ ]+) +([^ ]+)$").matcher(cmd)).find()) { ! mParentStack.addToARPStatic(m.group(1), m.group(2)); ! out += "Created new static ARP entry: " + m.group(1) + " is " + m.group(2) + "\n"; ! } ! else { ! out+="Unknown arp command. Usage:\n"; ! out+=" arp -a print ARP table\n"; ! out+=" arp -d <ip address> delete record from ARP table\n"; ! out+=" arp -s <ip address> <MAC address> add new ARP record\n"; ! } } else out = tokens[0] + ": command not found\n"; Index: SNMP.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/SNMP.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SNMP.java 24 Feb 2006 10:20:11 -0000 1.11 --- SNMP.java 25 Feb 2006 22:48:33 -0000 1.12 *************** *** 1232,1240 **** ((NetworkLayerDevice)current_device).setDefaultGateway(val); } ! else if(var.compareToIgnoreCase("IP.IPaddress_Eth0")==0) { ! ((NetworkLayerDevice)current_device).setIPAddress("Eth0", val); } else if(var.compareToIgnoreCase("IP.subnetMask_Eth0")==0) { ! ((NetworkLayerDevice)current_device).setCustomSubnetMask("Eth0", val); } else if(var.compareToIgnoreCase("SNMP.CommunityName")==0) { --- 1232,1241 ---- ((NetworkLayerDevice)current_device).setDefaultGateway(val); } ! else if(var.compareToIgnoreCase("IP.Address_Eth0")==0) { ! String a = ((NetworkLayerDevice)current_device).setIPAddress("eth0", val); ! printInfo(">>>>>>>>>> " + a); } else if(var.compareToIgnoreCase("IP.subnetMask_Eth0")==0) { ! ((NetworkLayerDevice)current_device).setCustomSubnetMask("eth0", val); } else if(var.compareToIgnoreCase("SNMP.CommunityName")==0) { *************** *** 1244,1247 **** --- 1245,1249 ---- catch(Exception e) { //System.out.print(e.toString()); + printInfo("bad value: " + var + " = \"" + val); return SNMP_ERROR_badValue; } |