javanetsim-cvs Mailing List for javaNetSim (Page 28)
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-02-23 14:37:16
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16380/core Modified Files: Version.java Log Message: Index: Version.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Version.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Version.java 20 Nov 2005 20:30:53 -0000 1.2 --- Version.java 23 Feb 2006 14:37:07 -0000 1.3 *************** *** 36,48 **** * @author Key * @since Sep 23, 2004 ! * @version v0.22 */ public class Version { ! public final static String CORE_VERSION = "v0.22"; //version of the simulation core public static final String TEAM_MEMBERS[] = { "from 03 November 2005","", ! "Alexander Bolshev [Key]", "Project Manager / Documentation Manager / Developer / Maintainer", "", "", ! "Semester 2, 2004", "", "Angela Brown " , "Project Manager / Documentation Manager / Developer ", "Bevan Calliess " , "Disaster Recovery Manager / Assistant Project Manager / Developer ", --- 36,52 ---- * @author Key * @since Sep 23, 2004 ! * @version v0.30 */ public class Version { ! public final static String CORE_VERSION = "v0.30"; //version of the simulation core public static final String TEAM_MEMBERS[] = { + "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "", "from 03 November 2005","", ! "Alexander Bolshev [Key]", "Project Manager / Developer / Maintainer", ! "Gift", "Developer / Configuration Developer", ! "Konstantin Karpov [QweR]", "Developer / Tester", ! "", "" ! /*, "Semester 2, 2004", "", "Angela Brown " , "Project Manager / Documentation Manager / Developer ", "Bevan Calliess " , "Disaster Recovery Manager / Assistant Project Manager / Developer ", *************** *** 53,56 **** "Tristan Veness " , "Project Manager / Developer ", "James Nikolaidis" , "Developer ", ! }; }//EOF --- 57,60 ---- "Tristan Veness " , "Project Manager / Developer ", "James Nikolaidis" , "Developer ", ! */}; }//EOF |
From: Alexander B. <da...@us...> - 2006-02-23 14:37:16
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16380/guiUI Modified Files: MenuBar.java Log Message: Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MenuBar.java 3 Dec 2005 11:28:46 -0000 1.2 --- MenuBar.java 23 Feb 2006 14:37:09 -0000 1.3 *************** *** 283,287 **** // Display message box with info about the project. String strAboutProject; ! strAboutProject = "jFirewallSim " + Version.CORE_VERSION + "\n\n"; --- 283,287 ---- // Display message box with info about the project. String strAboutProject; ! strAboutProject = "javaNetSim " + Version.CORE_VERSION + "\n\n"; *************** *** 290,294 **** strAboutProject = strAboutProject + Version.TEAM_MEMBERS[i] + "\n"; } ! JOptionPane.showMessageDialog(null, strAboutProject,"About jFirewall Sim", JOptionPane.INFORMATION_MESSAGE); } --- 290,294 ---- strAboutProject = strAboutProject + Version.TEAM_MEMBERS[i] + "\n"; } ! JOptionPane.showMessageDialog(null, strAboutProject,"About javaNetSim", JOptionPane.INFORMATION_MESSAGE); } |
From: gift <gi...@us...> - 2006-02-23 14:03:24
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31521/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: V.next Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Tcp.java 23 Feb 2006 11:18:49 -0000 1.34 --- Tcp.java 23 Feb 2006 14:03:10 -0000 1.35 *************** *** 365,369 **** public class TCPTask extends TimerTask { ! private int numRepeat=60; private TCP_HashTableElement Elm; private long repTime; --- 365,369 ---- public class TCPTask extends TimerTask { ! private int numRepeat=30; private TCP_HashTableElement Elm; private long repTime; *************** *** 473,477 **** public class TCPServerTask extends TimerTask { ! private int numRepeat=61; private int localPort; private TCP_HashTableElement Elm; --- 473,477 ---- public class TCPServerTask extends TimerTask { ! private int numRepeat=34; private int localPort; private TCP_HashTableElement Elm; |
From: Alexander B. <da...@us...> - 2006-02-23 11:56:14
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16516/guiUI Modified Files: DataLinkLayerDevice.java LinkProperties.java NetworkLayerDevice.java Log Message: Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/NetworkLayerDevice.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** NetworkLayerDevice.java 3 Dec 2005 12:20:52 -0000 1.5 --- NetworkLayerDevice.java 23 Feb 2006 11:56:00 -0000 1.6 *************** *** 118,122 **** } }); ! mnuPR.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.PrintRouteTable(lblNodeName.getText()); --- 118,123 ---- } }); ! ! mnuPR.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.PrintRouteTable(lblNodeName.getText()); Index: LinkProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/LinkProperties.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LinkProperties.java 4 Dec 2005 16:47:26 -0000 1.3 --- LinkProperties.java 23 Feb 2006 11:56:00 -0000 1.4 *************** *** 179,183 **** this.SBox = SBox; ! setTitle("Link Properties (Ahtung: NOT WORKING!!!!!)"); initGUI(nodeArray,selectedIndex); --- 179,183 ---- this.SBox = SBox; ! setTitle("Link Properties"); initGUI(nodeArray,selectedIndex); Index: DataLinkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/DataLinkLayerDevice.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** DataLinkLayerDevice.java 8 Nov 2005 04:04:26 -0000 1.1.1.1 --- DataLinkLayerDevice.java 23 Feb 2006 11:56:00 -0000 1.2 *************** *** 48,52 **** --- 48,54 ---- private JMenuItem mnuShowState = new JMenuItem("Show state"); private JMenuItem mnuReset = new JMenuItem("Reset"); + private JMenuItem mnuLink = new JMenuItem("Links properties"); private JMenuItem mnuBreakLink = new JMenuItem("Break link"); + /** *************** *** 82,88 **** --- 84,98 ---- }); + mnuLink.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.showLinkDialog(lblNodeName.getText()); + } + }); + + GuiNodePopMenu.add(mnuProperties); GuiNodePopMenu.add(mnuShowState); GuiNodePopMenu.add(mnuReset); + GuiNodePopMenu.add(mnuLink); GuiNodePopMenu.add(mnuBreakLink); } |
From: Alexander B. <da...@us...> - 2006-02-23 11:56:14
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16516/core Modified Files: EthernetNetworkInterface.java Hub.java Log Message: Index: Hub.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Hub.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Hub.java 8 Dec 2005 18:07:39 -0000 1.3 --- Hub.java 23 Feb 2006 11:56:00 -0000 1.4 *************** *** 51,54 **** --- 51,57 ---- int sz = 0; + + int buffSize = 255; + public Hub(String inName) { Index: EthernetNetworkInterface.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetNetworkInterface.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** EthernetNetworkInterface.java 8 Dec 2005 16:45:08 -0000 1.5 --- EthernetNetworkInterface.java 23 Feb 2006 11:56:00 -0000 1.6 *************** *** 56,61 **** * Stores The MAC address for each instance of this class * */ ! protected String MACAddress; ! /** * Constructs a NetworkInterface object with the name inName and a --- 56,61 ---- * Stores The MAC address for each instance of this class * */ ! protected String MACAddress; ! /** * Constructs a NetworkInterface object with the name inName and a |
From: gift <gi...@us...> - 2006-02-23 11:19:08
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28321/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: v.raw Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Tcp.java 23 Feb 2006 10:44:26 -0000 1.33 --- Tcp.java 23 Feb 2006 11:18:49 -0000 1.34 *************** *** 315,320 **** * Used in timer */ ! private static final long TCP_TIME = 40; //msec ! private static final long TCP_SENDER_TIME = 400; //msec /** --- 315,320 ---- * Used in timer */ ! private static final long TCP_SERVER_TIME = 250; //msec //server closing idle connection time ! private static final long TCP_SENDER_TIME = 1000; //msec time to resend all segments in SegmentsToresend queue /** *************** *** 349,353 **** System.out.println("Sender timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME,this),50,TCP_TIME); } else { --- 349,353 ---- System.out.println("Sender timer init!"); Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this),TCP_SENDER_TIME,TCP_SENDER_TIME); } else { *************** *** 356,360 **** Elm.timer=null; Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME,this),50,TCP_TIME); System.out.println(" Sender Timer REinit DONE!"); } --- 356,360 ---- Elm.timer=null; Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_SENDER_TIME,this),TCP_SENDER_TIME,TCP_SENDER_TIME); System.out.println(" Sender Timer REinit DONE!"); } *************** *** 365,369 **** public class TCPTask extends TimerTask { ! private int numRepeat=150; private TCP_HashTableElement Elm; private long repTime; --- 365,369 ---- public class TCPTask extends TimerTask { ! private int numRepeat=60; private TCP_HashTableElement Elm; private long repTime; *************** *** 457,461 **** System.out.println("Server Timer init!"); Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME,this),50,TCP_TIME); } else { --- 457,461 ---- System.out.println("Server Timer init!"); Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_SERVER_TIME,this),TCP_SERVER_TIME,TCP_SERVER_TIME); } else { *************** *** 464,468 **** Elm.Servertimer=null; Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME,this),50,TCP_TIME); System.out.println(" Server Timer REinit DONE!"); } --- 464,468 ---- Elm.Servertimer=null; Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_SERVER_TIME,this),TCP_SERVER_TIME,TCP_SERVER_TIME); System.out.println(" Server Timer REinit DONE!"); } *************** *** 473,477 **** public class TCPServerTask extends TimerTask { ! private int numRepeat=8; private int localPort; private TCP_HashTableElement Elm; --- 473,477 ---- public class TCPServerTask extends TimerTask { ! private int numRepeat=61; private int localPort; private TCP_HashTableElement Elm; |
From: gift <gi...@us...> - 2006-02-23 10:44:35
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8112/core/protocolsuite/tcp_ip Modified Files: Tcp.java Log Message: v.damp Index: Tcp.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Tcp.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Tcp.java 9 Dec 2005 14:50:35 -0000 1.32 --- Tcp.java 23 Feb 2006 10:44:26 -0000 1.33 *************** *** 315,319 **** * Used in timer */ ! private static final long TCP_TIME = 400; //msec /** --- 315,320 ---- * Used in timer */ ! private static final long TCP_TIME = 40; //msec ! private static final long TCP_SENDER_TIME = 400; //msec /** *************** *** 344,351 **** public void TCPsetTimer(TCP_HashTableElement Elm) { ! if(Elm.timer==null){ ! System.out.println("Timer init!"); ! Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME,this),50,TCP_TIME); } --- 345,361 ---- public void TCPsetTimer(TCP_HashTableElement Elm) { ! if(Elm.timer==null) ! { ! System.out.println("Sender timer init!"); ! Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME,this),50,TCP_TIME); ! } else ! { ! System.out.println("Sender Timer REinit due to new packet arrival!"); ! Elm.timer.cancel(); ! Elm.timer=null; ! Elm.timer=new Timer(); ! Elm.timer.schedule(new TCPTask(Elm,TCP_TIME,this),50,TCP_TIME); ! System.out.println(" Sender Timer REinit DONE!"); } *************** *** 355,359 **** public class TCPTask extends TimerTask { ! private int numRepeat=8; private TCP_HashTableElement Elm; private long repTime; --- 365,369 ---- public class TCPTask extends TimerTask { ! private int numRepeat=150; private TCP_HashTableElement Elm; private long repTime; *************** *** 443,452 **** public void TCPsetServerTimer(TCP_HashTableElement Elm, int inlocalPort) { - System.out.println("Server Timer IN!"); if(Elm.Servertimer==null) { ! System.out.println("Server Timer init!"); ! Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME,this),50,TCP_TIME); } --- 453,469 ---- public void TCPsetServerTimer(TCP_HashTableElement Elm, int inlocalPort) { if(Elm.Servertimer==null) { ! System.out.println("Server Timer init!"); ! Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME,this),50,TCP_TIME); ! } else ! { ! System.out.println("Server Timer REinit due to new packet arrival!"); ! Elm.Servertimer.cancel(); ! Elm.Servertimer=null; ! Elm.Servertimer=new Timer(); ! Elm.Servertimer.schedule(new TCPServerTask(Elm,inlocalPort,TCP_TIME,this),50,TCP_TIME); ! System.out.println(" Server Timer REinit DONE!"); } *************** *** 1117,1126 **** if (inPacket.get_SYN_flag()) { ! ! if (Elm.isServer) { //init ServerTask TCPsetServerTimer(Elm,inPacket.get_destPort()); } //we have received an answer for our SYN-segment --- 1134,1144 ---- if (inPacket.get_SYN_flag()) { ! /* ! if (Elm.isServer) { //init ServerTask TCPsetServerTimer(Elm,inPacket.get_destPort()); } + */ //we have received an answer for our SYN-segment *************** *** 1131,1135 **** Integer chk = (Integer)inPacket.get_sequence_number(); if (!(Elm.ReceivedSegments.contains(chk))) ! { Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received --- 1149,1160 ---- Integer chk = (Integer)inPacket.get_sequence_number(); if (!(Elm.ReceivedSegments.contains(chk))) ! { ! ! if (Elm.isServer) ! { ! //init ServerTask ! TCPsetServerTimer(Elm,inPacket.get_destPort()); ! } else TCPsetTimer(Elm); ! Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received *************** *** 1172,1176 **** } else { //we have already received this segment ! System.out.println("tttttttt"); Elm.received_duplicates++; Elm.sent_ACK++; --- 1197,1206 ---- } else { //we have already received this segment ! //System.out.println("tttttttt"); ! if (Elm.isServer) ! { ! //init ServerTask ! TCPsetServerTimer(Elm,inPacket.get_destPort()); ! } else TCPsetTimer(Elm); Elm.received_duplicates++; Elm.sent_ACK++; *************** *** 1180,1184 **** TCP_Info.setObjectName(mParentStack.getParentNodeName()); TCP_Info.setDataType("TCP Protocol"); ! System.out.println("%%% - in here"); TCP_Info.setLayer("Transport"); TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); --- 1210,1214 ---- TCP_Info.setObjectName(mParentStack.getParentNodeName()); TCP_Info.setDataType("TCP Protocol"); ! //System.out.println("%%% - in here"); TCP_Info.setLayer("Transport"); TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); *************** *** 1198,1202 **** Integer chk = (Integer)inPacket.get_sequence_number(); if (!(Elm.ReceivedSegments.contains(chk))) ! { Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received --- 1228,1237 ---- Integer chk = (Integer)inPacket.get_sequence_number(); if (!(Elm.ReceivedSegments.contains(chk))) ! { ! if (Elm.isServer) ! { ! //init ServerTask ! TCPsetServerTimer(Elm,inPacket.get_destPort()); ! } else TCPsetTimer(Elm); Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received *************** *** 1288,1300 **** } else { //we have already received this segment Elm.received_duplicates++; Elm.sent_ACK++; //Elm.sent_segments++; ! System.out.println("t+++++++++t"); //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); TCP_Info.setObjectName(mParentStack.getParentNodeName()); TCP_Info.setDataType("TCP Protocol"); ! System.out.println("%%% - in here - !!!"); TCP_Info.setLayer("Transport"); TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); --- 1323,1340 ---- } else { //we have already received this segment + if (Elm.isServer) + { + //init ServerTask + TCPsetServerTimer(Elm,inPacket.get_destPort()); + } else TCPsetTimer(Elm); Elm.received_duplicates++; Elm.sent_ACK++; //Elm.sent_segments++; ! //System.out.println("t+++++++++t"); //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); TCP_Info.setObjectName(mParentStack.getParentNodeName()); TCP_Info.setDataType("TCP Protocol"); ! //System.out.println("%%% - in here - !!!"); TCP_Info.setLayer("Transport"); TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); *************** *** 1314,1318 **** Integer our_ack = (Integer)inPacket.get_acknowledgment_number(); if (!(Elm.ReceivedSegments.contains(chk))) ! { Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received --- 1354,1363 ---- Integer our_ack = (Integer)inPacket.get_acknowledgment_number(); if (!(Elm.ReceivedSegments.contains(chk))) ! { ! if (Elm.isServer) ! { ! //init ServerTask ! TCPsetServerTimer(Elm,inPacket.get_destPort()); ! } else TCPsetTimer(Elm); Elm.received_segments++; Elm.ReceivedSegments.addElement(chk); //adding seq_number that we have received *************** *** 1394,1401 **** } else { //we have already received this segment Elm.received_duplicates++; Elm.sent_ACK++; //Elm.sent_segments++; ! System.out.println("t------t"); //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); --- 1439,1451 ---- } else { //we have already received this segment + if (Elm.isServer) + { + //init ServerTask + TCPsetServerTimer(Elm,inPacket.get_destPort()); + } else TCPsetTimer(Elm); Elm.received_duplicates++; Elm.sent_ACK++; //Elm.sent_segments++; ! //System.out.println("t------t"); //Create Layer info LayerInfo TCP_Info = new LayerInfo(getClass().getName()); *************** *** 1403,1407 **** TCP_Info.setDataType("TCP Protocol"); TCP_Info.setLayer("Transport"); ! System.out.println("%%% - in here ^^^"); TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); Simulation.addLayerInfo(TCP_Info); --- 1453,1457 ---- TCP_Info.setDataType("TCP Protocol"); TCP_Info.setLayer("Transport"); ! //System.out.println("%%% - in here ^^^"); TCP_Info.setDescription("Resending ACK packet due to duplicate arrival. Total duplicates received: " + Elm.received_duplicates + "."); Simulation.addLayerInfo(TCP_Info); |
From: QweR <qw...@us...> - 2006-02-22 20:04:41
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3906/guiUI Modified Files: MainScreen.java SNMPSendDataDialog.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** MainScreen.java 22 Feb 2006 17:40:51 -0000 1.31 --- MainScreen.java 22 Feb 2006 20:04:27 -0000 1.32 *************** *** 3077,3081 **** String port = JOptionPane.showInputDialog(this, "Port:", "Set SNMP agent listening on port.", JOptionPane.QUESTION_MESSAGE); if(port!=null){ ! String password = JOptionPane.showInputDialog(this, "Password:","Set SNMP password for agent", JOptionPane.QUESTION_MESSAGE); if(password!=null) { try{ --- 3077,3081 ---- String port = JOptionPane.showInputDialog(this, "Port:", "Set SNMP agent listening on port.", JOptionPane.QUESTION_MESSAGE); if(port!=null){ ! String password = JOptionPane.showInputDialog(this, "Community name:","Set SNMP community name for agent", JOptionPane.QUESTION_MESSAGE); if(password!=null) { try{ Index: SNMPSendDataDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SNMPSendDataDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SNMPSendDataDialog.java 9 Feb 2006 23:18:24 -0000 1.1 --- SNMPSendDataDialog.java 22 Feb 2006 20:04:27 -0000 1.2 *************** *** 131,144 **** private void initGUI() { try { ! setSize(350, 225); backpanel = new JPanel(); ! backpanel.setMinimumSize(new Dimension(200, 10)); this.getContentPane().add(backpanel, BorderLayout.CENTER); GridBagLayout backpanelLayout = new GridBagLayout(); ! backpanel.setPreferredSize(new java.awt.Dimension(264, 213)); backpanelLayout.columnWeights = new double[] {}; ! backpanelLayout.columnWidths = new int[] {100,150}; backpanelLayout.rowWeights = new double[] {0.0}; ! backpanelLayout.rowHeights = new int[] {5,5,5,5}; backpanel.setLayout(backpanelLayout); --- 131,144 ---- private void initGUI() { try { ! setSize(500, 225); backpanel = new JPanel(); ! //backpanel.setMinimumSize(new Dimension(400, 100)); this.getContentPane().add(backpanel, BorderLayout.CENTER); GridBagLayout backpanelLayout = new GridBagLayout(); ! //backpanel.setPreferredSize(new Dimension(800, 200)); backpanelLayout.columnWeights = new double[] {}; ! backpanelLayout.columnWidths = new int[] {100,100,250}; backpanelLayout.rowWeights = new double[] {0.0}; ! backpanelLayout.rowHeights = new int[] {5,5,5,5,5}; backpanel.setLayout(backpanelLayout); *************** *** 185,194 **** txtVariables = new JTextField(); txtVariables.setEnabled(true); ! backpanel.add(txtVariables, new GridBagConstraints(1,3,1,1,0.0,1.0,GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); // ***** Password ***** lblPassword = new JLabel(); ! lblPassword.setText("Password"); backpanel.add(lblPassword, new GridBagConstraints(0,4,1,1,0.0,1.0,GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); --- 185,194 ---- txtVariables = new JTextField(); txtVariables.setEnabled(true); ! backpanel.add(txtVariables, new GridBagConstraints(1,3,2,1,0.0,1.0,GridBagConstraints.LINE_START, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); // ***** Password ***** lblPassword = new JLabel(); ! lblPassword.setText("Community name"); backpanel.add(lblPassword, new GridBagConstraints(0,4,1,1,0.0,1.0,GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL,new Insets(0, 0, 0, 16),0,0)); *************** *** 238,242 **** } else if(txtPassword.getText()==null || txtPassword.getText().compareTo("")==0) { ! lblError.setText("Enter password!"); lblError.setVisible(true); } --- 238,242 ---- } else if(txtPassword.getText()==null || txtPassword.getText().compareTo("")==0) { ! lblError.setText("Enter community name!"); lblError.setVisible(true); } *************** *** 247,262 **** String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! ((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText()); this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! ((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText()); this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! ((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText()); this.dispose(); } --- 247,268 ---- String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); ! } this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); ! } this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); ! } this.dispose(); } *************** *** 290,294 **** if(var_value.length==1) { String vari = deleteSpaces(var_value[0]); ! vars.add(vari); } else if(var_value.length==2) { --- 296,302 ---- if(var_value.length==1) { String vari = deleteSpaces(var_value[0]); ! if(var_value[0].compareTo("")!=0) { ! vars.add(vari); ! } } else if(var_value.length==2) { |
From: QweR <qw...@us...> - 2006-02-22 20:04:37
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3906/core/protocolsuite/tcp_ip Modified Files: SNMP.java Log Message: Index: SNMP.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/SNMP.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SNMP.java 9 Feb 2006 23:12:39 -0000 1.8 --- SNMP.java 22 Feb 2006 20:04:27 -0000 1.9 *************** *** 37,41 **** --- 37,46 ---- import core.Packet; import core.Simulation; + import core.ApplicationLayerDevice; + import core.NetworkLayerDevice; + import core.Node; import java.util.Vector; + import java.lang.Integer; + import java.util.ArrayList; /** *************** *** 52,56 **** public final static int SNMP_ERROR_badValue = 3; // == SNMP_ERROR_wrongValue ??? public final static int SNMP_ERROR_readOnly = 4; ! public final static int SNMP_ERROR_gerErr = 5; public final static int SNMP_ERROR_noAccess = 6; public final static int SNMP_ERROR_wrongType = 7; --- 57,61 ---- public final static int SNMP_ERROR_badValue = 3; // == SNMP_ERROR_wrongValue ??? public final static int SNMP_ERROR_readOnly = 4; ! public final static int SNMP_ERROR_genErr = 5; public final static int SNMP_ERROR_noAccess = 6; public final static int SNMP_ERROR_wrongType = 7; *************** *** 66,69 **** --- 71,75 ---- private Vector<SNMPInstance> SNMPgroups = new Vector<SNMPInstance>(0); private String current_password = ""; + private ApplicationLayerDevice current_device; //following variables be actual temporality private int m_len=0; *************** *** 88,103 **** private Vector<String> tVectorString = new Vector<String>(0); ! public SNMP(ProtocolStack inParentStack, int listenPort, int appType, int UID) { super(inParentStack, listenPort, appType, UID); //groups and instance required placed in lexicographical order :(MIB) int i; ! SNMPgroups.add(new SNMPInstance("SNMP")); i=SNMPgroups.size()-1; ! SNMPgroups.get(i).add("revision","0"); ! SNMPgroups.get(i).add("version","2"); ! SNMPgroups.add(new SNMPInstance("test")); i=SNMPgroups.size()-1; ! SNMPgroups.get(i).add("test_1","A"); ! SNMPgroups.get(i).add("test_2","1"); } /** --- 94,136 ---- private Vector<String> tVectorString = new Vector<String>(0); ! public SNMP(ApplicationLayerDevice device,ProtocolStack inParentStack, int listenPort, int appType, int UID) { super(inParentStack, listenPort, appType, UID); + current_device = device; //groups and instance required placed in lexicographical order :(MIB) int i; ! SNMPgroups.add(new SNMPInstance("Counter")); //generate by SNMP manager (updateValues) i=SNMPgroups.size()-1; ! SNMPgroups.get(i).add("InputIP",""); //ro ! SNMPgroups.get(i).add("OutputIP",""); //ro ! SNMPgroups.get(i).add("ARP",""); //ro ! SNMPgroups.get(i).add("InputTCP",""); //ro ! SNMPgroups.get(i).add("OutputTCP",""); //ro ! SNMPgroups.get(i).add("ReceiveDuplicatedTCP",""); //ro ! SNMPgroups.get(i).add("SendDuplicatedTCP",""); //ro ! SNMPgroups.get(i).add("SendAckTCP",""); //ro ! SNMPgroups.get(i).add("InputUDP",""); //ro ! SNMPgroups.get(i).add("OutputUDP",""); //ro ! SNMPgroups.add(new SNMPInstance("Device")); //generate by SNMP manager (updateValues) i=SNMPgroups.size()-1; ! SNMPgroups.get(i).add("AllInterfaces",""); //ro ! SNMPgroups.get(i).add("AvailableInterfaces",""); //ro ! SNMPgroups.get(i).add("Hostname",""); //ro! ! SNMPgroups.get(i).add("MACaddress_Eth0",""); //ro ! SNMPgroups.add(new SNMPInstance("IP")); //generate by SNMP manager (updateValues) ! i=SNMPgroups.size()-1; ! SNMPgroups.get(i).add("AllInterfaces",""); //ro ! SNMPgroups.get(i).add("ARPTable",""); //ro ! SNMPgroups.get(i).add("DefaultGateway",""); //rw ! SNMPgroups.get(i).add("Address_Eth0",""); //rw ! SNMPgroups.get(i).add("SubnetMask_Eth0",""); //rw ! SNMPgroups.add(new SNMPInstance("SNMP")); //setup by developer ! i=SNMPgroups.size()-1; ! SNMPgroups.get(i).add("CommunityName",""); //rw ! SNMPgroups.get(i).add("revision","0"); //ro ! SNMPgroups.get(i).add("version","2"); //ro ! SNMPgroups.add(new SNMPInstance("test")); //temporary test MIB ! i=SNMPgroups.size()-1; ! SNMPgroups.get(i).add("test_1","A"); //rw ! SNMPgroups.get(i).add("test_2","1"); //rw } /** *************** *** 191,195 **** try { if(parse(Data) == 0) { ! updateValues(); switch(m_type) { case SNMP_GET: { --- 224,228 ---- try { if(parse(Data) == 0) { ! updateMIBValues(); switch(m_type) { case SNMP_GET: { *************** *** 197,202 **** printInfo("Received getRequest: `" + getPacketData(lastPacket)+"`"); if(current_password.compareTo(m_password)==0) { ! getValues(); ! getResponse(retIP, retPort, m_vars, m_values, m_errorstatus, m_errorindex); } else { --- 230,237 ---- printInfo("Received getRequest: `" + getPacketData(lastPacket)+"`"); if(current_password.compareTo(m_password)==0) { ! if(getValues()) ! getResponse(retIP, retPort, m_vars, m_values, m_errorstatus, m_errorindex); // m_errorstatus == 0 && m_errorindex ==0 ! else ! getResponse(retIP, retPort, tVectorString, tVectorString, m_errorstatus, m_errorindex); } else { *************** *** 211,216 **** printInfo("Received getNextRequest: `" + getPacketData(lastPacket)+"`"); if(current_password.compareTo(m_password)==0) { ! getnextValues(); ! getResponse(retIP, retPort, m_vars, m_values, m_errorstatus, m_errorindex); } else { --- 246,253 ---- printInfo("Received getNextRequest: `" + getPacketData(lastPacket)+"`"); if(current_password.compareTo(m_password)==0) { ! if(getnextValues()) ! getResponse(retIP, retPort, m_vars, m_values, m_errorstatus, m_errorindex); // m_errorstatus == 0 && m_errorindex ==0 ! else ! getResponse(retIP, retPort, tVectorString, tVectorString, m_errorstatus, m_errorindex); } else { *************** *** 225,230 **** printInfo("Received setRequest: `" + getPacketData(lastPacket)+"`"); if(current_password.compareTo(m_password)==0) { ! setValues(); ! getResponse(retIP, retPort, m_vars, m_values, m_errorstatus, m_errorindex); } else { --- 262,269 ---- printInfo("Received setRequest: `" + getPacketData(lastPacket)+"`"); if(current_password.compareTo(m_password)==0) { ! if(setValues()) ! getResponse(retIP, retPort, m_vars, m_values, m_errorstatus, m_errorindex); // m_errorstatus == 0 && m_errorindex ==0 ! else ! getResponse(retIP, retPort, tVectorString, tVectorString, m_errorstatus, m_errorindex); } else { *************** *** 249,252 **** --- 288,333 ---- s+="'"+m_vars.get(i)+"="+m_values.get(i)+"'"; } + switch(m_errorstatus) { + case SNMP_ERROR_noError: { + //s+=" without error"; + break; + } + case SNMP_ERROR_noSuchName: { + s+=" no such name #"+Integer.valueOf(m_errorindex).toString(); + break; + } + case SNMP_ERROR_badValue: { + s+=" bad value #"+Integer.valueOf(m_errorindex).toString(); + break; + } + case SNMP_ERROR_readOnly: { + s+=" read only #"+Integer.valueOf(m_errorindex).toString(); + break; + } + case SNMP_ERROR_genErr: { + s+=" gereral error"; + break; + } + case SNMP_ERROR_noAccess: { + s+=" no access (incorrect community name)"; + break; + } + case SNMP_ERROR_wrongType: { + s+=" wrong type #"+Integer.valueOf(m_errorindex).toString(); + break; + } + case SNMP_ERROR_wrongLength: { + s+=" wrong length"; + break; + } + case SNMP_ERROR_wrongEncoding: { + s+=" wrong encoding"; + break; + } + case SNMP_ERROR_wrongValue: { + s+=" wrong value #"+Integer.valueOf(m_errorindex).toString(); + break; + } + } printInfo("Received getResponse: " + s); } *************** *** 261,266 **** } else { ! printInfo("Received corrupted packet!"); ! getResponse(retIP, retPort, tVectorString, tVectorString, m_errorstatus, m_errorindex); } if(appType==0) { --- 342,361 ---- } else { ! switch(appType) { ! case 0: { ! printInfo("Agent received corrupted packet!"); ! getResponse(retIP, retPort, tVectorString, tVectorString, m_errorstatus, m_errorindex); ! break; ! } ! case 1: { ! printInfo("Manager received corrupted packet!"); ! break; ! } ! default: { ! printInfo("UNKNOWN program received corrupted packet!"); ! break; ! } ! } ! } if(appType==0) { *************** *** 315,319 **** pack += createSNMPPassword(password); String tmp = createSNMPVars(r); ! if(tmp.compareTo("")==0) { return false; } --- 410,414 ---- pack += createSNMPPassword(password); String tmp = createSNMPVars(r); ! if(tmp==null) { return false; } *************** *** 342,346 **** pack += createSNMPPassword(password); String tmp = createSNMPVars(r); ! if(tmp.compareTo("")==0) { return false; } --- 437,441 ---- pack += createSNMPPassword(password); String tmp = createSNMPVars(r); ! if(tmp==null) { return false; } *************** *** 370,374 **** pack += createSNMPPassword(password); String tmp = createSNMPVarsValues(r,v); ! if(tmp.compareTo("")==0) { return false; } --- 465,469 ---- pack += createSNMPPassword(password); String tmp = createSNMPVarsValues(r,v); ! if(tmp==null) { return false; } *************** *** 396,400 **** pack += createSNMPError(es,ei); String tmp = createSNMPVarsValues(r,v); ! if(tmp.compareTo("")==0) { return false; } --- 491,495 ---- pack += createSNMPError(es,ei); String tmp = createSNMPVarsValues(r,v); ! if(tmp==null) { return false; } *************** *** 421,425 **** // pack += createSNMPTrap(gtc,stc); // String tmp = createSNMPVarsValues(r,v); ! // if(tmp.compareTo("")==0) { // return false; // } --- 516,520 ---- // pack += createSNMPTrap(gtc,stc); // String tmp = createSNMPVarsValues(r,v); ! // if(tmp==null) { // return false; // } *************** *** 534,544 **** /** * This method gets values from vector of 'group.instance'. ! * return if result equals zero then function successful complete ! * if result == 1 then invalid variable name (without dots). ! * if result == 2 then not found groupID or instanceID * @author QweR * @version v0.01 */ ! protected int getValues() { String[] a; int i; --- 629,637 ---- /** * This method gets values from vector of 'group.instance'. ! * return true if function successful complete. If function false then m_errorstatus & m_errorindex contain error code * @author QweR * @version v0.01 */ ! protected boolean getValues() { String[] a; int i; *************** *** 551,570 **** m_values.add(SNMPgroups.get(m_GroupID).value.get(m_InstanceID)); } ! else return 2; } - else return 1; } ! return 0; } /** * This method get next values from vector of 'group.instance'. ! * return if result equals zero then function successful complete ! * if result == 1 then invalid variable name (without dots). ! * if result == 2 then not found groupID or instanceID * @author QweR * @version v0.01 */ ! protected int getnextValues() { String[] a; int i; --- 644,669 ---- m_values.add(SNMPgroups.get(m_GroupID).value.get(m_InstanceID)); } ! else { ! m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex = i+1; ! return false; ! } ! } ! else { ! m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex = i+1; ! return false; } } ! return true; } /** * This method get next values from vector of 'group.instance'. ! * return true if function successful complete. If function false then m_errorstatus & m_errorindex contain error code * @author QweR * @version v0.01 */ ! protected boolean getnextValues() { String[] a; int i; *************** *** 580,601 **** m_vars.set(i,SNMPgroups.get(m_GroupID).name+"."+SNMPgroups.get(m_GroupID).instance.get(m_InstanceID)); } ! else return 2; } - else return 1; } ! return 0; } /** * This method sets values from vector of 'group.instance' and 'value'. ! * return if result equals zero then function successful complete ! * if result == 1 then invalid variable name (without dots) ! * if result == 2 then not found groupID or instanceID ! * if result == 3 then value of variable is incorrect * @author QweR * @version v0.01 */ ! protected int setValues() { String[] a; int i; int er; --- 679,706 ---- m_vars.set(i,SNMPgroups.get(m_GroupID).name+"."+SNMPgroups.get(m_GroupID).instance.get(m_InstanceID)); } ! else { ! m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex = i+1; ! return false; ! } ! } ! else { ! m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex = i+1; ! return false; } } ! return true; } /** * This method sets values from vector of 'group.instance' and 'value'. ! * return true if function successful complete. If function false then m_errorstatus & m_errorindex contain error code * @author QweR * @version v0.01 */ ! protected boolean setValues() { String[] a; + String[] sa = new String[m_vars.size()]; int i; int er; *************** *** 605,619 **** if(a.length>=2) { if(getIDbyName(a[0],a[1])) { ! er = checkValues(a[0]+"."+a[1], m_values.get(i)); if(er==0) { SNMPgroups.get(m_GroupID).value.set(m_InstanceID,m_values.get(i)); } - else return er; } ! else return SNMP_ERROR_noSuchName; } - else return SNMP_ERROR_noSuchName; } ! return 0; } --- 710,738 ---- if(a.length>=2) { if(getIDbyName(a[0],a[1])) { ! er = checkMIBValue(a[0]+"."+a[1], m_values.get(i)); if(er==0) { SNMPgroups.get(m_GroupID).value.set(m_InstanceID,m_values.get(i)); + sa[i] = a[0]+"."+a[1]; + } + else { + m_errorstatus = er; + m_errorindex = i+1; + return false; } } ! else { ! m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex = i+1; ! return false; ! } ! } ! else { ! m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex = i+1; ! return false; } } ! for(i=0;i<m_vars.size();i++) setMIBValue(sa[i], m_values.get(i)); //set values only if all variables correct ! return true; } *************** *** 665,669 **** String[] gi; String out = ""; ! char[] c = new char[4]; for(i=0;i<r.size();i++) { --- 784,789 ---- String[] gi; String out = ""; ! char[] c = {0,0,0,0}; ! //char[] c = new char[4]; for(i=0;i<r.size();i++) { *************** *** 672,683 **** if(getIDbyName(gi[0], gi[1])) { c[0]=(char)(m_GroupID+1); ! c[1]=0; c[2]=(char)(m_InstanceID+1); ! c[3]=0; ! out+=String.copyValueOf(c); } ! else return ""; } ! else return ""; } return out; --- 792,803 ---- if(getIDbyName(gi[0], gi[1])) { c[0]=(char)(m_GroupID+1); ! //c[1]=0; c[2]=(char)(m_InstanceID+1); ! //c[3]=0; } ! else c[0]=c[2]=0; } ! else c[0]=c[2]=0; ! out+=String.copyValueOf(c); } return out; *************** *** 696,701 **** String[] gi; String out = ""; ! char[] c = new char[4]; ! char[] cv; if(r.size()!=v.size()) return ""; --- 816,821 ---- String[] gi; String out = ""; ! char[] c = {0,0,0,0}; ! char[] cv = new char[3]; if(r.size()!=v.size()) return ""; *************** *** 705,720 **** if(getIDbyName(gi[0],gi[1])) { c[0]=(char)(m_GroupID+1); ! c[1]=0; c[2]=(char)(m_InstanceID+1); ! c[3]=0; ! cv = new char[3]; ! cv[0]=2; ! cv[1]=(char)(v.get(i).length()/256); ! cv[2]=(char)(v.get(i).length()%256); ! out+=String.copyValueOf(c)+String.copyValueOf(cv)+v.get(i); } ! else return ""; } ! else return ""; } return out; --- 825,839 ---- if(getIDbyName(gi[0],gi[1])) { c[0]=(char)(m_GroupID+1); ! //c[1]=0; c[2]=(char)(m_InstanceID+1); ! //c[3]=0; } ! else c[0]=c[2]=0; } ! else c[0]=c[2]=0; ! cv[0]=2; ! cv[1]=(char)(v.get(i).length()/256); ! cv[2]=(char)(v.get(i).length()%256); ! out+=String.copyValueOf(c)+String.copyValueOf(cv)+v.get(i); } return out; *************** *** 787,802 **** */ protected boolean parseSNMPHeader(String in) { ! m_len=in.charAt(0)*256+in.charAt(1); ! m_majorver=in.charAt(2); ! m_minorver=in.charAt(3); ! m_release=in.charAt(4); ! m_id=in.charAt(5)*256+in.charAt(6); ! m_type=in.charAt(7); ! m_last=in.substring(8); ! if(m_len!=in.length()-2) { ! m_errorstatus = SNMP_ERROR_wrongLength; ! return false; } ! return true; } --- 906,924 ---- */ protected boolean parseSNMPHeader(String in) { ! if(in.length()>=8) { ! m_len=in.charAt(0)*256+in.charAt(1); ! m_majorver=in.charAt(2); ! m_minorver=in.charAt(3); ! m_release=in.charAt(4); ! m_id=in.charAt(5)*256+in.charAt(6); ! m_type=in.charAt(7); ! m_last=in.substring(8); ! if(m_len!=in.length()-2) { ! m_errorstatus = SNMP_ERROR_wrongLength; ! return false; ! } ! return true; } ! return false; } *************** *** 810,822 **** */ protected boolean parseSNMPPassword(String in) { ! int l; ! l=in.charAt(0)*256+in.charAt(1); ! if(l+2>=in.length()) { ! m_errorstatus = SNMP_ERROR_wrongLength; ! return false; } ! m_password=in.substring(2, l+2); ! m_last=in.substring(l+2); ! return true; } --- 932,946 ---- */ protected boolean parseSNMPPassword(String in) { ! if(in.length()>=2) { ! int l=in.charAt(0)*256+in.charAt(1); ! if(in.length()<l+2) { ! m_errorstatus = SNMP_ERROR_wrongLength; ! return false; ! } ! m_password=in.substring(2, l+2); ! m_last=in.substring(l+2); ! return true; } ! return false; } *************** *** 840,844 **** else { m_errorstatus=SNMP_ERROR_noSuchName; ! m_errorindex=m_vars.size(); return false; } --- 964,968 ---- else { m_errorstatus=SNMP_ERROR_noSuchName; ! m_errorindex=m_vars.size()+1; return false; } *************** *** 849,852 **** --- 973,977 ---- } } + if(c.length!=i) return false; return true; } *************** *** 863,867 **** char[] c = in.toCharArray(); int i,len; - int curi=0; m_vars.clear(); --- 988,991 ---- *************** *** 877,885 **** m_values.add(String.copyValueOf(c, i+7, len)); i+=len; - curi++; } else { m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex=curi; return false; } --- 1001,1008 ---- m_values.add(String.copyValueOf(c, i+7, len)); i+=len; } else { m_errorstatus = SNMP_ERROR_noSuchName; ! m_errorindex=m_vars.size()+1; return false; } *************** *** 905,908 **** --- 1028,1032 ---- } } + if(c.length!=i) return false; return true; } *************** *** 917,921 **** */ protected boolean parseSNMPError(String in) { ! if(in.length()<=7) { m_errorstatus = SNMP_ERROR_wrongLength; return false; --- 1041,1045 ---- */ protected boolean parseSNMPError(String in) { ! if(in.length()<7) { m_errorstatus = SNMP_ERROR_wrongLength; return false; *************** *** 962,967 **** * @version v0.01 */ ! protected void updateValues() { ! } --- 1086,1183 ---- * @version v0.01 */ ! protected void updateMIBValues() { ! String str=""; ! String[] stra; ! ArrayList alist; ! Object[] oba; ! try { ! //"Counter.InputIP" ! getIDbyName("Counter","InputIP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getinputIPCount()).toString()); ! //"Counter.OutputIP" ! getIDbyName("Counter","OutputIP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getoutputIPCount()).toString()); ! //"Counter.ARP" ! getIDbyName("Counter","ARP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getARPCount()).toString()); ! //"Counter.InputTCP" ! getIDbyName("Counter","InputTCP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getTCPinputCount()).toString()); ! //"Counter.OutputTCP" ! getIDbyName("Counter","OutputTCP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getTCPoutputCount()).toString()); ! //"Counter.ReceiveDuplicatedTCP" ! getIDbyName("Counter","ReceiveDuplicatedTCP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getTCPRDCount()).toString()); ! //"Counter.SendDuplicatedTCP" ! getIDbyName("Counter","SendDuplicatedTCP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getTCPSDCount()).toString()); ! //"Counter.SendAckTCP" ! getIDbyName("Counter","SendAckTCP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getTCPACKCount()).toString()); ! //"Counter.InputUDP" ! getIDbyName("Counter","InputUDP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getUDPinputCount()).toString()); ! //"Counter.OutputUDP" ! getIDbyName("Counter","OutputUDP"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, Integer.valueOf(mParentStack.getUDPoutputCount()).toString()); ! //"Device.AllInterfaces" ! str=""; ! alist=((Node)current_device).getAllInterfacesNames(); ! for(int i=0;i<alist.size();i++) { ! if(i!=0) str+=", "; ! str+=alist.get(i).toString(); ! } ! getIDbyName("Device", "AllInterfaces"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, str); ! //"Device.AvailableInterfaces" ! str=""; ! stra=((Node)current_device).getAvailableInterfaces(); ! for(int i=0;i<stra.length;i++) { ! if(i!=0) str+=", "; ! str+=stra[i]; ! } ! getIDbyName("Device", "AvailableInterfaces"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, str); ! //"Device.Hostname" ! getIDbyName("Device", "Hostname"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, ((Node)current_device).getName()); ! //"Device.MACaddress_Eth0" ! getIDbyName("Device", "MACaddress_Eth0"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, ((Node)current_device).getMACAddress("eth0")); ! //"IP.AllInterfaces" ! str=""; ! oba=((NetworkLayerDevice)current_device).getAllInterfaces(); ! for(int i=0;i<oba.length;i++) { ! if(i!=0) str+=", "; ! str+=oba[i].toString(); ! } ! getIDbyName("IP", "AllInterfaces"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, str); ! //"IP.ARPTable" ! str=""; ! stra = ((NetworkLayerDevice)current_device).getARPTable(); ! for(int i=1;i<stra.length;i++) { ! if(i!=1) str+=", "; ! str+=stra[i]; ! } ! getIDbyName("IP", "ARPTable"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, str); ! //"IP.DefaultGateway" ! getIDbyName("IP", "DefaultGateway"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, ((NetworkLayerDevice)current_device).getDefaultGateway()); ! //"IP.IPaddress_Eth0" ! getIDbyName("IP", "Address_Eth0"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, ((NetworkLayerDevice)current_device).getIPAddress("eth0")); ! //"IP.subnetMask_Eth0" ! getIDbyName("IP", "SubnetMask_Eth0"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, ((NetworkLayerDevice)current_device).getSubnetMask("eth0")); ! //"SNMP.CommunityName" ! getIDbyName("SNMP", "CommunityName"); ! SNMPgroups.get(m_GroupID).value.set(m_InstanceID, current_password); ! } ! catch(Exception e) { ! System.out.print(e.toString()); ! } } *************** *** 971,985 **** * @version v0.01 */ ! private int checkValues(String var,String val) { ! if(var.compareTo("test.test_1")==0) { if(val.compareTo("B")==0 || val.compareTo("C")==0) return 0; else return SNMP_ERROR_wrongValue; } ! else if(var.compareTo("test.test_2")==0) { if(Integer.parseInt(val,10)>0 && Integer.parseInt(val,10)<99) return 0; else return SNMP_ERROR_wrongValue; } return SNMP_ERROR_readOnly; } /** --- 1187,1241 ---- * @version v0.01 */ ! private int checkMIBValue(String var,String val) { ! if(var.compareToIgnoreCase("test.test_1")==0) { if(val.compareTo("B")==0 || val.compareTo("C")==0) return 0; else return SNMP_ERROR_wrongValue; } ! else if(var.compareToIgnoreCase("test.test_2")==0) { if(Integer.parseInt(val,10)>0 && Integer.parseInt(val,10)<99) return 0; else return SNMP_ERROR_wrongValue; } + else if(var.compareToIgnoreCase("IP.DefaultGateway")==0) { + if(val!="" || var!=null) return 0; + } + else if(var.compareToIgnoreCase("IP.Address_Eth0")==0) { + if(val!="" || var!=null) return 0; + } + else if(var.compareToIgnoreCase("IP.SubnetMask_Eth0")==0) { + if(val!="" || var!=null) return 0; + } + else if(var.compareToIgnoreCase("SNMP.CommunityName")==0) { + if(val!="" || var!=null) return 0; + } return SNMP_ERROR_readOnly; } + + /** + * This method set MIB value + * @author QweR + * @version v0.01 + */ + private int setMIBValue(String var,String val) { + try { + int er=0; + if((er=checkMIBValue(var, val))!=0) return er; + if(var.compareToIgnoreCase("IP.DefaultGateway")==0) { + ((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) { + current_password=val; + } + } + catch(Exception e) { + System.out.print(e.toString()); + } + return 0; + } /** *************** *** 993,997 **** for(i=0;i<SNMPgroups.size();i++) { ! if(SNMPgroups.get(i).name.compareTo(n)==0) break; } if(i>=SNMPgroups.size()) return (-1); --- 1249,1253 ---- for(i=0;i<SNMPgroups.size();i++) { ! if(SNMPgroups.get(i).name.compareToIgnoreCase(n)==0) break; } if(i>=SNMPgroups.size()) return (-1); *************** *** 1024,1031 **** protected String getPacketData(String pack) { ! String out=""; ! out += Integer.toString((int) pack.charAt(0), 16); ! for(int i=1;i<pack.length();i++) { ! out += ","+Integer.toString((int) pack.charAt(i), 16); } return out; --- 1280,1289 ---- protected String getPacketData(String pack) { ! String out="",ob=""; ! for(int i=0;i<pack.length();i++) { ! if(i!=0) out += " "; ! ob = Integer.toString((int) pack.charAt(i), 16).toUpperCase(); ! if(ob.length()<=1) out += "0"; ! out += ob; } return out; *************** *** 1051,1055 **** for(i=0;i<instance.size();i++) { ! if(instance.get(i).compareTo(n)==0) break; } if(i>=instance.size()) return (-1); --- 1309,1313 ---- for(i=0;i<instance.size();i++) { ! if(instance.get(i).compareToIgnoreCase(n)==0) break; } if(i>=instance.size()) return (-1); |
From: QweR <qw...@us...> - 2006-02-22 20:04:34
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3906/core Modified Files: NetworkLayerDevice.java Node.java PC.java Log Message: Index: PC.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/PC.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PC.java 22 Feb 2006 16:29:29 -0000 1.8 --- PC.java 22 Feb 2006 20:04:27 -0000 1.9 *************** *** 113,122 **** Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); Telnet_server telnetServer = new Telnet_server(NodeProtocolStack, 23, 1, core.ProtocolStack.UIDGen++); Telnet_client telnetClient = new Telnet_client(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); - - SNMP snmpAgent = new SNMP(NodeProtocolStack, 161, 0, core.ProtocolStack.UIDGen++); - SNMP snmpManager = new SNMP(NodeProtocolStack, 0, 1, core.ProtocolStack.UIDGen++); addApp(echoServer, 7); --- 113,122 ---- Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); + SNMP snmpAgent = new SNMP((ApplicationLayerDevice)this, NodeProtocolStack, 161, 0, core.ProtocolStack.UIDGen++); + SNMP snmpManager = new SNMP((ApplicationLayerDevice)this, NodeProtocolStack, 0, 1, core.ProtocolStack.UIDGen++); + Telnet_server telnetServer = new Telnet_server(NodeProtocolStack, 23, 1, core.ProtocolStack.UIDGen++); Telnet_client telnetClient = new Telnet_client(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); addApp(echoServer, 7); Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkLayerDevice.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** NetworkLayerDevice.java 8 Dec 2005 16:45:08 -0000 1.6 --- NetworkLayerDevice.java 22 Feb 2006 20:04:27 -0000 1.7 *************** *** 205,209 **** */ ! protected String setIPAddress(String inInterface, String inIPAddress) throws InvalidNetworkInterfaceNameException,InvalidIPAddressException { String macAddress = null; if (NetworkInterfacetable.containsKey(inInterface)) { --- 205,209 ---- */ ! public String setIPAddress(String inInterface, String inIPAddress) throws InvalidNetworkInterfaceNameException,InvalidIPAddressException { String macAddress = null; if (NetworkInterfacetable.containsKey(inInterface)) { Index: Node.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Node.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Node.java 3 Dec 2005 12:20:52 -0000 1.6 --- Node.java 22 Feb 2006 20:04:27 -0000 1.7 *************** *** 562,565 **** --- 562,575 ---- else return null; } + + /** + * Gets the name of the Node. + * @author luke_hamilton + * @return The name of the Node. + * @version v0.20 + */ + public void setName(String inName) { + name=inName; + } }//EOF |
From: Alexander B. <da...@us...> - 2006-02-22 19:57:04
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32724/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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Telnet_server.java 22 Feb 2006 18:57:43 -0000 1.1 --- Telnet_server.java 22 Feb 2006 19:56:58 -0000 1.2 *************** *** 2,6 **** * Echo.java * ! * Created on 19 Nov 2005 Ç., 14:09 * */ --- 2,6 ---- * Echo.java * ! * Created on 19 Nov 2005, 14:09 * */ |
From: Alexander B. <da...@us...> - 2006-02-22 18:57:47
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27673 Added Files: Telnet_client.java Telnet_server.java Log Message: --- NEW FILE: Telnet_client.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Telnet_server.java --- (This appears to be a binary file; contents omitted.) |
From: Alexander B. <da...@us...> - 2006-02-22 17:42:39
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10513/guiUI Added Files: TelnetEmulator.java Log Message: --- NEW FILE: TelnetEmulator.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 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; /** * * @author key */ public class TelnetEmulator extends JFrame { private final Telnet_client telnet; private JPanel panel; private JLabel terminal; private String text; MainScreen parent; /** Creates a new instance of TelnetEmulator */ public TelnetEmulator(MainScreen parent, Telnet_client telnet, String Host, int Port) { super("Telnet client"); this.telnet = telnet; this.parent = parent; text = ""; text += "Opening " + Host + ":" + Port + "..."; terminal = new JLabel(text); panel = new JPanel(); this.addKeyListener( new KeyAdapter(){ public void keyPressed(KeyEvent e) { char c = (char)e.getKeyCode(); String s = String.valueOf(c).toString(); sendData(s); } }); this.addWindowListener( new java.awt.event.WindowAdapter() { public void windowClosing(WindowEvent winEvt) { printInfo(); } }); panel.setLayout(new java.awt.BorderLayout()); panel.setPreferredSize(new java.awt.Dimension(600,100)); this.setContentPane(panel); panel.add(terminal); try{ this.telnet.TelnetConnect(this, Host, Port); }catch(CommunicationException e){ /// ///FIXME!!!!!! CATCH EXCEPTION!!!!! /// }catch(LowLinkException e){ /// ///FIXME!!!!!! CATCH EXCEPTION!!!!! /// }catch(InvalidNetworkLayerDeviceException e){ /// ///FIXME!!!!!! CATCH EXCEPTION!!!!! /// }catch(TransportLayerException e){ /// ///FIXME!!!!!! CATCH EXCEPTION!!!!! /// } } public void recvData(String Data){ text += Data; terminal.setText(text); } public void sendData(String Data){ try{ telnet.SendData(Data); }catch(Exception e){ System.out.println(e.toString()); } } public void printInfo(){ parent.printLayerInfo(false); //!!!!!: add more headers here } } |
From: Alexander B. <da...@us...> - 2006-02-22 17:40:59
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9071/guiUI Modified Files: MainScreen.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** MainScreen.java 22 Feb 2006 16:29:30 -0000 1.30 --- MainScreen.java 22 Feb 2006 17:40:51 -0000 1.31 *************** *** 3191,3195 **** //=<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(((Telnet_client)((core.ApplicationLayerDevice)Sim.getNode(inNodeName)).getApp(30023)),ip,Integer.valueOf(port).intValue()); t.pack(); t.setVisible(true); --- 3191,3195 ---- //=<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); |
From: Alexander B. <da...@us...> - 2006-02-22 16:29:40
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1477/guiUI Modified Files: ApplicationLayerDevice.java MainScreen.java Log Message: Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** MainScreen.java 9 Feb 2006 23:12:39 -0000 1.29 --- MainScreen.java 22 Feb 2006 16:29:30 -0000 1.30 *************** *** 122,127 **** import core.protocolsuite.tcp_ip.Echo_tcp; import core.protocolsuite.tcp_ip.SNMP; ! ! --- 122,127 ---- import core.protocolsuite.tcp_ip.Echo_tcp; import core.protocolsuite.tcp_ip.SNMP; ! import core.protocolsuite.tcp_ip.Telnet_server; ! import core.protocolsuite.tcp_ip.Telnet_client; *************** *** 3002,3005 **** --- 3002,3032 ---- } + 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()); + + } + + } + + } /** *************** *** 3145,3148 **** --- 3172,3211 ---- } + + + public void TelnetConnect(String inNodeName){ + + String ip = JOptionPane.showInputDialog(this, "Server IP:", "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE); + + String port = JOptionPane.showInputDialog(this, "Server Port:", "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE); + + if(port!=null && ip!=null){ + + 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(((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()); + + } + addHeader(); + printLayerInfo(false); + + } + + } /** Index: ApplicationLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/ApplicationLayerDevice.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ApplicationLayerDevice.java 9 Feb 2006 23:12:39 -0000 1.6 --- ApplicationLayerDevice.java 22 Feb 2006 16:29:30 -0000 1.7 *************** *** 26,29 **** --- 26,31 ---- private JMenuItem mnuEchotcpListen = new JMenuItem("Start tcp echo server to listen."); private JMenuItem mnuEchotcpSend = new JMenuItem("Send data via tcp echo client."); + private JMenuItem mnuTelnetListen = new JMenuItem("Start telnet server to listen."); + private JMenuItem mnuTelnetConnect = new JMenuItem("Telnet client."); private JMenu mnuAppLayer = new JMenu("Applications"); private JMenuItem mnuSNMPAgent = new JMenuItem("Start SNMP agent"); *************** *** 80,86 **** --- 82,102 ---- } }); + mnuTelnetListen.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.TelnetListen(lblNodeName.getText()); + } + }); + + mnuTelnetConnect.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.TelnetConnect(lblNodeName.getText()); + } + }); mnuAppLayer.addSeparator(); mnuAppLayer.add(mnuSNMPAgent); mnuAppLayer.add(mnuSNMPManager); + mnuAppLayer.addSeparator(); + mnuAppLayer.add(mnuTelnetListen); + mnuAppLayer.add(mnuTelnetConnect); } } |
From: Alexander B. <da...@us...> - 2006-02-22 16:29:35
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1477/core Modified Files: PC.java Simulation.java Log Message: Index: PC.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/PC.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PC.java 9 Feb 2006 23:12:39 -0000 1.7 --- PC.java 22 Feb 2006 16:29:29 -0000 1.8 *************** *** 58,62 **** import core.protocolsuite.tcp_ip.Echo; ! import core.protocolsuite.tcp_ip.Echo_tcp; import core.protocolsuite.tcp_ip.SNMP; --- 58,63 ---- import core.protocolsuite.tcp_ip.Echo; ! import core.protocolsuite.tcp_ip.Telnet_server; ! import core.protocolsuite.tcp_ip.Telnet_client; import core.protocolsuite.tcp_ip.Echo_tcp; import core.protocolsuite.tcp_ip.SNMP; *************** *** 108,137 **** Echo echoClient = new Echo(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); - - Echo_tcp echotcpServer = new Echo_tcp(NodeProtocolStack, 17, 1, core.ProtocolStack.UIDGen++); Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); SNMP snmpAgent = new SNMP(NodeProtocolStack, 161, 0, core.ProtocolStack.UIDGen++); SNMP snmpManager = new SNMP(NodeProtocolStack, 0, 1, core.ProtocolStack.UIDGen++); - - addApp(echoServer, 7); addApp(echoClient, 30007); - - addApp(echotcpServer, 17); - addApp(echotcpClient, 30017); addApp(snmpAgent, 161); addApp(snmpManager, 30161); - - addNetworkInterface("eth0"); --- 109,137 ---- Echo echoClient = new Echo(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); Echo_tcp echotcpServer = new Echo_tcp(NodeProtocolStack, 17, 1, core.ProtocolStack.UIDGen++); Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); + Telnet_server telnetServer = new Telnet_server(NodeProtocolStack, 23, 1, core.ProtocolStack.UIDGen++); + + Telnet_client telnetClient = new Telnet_client(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); + SNMP snmpAgent = new SNMP(NodeProtocolStack, 161, 0, core.ProtocolStack.UIDGen++); SNMP snmpManager = new SNMP(NodeProtocolStack, 0, 1, core.ProtocolStack.UIDGen++); addApp(echoServer, 7); addApp(echoClient, 30007); addApp(echotcpServer, 17); addApp(echotcpClient, 30017); + + addApp(telnetServer, 23); + addApp(telnetClient, 30023); + addApp(snmpAgent, 161); addApp(snmpManager, 30161); addNetworkInterface("eth0"); Index: Simulation.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Simulation.java 8 Dec 2005 18:07:39 -0000 1.8 --- Simulation.java 22 Feb 2006 16:29:30 -0000 1.9 *************** *** 430,434 **** if (temp instanceof NetworkLayerDevice){ //test if device is a network layer device NetworkLayerDevice t = (NetworkLayerDevice)temp; ! macAddress = t.setIPAddress(inNodeInterface,inIPAddress); updateARP(inIPAddress, macAddress, inNodeName); //t.addToARP(inIPAddress, macAddress); --- 430,435 ---- if (temp instanceof NetworkLayerDevice){ //test if device is a network layer device NetworkLayerDevice t = (NetworkLayerDevice)temp; ! ! macAddress = t.setIPAddress(inNodeInterface,inIPAddress); updateARP(inIPAddress, macAddress, inNodeName); //t.addToARP(inIPAddress, macAddress); |
From: Alexander B. <da...@us...> - 2006-02-22 14:06:01
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21494 Modified Files: OSPF.java OSPFDTBdescription_packet.java OSPF_lsaheader.java Log Message: Index: OSPFDTBdescription_packet.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPFDTBdescription_packet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OSPFDTBdescription_packet.java 10 Feb 2006 13:00:57 -0000 1.4 --- OSPFDTBdescription_packet.java 22 Feb 2006 14:05:53 -0000 1.5 *************** *** 2,6 **** * OSPFDTBdescription_packet.java * ! * Created on 19 Íîÿáðü 2005 ã., 20:15 * * To change this template, choose Tools | Options and locate the template under --- 2,6 ---- * OSPFDTBdescription_packet.java * ! * Created on 19 Nov 2005, 20:15 * * To change this template, choose Tools | Options and locate the template under Index: OSPF.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPF.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OSPF.java 12 Feb 2006 10:22:34 -0000 1.2 --- OSPF.java 22 Feb 2006 14:05:53 -0000 1.3 *************** *** 256,261 **** } tosend.setDestIPAddress(inDestIPAddress); mParentStack.sendPacket(tosend); ! } --- 256,262 ---- } tosend.setDestIPAddress(inDestIPAddress); + try{ mParentStack.sendPacket(tosend); ! }catch(Exception e){} } *************** *** 270,279 **** // check if this router ID is leeser than ID neighbor // TODO ! if (RouterID < inPacket.GetRouterID() ) ! { // ageree // SendDTBdescroption_packet // SendDTBdescriptionPacket(1,1,0,inPacket.ReturnDdsn(),0); ! } } else --- 271,280 ---- // check if this router ID is leeser than ID neighbor // TODO ! //if (RouterID < inPacket.GetRouterID() ) ! //{ // ageree // SendDTBdescroption_packet // SendDTBdescriptionPacket(1,1,0,inPacket.ReturnDdsn(),0); ! //} } else *************** *** 297,306 **** // check the element in incoming packet ! if ( !ForeignHeader.contains(inPacket.ReturnLsaHeader().elementAt(i)) ) ! { /* add header to this list */ ! ForeignHeader.addElement(inPacket.ReturnLsaHeader().elementAt(i)); // // form graph ! } } --- 298,307 ---- // check the element in incoming packet ! //if ( !ForeignHeader.contains(inPacket.ReturnLsaHeader().elementAt(i)) ) ! //{ /* add header to this list */ ! // ForeignHeader.addElement(inPacket.ReturnLsaHeader().elementAt(i)); // // form graph ! //} } *************** *** 343,347 **** public OSPF_linkstaterequest_packet SendLinkStateRequestPacket() { ! } --- 344,348 ---- public OSPF_linkstaterequest_packet SendLinkStateRequestPacket() { ! return null; } *************** *** 353,357 **** public OSPFlinkstateupdate_packet SendLinkStateUpdatePacket() { ! } /* --- 354,358 ---- public OSPFlinkstateupdate_packet SendLinkStateUpdatePacket() { ! return null; } /* Index: OSPF_lsaheader.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPF_lsaheader.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OSPF_lsaheader.java 10 Feb 2006 13:00:57 -0000 1.2 --- OSPF_lsaheader.java 22 Feb 2006 14:05:53 -0000 1.3 *************** *** 2,6 **** * OSPF_lsaheader.java * ! * Created on 19 Íîÿáðü 2005 ã., 20:26 * * To change this template, choose Tools | Options and locate the template under --- 2,6 ---- * OSPF_lsaheader.java * ! * Created on 19 Nov 2005, 20:26 * * To change this template, choose Tools | Options and locate the template under |
From: Alexander B. <da...@us...> - 2006-02-22 14:05:32
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21006/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.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ProtocolStack.java 10 Feb 2006 15:42:15 -0000 1.39 --- ProtocolStack.java 22 Feb 2006 14:05:19 -0000 1.40 *************** *** 944,949 **** try{ ! ! //Create layer info --- 944,949 ---- try{ ! if(!(ipPacket instanceof ARP_packet)){ ! //Create layer info *************** *** 963,966 **** --- 963,968 ---- forwardPacket(ipPacket); + + } }catch(CommunicationException ex){ |
From: Alouette <alo...@us...> - 2006-02-12 10:22:48
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7513/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.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OSPF.java 10 Feb 2006 18:01:56 -0000 1.1 --- OSPF.java 12 Feb 2006 10:22:34 -0000 1.2 *************** *** 34,37 **** --- 34,38 ---- //private String myID; //private Vector ForeignHeader = new Vector(); + private ProtocolStack mParentStack; private String RouterID; // id current router private String DesignatedRouter; *************** *** 213,217 **** if (flag==0) { ! // send hello packet } --- 214,220 ---- if (flag==0) { ! // send hello packet ! AddRouter(inPacket.GetRouterID(), RouterID, 1); ! SendospfHelloPacket(inPacket.GetRouterID()); } *************** *** 230,233 **** --- 233,237 ---- //SendHelloPacket(); + SendospfHelloPacket(inPacket.GetRouterID()); } } *************** *** 252,256 **** } tosend.setDestIPAddress(inDestIPAddress); ! sendPacket(tosend); } --- 256,260 ---- } tosend.setDestIPAddress(inDestIPAddress); ! mParentStack.sendPacket(tosend); } |
From: Alouette <alo...@us...> - 2006-02-10 18:02:08
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20211/core/protocolsuite/tcp_ip/ospf Added Files: OSPF.java OSPF_linkstaterequest_packet.java OSPF_lsatypeone.java OSPF_lsatypethree.java OSPF_lsatypetwo.java OSPFlinkstateupdate_packet.java Log Message: --- NEW FILE: OSPF_lsatypeone.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: OSPFlinkstateupdate_packet.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: OSPF.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: OSPF_lsatypetwo.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: OSPF_lsatypethree.java --- (This appears to be a binary file; contents omitted.) --- NEW FILE: OSPF_linkstaterequest_packet.java --- (This appears to be a binary file; contents omitted.) |
From: Alouette <alo...@us...> - 2006-02-10 15:42:31
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17647/core/protocolsuite/tcp_ip/ospf Modified Files: OSPFhello_packet.java Log Message: Index: OSPFhello_packet.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPFhello_packet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** OSPFhello_packet.java 10 Feb 2006 13:00:57 -0000 1.4 --- OSPFhello_packet.java 10 Feb 2006 15:42:17 -0000 1.5 *************** *** 119,122 **** --- 119,130 ---- Neighbor.addElement(inRouterID); } + public String GetDesignatedRouter() + { + return DesignatedRouter; + } + public String GetbackupDesignatedRouter() + { + return BackupDesignatedRouter; + } } |
From: Alouette <alo...@us...> - 2006-02-10 15:42:27
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17647/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.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ProtocolStack.java 10 Feb 2006 13:48:41 -0000 1.38 --- ProtocolStack.java 10 Feb 2006 15:42:15 -0000 1.39 *************** *** 862,866 **** if (((ospf_packetheader)ipPacket).GetPackettype()==1) { ! if (ipPacket.getHopCount()==1) { // in --- 862,866 ---- if (((ospf_packetheader)ipPacket).GetPackettype()==1) { ! if (ipPacket.getHopCount()==1) //hop count { // in |
From: Alouette <alo...@us...> - 2006-02-10 13:48:58
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32073/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.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ProtocolStack.java 10 Feb 2006 13:00:57 -0000 1.37 --- ProtocolStack.java 10 Feb 2006 13:48:41 -0000 1.38 *************** *** 77,80 **** --- 77,82 ---- import java.util.TimerTask; + import core.protocolsuite.tcp_ip.ospf.*; + *************** *** 124,128 **** private Node mParentNode = null; ! private Ospf mOspfprotocol = null; --- 126,130 ---- private Node mParentNode = null; ! private OSPF mOspfprotocol = null; *************** *** 168,172 **** mUDPprotocol = new Udp(this); //gift (sourceforge.net user) 17 Nov 2005 ! } mParentNode = node; --- 170,175 ---- mUDPprotocol = new Udp(this); //gift (sourceforge.net user) 17 Nov 2005 ! mOspfprotocol = new OSPF(this); // alouette ! } mParentNode = node; *************** *** 859,863 **** if (((ospf_packetheader)ipPacket).GetPackettype()==1) { ! // initialize } else if (((ospf_packetheader)ipPacket).GetPackettype()==2) --- 862,870 ---- if (((ospf_packetheader)ipPacket).GetPackettype()==1) { ! if (ipPacket.getHopCount()==1) ! { ! // in ! mOspfprotocol.ReceiveHelloPacket((OSPFhello_packet)ipPacket); ! } } else if (((ospf_packetheader)ipPacket).GetPackettype()==2) *************** *** 1930,1937 **** } ! public void Sendospf(ospf_packetheader tosend) ! { ! sendPacket(tosend); ! } }//EOF --- 1937,1941 ---- } ! }//EOF |
From: Alouette <alo...@us...> - 2006-02-10 13:48:58
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32073/core/protocolsuite/tcp_ip/ospf Modified Files: ospf_packetheader.java Log Message: Index: ospf_packetheader.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/ospf_packetheader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ospf_packetheader.java 10 Feb 2006 13:00:57 -0000 1.4 --- ospf_packetheader.java 10 Feb 2006 13:48:45 -0000 1.5 *************** *** 41,44 **** --- 41,45 ---- */ public ospf_packetheader() { + super(""); Checksum=1; Authentication=""; *************** *** 55,58 **** --- 56,60 ---- public ospf_packetheader(int inType) { + super(""); Checksum=1; Type=inType; |
From: Alouette <alo...@us...> - 2006-02-10 13:01:11
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10149/core/protocolsuite/tcp_ip/ospf Modified Files: OSPFDTBdescription_packet.java OSPF_lsaheader.java OSPFhello_packet.java ospf_packetheader.java Log Message: Index: OSPFDTBdescription_packet.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPFDTBdescription_packet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OSPFDTBdescription_packet.java 30 Nov 2005 08:44:51 -0000 1.3 --- OSPFDTBdescription_packet.java 10 Feb 2006 13:00:57 -0000 1.4 *************** *** 49,51 **** --- 49,74 ---- } + public Vector ReturnLsaHeader() + { + return LSAheader_list; + } + + public int ReturnMS(int innum) + { + return IMMS[innum]; + } + public int ReturnDdsn() + { + return DDSequenceNumber; + } + + /*public String GetRouterID() + { + return RouterID; + } + + public void SetRouterID(String inRouterID) + { + RouterID = inRouterID; + }*/ } Index: OSPFhello_packet.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPFhello_packet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** OSPFhello_packet.java 20 Nov 2005 14:31:16 -0000 1.3 --- OSPFhello_packet.java 10 Feb 2006 13:00:57 -0000 1.4 *************** *** 11,14 **** --- 11,15 ---- package core.protocolsuite.tcp_ip.ospf; import core.protocolsuite.tcp_ip.ospf.ospf_packetheader; + import java.util.*; /** *************** *** 24,36 **** private static final int Interval=30; // period of sending packets ??! private int Priority; ! private int DeadInterval; private String DesignatedRouter; // 0 - not chosen yet private String BackupDesignatedRouter; //0 - not chosen yet /* todo */ /* need to be list*/ ! private String[] Neighbor; /** Creates a new instance of OSPFhello_packet */ ! public OSPFhello_packet(int NeighborCount) { super(1); --- 25,37 ---- private static final int Interval=30; // period of sending packets ??! private int Priority; ! private static final int DeadInterval=300; private String DesignatedRouter; // 0 - not chosen yet private String BackupDesignatedRouter; //0 - not chosen yet /* todo */ /* need to be list*/ ! private Vector Neighbor = new Vector(); /** Creates a new instance of OSPFhello_packet */ ! public OSPFhello_packet() { super(1); *************** *** 43,50 **** BackupDesignatedRouter=""; DesignatedRouter=""; ! if (NeighborCount>0) ! { ! Neighbor = new String[NeighborCount]; ! } } --- 44,48 ---- BackupDesignatedRouter=""; DesignatedRouter=""; ! } *************** *** 103,106 **** --- 101,122 ---- *v1.0 */ + + + + + public Vector GetNeighbor() + { + return Neighbor; + } + + + public void SetAreaID(String inAreaID) + { + AreaID=inAreaID; + } + public void AddNeighbor(String inRouterID) + { + Neighbor.addElement(inRouterID); + } } Index: ospf_packetheader.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/ospf_packetheader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ospf_packetheader.java 20 Nov 2005 14:31:16 -0000 1.3 --- ospf_packetheader.java 10 Feb 2006 13:00:57 -0000 1.4 *************** *** 10,13 **** --- 10,15 ---- package core.protocolsuite.tcp_ip.ospf; + import core.Packet; + import core.protocolsuite.tcp_ip.*; /** *************** *** 16,20 **** * */ ! public class ospf_packetheader { /* * --- 18,22 ---- * */ ! public class ospf_packetheader extends IP_packet { /* * *************** *** 23,28 **** protected int Type; // packet type protected int PacketLength; // packet length in oktets ! protected int RouterID; ! protected int AreaID; protected int Checksum; // for future developing protected boolean AuthenticationType; // if false - authentication without password, --- 25,30 ---- protected int Type; // packet type protected int PacketLength; // packet length in oktets ! protected String RouterID; ! protected String AreaID; protected int Checksum; // for future developing protected boolean AuthenticationType; // if false - authentication without password, *************** *** 63,67 **** * @version 1.0 */ ! protected int GetChecksum() { return Checksum; --- 65,69 ---- * @version 1.0 */ ! public int GetChecksum() { return Checksum; *************** *** 79,83 **** * @version 1.0 */ ! protected int GetPackettype() { return Type; --- 81,85 ---- * @version 1.0 */ ! public int GetPackettype() { return Type; *************** *** 91,95 **** * @version 1.0 */ ! protected boolean GetAuthenticationType() { return AuthenticationType; --- 93,97 ---- * @version 1.0 */ ! public boolean GetAuthenticationType() { return AuthenticationType; *************** *** 103,109 **** * @version 1.0 */ ! protected int GetPacketLength() { return PacketLength; } } --- 105,121 ---- * @version 1.0 */ ! public int GetPacketLength() { return PacketLength; } + + public String GetRouterID() + { + return RouterID; + } + + public void SetRouterID(String inRouterID) + { + RouterID = inRouterID; + } } Index: OSPF_lsaheader.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ospf/OSPF_lsaheader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** OSPF_lsaheader.java 28 Nov 2005 13:17:18 -0000 1.1 --- OSPF_lsaheader.java 10 Feb 2006 13:00:57 -0000 1.2 *************** *** 20,24 **** protected int[] ls_options; //options same to , for example, hello message protected int LS_type; // type of LSA ! protected int LS_ID; // link identifier protected String ls_AdvertisingRouter; protected long LS_sequencenumber; --- 20,24 ---- protected int[] ls_options; //options same to , for example, hello message protected int LS_type; // type of LSA ! protected String LS_ID; // link identifier protected String ls_AdvertisingRouter; protected long LS_sequencenumber; *************** *** 120,129 **** } ! public void SetLSID(int inID) { LS_ID=inID; } ! public int GetID() { return LS_ID; --- 120,129 ---- } ! public void SetLSID(String inID) { LS_ID=inID; } ! public String GetID() { return LS_ID; |