javanetsim-cvs Mailing List for javaNetSim (Page 11)
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: gift <gi...@us...> - 2007-09-16 15:27:32
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21582/guiUI Modified Files: MainScreen.java SandBox.java Log Message: A try to save image file. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** MainScreen.java 15 Sep 2007 20:39:44 -0000 1.61 --- MainScreen.java 16 Sep 2007 15:27:26 -0000 1.62 *************** *** 62,65 **** --- 62,67 ---- import java.awt.Cursor; + import java.awt.image.BufferedImage; + import java.awt.image.RenderedImage; import java.io.File; *************** *** 93,97 **** import java.util.Arrays; ! --- 95,99 ---- import java.util.Arrays; ! import javax.imageio.*; *************** *** 2254,2258 **** //Generate report and save Simulation. ! generate_html_report(simSaveFile.getAbsolutePath()); System.out.println("Generating HTML report file"); --- 2256,2260 ---- //Generate report and save Simulation. ! generate_html_report(simSaveFile.getAbsolutePath(), tempFile.getPath()+".jpg"); System.out.println("Generating HTML report file"); *************** *** 3379,3386 **** * @author gift (sourceforge.net user) */ ! public void generate_html_report(String path) { ! FileWriter f_out; ! try { f_out = new FileWriter(path); --- 3381,3388 ---- * @author gift (sourceforge.net user) */ ! public void generate_html_report(String path, String gr_path) { ! FileWriter f_out; //html file ! File g_out; //graphics file try { f_out = new FileWriter(path); *************** *** 3395,3400 **** "<TITLE>javaNetSim HTML report</TITLE>\r\n" + "</HEAD>\r\n<BODY>\r\n"); ! f_out.write("<P>Welcome to javaNetSim report page!<BR/>" + ! "Here is the summary of the devices you used in your simulation." + "</P>\r\n<P>"); f_out.write(generate_html_node_info().toString()); --- 3397,3404 ---- "<TITLE>javaNetSim HTML report</TITLE>\r\n" + "</HEAD>\r\n<BODY>\r\n"); ! f_out.write("<P>Welcome to javaNetSim report page!</P>\r\n" + ! "<P>Simulation printscreen: <BR/>"+ ! "<IMG SRC=\""+ gr_path +"\"></P>\r\n" + ! "<P>Here is the summary of the devices you used in your simulation." + "</P>\r\n<P>"); f_out.write(generate_html_node_info().toString()); *************** *** 3408,3414 **** "<!-- close html file -->\r\n</BODY>\r\n</HTML>"); f_out.close(); } catch (IOException ex) { addToConsole(ex.toString()); ! } } --- 3412,3443 ---- "<!-- close html file -->\r\n</BODY>\r\n</HTML>"); f_out.close(); + + // Get image to write to a file + int width = 1000; + int height = 1000; + BufferedImage bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); + + // Create a graphics contents on the buffered image + Graphics2D g2d = bufferedImage.createGraphics(); + + // Draw graphics + java.awt.Component c[] = this.Sandbox.getComponentsInLayer(3); + g2d = (Graphics2D) c[0].getGraphics(); + + + // Graphics context no longer needed so dispose it + g2d.dispose(); + + // Save as PNG + //File file = new File("newimage.png"); + //ImageIO.write(rendImage, "png", file); + + // Save as JPEG + g_out = new File(gr_path); + ImageIO.write((RenderedImage) bufferedImage, "jpg", g_out); + } catch (IOException ex) { addToConsole(ex.toString()); ! } } Index: SandBox.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SandBox.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** SandBox.java 13 Sep 2007 13:38:53 -0000 1.4 --- SandBox.java 16 Sep 2007 15:27:26 -0000 1.5 *************** *** 207,211 **** this.setCursor(csrDefault); Point NodeLocation = new Point(e.getX(), e.getY()); ! controller.addExternalNAT(NodeLocation); } } --- 207,211 ---- this.setCursor(csrDefault); Point NodeLocation = new Point(e.getX(), e.getY()); ! controller.addExternalNAT(NodeLocation); } } *************** *** 248,253 **** public void componentShown(ComponentEvent arg0) { } - - } --- 248,257 ---- public void componentShown(ComponentEvent arg0) { } + + + public Graphics getGraphics() + { + return this.controller.getGraphics(); + } } |
From: gift <gi...@us...> - 2007-09-15 20:39:50
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16162/guiUI Modified Files: MainScreen.java Log Message: body tag and spelling Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** MainScreen.java 15 Sep 2007 18:50:48 -0000 1.60 --- MainScreen.java 15 Sep 2007 20:39:44 -0000 1.61 *************** *** 3394,3400 **** "<!-- <LINK REL=stylesheet type=text/css href=\"style.css\"> -->\r\n" + "<TITLE>javaNetSim HTML report</TITLE>\r\n" + ! "</HEAD>\r\n\r\n"); f_out.write("<P>Welcome to javaNetSim report page!<BR/>" + ! "Here is the summury of the devices you used in your simulation." + "</P>\r\n<P>"); f_out.write(generate_html_node_info().toString()); --- 3394,3400 ---- "<!-- <LINK REL=stylesheet type=text/css href=\"style.css\"> -->\r\n" + "<TITLE>javaNetSim HTML report</TITLE>\r\n" + ! "</HEAD>\r\n<BODY>\r\n"); f_out.write("<P>Welcome to javaNetSim report page!<BR/>" + ! "Here is the summary of the devices you used in your simulation." + "</P>\r\n<P>"); f_out.write(generate_html_node_info().toString()); *************** *** 3406,3410 **** "<!-- Appendix -->\r\n" + "Project page: <A HREF = \"http://sf.net/projects/javanetsim\">http://sf.net/projects/javanetsim</A>, if you found a bug, please, post it to <A HREF = \"http://sf.net/tracker/?atid=784685&group_id=152576\">http://sf.net/tracker/?atid=784685&group_id=152576</A>" + ! "<!-- close html file -->\r\n</HTML>"); f_out.close(); } catch (IOException ex) { --- 3406,3410 ---- "<!-- Appendix -->\r\n" + "Project page: <A HREF = \"http://sf.net/projects/javanetsim\">http://sf.net/projects/javanetsim</A>, if you found a bug, please, post it to <A HREF = \"http://sf.net/tracker/?atid=784685&group_id=152576\">http://sf.net/tracker/?atid=784685&group_id=152576</A>" + ! "<!-- close html file -->\r\n</BODY>\r\n</HTML>"); f_out.close(); } catch (IOException ex) { |
From: gift <gi...@us...> - 2007-09-15 18:50:55
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32627/guiUI Modified Files: EditRoutesDialog.java MainScreen.java MenuBar.java SNMPSendDataDialog.java Log Message: HTML reporting is done. HTML file chooser added. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** MainScreen.java 15 Sep 2007 13:42:33 -0000 1.59 --- MainScreen.java 15 Sep 2007 18:50:48 -0000 1.60 *************** *** 161,164 **** --- 161,166 ---- private static final String SIM_PREFIX = "jfst"; + + private static final String HTM_PREFIX = "htm"; *************** *** 215,224 **** //Colors for console output ! private Color NETWORK_LAYER_COLOR = Color.CYAN; ! private Color LINK_LAYER_COLOR = Color.YELLOW; ! private Color TRANSPORT_LAYER_COLOR = Color.LIGHT_GRAY; ! private Color APPLICATION_LAYER_COLOR = Color.GREEN; ! private Color HARDWARE_LAYER_COLOR = Color.ORANGE; ! private Color SYSTEM_LAYER_COLOR = Color.RED ; //The File chooser class --- 217,226 ---- //Colors for console output ! private static final Color NETWORK_LAYER_COLOR = Color.CYAN; ! private static final Color LINK_LAYER_COLOR = Color.YELLOW; ! private static final Color TRANSPORT_LAYER_COLOR = Color.LIGHT_GRAY; ! private static final Color APPLICATION_LAYER_COLOR = Color.GREEN; ! private static final Color HARDWARE_LAYER_COLOR = Color.ORANGE; ! private static final Color SYSTEM_LAYER_COLOR = Color.RED ; //The File chooser class *************** *** 2221,2226 **** --- 2223,2269 ---- + /** + * Generate and save html report file + * @author gift (sourceforge.net user) + */ + public void save_html_rep(String saveas){ + chooser.setDialogTitle("Save HTML report..."); + chooser.setAcceptAllFileFilterUsed(false); + chooser.addChoosableFileFilter(new HTMLFilter()); + int returnVal; + + if(saveas == null){ + returnVal = chooser.showSaveDialog(this); + }else{ + returnVal = JFileChooser.APPROVE_OPTION; + } + + if(returnVal == JFileChooser.APPROVE_OPTION){ + + //Get Selected file for saving GUI information + File tempFile = chooser.getSelectedFile(); + + //TODO Test if prefix isnt already added!!!!! + //Set the report save file + if(saveas == null){ + if(tempFile.getPath().contains("."+HTM_PREFIX)) simSaveFile = new File(tempFile.getPath()); + else simSaveFile = new File(tempFile.getPath()+"."+HTM_PREFIX); + } + + //Generate report and save Simulation. + generate_html_report(simSaveFile.getAbsolutePath()); + + System.out.println("Generating HTML report file"); + System.out.println("Simulation was saved succesfully."); + System.out.println("File "+ simSaveFile.getName() + " has been saved to " + simSaveFile.getAbsolutePath()); + System.out.println(); + setStatus("HTML report was saved succesfully."); + } + + } + + void BuildSandbox() *************** *** 2861,2865 **** if (mConsole.getColumnCount()>0 && mConsole.getRowCount()>0) { ! out.append("<TABLE align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" style='border:solid windowtext 1.0pt;'>\r\n<TR bgColor=#FFFFFF>"); //Form table header for (i=0; i<mConsole.getColumnCount(); i++) --- 2904,2908 ---- if (mConsole.getColumnCount()>0 && mConsole.getRowCount()>0) { ! out.append("<!-- Console output part -->\r\n<TABLE align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" style='border:solid windowtext 1.0pt;'>\r\n<TR bgColor=#FFFFFF>"); //Form table header for (i=0; i<mConsole.getColumnCount(); i++) *************** *** 2931,2935 **** if (mConsole.getColumnCount()>0 && r_c>0) { ! out.append("<TABLE align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" style='border:solid windowtext 1.0pt;'>\r\n<TR bgColor=#FFFFFF>"); //Form table header for (i=0; i<mConsole.getColumnCount(); i++) --- 2974,2978 ---- if (mConsole.getColumnCount()>0 && r_c>0) { ! out.append("<!-- Console output part -->\r\n<TABLE align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" style='border:solid windowtext 1.0pt;'>\r\n<TR bgColor=#FFFFFF>"); //Form table header for (i=0; i<mConsole.getColumnCount(); i++) *************** *** 2982,2992 **** public StringBuffer generate_html_node_info(){ ! int i,j; StringBuffer out = new StringBuffer(10240); //approx 10 units in simulation ! String cur; ! if (true) ! { ! out.append("<BR />Sorry :) not implemented yet.<BR /><BR />"); } else { --- 3025,3082 ---- public StringBuffer generate_html_node_info(){ ! int i = 0; StringBuffer out = new StringBuffer(10240); //approx 10 units in simulation ! String cur_col; ! if (!GUInodeTable.isEmpty()) ! { ! Enumeration enu = GUInodeTable.keys(); ! String strCurrentNodeName = ""; ! ! out.append("<!-- Node information part -->\r\n<TABLE align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" style='border:solid windowtext 1.0pt;'>\r\n\r\n"); ! ! while(enu.hasMoreElements()) ! { ! try ! { ! Vector NodeData = Sim.getAllNodeInformation((String)enu.nextElement()); ! Iterator it = NodeData.iterator(); ! ! while(it.hasNext()) ! { ! Vector LineData = (Vector)it.next(); ! String strNodeName = (String)LineData.elementAt(0); ! String strDefGate = (String)LineData.elementAt(1); ! String strInterfaceName = (String)LineData.elementAt(2); ! String strMAC = (String)LineData.elementAt(3); ! String strIP = (String)LineData.elementAt(4); ! String strSubnet = (String)LineData.elementAt(5); ! String strLinkName = (String)LineData.elementAt(6); ! ! if(!strCurrentNodeName.equals(strNodeName)) ! { ! strCurrentNodeName = strNodeName; ! cur_col = ((i ^= 1) == 0) ? "<TR bgColor=#9999FF>" : "<TR bgColor=#FF9999>"; ! ! out.append("<!-- Simulation device -->\r\n" + cur_col + "\r\n" ! + "<TD>Name: " + strNodeName + "</TD>\r\n" ! + "<TD>Default gateway: " + strDefGate + "</TD>\r\n" ! + "<TD> </TD><TD> </TD><TD> </TD>\r\n</TR>\r\n\t<!-- device interfaces-->\r\n"); ! } ! out.append("\t<TR bgColor=#CCCCCC>\r\n"); ! out.append("\t<TD>Interface: " + strInterfaceName + "</TD>\r\n" + ! "\t<TD>MAC address: " + strMAC + "</TD>\r\n" + ! "\t<TD>IP address: " + strIP + "</TD>\r\n" + ! "\t<TD>Subnet mask: " + strSubnet + "</TD>\r\n" + ! "\t<TD>Link name: " + strLinkName + "</TD>\r\n"); ! out.append("\t</TR>\r\n"); ! } ! } ! catch(Exception e) ! { ! addToConsole(e.toString()); ! } ! } ! out.append("</TABLE>\r\n<!-- Node information output body -->\r\n\r\n"); } else { *************** *** 3038,3041 **** --- 3128,3152 ---- } + /** + * @author gift (sourceforge.net user) + */ + class HTMLFilter extends FileFilter{ + /** + * This method returns the Description that is in the File choosers Dialog + */ + public String getDescription(){ + return "Hypertext markup language file (*."+HTM_PREFIX+")"; + } + + /** + * This method returns true or false if a file has the prefix + */ + public boolean accept(File f) { + if(f.isDirectory() || f.getName().endsWith(HTM_PREFIX)){ + return true; + } + return false; + } + } *************** *** 3268,3277 **** * @author gift (sourceforge.net user) */ ! public void generate_html_report() { FileWriter f_out; try { ! f_out = new FileWriter("c:\\jns_rpt.htm"); f_out.write("<HTML>\r\n" + --- 3379,3388 ---- * @author gift (sourceforge.net user) */ ! public void generate_html_report(String path) { FileWriter f_out; try { ! f_out = new FileWriter(path); f_out.write("<HTML>\r\n" + *************** *** 3283,3295 **** "<!-- <LINK REL=stylesheet type=text/css href=\"style.css\"> -->\r\n" + "<TITLE>javaNetSim HTML report</TITLE>\r\n" + ! "</HEAD>\r\n\r\n"); f_out.write(generate_html_node_info().toString()); f_out.write(generate_html_console_out_rapid().toString()); ! f_out.write("\r\n<!-- close html file -->>\r\n</HTML>"); f_out.close(); } catch (IOException ex) { addToConsole(ex.toString()); ! } ! } --- 3394,3414 ---- "<!-- <LINK REL=stylesheet type=text/css href=\"style.css\"> -->\r\n" + "<TITLE>javaNetSim HTML report</TITLE>\r\n" + ! "</HEAD>\r\n\r\n"); ! f_out.write("<P>Welcome to javaNetSim report page!<BR/>" + ! "Here is the summury of the devices you used in your simulation." + ! "</P>\r\n<P>"); f_out.write(generate_html_node_info().toString()); + f_out.write("</P><BR/><BR/><P>" + + "Here is the transaction log of your simulation (taken from console)." + + "</P><P>"); f_out.write(generate_html_console_out_rapid().toString()); ! f_out.write("</P>\r\n" + ! "<!-- Appendix -->\r\n" ! + "Project page: <A HREF = \"http://sf.net/projects/javanetsim\">http://sf.net/projects/javanetsim</A>, if you found a bug, please, post it to <A HREF = \"http://sf.net/tracker/?atid=784685&group_id=152576\">http://sf.net/tracker/?atid=784685&group_id=152576</A>" + ! "<!-- close html file -->\r\n</HTML>"); f_out.close(); } catch (IOException ex) { addToConsole(ex.toString()); ! } } Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MenuBar.java 15 Sep 2007 11:34:58 -0000 1.14 --- MenuBar.java 15 Sep 2007 18:50:49 -0000 1.15 *************** *** 49,53 **** //HTML report generator menu ! private JMenuItem mnuGenRep = new JMenuItem("Generate HTML report"); //Add submenu private JMenu mnuAdd = new JMenu("Add"); //For Adding objects to simulation --- 49,53 ---- //HTML report generator menu ! private JMenuItem mnuGenRep = new JMenuItem("Generate HTML report..."); //Add submenu private JMenu mnuAdd = new JMenu("Add"); //For Adding objects to simulation *************** *** 198,202 **** mnuGenRep.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ ! controller.generate_html_report(); } }); --- 198,202 ---- mnuGenRep.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ ! controller.save_html_rep(null); } }); Index: EditRoutesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/EditRoutesDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** EditRoutesDialog.java 13 Sep 2007 13:38:52 -0000 1.2 --- EditRoutesDialog.java 15 Sep 2007 18:50:48 -0000 1.3 *************** *** 125,129 **** btnCancel.setText("Cancel"); this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); --- 125,130 ---- btnCancel.setText("Cancel"); this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); ! //this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); Index: SNMPSendDataDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SNMPSendDataDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SNMPSendDataDialog.java 22 Feb 2006 20:04:27 -0000 1.2 --- SNMPSendDataDialog.java 15 Sep 2007 18:50:49 -0000 1.3 *************** *** 122,126 **** this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); --- 122,127 ---- this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); ! //this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); |
From: gift <gi...@us...> - 2007-09-15 13:42:43
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24574/guiUI Modified Files: MainScreen.java Log Message: HTML generation to fila added. HTML headers added, HTML generation structure corrected. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** MainScreen.java 15 Sep 2007 12:36:21 -0000 1.58 --- MainScreen.java 15 Sep 2007 13:42:33 -0000 1.59 *************** *** 2837,2841 **** * Generates HTML code from text in console. * Is not used. generate_html_console_out_rapid is used instead. ! * * P.S. Generation is independent of mConsole structure => slower that generate_html_console_out_rapid. Has some bugs with coloring * that are not fixed due to my lazy mood. --- 2837,2841 ---- * Generates HTML code from text in console. * Is not used. generate_html_console_out_rapid is used instead. ! * @author gift (sourceforge.net user) * P.S. Generation is independent of mConsole structure => slower that generate_html_console_out_rapid. Has some bugs with coloring * that are not fixed due to my lazy mood. *************** *** 2918,2922 **** /** * Generates HTML code from text in console. ! * * P.S. Depends on mConsole structure => faster that generate_html_console_out and has less bugs with coloring :) */ --- 2918,2922 ---- /** * Generates HTML code from text in console. ! * @author gift (sourceforge.net user) * P.S. Depends on mConsole structure => faster that generate_html_console_out and has less bugs with coloring :) */ *************** *** 2926,2930 **** int clr = 0xFFFFFF; int r_c = mConsole.getRowCount(); ! StringBuffer out = new StringBuffer(655360); String cur; --- 2926,2930 ---- int clr = 0xFFFFFF; int r_c = mConsole.getRowCount(); ! StringBuffer out = new StringBuffer(655360); //640Kb for a log stripe String cur; *************** *** 2974,2977 **** --- 2974,3000 ---- return out; } + + /** + * Generates HTML code from text in node information. + * + * @author gift (sourceforge.net user) + */ + public StringBuffer generate_html_node_info(){ + + int i,j; + StringBuffer out = new StringBuffer(10240); //approx 10 units in simulation + String cur; + + if (true) + { + out.append("<BR />Sorry :) not implemented yet.<BR /><BR />"); + } else + { + out.append("<BR />Nothing to show in node information.<BR />"); + } + + return out; + } + class GraphicFilter extends FileFilter{ *************** *** 3243,3251 **** /** * Generates HTML report of the simulation ! * */ public void generate_html_report() ! { ! this.addToConsole(generate_html_console_out_rapid().toString()); } --- 3266,3295 ---- /** * Generates HTML report of the simulation ! * @author gift (sourceforge.net user) */ public void generate_html_report() ! { ! FileWriter f_out; ! ! try { ! f_out = new FileWriter("c:\\jns_rpt.htm"); ! ! f_out.write("<HTML>\r\n" + ! "<HEAD>\r\n" + ! "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=windows-1251\">\r\n" + ! "<META HTTP-EQUIV=\"Content-Style-Type\" CONTENT=\"text/css\">\r\n" + ! "<META HTTP-EQUIV=\"Author\" CONTENT=\"javaNetSim, http://sf.net/projects/javanetsim\">\r\n" + ! "<META HTTP-EQUIV=\"Keywords\" CONTENT=\"javaNetSim, network simulator, eth, ethernet, nets, ip, tcp, udp, switch, hub, dod\">\r\n" + ! "<!-- <LINK REL=stylesheet type=text/css href=\"style.css\"> -->\r\n" + ! "<TITLE>javaNetSim HTML report</TITLE>\r\n" + ! "</HEAD>\r\n\r\n"); ! f_out.write(generate_html_node_info().toString()); ! f_out.write(generate_html_console_out_rapid().toString()); ! f_out.write("\r\n<!-- close html file -->>\r\n</HTML>"); ! f_out.close(); ! } catch (IOException ex) { ! addToConsole(ex.toString()); ! } ! } |
From: gift <gi...@us...> - 2007-09-15 12:36:24
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30836/guiUI Modified Files: MainScreen.java Log Message: color bug fixed. HTML generation optimized. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** MainScreen.java 15 Sep 2007 11:56:38 -0000 1.57 --- MainScreen.java 15 Sep 2007 12:36:21 -0000 1.58 *************** *** 2836,2840 **** --- 2836,2843 ---- /** * Generates HTML code from text in console. + * Is not used. generate_html_console_out_rapid is used instead. * + * P.S. Generation is independent of mConsole structure => slower that generate_html_console_out_rapid. Has some bugs with coloring + * that are not fixed due to my lazy mood. */ public StringBuffer generate_html_console_out(){ *************** *** 2843,2847 **** int clr = 0xFFFFFF; int mask = 0xFFFFFF; ! StringBuffer out = new StringBuffer(655360); String cur; boolean color_selected = false; --- 2846,2859 ---- int clr = 0xFFFFFF; int mask = 0xFFFFFF; ! /* ! When I have done generate_html_console_out_rapid I decided to comment out StringBuffer(655360). There is a chance that java will allocate memory ;) ! If you plan to use generate_html_console_out instead of generate_html_console_out_rapid you'd better use StringBuffer(655360). ! */ ! ! // UNCOMMENT NEXT LINE ! //StringBuffer out = new StringBuffer(655360); ! // COMMENT NEXT LINE ! StringBuffer out = new StringBuffer(1024); ! String cur; boolean color_selected = false; *************** *** 2904,2909 **** } - class GraphicFilter extends FileFilter{ --- 2916,2978 ---- } + /** + * Generates HTML code from text in console. + * + * P.S. Depends on mConsole structure => faster that generate_html_console_out and has less bugs with coloring :) + */ + public StringBuffer generate_html_console_out_rapid(){ + + int i,j; + int clr = 0xFFFFFF; + int r_c = mConsole.getRowCount(); + StringBuffer out = new StringBuffer(655360); + String cur; + + if (mConsole.getColumnCount()>0 && r_c>0) + { + out.append("<TABLE align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" style='border:solid windowtext 1.0pt;'>\r\n<TR bgColor=#FFFFFF>"); + //Form table header + for (i=0; i<mConsole.getColumnCount(); i++) + { + out.append("<TD>" + mConsole.getColumnName(i) + "</TD>"); + } + out.append("</TR>\r\n<!-- main console output body -->\r\n\r\n"); + + //Form table body + for (j=0; j<r_c; j++) + { + //Select color for TR background + cur = (String) mConsole.getValueAt(j,3); + if(cur.contains("Network")){ + clr = NETWORK_LAYER_COLOR.getRGB(); + }else if(cur.contains("Link")){ + clr = LINK_LAYER_COLOR.getRGB(); + }else if(cur.contains("Transport")){ + clr = TRANSPORT_LAYER_COLOR.getRGB(); + }else if(cur.contains("Application")){ + clr = APPLICATION_LAYER_COLOR.getRGB(); + }else if(cur.contains("Hardware")){ + clr = HARDWARE_LAYER_COLOR.getRGB(); + }else if(cur.contains("*SYSTEM*")){ + clr = SYSTEM_LAYER_COLOR.getRGB(); + } + + //add table row + out.append("<TR bgColor=#" + String.format("%06X", clr & 0xFFFFFF) + ">\r\n"); + for (i=0; i<5; i++) + { + out.append("<TD vAlign=\"top\">" + (String) mConsole.getValueAt(j,i) + "</TD>"); + } + out.append("\r\n</TR>\r\n"); + } + out.append("</TABLE>\r\n<!-- main console output body end -->\r\n\r\n"); + } else + { + out.append("<BR />Nothing to show in simulation transactions.<BR />"); + } + + return out; + } class GraphicFilter extends FileFilter{ *************** *** 3178,3182 **** public void generate_html_report() { ! this.addToConsole(generate_html_console_out().toString()); } --- 3247,3251 ---- public void generate_html_report() { ! this.addToConsole(generate_html_console_out_rapid().toString()); } |
From: gift <gi...@us...> - 2007-09-15 11:56:44
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14558/guiUI Modified Files: MainScreen.java Log Message: buffer widening due to generate large reports (more than 4MB html files). Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** MainScreen.java 15 Sep 2007 11:34:58 -0000 1.56 --- MainScreen.java 15 Sep 2007 11:56:38 -0000 1.57 *************** *** 2843,2847 **** int clr = 0xFFFFFF; int mask = 0xFFFFFF; ! StringBuffer out = new StringBuffer(65536); String cur; boolean color_selected = false; --- 2843,2847 ---- int clr = 0xFFFFFF; int mask = 0xFFFFFF; ! StringBuffer out = new StringBuffer(655360); String cur; boolean color_selected = false; |
From: gift <gi...@us...> - 2007-09-15 11:35:12
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4186/guiUI Modified Files: LinkDialog.java MainScreen.java MenuBar.java PingDialog.java Log Message: HTML generation pattern added. Console HTML generation done. Some depricated methods replaced. Color usage optimized. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** MainScreen.java 14 Sep 2007 15:30:08 -0000 1.55 --- MainScreen.java 15 Sep 2007 11:34:58 -0000 1.56 *************** *** 214,218 **** private Hashtable GUInodeTable = new Hashtable(); ! //The File chooser class --- 214,224 ---- private Hashtable GUInodeTable = new Hashtable(); ! //Colors for console output ! private Color NETWORK_LAYER_COLOR = Color.CYAN; ! private Color LINK_LAYER_COLOR = Color.YELLOW; ! private Color TRANSPORT_LAYER_COLOR = Color.LIGHT_GRAY; ! private Color APPLICATION_LAYER_COLOR = Color.GREEN; ! private Color HARDWARE_LAYER_COLOR = Color.ORANGE; ! private Color SYSTEM_LAYER_COLOR = Color.RED ; //The File chooser class *************** *** 554,566 **** mConsole.setColumnIdentifiers(new Object[]{"Time","Node","Packet","Layer","Info"}); ! pnlConsole.getColumnModel().getColumn(0).setMaxWidth(100); ! pnlConsole.getColumnModel().getColumn(0).setMinWidth(100); ! pnlConsole.getColumnModel().getColumn(1).setMaxWidth(100); ! pnlConsole.getColumnModel().getColumn(1).setMinWidth(100); ! pnlConsole.getColumnModel().getColumn(2).setMaxWidth(200); ! pnlConsole.getColumnModel().getColumn(2).setMinWidth(200); ! pnlConsole.getColumnModel().getColumn(3).setMaxWidth(100); ! pnlConsole.getColumnModel().getColumn(3).setMinWidth(100); ! pnlConsole.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); } --- 560,579 ---- mConsole.setColumnIdentifiers(new Object[]{"Time","Node","Packet","Layer","Info"}); ! // pnlConsole.getColumnModel().getColumn(0).setMaxWidth(100); ! // pnlConsole.getColumnModel().getColumn(0).setMinWidth(100); ! // pnlConsole.getColumnModel().getColumn(1).setMaxWidth(100); ! // pnlConsole.getColumnModel().getColumn(1).setMinWidth(100); ! // pnlConsole.getColumnModel().getColumn(2).setMaxWidth(200); ! // pnlConsole.getColumnModel().getColumn(2).setMinWidth(200); ! // pnlConsole.getColumnModel().getColumn(3).setMaxWidth(100); ! // pnlConsole.getColumnModel().getColumn(3).setMinWidth(100); ! ! // pnlConsole.getColumnModel().getColumn(0).sizeWidthToFit(); ! // pnlConsole.getColumnModel().getColumn(1).sizeWidthToFit(); ! // pnlConsole.getColumnModel().getColumn(2).sizeWidthToFit(); ! // pnlConsole.getColumnModel().getColumn(3).sizeWidthToFit(); ! // pnlConsole.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); ! ! } *************** *** 1122,1126 **** dlgLink.setTitle("Create Link between " + inNode1 + " and " + inNode2 + "?"); ! dlgLink.show(); --- 1135,1140 ---- dlgLink.setTitle("Create Link between " + inNode1 + " and " + inNode2 + "?"); ! //dlgLink.show(); ! dlgLink.setVisible(true); *************** *** 1278,1282 **** dlgSendPing.setTitle("Send ping from " + inNodeName +" to ..."); ! dlgSendPing.show(); --- 1292,1297 ---- dlgSendPing.setTitle("Send ping from " + inNodeName +" to ..."); ! //dlgSendPing.show(); ! dlgSendPing.setVisible(true); *************** *** 1357,1375 **** return sdf.format(cal.getTime()); } ! public void insertInConsole(String Node, String Packet, String Layer, String Info){ mConsole.insertRow(mConsole.getRowCount(), new Object[]{now(), Node,Packet,Layer,Info}); ! if(Layer.contains("Network")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.CYAN); }else if(Layer.contains("Link")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.YELLOW); }else if(Layer.contains("Transport")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.LIGHT_GRAY); }else if(Layer.contains("Application")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.GREEN); }else if(Layer.contains("Hardware")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.ORANGE); }else if(Layer.contains("*SYSTEM*")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.RED); } --- 1372,1390 ---- return sdf.format(cal.getTime()); } ! public void insertInConsole(String Node, String Packet, String Layer, String Info){ mConsole.insertRow(mConsole.getRowCount(), new Object[]{now(), Node,Packet,Layer,Info}); ! if(Layer.contains("Network")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, this.NETWORK_LAYER_COLOR); }else if(Layer.contains("Link")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, this.LINK_LAYER_COLOR); }else if(Layer.contains("Transport")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, this.TRANSPORT_LAYER_COLOR); }else if(Layer.contains("Application")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, this.APPLICATION_LAYER_COLOR); }else if(Layer.contains("Hardware")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, this.HARDWARE_LAYER_COLOR); }else if(Layer.contains("*SYSTEM*")){ ! colorRenderer.setRowColor(mConsole.getRowCount() - 1, this.SYSTEM_LAYER_COLOR); } *************** *** 1464,1468 **** dlgNodeProperties.setTitle("Properties for " + inNodeName); ! dlgNodeProperties.show(); }catch(Exception ufe){ --- 1479,1484 ---- dlgNodeProperties.setTitle("Properties for " + inNodeName); ! //dlgNodeProperties.show(); ! dlgNodeProperties.setVisible(true); }catch(Exception ufe){ *************** *** 2810,2827 **** /** - * Clears the Console. - * - */ - - - public void clearConsole() - { mConsole.setRowCount(0); } --- 2826,2906 ---- /** * Clears the Console. * */ public void clearConsole() { mConsole.setRowCount(0); } + + /** + * Generates HTML code from text in console. + * + */ + public StringBuffer generate_html_console_out(){ + + int i,j; + int clr = 0xFFFFFF; + int mask = 0xFFFFFF; + StringBuffer out = new StringBuffer(65536); + String cur; + boolean color_selected = false; + + if (mConsole.getColumnCount()>0 && mConsole.getRowCount()>0) + { + out.append("<TABLE align=\"center\" cellSpacing=\"0\" cellPadding=\"0\" width=\"100%\" border=\"0\" style='border:solid windowtext 1.0pt;'>\r\n<TR bgColor=#FFFFFF>"); + //Form table header + for (i=0; i<mConsole.getColumnCount(); i++) + { + out.append("<TD>" + mConsole.getColumnName(i) + "</TD>"); + } + out.append("</TR>\r\n<!-- main console output body -->\r\n\r\n"); + + + //Form table body + for (j=0; j<mConsole.getRowCount(); j++) + { + color_selected = false; + cur = ""; + + //add table row + for (i=0; i<mConsole.getColumnCount(); i++) + { + cur += "<TD vAlign=\"top\">" + (String) mConsole.getValueAt(j,i) + "</TD>"; + //Select TR bgColor. + if (!color_selected) + { + if(cur.contains("Network")){ + clr = NETWORK_LAYER_COLOR.getRGB(); + color_selected = true; + }else if(cur.contains("Link")){ + clr = LINK_LAYER_COLOR.getRGB(); + color_selected = true; + }else if(cur.contains("Transport")){ + clr = TRANSPORT_LAYER_COLOR.getRGB(); + color_selected = true; + }else if(cur.contains("Application")){ + clr = APPLICATION_LAYER_COLOR.getRGB(); + color_selected = true; + }else if(cur.contains("Hardware")){ + clr = HARDWARE_LAYER_COLOR.getRGB(); + color_selected = true; + }else if(cur.contains("*SYSTEM*")){ + clr = SYSTEM_LAYER_COLOR.getRGB(); + color_selected = true; + } + } + } + //Integer.toHexString(clr).toUpperCase() + out.append("<TR bgColor=#" + String.format("%06X", clr & mask) + ">\r\n" + cur + "\r\n</TR>\r\n"); + } + out.append("</TABLE>\r\n<!-- main console output body end -->\r\n\r\n"); + } else + { + out.append("<BR />Nothing to show in simulation transactions.<BR />"); + } + + return out; + } *************** *** 3087,3095 **** help.setLocationRelativeTo(null); ! help.show(); } public void clearSaveAs() --- 3166,3183 ---- help.setLocationRelativeTo(null); ! //help.show(); ! help.setVisible(true); } + /** + * Generates HTML report of the simulation + * + */ + public void generate_html_report() + { + this.addToConsole(generate_html_console_out().toString()); + } public void clearSaveAs() *************** *** 3142,3145 **** --- 3230,3234 ---- { + this.setAllHighlightsOff(); *************** *** 3179,3185 **** return true; ! ! ! } --- 3268,3272 ---- return true; ! } Index: PingDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/PingDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PingDialog.java 13 Sep 2007 13:38:52 -0000 1.2 --- PingDialog.java 15 Sep 2007 11:34:58 -0000 1.3 *************** *** 115,119 **** { wasOkPressed = true; ! this.hide(); } else --- 115,120 ---- { wasOkPressed = true; ! //this.hide(); ! this.setVisible(false); } else Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MenuBar.java 14 Sep 2007 15:30:08 -0000 1.13 --- MenuBar.java 15 Sep 2007 11:34:58 -0000 1.14 *************** *** 47,52 **** private JCheckBoxMenuItem mnuMsgTransport = new JCheckBoxMenuItem("Transport Layer",true); private JCheckBoxMenuItem mnuMsgApplication = new JCheckBoxMenuItem("Application Layer",true); ! ! //Add submenu private JMenu mnuAdd = new JMenu("Add"); //For Adding objects to simulation --- 47,53 ---- private JCheckBoxMenuItem mnuMsgTransport = new JCheckBoxMenuItem("Transport Layer",true); private JCheckBoxMenuItem mnuMsgApplication = new JCheckBoxMenuItem("Application Layer",true); ! ! //HTML report generator menu ! private JMenuItem mnuGenRep = new JMenuItem("Generate HTML report"); //Add submenu private JMenu mnuAdd = new JMenu("Add"); //For Adding objects to simulation *************** *** 91,95 **** private void buildMenu(){ ! mnuNew.setAccelerator(KeyStroke.getKeyStroke("ctrl N")); mnuOpen.setAccelerator(KeyStroke.getKeyStroke("ctrl O")); mnuSave.setAccelerator(KeyStroke.getKeyStroke("ctrl S")); --- 92,96 ---- private void buildMenu(){ ! mnuNew.setAccelerator(KeyStroke.getKeyStroke("ctrl N")); mnuOpen.setAccelerator(KeyStroke.getKeyStroke("ctrl O")); mnuSave.setAccelerator(KeyStroke.getKeyStroke("ctrl S")); *************** *** 98,101 **** --- 99,103 ---- mnuHub.setAccelerator(KeyStroke.getKeyStroke("ctrl H")); mnuSwitch.setAccelerator(KeyStroke.getKeyStroke("ctrl W")); + mnuGenRep.setAccelerator(KeyStroke.getKeyStroke("ctrl G")); mnuClearConsole.setAccelerator(KeyStroke.getKeyStroke("F3")); *************** *** 121,124 **** --- 123,127 ---- //Add items to simulation menu + mnuSimulation.add(mnuGenRep); mnuSimulation.add(mnuAdd); mnuAdd.add(mnuPC); *************** *** 170,173 **** --- 173,177 ---- mnuRouter.setMnemonic('R'); mnuHub.setMnemonic('H'); + mnuGenRep.setMnemonic('G'); //mnuSwitch.setMnemonic('S'); *************** *** 190,193 **** --- 194,205 ---- + + //Add action listener to generate html report menuitem + mnuGenRep.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.generate_html_report(); + } + }); + //Add action listener to new Pc menuitem mnuPC.addActionListener(new ActionListener(){ Index: LinkDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/LinkDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** LinkDialog.java 13 Sep 2007 13:38:52 -0000 1.2 --- LinkDialog.java 15 Sep 2007 11:34:58 -0000 1.3 *************** *** 191,195 **** { wasOkPressed = true; ! this.hide(); } else --- 191,196 ---- { wasOkPressed = true; ! //this.hide(); ! this.setVisible(false); } else |
From: Alexander B. <da...@us...> - 2007-09-14 15:30:16
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22094/guiUI Modified Files: MainScreen.java MenuBar.java Log Message: Updated TODO, README, and vesrion. Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** MainScreen.java 14 Sep 2007 11:14:51 -0000 1.54 --- MainScreen.java 14 Sep 2007 15:30:08 -0000 1.55 *************** *** 894,898 **** public void addExternalNAT(Point inPoint){ ! String result = JOptionPane.showInputDialog(this,"Please enter a Proxy/Gateway to External network name:","Create New NAT Gateway to External network", JOptionPane.PLAIN_MESSAGE); if(result != null){ --- 894,898 ---- public void addExternalNAT(Point inPoint){ ! String result = JOptionPane.showInputDialog(this,"Please enter a Socks Proxy to External network name:","Create New Socks Proxy to External network", JOptionPane.PLAIN_MESSAGE); if(result != null){ Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** MenuBar.java 13 Sep 2007 20:23:29 -0000 1.12 --- MenuBar.java 14 Sep 2007 15:30:08 -0000 1.13 *************** *** 55,59 **** private JMenuItem mnuHub = new JMenuItem("Hub ..."); private JMenuItem mnuSwitch = new JMenuItem("Switch ..."); ! private JMenuItem mnuExternalNAT = new JMenuItem("Proxy/Router to External Network..."); //Tools submenu --- 55,59 ---- private JMenuItem mnuHub = new JMenuItem("Hub ..."); private JMenuItem mnuSwitch = new JMenuItem("Switch ..."); ! private JMenuItem mnuExternalNAT = new JMenuItem("Socks Proxy..."); //Tools submenu |
From: Alexander B. <da...@us...> - 2007-09-14 15:30:13
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22094/core Modified Files: Version.java Log Message: Updated TODO, README, and vesrion. Index: Version.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Version.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Version.java 22 Nov 2006 21:51:14 -0000 1.11 --- Version.java 14 Sep 2007 15:30:08 -0000 1.12 *************** *** 40,52 **** */ public class Version { ! public final static String CORE_VERSION = "v0.32.3"; //version of the simulation core ! public final static String YEARS = "2005 - 2006"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 10 Nov 2006", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", "Alexander Bolshev [Key]", "Project Leader / Developer / Maintainer", ! "Ilgar Alekperov [Gift]", "Developer / Configuration Developer", "Konstantin Karpov [QweR]", "Developer / Tester", "", "If you found a bug, please post it to: http://sf.net/tracker/?atid=784685&group_id=152576", --- 40,52 ---- */ public class Version { ! public final static String CORE_VERSION = "v0.33"; //version of the simulation core ! public final static String YEARS = "2005 - 2007"; public static final String TEAM_MEMBERS[] = { ! "http://sf.net/projects/javanetsim","release date: 26 Sep 2007", "", "fork of jFirewallSim project (http://sf.net/projects/jfirewallsim/)", "from 03 Nov 2005","", "Alexander Bolshev [Key]", "Project Leader / Developer / Maintainer", ! "Ilgar Alekperov [Gift]", "Developer / Tester", "Konstantin Karpov [QweR]", "Developer / Tester", "", "If you found a bug, please post it to: http://sf.net/tracker/?atid=784685&group_id=152576", |
From: Alexander B. <da...@us...> - 2007-09-14 15:30:12
|
Update of /cvsroot/javanetsim/javaNetSim In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22094 Modified Files: README.txt TODO.txt Log Message: Updated TODO, README, and vesrion. Index: TODO.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/TODO.txt,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TODO.txt 8 Nov 2006 14:27:29 -0000 1.22 --- TODO.txt 14 Sep 2007 15:30:08 -0000 1.23 *************** *** 4,11 **** *** Whole Project ! 1. SOA interfaces? Script language to operate sockets? Middleware emulation? ! 2. NAT gateway to external network. ! *** Documentation 1. Write documentation for routing functions in ProtocolStack, IPv4, Route_Entry. --- 4,18 ---- *** Whole Project ! 2. Socks Proxy(old -- Nat Gateway) to external network. ! 3. ReNew Console(IOS-similar command line) and normal config files. ! 4. VPN-client/VPN-gateway (sockets, RMI and Corba mechanisms) (or PPP Client/PPP Gateway -- ??) ! 5. Second level Switches (VLAN, etc...) ! 6. Normal SocketLayer (instead of current ugly mechanism) ! 7. Firewalls (NAT, PAT, etc) ! 8. Access-lists in Firewalls/Routers/PCs ! 9. DHCP server/clients, DNS. ! 10. Wi-Fi Access-Points and Wi-Fi adapters in PCs ! *** Documentation/Comments 1. Write documentation for routing functions in ProtocolStack, IPv4, Route_Entry. *************** *** 17,32 **** 2. Create _normal_ route table edit form (instead of route command). Use as template EditRoutesDialog.java. Note, that "route" command is only for ugly testing purposes! - 5. App setting SAVE/LOAD! 7. Fix LinkProperties Dialog: safe using (check for correct input values) (!!!, Gift!). 8. Add show switch cache dialog. *** Simulation Related *** Command Line Interface (CLI) Related - (useless tasks, CLI shall be removed in future) 0. Redevelop the CLI. - 1. The Command Line Interface DISPLAYNODES and DISPLAYLINKS functions do not output anything if there are no Nodes or Links in the Simulation. Same with the DISPLAYSCRIPT command, if the script is empty nothing is displayed. - 2. The Command Line Interface DISPLAYALLINFO command will instantiate more than one timer if you use it more than once. This will also cause the CLI to not exit normally when using 'exit' or 'quit'. - 3. In the CLI, a warning message is printed out if there are simulation network environment problems before using RUNSCRIPT. The CLI *may* fall over if you attempt to run the script when there are some environment problems. This hasn't been tested completely. - --- 24,34 ---- 2. Create _normal_ route table edit form (instead of route command). Use as template EditRoutesDialog.java. Note, that "route" command is only for ugly testing purposes! 7. Fix LinkProperties Dialog: safe using (check for correct input values) (!!!, Gift!). 8. Add show switch cache dialog. + 9. Device config save/load. *** Simulation Related *** Command Line Interface (CLI) Related 0. Redevelop the CLI. Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/README.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** README.txt 22 Nov 2006 21:51:14 -0000 1.11 --- README.txt 14 Sep 2007 15:30:08 -0000 1.12 *************** *** 3,7 **** ################################### ! Version: Public Release Version 0.32.3 Website: http://sf.net/projects/javanetsim Authors: See 'About' menu. --- 3,7 ---- ################################### ! Version: Public Release Version 0.33 Website: http://sf.net/projects/javanetsim Authors: See 'About' menu. *************** *** 18,22 **** 1. If you do not have the Java Runtime Environment (JRE) installed on your Operating System, the program will not be ! able to run. You must install the Java Runtime Environment 1.5.0_07 or later. This can be downloaded from www.java.com --- 18,22 ---- 1. If you do not have the Java Runtime Environment (JRE) installed on your Operating System, the program will not be ! able to run. You must install the Java Runtime Environment 1.6.0_01 or later. This can be downloaded from www.java.com *************** *** 24,28 **** to start the Graphical User Interface. ! Note: The Java Network Simulator has only been fully tested under WinXP and Linux (Gentoo/Fedora). While there should be no problem running on other platforms, unexpected results may possibly occur. --- 24,28 ---- to start the Graphical User Interface. ! Note: The Java Network Simulator has only been fully tested under WinXP/WinVista and Linux (Gentoo/Fedora). While there should be no problem running on other platforms, unexpected results may possibly occur. *************** *** 32,35 **** --- 32,52 ---- ********************* + ***** Release Version 0.33 16th September 2007 ***** + + Fixed + ----- + + GUI Issues - + + 1. Fixed Java 6 related bugs with some diaglogs. + + New Features + ------------ + + 1. Text packet log console replaced with nice color table. + 2. Print ARP Cache/Print Route Table results now shows in a separate window(insted of log console). + 3. New Turn On/Off network device function. + 4. Finally moved to Java 6 (1.6). + ***** Release Version 0.32.3 16th November 2006 ***** *************** *** 113,117 **** 2. Added 'readme/changelog' window and menu item. 3. Added switches(experimental). ! ***** Release Version 0.22.1 6th November 2005 ***** --- 130,137 ---- 2. Added 'readme/changelog' window and menu item. 3. Added switches(experimental). ! 4. Added routing. ! 5. Added TCP/UDP and some Applications (Telnet, TCP/UDP Echo and SNMP). ! 6. Added console for network level devices. ! 7. Added lines sieve feature. ***** Release Version 0.22.1 6th November 2005 ***** |
From: Alexander B. <da...@us...> - 2007-09-14 11:14:57
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16192/guiUI Modified Files: DataLinkLayerDevice.java GuiNode.java LinkProperties.java MainScreen.java NetworkLayerDevice.java breakLinkDialog.java Log Message: Fixed Java 6 related bugs in several Dialogs, introduced new function: Turn On/Off network device... Index: LinkProperties.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/LinkProperties.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LinkProperties.java 10 Nov 2006 19:40:15 -0000 1.6 --- LinkProperties.java 14 Sep 2007 11:14:51 -0000 1.7 *************** *** 123,127 **** btnCancel.setText("Cancel"); this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); --- 123,127 ---- btnCancel.setText("Cancel"); this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/NetworkLayerDevice.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NetworkLayerDevice.java 28 Feb 2006 16:55:35 -0000 1.8 --- NetworkLayerDevice.java 14 Sep 2007 11:14:51 -0000 1.9 *************** *** 125,135 **** private JMenuItem mnuArp = new JMenuItem("Print ARP Table"); - private JMenuItem mnuLink = new JMenuItem("Links properties"); - - private JMenuItem mnuBreakLink = new JMenuItem("Break link"); - - - - /** --- 125,128 ---- *************** *** 227,241 **** }); ! mnuBreakLink.addActionListener(new ActionListener(){ ! ! public void actionPerformed(ActionEvent e){ ! ! controller.showBreakLinkDialog(lblNodeName.getText()); ! ! } ! ! }); ! ! mnuPR.addActionListener(new ActionListener(){ --- 220,224 ---- }); ! mnuPR.addActionListener(new ActionListener(){ *************** *** 249,266 **** }); - mnuLink.addActionListener(new ActionListener(){ - - public void actionPerformed(ActionEvent e){ - - controller.showLinkDialog(lblNodeName.getText()); - - } - - }); - - - - - mnuShowCounters.addActionListener(new ActionListener(){ --- 232,235 ---- *************** *** 309,316 **** GuiNodePopMenu.add(mnuPR); - GuiNodePopMenu.add(mnuBreakLink); - - GuiNodePopMenu.add(mnuLink); - GuiNodePopMenu.add(mnuProperties); --- 278,281 ---- Index: breakLinkDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/breakLinkDialog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** breakLinkDialog.java 13 Sep 2007 13:38:53 -0000 1.3 --- breakLinkDialog.java 14 Sep 2007 11:14:51 -0000 1.4 *************** *** 1,310 **** /* 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 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.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; /** * * @author Key * * This class is a dialog that enables to remove links from the devices * */ public class breakLinkDialog extends javax.swing.JDialog { private JPanel backpanel; private JLabel lblInterface; private JLabel lblNodeName; private JComboBox cmbNodeName; private JComboBox cmbInterface; private JLabel lblError; private JButton btnOk; private MainScreen controller; private Simulation Sim; private SandBox SBox; private String NodeName; private String Interface; private boolean ErrorFlag = true; public breakLinkDialog(JFrame frame, Object nodeArray[], int selectedIndex, Simulation Sim, SandBox SBox) { super(frame); setResizable(false); controller = (MainScreen)frame; this.Sim = Sim; this.SBox = SBox; setTitle("Break link"); initGUI(nodeArray,selectedIndex); final JPanel panel = new JPanel(); getContentPane().add(panel, BorderLayout.SOUTH); btnOk = new JButton(); btnOk.setEnabled(true); btnOk.setToolTipText("Disconnect selected link!"); btnOk.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButton(); } }); btnOk.setName("btnOK"); panel.add(btnOk); btnOk.setText("OK"); final JButton btnCancel = new JButton(); btnCancel.setToolTipText("Cancel changes"); btnCancel.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButton(); } }); btnCancel.setName("btnCancel"); panel.add(btnCancel); btnCancel.setText("Cancel"); this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); this.setVisible(true); } private void initGUI(Object nodeArray[], int selectedIndex) { 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[] {}; backpanelLayout.rowWeights = new double[] {0.0}; backpanelLayout.rowHeights = new int[] {5,5,5,5}; backpanel.setLayout(backpanelLayout); { lblNodeName = new JLabel(); backpanel.add(lblNodeName, new GridBagConstraints( 0, 0, 1, 1, 0.0, 1.0, GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 21, 0)); lblNodeName.setText("Node Name:"); } { lblInterface = new JLabel(); backpanel.add(lblInterface, new GridBagConstraints( 0, 1, 1, 1, 0.0, 1.0, GridBagConstraints.LINE_END, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 27), 0, 0)); lblInterface.setText("Interface:"); } cmbNodeName = new JComboBox(nodeArray); cmbNodeName.setMinimumSize(new Dimension(100, 0)); cmbNodeName.setSelectedIndex(selectedIndex); cmbNodeName.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectNode(); } }); final GridBagConstraints gridBagConstraints = new GridBagConstraints(); gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints.anchor = GridBagConstraints.LINE_START; gridBagConstraints.gridy = 0; gridBagConstraints.gridx = 1; backpanel.add(cmbNodeName, gridBagConstraints); cmbInterface = new JComboBox(); cmbInterface.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectInterface(); } }); cmbInterface.setEnabled(false); final GridBagConstraints gridBagConstraints_1 = new GridBagConstraints(); gridBagConstraints_1.fill = GridBagConstraints.HORIZONTAL; gridBagConstraints_1.anchor = GridBagConstraints.LINE_START; gridBagConstraints_1.gridy = 1; gridBagConstraints_1.gridx = 1; backpanel.add(cmbInterface, gridBagConstraints_1); lblError = new JLabel(); lblError.setHorizontalTextPosition(SwingConstants.CENTER); lblError.setHorizontalAlignment(SwingConstants.CENTER); lblError.setAlignmentX(Component.CENTER_ALIGNMENT); lblError.setMinimumSize(new Dimension(100, 20)); lblError.setMaximumSize(new Dimension(100, 20)); lblError.setPreferredSize(new Dimension(100, 20)); lblError.setVisible(false); final GridBagConstraints gridBagConstraints_5 = new GridBagConstraints(); gridBagConstraints_5.anchor = GridBagConstraints.WEST; gridBagConstraints_5.insets = new Insets(0, 1, 0, 0); gridBagConstraints_5.fill = GridBagConstraints.BOTH; gridBagConstraints_5.gridwidth = 2; gridBagConstraints_5.gridy = 5; gridBagConstraints_5.gridx = 0; backpanel.add(lblError, gridBagConstraints_5); lblError.setText("Error Message!!!! Error"); if(selectedIndex == 0){ selectNode(); } } } catch (Exception e) { e.printStackTrace(); } } /** * This method is executed when the user hit's the enter button. * It will delete the link on selected interface. * * @author Key * */ private void okButton(){ try { if(NodeName != null && Interface != null){ String str = Sim.disconnectLink(NodeName, Interface); SBox.removeLine(str); controller.addToConsole(NodeName +"'s link on interface "+Interface+" has been disconnected!\n"); } this.dispose(); } catch (Exception e) { e.printStackTrace(); } } /** * This method is executed when the user hits the cancel button * @author luke_hamilton * @author Key * */ private void cancelButton(){ this.dispose(); } /** * This method will generate the data within the Interface combobox based * on the node that is selected. It will also get the default gateway if there is one set * for the node and add the text to the text field * * @author luke_hamilton * @author Key * */ private void selectNode(){ //Remove all items before regenerating the combobox. //This is because if a users selects the node twice, it would add the interfaces twice. cmbInterface.removeAllItems(); NodeName = (String)cmbNodeName.getSelectedItem(); try { Object nics[] = Sim.getAllInterfaces(NodeName); //Get object array of interface names //Sort the array Arrays.sort(nics); for (int i = 0; i < nics.length; i++) { //Add them to the combobox cmbInterface.addItem(nics[i]); } cmbInterface.setEnabled(true); } catch (Exception e) { //This should never happen e.printStackTrace(); } } /** * This method enabled's the IP Address text field once the interface has been selected. * This will also check the selected interface to see if the ip address has already been set * if so entering that ip address into the text field and then getting the set subnet mask for that * ip address. * @author Key */ private void selectInterface(){ Interface = (String)cmbInterface.getSelectedItem(); } } --- 1,620 ---- /* + 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 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.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; + + /** + * + * @author Key + * + * This class is a dialog that enables to remove links from the devices + * + */ + public class breakLinkDialog extends javax.swing.JDialog { + private JPanel backpanel; + private JLabel lblInterface; + private JLabel lblNodeName; + private JComboBox cmbNodeName; + private JComboBox cmbInterface; + private JLabel lblError; + private JButton btnOk; + + private MainScreen controller; + private Simulation Sim; + private SandBox SBox; + + private String NodeName; + private String Interface; + + private boolean ErrorFlag = true; + + public breakLinkDialog(JFrame frame, Object nodeArray[], int selectedIndex, Simulation Sim, SandBox SBox) { + super(frame); + setResizable(false); + controller = (MainScreen)frame; + this.Sim = Sim; + this.SBox = SBox; + setTitle("Break link"); + initGUI(nodeArray,selectedIndex); + + final JPanel panel = new JPanel(); + getContentPane().add(panel, BorderLayout.SOUTH); + + btnOk = new JButton(); + btnOk.setEnabled(true); + btnOk.setToolTipText("Disconnect selected link!"); + btnOk.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + okButton(); + } + }); + + btnOk.setName("btnOK"); + panel.add(btnOk); + btnOk.setText("OK"); + + final JButton btnCancel = new JButton(); + btnCancel.setToolTipText("Cancel changes"); + btnCancel.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + cancelButton(); + } + }); + btnCancel.setName("btnCancel"); + panel.add(btnCancel); + btnCancel.setText("Cancel"); + this.getRootPane().setDefaultButton(btnOk); ! ! this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); ! this.setLocationRelativeTo(null); + this.setModal(true); + this.setVisible(true); + + } + + private void initGUI(Object nodeArray[], int selectedIndex) { + 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[] {}; + backpanelLayout.rowWeights = new double[] {0.0}; + backpanelLayout.rowHeights = new int[] {5,5,5,5}; + backpanel.setLayout(backpanelLayout); + { + lblNodeName = new JLabel(); + backpanel.add(lblNodeName, new GridBagConstraints( + 0, + 0, + 1, + 1, + 0.0, + 1.0, + GridBagConstraints.LINE_END, + GridBagConstraints.HORIZONTAL, + new Insets(0, 0, 0, 0), + 21, + 0)); + lblNodeName.setText("Node Name:"); + } + { + lblInterface = new JLabel(); + backpanel.add(lblInterface, new GridBagConstraints( + 0, + 1, + 1, + 1, + 0.0, + 1.0, + GridBagConstraints.LINE_END, + GridBagConstraints.HORIZONTAL, + new Insets(0, 0, 0, 27), + 0, + 0)); + lblInterface.setText("Interface:"); + } + + cmbNodeName = new JComboBox(nodeArray); + cmbNodeName.setMinimumSize(new Dimension(100, 0)); + cmbNodeName.setSelectedIndex(selectedIndex); + cmbNodeName.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + selectNode(); + } + }); + final GridBagConstraints gridBagConstraints = new GridBagConstraints(); + gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints.anchor = GridBagConstraints.LINE_START; + gridBagConstraints.gridy = 0; + gridBagConstraints.gridx = 1; + backpanel.add(cmbNodeName, gridBagConstraints); + + cmbInterface = new JComboBox(); + cmbInterface.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + selectInterface(); + } + }); + cmbInterface.setEnabled(false); + + final GridBagConstraints gridBagConstraints_1 = new GridBagConstraints(); + gridBagConstraints_1.fill = GridBagConstraints.HORIZONTAL; + gridBagConstraints_1.anchor = GridBagConstraints.LINE_START; + gridBagConstraints_1.gridy = 1; + gridBagConstraints_1.gridx = 1; + backpanel.add(cmbInterface, gridBagConstraints_1); + + lblError = new JLabel(); + lblError.setHorizontalTextPosition(SwingConstants.CENTER); + lblError.setHorizontalAlignment(SwingConstants.CENTER); + lblError.setAlignmentX(Component.CENTER_ALIGNMENT); + lblError.setMinimumSize(new Dimension(100, 20)); + lblError.setMaximumSize(new Dimension(100, 20)); + lblError.setPreferredSize(new Dimension(100, 20)); + lblError.setVisible(false); + final GridBagConstraints gridBagConstraints_5 = new GridBagConstraints(); + gridBagConstraints_5.anchor = GridBagConstraints.WEST; + gridBagConstraints_5.insets = new Insets(0, 1, 0, 0); + gridBagConstraints_5.fill = GridBagConstraints.BOTH; + gridBagConstraints_5.gridwidth = 2; + gridBagConstraints_5.gridy = 5; + gridBagConstraints_5.gridx = 0; + backpanel.add(lblError, gridBagConstraints_5); + lblError.setText("Error Message!!!! Error"); + + + if(selectedIndex == 0){ + selectNode(); + } + + } + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * This method is executed when the user hit's the enter button. + * It will delete the link on selected interface. + * + * @author Key + * + */ + private void okButton(){ + try { + + if(NodeName != null && Interface != null){ + String str = Sim.disconnectLink(NodeName, Interface); + SBox.removeLine(str); + controller.addToConsole(NodeName +"'s link on interface "+Interface+" has been disconnected!\n"); + + } + + + this.dispose(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * This method is executed when the user hits the cancel button + * @author luke_hamilton + * @author Key + * + */ + private void cancelButton(){ + this.dispose(); + } + + /** + * This method will generate the data within the Interface combobox based + * on the node that is selected. It will also get the default gateway if there is one set + * for the node and add the text to the text field + * + * @author luke_hamilton + * @author Key + * + */ + private void selectNode(){ + + //Remove all items before regenerating the combobox. + //This is because if a users selects the node twice, it would add the interfaces twice. + cmbInterface.removeAllItems(); + + NodeName = (String)cmbNodeName.getSelectedItem(); + + try { + Object nics[] = Sim.getAllInterfaces(NodeName); //Get object array of interface names + + //Sort the array + Arrays.sort(nics); + + for (int i = 0; i < nics.length; i++) { //Add them to the combobox + cmbInterface.addItem(nics[i]); + } + cmbInterface.setEnabled(true); + + } catch (Exception e) { //This should never happen + e.printStackTrace(); + } + } + + /** + * This method enabled's the IP Address text field once the interface has been selected. + * This will also check the selected interface to see if the ip address has already been set + * if so entering that ip address into the text field and then getting the set subnet mask for that + * ip address. + * @author Key + */ + private void selectInterface(){ + Interface = (String)cmbInterface.getSelectedItem(); + } + + } + Index: DataLinkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/DataLinkLayerDevice.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DataLinkLayerDevice.java 13 Sep 2007 13:38:52 -0000 1.3 --- DataLinkLayerDevice.java 14 Sep 2007 11:14:50 -0000 1.4 *************** *** 1,99 **** /* 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.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JMenuItem; /** * <P>The DataLinkLayerDevice class is an abstract class used for further classification of Data </P> * <P>link layer devices such as Hub's and Switches. * * @author VC2 Team. * @since 15th November 2004 * @version v0.20 */ public abstract class DataLinkLayerDevice extends GuiNode { private JMenuItem mnuProperties = new JMenuItem("Properties ..."); 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"); ! ! /** * @param inName The name of the Data Link Layer Device * @param inMainscreen The JFrame that the router will be created on * @param imageLocation Location of the Image used on the GUI */ public DataLinkLayerDevice(String inName, MainScreen inMainScreen, String imageLocation) { super(inName, inMainScreen, imageLocation); 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()); ! } ! }); ! mnuReset.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.ResetHub(lblNodeName.getText()); } }); mnuShowState.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e){ controller.ShowHubState(lblNodeName.getText()); } }); ! 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); } } --- 1,165 ---- /* + 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.event.ActionEvent; + + import java.awt.event.ActionListener; + + import javax.swing.JMenuItem; + + /** + * <P>The DataLinkLayerDevice class is an abstract class used for further classification of Data </P> + * <P>link layer devices such as Hub's and Switches. + * + * @author VC2 Team. + * @since 15th November 2004 + * @version v0.20 + */ + + public abstract class DataLinkLayerDevice extends GuiNode { + + private JMenuItem mnuProperties = new JMenuItem("Properties ..."); + private JMenuItem mnuShowState = new JMenuItem("Show state"); + private JMenuItem mnuReset = new JMenuItem("Reset"); ! ! /** + * @param inName The name of the Data Link Layer Device + * @param inMainscreen The JFrame that the router will be created on + * @param imageLocation Location of the Image used on the GUI + */ + + public DataLinkLayerDevice(String inName, MainScreen inMainScreen, String imageLocation) { + super(inName, inMainScreen, imageLocation); + + mnuProperties.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.showPropertiesDialog(lblNodeName.getText()); + } + }); ! mnuReset.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.ResetHub(lblNodeName.getText()); + } + }); + + mnuShowState.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + controller.ShowHubState(lblNodeName.getText()); + } + }); + ! ! ! + GuiNodePopMenu.add(mnuProperties); + GuiNodePopMenu.add(mnuShowState); ! ! GuiNodePopMenu.add(mnuReset); } + } + Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** MainScreen.java 13 Sep 2007 20:23:29 -0000 1.53 --- MainScreen.java 14 Sep 2007 11:14:51 -0000 1.54 *************** *** 3407,3410 **** --- 3407,3432 ---- printLayerInfo(true); } + + public boolean isOn(String inNodeName){ + try{ + return Sim.getNode(inNodeName).On; + }catch(Exception e){ + return false; + } + } + + public String TurnDevice(String inNodeName){ + try{ + if(Sim.getNode(inNodeName).On == true){ + Sim.getNode(inNodeName).On = false; + return "Turn On"; + }else{ + Sim.getNode(inNodeName).On = true; + return "Turn Off"; + } + }catch(Exception e){ + return "??????"; + } + } /** *************** *** 3416,3421 **** * @param String inNodeName Name of node to server listen ! */ ! --- 3438,3442 ---- * @param String inNodeName Name of node to server listen ! */ Index: GuiNode.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GuiNode.java 26 Oct 2006 15:04:38 -0000 1.2 --- GuiNode.java 14 Sep 2007 11:14:51 -0000 1.3 *************** *** 1,470 **** ! /* ! 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. [...1419 lines suppressed...] ! ! * @param inDimension The current dimension of the sandBox. ! ! */ ! ! public void setCurrentSandboxDim(Dimension inDimension) ! ! { ! ! SandBoxHeight = (int)inDimension.getHeight(); ! ! SandBoxWidth = (int)inDimension.getWidth(); ! ! } ! ! ! ! ! } ! |
From: Alexander B. <da...@us...> - 2007-09-14 11:14:55
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16192/core Modified Files: NetworkInterfacePort.java Node.java Log Message: Fixed Java 6 related bugs in several Dialogs, introduced new function: Turn On/Off network device... Index: NetworkInterfacePort.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkInterfacePort.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NetworkInterfacePort.java 13 Sep 2007 13:38:52 -0000 1.4 --- NetworkInterfacePort.java 14 Sep 2007 11:14:49 -0000 1.5 *************** *** 1,103 **** /* Java Firewall Simulator (jFirewallSim) Copyright (c) 2004, jFirewallSim development team All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of the Canberra Institute of Technology nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package core; import java.io.Serializable; /** * A NetworkInterfacePort represents the physical interface between * a DataLinkLayerDevice and a physical Link (network cable). Think of it as a port * * <P>Different DataLinkLayerDevices can contain different numbers of NetworkInterfacesPorts. * A Hub often has 4 or 8 and a switch has 8, 16 or 32.</P> * * <P>In order for a DataLinkLayerDevice to be able to send or receive network information (packets), * there must be a Link (network cable) between at least 2 NetworkInterfaces.</P> * * <P>NetworkInterfacePotrs receive and send packets to and from DatalinkProtocols and * the Link object they are connected to.</P> * * @author bevan_valliess * @since 13 Nov 2004 * @version v0.20 */ public class NetworkInterfacePort extends NetworkInterface{ /** * Constructs a NetworkInterfacePort object with the name inName * and a reference to it's parent Node. * @author baven_calliess * @param inName - The name to give the NetworkInterface eg: eth0 * @param inParent - The Node that the NetworkInterface is to be added to, it's parent. * @version v0.20 */ protected NetworkInterfacePort(String inName, Node inParent) { super(inName,inParent); } /** * This method recevie a packet from a connected link and then pass it * to the node's protocolstack. Depending on the network any * testing of the packets headers may need to be inserted here. * @author bevan_calliess * @param inPacket - The packet being recived by this port * @version v0.20 */ protected void receivePacket(Packet inPacket) throws LowLinkException { parentNode.receivePacket(inPacket, name); ! return; } /** * This method sends a packet to a connected link Depending * it is used by the datalinkLayer devices to tansport * packets without any validation or data checking. * @author bevan_calliess * @author angela_brown * @param outPacket - A Packet * @version v0.20 */ protected void sendPacket(Packet outPacket) throws LowLinkException{ Ethernet_packet tempPacket = (Ethernet_packet)outPacket; EthernetLink temp = (EthernetLink)connectedLink; if(temp!=null){ temp.transportPacket(tempPacket,getSourceName()); } } /** * This method returns information about this InterfacePort * @author bevan_calliess * @return String - The details of Interface name Mac and Links * @version v0.20 */ protected String getDetails(){ return "Interface: "+name+"\t\tMAC: Not Applicable \t\t"+ getConnectLinkDetails(); } }//EOF --- 1,209 ---- /* + Java Firewall Simulator (jFirewallSim) + + Copyright (c) 2004, jFirewallSim development team All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are + permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, this list + of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other + materials provided with the distribution. + - Neither the name of the Canberra Institute of Technology nor the names of its + contributors may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package core; + import java.io.Serializable; + /** + * A NetworkInterfacePort represents the physical interface between + * a DataLinkLayerDevice and a physical Link (network cable). Think of it as a port + * + * <P>Different DataLinkLayerDevices can contain different numbers of NetworkInterfacesPorts. + * A Hub often has 4 or 8 and a switch has 8, 16 or 32.</P> + * + * <P>In order for a DataLinkLayerDevice to be able to send or receive network information (packets), + * there must be a Link (network cable) between at least 2 NetworkInterfaces.</P> + * + * <P>NetworkInterfacePotrs receive and send packets to and from DatalinkProtocols and + * the Link object they are connected to.</P> + * + * @author bevan_valliess + * @since 13 Nov 2004 + * @version v0.20 + */ + + public class NetworkInterfacePort extends NetworkInterface{ + + /** + * Constructs a NetworkInterfacePort object with the name inName + * and a reference to it's parent Node. + * @author baven_calliess + * @param inName - The name to give the NetworkInterface eg: eth0 + * @param inParent - The Node that the NetworkInterface is to be added to, it's parent. + * @version v0.20 + */ + protected NetworkInterfacePort(String inName, Node inParent) { + super(inName,inParent); + } + + + /** + * This method recevie a packet from a connected link and then pass it + * to the node's protocolstack. Depending on the network any + * testing of the packets headers may need to be inserted here. + * @author bevan_calliess + * @param inPacket - The packet being recived by this port + * @version v0.20 + */ + protected void receivePacket(Packet inPacket) throws LowLinkException { + if(!parentNode.On) return; + parentNode.receivePacket(inPacket, name); ! ! return; ! } + + /** + * This method sends a packet to a connected link Depending + * it is used by the datalinkLayer devices to tansport + * packets without any validation or data checking. + * @author bevan_calliess + * @author angela_brown + * @param outPacket - A Packet + * @version v0.20 + */ + protected void sendPacket(Packet outPacket) throws LowLinkException{ + + if(!parentNode.On) return; + Ethernet_packet tempPacket = (Ethernet_packet)outPacket; + EthernetLink temp = (EthernetLink)connectedLink; + + if(temp!=null){ + temp.transportPacket(tempPacket,getSourceName()); + } + } + + /** + * This method returns information about this InterfacePort + * @author bevan_calliess + * @return String - The details of Interface name Mac and Links + * @version v0.20 + */ + protected String getDetails(){ + return "Interface: "+name+"\t\tMAC: Not Applicable \t\t"+ getConnectLinkDetails(); + } + }//EOF + Index: Node.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Node.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Node.java 22 Feb 2006 20:04:27 -0000 1.7 --- Node.java 14 Sep 2007 11:14:49 -0000 1.8 *************** *** 125,129 **** public ProtocolStack NodeProtocolStack; ! protected String name; --- 125,131 ---- public ProtocolStack NodeProtocolStack; ! protected String name; ! ! public boolean On; *************** *** 149,157 **** protected Node(String inName, int inProtocolStackLayers) { ! NetworkInterfacetable = new Hashtable(); name=inName; ! if(inProtocolStackLayers != 1){ --- 151,159 ---- protected Node(String inName, int inProtocolStackLayers) { ! NetworkInterfacetable = new Hashtable(); name=inName; ! On = true; if(inProtocolStackLayers != 1){ |
From: QweR <qw...@us...> - 2007-09-13 20:23:36
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6925/guiUI Modified Files: MainScreen.java MenuBar.java Log Message: Èñïðàâëåíû Print Route Table è Print ARP Table Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** MainScreen.java 13 Sep 2007 15:07:20 -0000 1.52 --- MainScreen.java 13 Sep 2007 20:23:29 -0000 1.53 *************** *** 3231,3263 **** public void printARP(String inNodeName) - { ! ! try{ ! ! this.addToConsole("ARP entries for :" + inNodeName + "\n"); ! ! String ArpTable[] = Sim.getARPTable(inNodeName); ! ! for(int i=0;i<ArpTable.length;i++) ! ! { ! ! this.addToConsole(ArpTable[i] + "\n"); ! ! } ! ! ! ! } ! ! catch(Exception e) ! ! { ! ! //Should never get here. ! ! } ! } --- 3231,3248 ---- public void printARP(String inNodeName) { ! try{ ! String s = ""; ! s+="ARP entries for :" + inNodeName + "\n"; ! String ArpTable[] = Sim.getARPTable(inNodeName); ! for(int i=0;i<ArpTable.length;i++) ! { ! s+=ArpTable[i] + "\n"; ! } ! InfoBox ib = new InfoBox(this, "ARP table", s); ! } ! catch(Exception e){ ! //Should never get here. ! } } *************** *** 3640,3653 **** public void PrintRouteTable(String inNodeName){ 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"); ! } } --- 3625,3637 ---- public void PrintRouteTable(String inNodeName){ String routes[] = Sim.getRouteTableEntries(inNodeName); ! String s = ""; ! s+="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]); ! s+=routes[i] + "\t" + r.gateway + "\t" + r.genMask + "\t" + r.Type + "\t" + r.iFace + "\n"; } + InfoBox ib = new InfoBox(this, "Route table", s); + } Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** MenuBar.java 13 Sep 2007 19:59:57 -0000 1.11 --- MenuBar.java 13 Sep 2007 20:23:29 -0000 1.12 *************** *** 72,76 **** private JMenuItem mnuAbout = new JMenuItem("About..."); private JMenuItem mnuHelpPane = new JMenuItem("ReadMe/ChangeLog"); - private JMenuItem mnuHelpTestPane = new JMenuItem("Test"); --- 72,75 ---- *************** *** 155,164 **** mnuHelp.add(mnuHelpPane); mnuHelp.add(mnuAbout); - mnuHelp.add(mnuHelpTestPane); - mnuHelpTestPane.addActionListener(new ActionListener(){ - public void actionPerformed(ActionEvent e){ - InfoBox ib = new InfoBox(controller, "Test", "Testtestetstetstestestetestesttestest"); - } - }); // Set up Mnemonics for menu bar. --- 154,157 ---- |
From: QweR <qw...@us...> - 2007-09-13 20:01:01
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29512/guiUI Modified Files: MenuBar.java Added Files: InfoBox.java Log Message: Äîáàâëåí InfoBox Index: MenuBar.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MenuBar.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MenuBar.java 13 Sep 2007 13:38:52 -0000 1.10 --- MenuBar.java 13 Sep 2007 19:59:57 -0000 1.11 *************** *** 72,75 **** --- 72,76 ---- private JMenuItem mnuAbout = new JMenuItem("About..."); private JMenuItem mnuHelpPane = new JMenuItem("ReadMe/ChangeLog"); + private JMenuItem mnuHelpTestPane = new JMenuItem("Test"); *************** *** 154,158 **** mnuHelp.add(mnuHelpPane); mnuHelp.add(mnuAbout); ! // Set up Mnemonics for menu bar. --- 155,164 ---- mnuHelp.add(mnuHelpPane); mnuHelp.add(mnuAbout); ! mnuHelp.add(mnuHelpTestPane); ! mnuHelpTestPane.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! InfoBox ib = new InfoBox(controller, "Test", "Testtestetstetstestestetestesttestest"); ! } ! }); // Set up Mnemonics for menu bar. --- NEW FILE: InfoBox.java --- (This appears to be a binary file; contents omitted.) |
From: Alexander B. <da...@us...> - 2007-09-13 15:07:24
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv681/guiUI Modified Files: MainScreen.java Log Message: New color table used instead plain textarea for packets log. Some color/usability tuning and also testing of it needed... Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** MainScreen.java 22 Nov 2006 21:18:38 -0000 1.51 --- MainScreen.java 13 Sep 2007 15:07:20 -0000 1.52 *************** *** 128,131 **** --- 128,137 ---- import guiUI.RunCMD; import javax.swing.JViewport; + import javax.swing.table.*; + import java.awt.*; + import java.awt.event.*; + import javax.swing.*; + import java.util.*; + import java.text.SimpleDateFormat; *************** *** 218,228 **** //This is the consol window used to display feedback from the sim ! private JTextArea pnlConsole = new JTextArea(); private JTextArea pnlNodeInformation = new JTextArea(); ! ! ! ! private JScrollPane scrConsole = new JScrollPane(pnlConsole); private JScrollPane scrNodeInformation = new JScrollPane(pnlNodeInformation); --- 224,256 ---- //This is the consol window used to display feedback from the sim ! //private JTextArea pnlConsole = new JTextArea(); private JTextArea pnlNodeInformation = new JTextArea(); ! ! ColorRenderer colorRenderer; ! ! DefaultTableModel mConsole = new DefaultTableModel(); ! ! ! ! String columnNames[] = { "English", "Japanese", "Boolean", "Date", "ImageIcon" }; ! ! JTable pnlConsole = new JTable(mConsole) ! { ! public Class getColumnClass(int column) ! { ! return getValueAt(0, column).getClass(); ! } ! ! public Component prepareRenderer( ! TableCellRenderer renderer, int row, int column) ! { ! Component c = super.prepareRenderer(renderer, row, column); ! colorRenderer.setBackground(c, row, column); ! return c; ! } ! }; ! ! private JScrollPane scrConsole = new JScrollPane(pnlConsole); private JScrollPane scrNodeInformation = new JScrollPane(pnlNodeInformation); *************** *** 252,256 **** SimulationToolBar SimToolBar; ! /** --- 280,399 ---- SimulationToolBar SimToolBar; ! ! class ColorRenderer implements ActionListener ! { ! private JTable table; ! private AbstractTableModel model; ! private Map colors; ! private Point location; ! ! public ColorRenderer(JTable table) ! { ! this.table = table; ! model = (AbstractTableModel)table.getModel(); ! colors = new HashMap(); ! location = new Point(); ! } ! ! public void setBackground(Component c, int row, int column) ! { ! if ( table.isCellSelected(row, column) ) return; ! ! if (c instanceof DefaultTableCellRenderer) ! { ! c.setBackground( table.getBackground() ); ! } ! ! column = table.convertColumnIndexToModel(column); ! ! // cell color ! ! Object key = getKey(row, column); ! Object o = colors.get( key ); ! ! if (o != null) ! { ! c.setBackground( (Color)o ); ! return; ! } ! ! // row color ! ! key = getKey(row, -1); ! o = colors.get( key ); ! ! if (o != null) ! { ! c.setBackground( (Color)o ); ! return; ! } ! ! // column color ! ! key = getKey(-1, column); ! o = colors.get( key ); ! ! if (o != null) ! { ! c.setBackground( (Color)o ); ! return; ! } ! ! } ! ! public void setCellColor(int row, int column, Color color) ! { ! Point key = new Point(row, column); ! colors.put(key, color); ! } ! ! public void setColumnColor(int column, Color color) ! { ! setCellColor(-1, column, color); ! } ! ! public void setRowColor(int row, Color color) ! { ! setCellColor(row, -1, color); ! } ! ! private Object getKey(int row, int column) ! { ! location.x = row; ! location.y = column; ! return location; ! } ! ! public void actionPerformed(ActionEvent e) ! { ! ! Iterator it = colors.keySet().iterator(); ! ! while ( it.hasNext() ) ! { ! Point key = (Point)it.next(); ! int row = key.x; ! int column = key.y; ! ! if (column == -1) ! { ! model.fireTableRowsUpdated(row, row); ! } ! else if (row == -1) ! { ! int rows = table.getRowCount(); ! ! for (int i = 0; i < rows; i++) ! { ! model.fireTableCellUpdated(i, column); ! } ! } ! else ! { ! model.fireTableCellUpdated(row, column); ! } ! } ! } ! } /** *************** *** 375,379 **** tabConsole.add("Node Information", scrNodeInformation); ! pnlConsole.setEditable(false); pnlNodeInformation.setEditable(false); --- 518,523 ---- tabConsole.add("Node Information", scrNodeInformation); ! //EDITABLE << FIXME!!! ! //pnlConsole.setEditable(false); pnlNodeInformation.setEditable(false); *************** *** 406,411 **** //this.setExtendedState(MAXIMIZED_BOTH); ! ! } --- 550,566 ---- //this.setExtendedState(MAXIMIZED_BOTH); ! ! colorRenderer = new ColorRenderer( pnlConsole ); ! ! mConsole.setColumnIdentifiers(new Object[]{"Time","Node","Packet","Layer","Info"}); ! pnlConsole.getColumnModel().getColumn(0).setMaxWidth(100); ! pnlConsole.getColumnModel().getColumn(0).setMinWidth(100); ! pnlConsole.getColumnModel().getColumn(1).setMaxWidth(100); ! pnlConsole.getColumnModel().getColumn(1).setMinWidth(100); ! pnlConsole.getColumnModel().getColumn(2).setMaxWidth(200); ! pnlConsole.getColumnModel().getColumn(2).setMinWidth(200); ! pnlConsole.getColumnModel().getColumn(3).setMaxWidth(100); ! pnlConsole.getColumnModel().getColumn(3).setMinWidth(100); ! pnlConsole.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); } *************** *** 547,551 **** this.setAllHighlightsOff(); ! pnlConsole.append("Added PC "+result+" to simulation\n"); } catch (InvalidNodeNameException e) { --- 702,708 ---- this.setAllHighlightsOff(); ! //pnlConsole.append("Added PC "+result+" to simulation\n"); ! ! //mConsole.insertRow(mConsole.getRowCount(), new Object[]{"1","2,"3","4"}); } catch (InvalidNodeNameException e) { *************** *** 637,641 **** this.setAllHighlightsOff(); ! pnlConsole.append("Added Router "+result+" to simulation \n"); } catch (InvalidNodeNameException e) { --- 794,798 ---- this.setAllHighlightsOff(); ! //pnlConsole.append("Added Router "+result+" to simulation \n"); } catch (InvalidNodeNameException e) { *************** *** 701,705 **** this.setAllHighlightsOff(); ! pnlConsole.append("Added Hub "+result+" to simulation\n"); } catch (InvalidNodeNameException e) { --- 858,862 ---- this.setAllHighlightsOff(); ! //pnlConsole.append("Added Hub "+result+" to simulation\n"); } catch (InvalidNodeNameException e) { *************** *** 763,767 **** this.setAllHighlightsOff(); ! pnlConsole.append("Added Hub "+result+" to simulation\n"); } catch (InvalidNodeNameException e) { --- 920,924 ---- this.setAllHighlightsOff(); ! //pnlConsole.append("Added Hub "+result+" to simulation\n"); } catch (InvalidNodeNameException e) { *************** *** 827,831 **** this.setAllHighlightsOff(); ! pnlConsole.append("Added Switch "+result+" to simulation\n"); } catch (InvalidNodeNameException e) { --- 984,988 ---- this.setAllHighlightsOff(); ! //pnlConsole.append("Added Switch "+result+" to simulation\n"); } catch (InvalidNodeNameException e) { *************** *** 1011,1015 **** tempSecondNode.setConnectedLinkName(strLinkName,2, inNode1); ! pnlConsole.append("Added Link between "+ inNode1 +" and " + inNode2 + "\n"); } --- 1168,1172 ---- tempSecondNode.setConnectedLinkName(strLinkName,2, inNode1); ! //pnlConsole.append("Added Link between "+ inNode1 +" and " + inNode2 + "\n"); } *************** *** 1147,1174 **** } ! catch(LowLinkException e){ ! ! pnlConsole.append(e.toString()+"\n"); } catch(CommunicationException e){ ! ! pnlConsole.append(e.toString()+"\n"); } catch(InvalidNetworkLayerDeviceException e){ ! ! pnlConsole.append(e.toString()+"\n"); ! } catch(InvalidNodeNameException e){ ! ! // This should never be actually thrown ! ! pnlConsole.append(e.toString()+"\n"); ! } --- 1304,1323 ---- } ! catch(LowLinkException e){ ! insertInConsole("(none)", "(none)", "*SYSTEM*", e.toString()); } catch(CommunicationException e){ ! insertInConsole("(none)", "(none)", "*SYSTEM*", e.toString()); } catch(InvalidNetworkLayerDeviceException e){ ! insertInConsole("(none)", "(none)", "*SYSTEM*", e.toString()); } catch(InvalidNodeNameException e){ ! insertInConsole("(none)", "(none)", "*SYSTEM*", e.toString()); } *************** *** 1191,1209 **** setStatus("Starting network transfer..."); ! pnlConsole.append("**************************************************************************************************************** \n"); ! pnlConsole.append("Starting network transfer... \n"); ! pnlConsole.append("**************************************************************************************************************** \n"); ! pnlConsole.append("\n"); } public void printLayerInfo(boolean header){ ! if(header) pnlConsole.append("\n"); Vector vecRecordedInfo = Sim.getRecordedInfo(); --- 1340,1383 ---- setStatus("Starting network transfer..."); ! //pnlConsole.append("**************************************************************************************************************** \n"); ! //pnlConsole.append("Starting network transfer... \n"); ! //pnlConsole.append("**************************************************************************************************************** \n"); ! //pnlConsole.append("\n"); } + + public static final String DATE_FORMAT_NOW = "HH:mm:ss-SSS"; + public static String now() { + Calendar cal = Calendar.getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); + return sdf.format(cal.getTime()); + } + + public void insertInConsole(String Node, String Packet, String Layer, String Info){ + mConsole.insertRow(mConsole.getRowCount(), new Object[]{now(), Node,Packet,Layer,Info}); + if(Layer.contains("Network")){ + colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.CYAN); + }else if(Layer.contains("Link")){ + colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.YELLOW); + }else if(Layer.contains("Transport")){ + colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.LIGHT_GRAY); + }else if(Layer.contains("Application")){ + colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.GREEN); + }else if(Layer.contains("Hardware")){ + colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.ORANGE); + }else if(Layer.contains("*SYSTEM*")){ + colorRenderer.setRowColor(mConsole.getRowCount() - 1, Color.RED); + } + + } public void printLayerInfo(boolean header){ ! //if(header) pnlConsole.append("\n"); Vector vecRecordedInfo = Sim.getRecordedInfo(); *************** *** 1216,1224 **** if(header){ ! pnlConsole.append("**************************************************************************************************************** \n"); ! pnlConsole.append("The following is a record of the last Transactions movements. \n"); ! pnlConsole.append("**************************************************************************************************************** \n"); } --- 1390,1398 ---- if(header){ ! //pnlConsole.append("**************************************************************************************************************** \n"); ! //pnlConsole.append("The following is a record of the last Transactions movements. \n"); ! //pnlConsole.append("**************************************************************************************************************** \n"); } *************** *** 1238,1242 **** 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"); } --- 1412,1417 ---- 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"); ! insertInConsole(recording[1], packet, layer, recording[5]); } *************** *** 1244,1248 **** if(header){ ! pnlConsole.append("****************************************************************************************************************\n"); } --- 1419,1423 ---- if(header){ ! //pnlConsole.append("****************************************************************************************************************\n"); } *************** *** 1254,1267 **** public void addFooter(){ ! pnlConsole.append("****************************************************************************************************************\n"); } public void addHeader(){ ! pnlConsole.append("**************************************************************************************************************** \n"); ! pnlConsole.append("The following is a record of the last Transactions movements. \n"); ! pnlConsole.append("**************************************************************************************************************** \n"); } /** --- 1429,1442 ---- public void addFooter(){ ! //pnlConsole.append("****************************************************************************************************************\n"); } public void addHeader(){ ! //pnlConsole.append("**************************************************************************************************************** \n"); ! //pnlConsole.append("The following is a record of the last Transactions movements. \n"); ! //pnlConsole.append("**************************************************************************************************************** \n"); } /** *************** *** 1683,1687 **** this.Sandbox.repaint(); ! pnlConsole.append(inNode.getName() +", and any connected links have been deleted\n"); this.refreshNodeInformationTab(); --- 1858,1862 ---- this.Sandbox.repaint(); ! //pnlConsole.append(inNode.getName() +", and any connected links have been deleted\n"); this.refreshNodeInformationTab(); *************** *** 2531,2536 **** Sim.Reset(InNodeName); ! pnlConsole.append("Device " + InNodeName + " reseted.\n"); ! } --- 2706,2710 ---- Sim.Reset(InNodeName); ! insertInConsole(InNodeName, "(none)", "Hardware", "Device reseted."); } *************** *** 2647,2654 **** public void clearConsole() ! { ! ! pnlConsole.setText(""); ! } --- 2821,2826 ---- public void clearConsole() ! { ! mConsole.setRowCount(0); } *************** *** 3040,3045 **** public void addToConsole(String msg){ ! pnlConsole.append(msg); ! } --- 3212,3217 ---- public void addToConsole(String msg){ ! //pnlConsole.append(msg); ! System.out.println("CONSOLE:!!!!" + msg); } |
From: Alexander B. <da...@us...> - 2007-09-13 13:39:13
|
Update of /cvsroot/javanetsim/javaNetSim/textUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28933/textUI Modified Files: README.txt TextUI.java Log Message: Fix dev tree; fixed Java 1.66 bug in Set TCP/IP Properties dialog. Index: TextUI.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/textUI/TextUI.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** TextUI.java 8 Nov 2005 04:05:43 -0000 1.1.1.1 --- TextUI.java 13 Sep 2007 13:38:53 -0000 1.2 *************** *** 1,1598 **** ! /* ! 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. [...3169 lines suppressed...] ! } catch (IOException e) { ! System.out.println("IO Exception encountered."); ! } ! ! if(response.equalsIgnoreCase("Y")){ ! sim.removeAllObjects(); ! System.out.println("New Simulation created\n"); ! isDirty = false; ! } ! }else{ ! System.out.println(); ! } ! } ! ! ! }//EOF ! ! \ No newline at end of file Index: README.txt =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/textUI/README.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README.txt 8 Nov 2005 04:05:43 -0000 1.1.1.1 --- README.txt 13 Sep 2007 13:38:53 -0000 1.2 *************** *** 1 **** ! This directory is to contain all textUi file for the jfirewallsim project --- 1 ---- ! This directory is to contain all textUi file for the jfirewallsim project |
From: Alexander B. <da...@us...> - 2007-09-13 13:39:08
|
Update of /cvsroot/javanetsim/javaNetSim/HtmlHelp In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28933/HtmlHelp Modified Files: GUI-tutorial.htm about.htm credits.htm introduction.htm toc.html Log Message: Fix dev tree; fixed Java 1.66 bug in Set TCP/IP Properties dialog. Index: about.htm =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/HtmlHelp/about.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** about.htm 8 Nov 2005 04:05:43 -0000 1.1.1.1 --- about.htm 13 Sep 2007 13:38:51 -0000 1.2 *************** *** 1,29 **** ! <html> ! ! <head> ! <meta http-equiv="Content-Language" content="en-us"> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>New Page 1</title> ! </head> ! ! <body> ! ! <p align="center"><font size="5"> About The jNetSim Project. </font></p> ! ! ! ! ! <p>The jNetSim project is a java based network and firewall simulator that will one day allows users to set and test the effectiveness of firewall rules (as accurately as possible) using either a command line interface or GUI. The project is coded in java and is cross platform compatible. The simulation is designed to be separate from the GUI.</p> ! <p>The jFirewallsim project was started by students from the Canberra Institute of Technology in Canberra, Australia. Each year the students in their final semester studying for a Diploma in Software Development, creates a new project or extend on an existing one. Currently (Semester 2, 2004) we are in the second phase of the jFirewallSim project. ! <p>The jFirewallsim project was renamed to jNetSim project by new maintainer Alexande Bolshev [Key]. ! ! <!--The jFirewallSim is the major project for the VC (Virtual Consultancy) class. The VC class is two days a week, for six hours each day and aims to give the students a taste of what it is like to work on a "real life" project. The jFirewallSim will be used as a teaching aid, to help the Network Engineering students at CIT understand how a network operates. </p> ! --> ! <p><a href="toc.html"> ! <img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! ! </html> --- 1,29 ---- ! <html> ! ! <head> ! <meta http-equiv="Content-Language" content="en-us"> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>New Page 1</title> ! </head> ! ! <body> ! ! <p align="center"><font size="5"> About The jNetSim Project. </font></p> ! ! ! ! ! <p>The jNetSim project is a java based network and firewall simulator that will one day allows users to set and test the effectiveness of firewall rules (as accurately as possible) using either a command line interface or GUI. The project is coded in java and is cross platform compatible. The simulation is designed to be separate from the GUI.</p> ! <p>The jFirewallsim project was started by students from the Canberra Institute of Technology in Canberra, Australia. Each year the students in their final semester studying for a Diploma in Software Development, creates a new project or extend on an existing one. Currently (Semester 2, 2004) we are in the second phase of the jFirewallSim project. ! <p>The jFirewallsim project was renamed to jNetSim project by new maintainer Alexande Bolshev [Key]. ! ! <!--The jFirewallSim is the major project for the VC (Virtual Consultancy) class. The VC class is two days a week, for six hours each day and aims to give the students a taste of what it is like to work on a "real life" project. The jFirewallSim will be used as a teaching aid, to help the Network Engineering students at CIT understand how a network operates. </p> ! --> ! <p><a href="toc.html"> ! <img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! ! </html> Index: GUI-tutorial.htm =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/HtmlHelp/GUI-tutorial.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** GUI-tutorial.htm 8 Nov 2005 04:05:43 -0000 1.1.1.1 --- GUI-tutorial.htm 13 Sep 2007 13:38:51 -0000 1.2 *************** *** 1,78 **** ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ! "http://www.w3.org/TR/html4/loose.dtd"> ! <html> ! <head> ! <title>Untitled Document</title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! </head> ! ! <body> ! <h1>Graphical User Interface Tutorial </h1> ! <h2>Introduction </h2> ! <p>When the Java Firewall Simulator GUI starts a new window is created. It is divided into two areas: The main area and the console window. The main area is where the nodes and links are created. In the console window we display all of the information relating to the current simulation on screen. </p> ! <p><img src="images/Sim4_sm.gif" width="249" height="168"></p> ! <p><strong>Creating a new simulation </strong></p> ! <p>To create a new simulation the user must select one of the following options: </p> ! <ul> ! <li> File > New from the menu </li> ! <li>Select the New icon form the toolbar </li> ! </ul> ! <p>A dialog box will appear to confirm the creation of a new simulation. </p> ! <p><em>Please note </em>: Selecting yes' in the dialog box, will override the current simulation. </p> ! <p><strong>Adding a PC </strong></p> ! <p>To add a PC the user must select one of the following two options: </p> ! <ul> ! <li> Simulation > Add > PC from the menu </li> ! <li> Select the PC icon from the toolbar </li> ! </ul> ! <p>As a result of one of these options a dialog box will appear asking the user to enter a name for the PC. Once a valid PC name has been entered, the PC icon is successfully dropped into the main screen. </p> ! <p><strong>Adding a Hub </strong></p> ! <p>To add a Hub the user must select one of the following two options: </p> ! <ul> ! <li> Simulation > Add > Hub from the menu </li> ! <li>Select the Hub icon from the toolbar </li> ! </ul> ! <p>As a result of one of these options a dialog box will appear asking the user to enter a name for the Hub. Once a valid Hub name has been entered, the Hub icon is successfully dropped into the main screen. </p> ! <p><strong>Adding a Router </strong></p> ! <p>To add a Router the user must select one of the following two options: </p> ! <ul> ! <li>Simulation > Add > Router from the menu </li> ! <li>Select the Router icon from the toolbar </li> ! </ul> ! <p>As a result of one of these options a dialog box will appear asking the user to enter a name for the Router. Once a valid Router name has been entered, the Router icon is successfully dropped into the main screen. </p> ! <p><strong>Adding a Link </strong></p> ! <p>To add a Link connecting two nodes the user must select the Link icon from the toolbar. As a result of Link being selected from the toolbar the user must then click on the first node, drag the mouse over to the second node and then release the mouse button. As a result of this action a dialog box will appear, informing the user of, the name of the link and the nodes interfaces the link will be connected to. </p> ! <p><strong>Deleting a Node </strong></p> ! <p>To delete a node right click on the selected node and choose delete' from the menu options. This will delete the node from the simulation. </p> ! <p><strong>Sending a Ping </strong></p> ! <p>To send a ping the user must right click on the selected PC and choose send ping' from the menu options. As a result of this action a dialog box will appear asking the user to enter the IP address of the PC they wish to ping. Information will be displayed to the console window informing the user of latest transaction result.</p> ! <p><img src="images/Sim1_PingInfo_sm.gif" width="249" height="260"></p> ! <p><strong>Setting TCP/IP Properties </strong></p> ! <p>To set the TCP/IP properties of node the user must select one of the following two options: </p> ! <ul> ! <li> Simulation > Set TCP/IP Properties from the menu </li> ! <li> Right click on a particular PC or Router and select Set TCP/IP properties' from the menu options.</li> ! </ul> ! <p>As a result of the one of these options a dialog box will appear asking the user to select the Node Name and the Interface Name. Enter in the IP Address, and the Default Gateway. If all fields are valid a message will be displayed to the console confirming the properties have been set. </p> ! <p><em>Please note: </em> In order to set the TCP/IP properties there must be at least one node created in the simulation. </p> ! <p><strong>Node Properties </strong></p> ! <p>To display the properties of a particular node right click on the selected node and choose properties' from the menu options. This will display the node information in the console window. </p> ! <p><img src="images/Sim1_NodeInfo_sm.gif" width="250" height="188"></p> ! <p><strong>Print ARP Table </strong></p> ! <p>To print out the ARP table of a particular node, right click on it and select Print ARP table' from the menu options. This will display the ARP table for that node in the console window. <strong></strong></p> ! <p><strong>Clearing the console </strong></p> ! <p>To clear the console window, select Environment > Clear Console' from the menu bar. </p> ! <p><strong>Clearing the Node Information </strong></p> ! <p>To clear the node information, select Environment > Clear Node Information' from the menu bar. </p> ! <p><strong>Creating Scenarios </strong></p> ! <p>To create a pre-saved scenario select Simulation > Scenario > Selected Scenario' from the menu bar. </p> ! <ul> ! <li> Test 1: Creates two connected PC's </li> ! <li> Test 2: Creates two PC's connected via a router </li> ! <li> Test 3: Creates two PC's connected through two Routers </li> ! <li> Test 4: Creates threes PC's connected to Hub1, which is connected to a Router. The Router is then connected to Hub2 which is connected to a further three PC's.</li> ! </ul> ! <p><a href="toc.html"><img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! </html> --- 1,78 ---- ! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ! "http://www.w3.org/TR/html4/loose.dtd"> ! <html> ! <head> ! <title>Untitled Document</title> ! <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> ! </head> ! ! <body> ! <h1>Graphical User Interface Tutorial </h1> ! <h2>Introduction </h2> ! <p>When the Java Firewall Simulator GUI starts a new window is created. It is divided into two areas: The main area and the console window. The main area is where the nodes and links are created. In the console window we display all of the information relating to the current simulation on screen. </p> ! <p><img src="images/Sim4_sm.gif" width="249" height="168"></p> ! <p><strong>Creating a new simulation </strong></p> ! <p>To create a new simulation the user must select one of the following options: </p> ! <ul> ! <li> File > New from the menu </li> ! <li>Select the New icon form the toolbar </li> ! </ul> ! <p>A dialog box will appear to confirm the creation of a new simulation. </p> ! <p><em>Please note </em>: Selecting yes' in the dialog box, will override the current simulation. </p> ! <p><strong>Adding a PC </strong></p> ! <p>To add a PC the user must select one of the following two options: </p> ! <ul> ! <li> Simulation > Add > PC from the menu </li> ! <li> Select the PC icon from the toolbar </li> ! </ul> ! <p>As a result of one of these options a dialog box will appear asking the user to enter a name for the PC. Once a valid PC name has been entered, the PC icon is successfully dropped into the main screen. </p> ! <p><strong>Adding a Hub </strong></p> ! <p>To add a Hub the user must select one of the following two options: </p> ! <ul> ! <li> Simulation > Add > Hub from the menu </li> ! <li>Select the Hub icon from the toolbar </li> ! </ul> ! <p>As a result of one of these options a dialog box will appear asking the user to enter a name for the Hub. Once a valid Hub name has been entered, the Hub icon is successfully dropped into the main screen. </p> ! <p><strong>Adding a Router </strong></p> ! <p>To add a Router the user must select one of the following two options: </p> ! <ul> ! <li>Simulation > Add > Router from the menu </li> ! <li>Select the Router icon from the toolbar </li> ! </ul> ! <p>As a result of one of these options a dialog box will appear asking the user to enter a name for the Router. Once a valid Router name has been entered, the Router icon is successfully dropped into the main screen. </p> ! <p><strong>Adding a Link </strong></p> ! <p>To add a Link connecting two nodes the user must select the Link icon from the toolbar. As a result of Link being selected from the toolbar the user must then click on the first node, drag the mouse over to the second node and then release the mouse button. As a result of this action a dialog box will appear, informing the user of, the name of the link and the nodes interfaces the link will be connected to. </p> ! <p><strong>Deleting a Node </strong></p> ! <p>To delete a node right click on the selected node and choose delete' from the menu options. This will delete the node from the simulation. </p> ! <p><strong>Sending a Ping </strong></p> ! <p>To send a ping the user must right click on the selected PC and choose send ping' from the menu options. As a result of this action a dialog box will appear asking the user to enter the IP address of the PC they wish to ping. Information will be displayed to the console window informing the user of latest transaction result.</p> ! <p><img src="images/Sim1_PingInfo_sm.gif" width="249" height="260"></p> ! <p><strong>Setting TCP/IP Properties </strong></p> ! <p>To set the TCP/IP properties of node the user must select one of the following two options: </p> ! <ul> ! <li> Simulation > Set TCP/IP Properties from the menu </li> ! <li> Right click on a particular PC or Router and select Set TCP/IP properties' from the menu options.</li> ! </ul> ! <p>As a result of the one of these options a dialog box will appear asking the user to select the Node Name and the Interface Name. Enter in the IP Address, and the Default Gateway. If all fields are valid a message will be displayed to the console confirming the properties have been set. </p> ! <p><em>Please note: </em> In order to set the TCP/IP properties there must be at least one node created in the simulation. </p> ! <p><strong>Node Properties </strong></p> ! <p>To display the properties of a particular node right click on the selected node and choose properties' from the menu options. This will display the node information in the console window. </p> ! <p><img src="images/Sim1_NodeInfo_sm.gif" width="250" height="188"></p> ! <p><strong>Print ARP Table </strong></p> ! <p>To print out the ARP table of a particular node, right click on it and select Print ARP table' from the menu options. This will display the ARP table for that node in the console window. <strong></strong></p> ! <p><strong>Clearing the console </strong></p> ! <p>To clear the console window, select Environment > Clear Console' from the menu bar. </p> ! <p><strong>Clearing the Node Information </strong></p> ! <p>To clear the node information, select Environment > Clear Node Information' from the menu bar. </p> ! <p><strong>Creating Scenarios </strong></p> ! <p>To create a pre-saved scenario select Simulation > Scenario > Selected Scenario' from the menu bar. </p> ! <ul> ! <li> Test 1: Creates two connected PC's </li> ! <li> Test 2: Creates two PC's connected via a router </li> ! <li> Test 3: Creates two PC's connected through two Routers </li> ! <li> Test 4: Creates threes PC's connected to Hub1, which is connected to a Router. The Router is then connected to Hub2 which is connected to a further three PC's.</li> ! </ul> ! <p><a href="toc.html"><img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! </html> Index: introduction.htm =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/HtmlHelp/introduction.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** introduction.htm 8 Nov 2005 04:05:43 -0000 1.1.1.1 --- introduction.htm 13 Sep 2007 13:38:51 -0000 1.2 *************** *** 1,48 **** ! <html> ! ! <head> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>New Page 1</title> ! </head> ! ! <body> ! ! <p align="center"><b><font size="5">Introduction</font></b></p> ! <p align="center"> </p> ! <p align="left"><u><font size="4">Screen Layout</font></u></p> ! <p align="center"> ! <img border="0" src="images/screeninformation.JPG" width="1011" height="805"></p> ! <p align="left"> </p> ! <ol> ! <li> ! <p align="left">Menu Bar, most components available on toolbars are also ! available via the Menu</li> ! <li> ! <p align="left">Node Toolbar which allows the creation of various nodes such ! as PC's, Router, Switches, Hubs and Links.</li> ! <li> ! <p align="left">Simulation Toolbar which allow the creation of new Simulations ! and the saving, loading of Simulations.</li> ! <li> ! <p align="left">The "Sandbox". Nodes are placed and moved around the ! sandbox. Think of this as where your simulation lives!</li> ! <li> ! <p align="left">Console tab. This tab will display output from Nodes to ! the area designated as 7.</li> ! <li> ! <p align="left">Node Information Tab. This tab will display information ! about the make up the simulation such as the nodes current default gateway and ! how it's interface cards are setup</li> ! <li> ! <p align="left">Information area. This is where information from the ! Console and Node Information tabs will be displayed.</li> ! </ol> ! <p align="left"> </p> ! <p align="left"><a href="toc.html"> ! <img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! </html> \ No newline at end of file --- 1,48 ---- ! <html> ! ! <head> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>New Page 1</title> ! </head> ! ! <body> ! ! <p align="center"><b><font size="5">Introduction</font></b></p> ! <p align="center"> </p> ! <p align="left"><u><font size="4">Screen Layout</font></u></p> ! <p align="center"> ! <img border="0" src="images/screeninformation.JPG" width="1011" height="805"></p> ! <p align="left"> </p> ! <ol> ! <li> ! <p align="left">Menu Bar, most components available on toolbars are also ! available via the Menu</li> ! <li> ! <p align="left">Node Toolbar which allows the creation of various nodes such ! as PC's, Router, Switches, Hubs and Links.</li> ! <li> ! <p align="left">Simulation Toolbar which allow the creation of new Simulations ! and the saving, loading of Simulations.</li> ! <li> ! <p align="left">The "Sandbox". Nodes are placed and moved around the ! sandbox. Think of this as where your simulation lives!</li> ! <li> ! <p align="left">Console tab. This tab will display output from Nodes to ! the area designated as 7.</li> ! <li> ! <p align="left">Node Information Tab. This tab will display information ! about the make up the simulation such as the nodes current default gateway and ! how it's interface cards are setup</li> ! <li> ! <p align="left">Information area. This is where information from the ! Console and Node Information tabs will be displayed.</li> ! </ol> ! <p align="left"> </p> ! <p align="left"><a href="toc.html"> ! <img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! </html> \ No newline at end of file Index: credits.htm =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/HtmlHelp/credits.htm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** credits.htm 8 Nov 2005 04:05:43 -0000 1.1.1.1 --- credits.htm 13 Sep 2007 13:38:51 -0000 1.2 *************** *** 1,43 **** ! <html> ! ! <head> ! <meta http-equiv="Content-Language" content="en-us"> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>New Page 1</title> ! </head> ! ! <body> ! ! <p align="center"><font size="5"> jNetSim Credits </font></p> ! <p> </p> ! <p>jNetSim was created by : </p> ! <p><u><b><font size="5">from 03 November 2005</font></b></u><br> ! </p> ! <p>Alexander Bolshev [Key] - Project Manager / Documentation Manager / Developer / Maintainer</p> ! ! <p><u><b><font size="5">Semester 2, 2004</font></b></u><br> ! </p> ! <p>Angela Brown - Project Manager / Documentation Manager / Developer </p> ! <p>Bevan Calliess - Disaster Recovery Manager / Assistant Project Manager ! / Developer</p> ! <p><br> ! Luke Hamilton - Documentation Manager / Project Manager / Developer</p> ! <p><br> ! Michael Reith - Testing Manager / Assistant Release Manager / Developer</p> ! <p><br> ! Rob Hulford - Release Manager / Assistant Disaster Recovery Manager / Developer</p> ! <p><br> ! <u><b><font size="5">Semester 1, 2004</font></b></u></p> ! <p><br> ! Tristan Veness - Project Manager / Developer</p> ! <p><br> ! James Nikolaidis - Developer</p> ! <p> </p> ! <p><a href="toc.html"> ! <img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! ! </html> --- 1,43 ---- ! <html> ! ! <head> ! <meta http-equiv="Content-Language" content="en-us"> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>New Page 1</title> ! </head> ! ! <body> ! ! <p align="center"><font size="5"> jNetSim Credits </font></p> ! <p> </p> ! <p>jNetSim was created by : </p> ! <p><u><b><font size="5">from 03 November 2005</font></b></u><br> ! </p> ! <p>Alexander Bolshev [Key] - Project Manager / Documentation Manager / Developer / Maintainer</p> ! ! <p><u><b><font size="5">Semester 2, 2004</font></b></u><br> ! </p> ! <p>Angela Brown - Project Manager / Documentation Manager / Developer </p> ! <p>Bevan Calliess - Disaster Recovery Manager / Assistant Project Manager ! / Developer</p> ! <p><br> ! Luke Hamilton - Documentation Manager / Project Manager / Developer</p> ! <p><br> ! Michael Reith - Testing Manager / Assistant Release Manager / Developer</p> ! <p><br> ! Rob Hulford - Release Manager / Assistant Disaster Recovery Manager / Developer</p> ! <p><br> ! <u><b><font size="5">Semester 1, 2004</font></b></u></p> ! <p><br> ! Tristan Veness - Project Manager / Developer</p> ! <p><br> ! James Nikolaidis - Developer</p> ! <p> </p> ! <p><a href="toc.html"> ! <img border="0" src="images/back.gif" width="42" height="22"><b>Back</b></a></p> ! ! </body> ! ! </html> Index: toc.html =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/HtmlHelp/toc.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** toc.html 8 Nov 2005 04:05:43 -0000 1.1.1.1 --- toc.html 13 Sep 2007 13:38:51 -0000 1.2 *************** *** 1,32 **** ! <html> ! ! <head> ! <meta http-equiv="Content-Language" content="en-us"> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>JFirewallSim Help Files</title> ! </head> ! ! <body> ! ! <p align="center"><font size="6"><b>j</b></font><b><font size="6">FirewallSim ! Help Files</font></b></p> ! <p align="center"> ! <img border="0" src="images/firewall.gif" width="222" height="149"></p> ! <p align="center"> </p> ! <p align="center"> </p> ! <p align="left"><font size="4">Welcome to jFirewallSim. These help files ! will assist you in a basic introduction to the use of jFirewallSim.</font></p> ! <p align="left"><font size="4">Please select from the following.</font></p> ! <p align="left"> </p> ! <ol> ! <li><a href="about.htm">About</a></li> ! <li><a href="GUI-tutorial.htm">GUI tutorial</a></li> ! <li><a href="credits.htm">Credits</a></li> ! </ol> ! <p> </p> ! ! </body> ! ! </html> --- 1,32 ---- ! <html> ! ! <head> ! <meta http-equiv="Content-Language" content="en-us"> ! <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> ! <meta name="ProgId" content="FrontPage.Editor.Document"> ! <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> ! <title>JFirewallSim Help Files</title> ! </head> ! ! <body> ! ! <p align="center"><font size="6"><b>j</b></font><b><font size="6">FirewallSim ! Help Files</font></b></p> ! <p align="center"> ! <img border="0" src="images/firewall.gif" width="222" height="149"></p> ! <p align="center"> </p> ! <p align="center"> </p> ! <p align="left"><font size="4">Welcome to jFirewallSim. These help files ! will assist you in a basic introduction to the use of jFirewallSim.</font></p> ! <p align="left"><font size="4">Please select from the following.</font></p> ! <p align="left"> </p> ! <ol> ! <li><a href="about.htm">About</a></li> ! <li><a href="GUI-tutorial.htm">GUI tutorial</a></li> ! <li><a href="credits.htm">Credits</a></li> ! </ol> ! <p> </p> ! ! </body> ! ! </html> |
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28933/guiUI Modified Files: DataLinkLayerDevice.java EditRoutesDialog.java GuiHub.java GuiPC.java GuiRouter.java GuiSwitch.java LinkDialog.java LinkLayerPanel.java MANIFEST MenuBar.java NodePropertiesDialog.java PingDialog.java README.txt SandBox.java SetTCPIPPropertiesDialog.java StandardToolBar.java ToolBar.java breakLinkDialog.java Log Message: Fix dev tree; fixed Java 1.66 bug in Set TCP/IP Properties dialog. Index: LinkLayerPanel.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/LinkLayerPanel.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** LinkLayerPanel.java 8 Nov 2005 04:04:22 -0000 1.1.1.1 --- LinkLayerPanel.java 13 Sep 2007 13:38:52 -0000 1.2 *************** *** 1,129 **** ! /* ! 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.BasicStroke; ! import java.awt.Graphics; ! import java.awt.Graphics2D; ! import java.awt.geom.*; ! import java.awt.Color; ! import java.awt.Point; ! import java.util.Hashtable; ! import java.util.Enumeration; ! ! import javax.swing.JPanel; ! ! /** ! * This object is an extension of the Java Swing JPanel. ! * It has been extended so that we can overide the paint method ! * and use it to draw the various links. It will be inserted into the ! * bottom layer of a layered pane so that it always sits behind the ! * various Nodes being displayed on teh screen. ! * ! * @author bevan_calliess ! * ! */ ! ! public class LinkLayerPanel extends JPanel { ! ! final static String FAKELINE = new String("FakeLine"); ! final static BasicStroke stroke = new BasicStroke(3.0f); ! final static Color linkCol = Color.BLUE; ! private Hashtable LineTable = new Hashtable(); ! ! ! /** ! * This method will take the name of the Link and the starting ! * and ending points that it is drawn between. ! * A 2DLine object is created using these co-ordinates and then ! * it is added to a hashTable using the name as a key ! * so that it can be located and moved and/or removed as required. ! * @param inName Used as the key for the hashTable ! * @param inStart Used for the first set of co-ordinates p1x and p1y ! * @param inEnd Used for the second set of co-ordinates p2x and p2y ! */ ! public void addLine(String inName,Point inStart, Point inEnd){ ! Line2D.Double Line = new Line2D.Double(inStart.x,inStart.y,inEnd.x,inEnd.y); ! LineTable.put(inName,Line); ! repaint(); ! } ! /** ! * This method will remove a line from the hashtable so that ! * it will no longer be drawn. ! * @param inName ! */ ! public void removeLine(String inName){ ! LineTable.remove(inName); ! repaint(); ! } ! ! /** ! * This method is Used to move the co-ordinates of a particular ! * line in the hashTable. ! * ! * @param inName Key to the HashTable.(linkName) ! * @param inWhichEnd Which set of co_ordinates to move p1 or p2 ! * @param inPosition The position to move those cordinates to. ! */ ! public void moveLine(String inName,int inWhichEnd,Point inPosition){ ! if(LineTable.containsKey(inName)) ! { ! Line2D.Double myLine = (Line2D.Double)LineTable.get(inName); ! if(inWhichEnd == 1){ ! Point2D p1 = (Point2D)inPosition; ! Point2D p2 = myLine.getP2(); ! myLine.setLine(p1,p2); ! }else{ ! Point2D p1 = myLine.getP1(); ! Point2D p2 = (Point2D)inPosition; ! myLine.setLine(p1,p2); ! } ! repaint(); ! } ! ! } ! ! /** ! * Overides the standard paint method so that it ! * draws the various lines on the screen. ! */ ! public void paint(Graphics g) ! { ! super.paint(g); ! Graphics2D g2D = (Graphics2D)g; ! g2D.setStroke(stroke); ! g2D.setPaint(linkCol); ! ! Enumeration it = LineTable.elements(); ! ! while(it.hasMoreElements()){ ! Line2D.Double myLine = (Line2D.Double)it.nextElement(); ! g2D.draw(myLine); ! } ! } ! } --- 1,129 ---- ! /* ! 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.BasicStroke; ! import java.awt.Graphics; ! import java.awt.Graphics2D; ! import java.awt.geom.*; ! import java.awt.Color; ! import java.awt.Point; ! import java.util.Hashtable; ! import java.util.Enumeration; ! ! import javax.swing.JPanel; ! ! /** ! * This object is an extension of the Java Swing JPanel. ! * It has been extended so that we can overide the paint method ! * and use it to draw the various links. It will be inserted into the ! * bottom layer of a layered pane so that it always sits behind the ! * various Nodes being displayed on teh screen. ! * ! * @author bevan_calliess ! * ! */ ! ! public class LinkLayerPanel extends JPanel { ! ! final static String FAKELINE = new String("FakeLine"); ! final static BasicStroke stroke = new BasicStroke(3.0f); ! final static Color linkCol = Color.BLUE; ! private Hashtable LineTable = new Hashtable(); ! ! ! /** ! * This method will take the name of the Link and the starting ! * and ending points that it is drawn between. ! * A 2DLine object is created using these co-ordinates and then ! * it is added to a hashTable using the name as a key ! * so that it can be located and moved and/or removed as required. ! * @param inName Used as the key for the hashTable ! * @param inStart Used for the first set of co-ordinates p1x and p1y ! * @param inEnd Used for the second set of co-ordinates p2x and p2y ! */ ! public void addLine(String inName,Point inStart, Point inEnd){ ! Line2D.Double Line = new Line2D.Double(inStart.x,inStart.y,inEnd.x,inEnd.y); ! LineTable.put(inName,Line); ! repaint(); ! } ! /** ! * This method will remove a line from the hashtable so that ! * it will no longer be drawn. ! * @param inName ! */ ! public void removeLine(String inName){ ! LineTable.remove(inName); ! repaint(); ! } ! ! /** ! * This method is Used to move the co-ordinates of a particular ! * line in the hashTable. ! * ! * @param inName Key to the HashTable.(linkName) ! * @param inWhichEnd Which set of co_ordinates to move p1 or p2 ! * @param inPosition The position to move those cordinates to. ! */ ! public void moveLine(String inName,int inWhichEnd,Point inPosition){ ! if(LineTable.containsKey(inName)) ! { ! Line2D.Double myLine = (Line2D.Double)LineTable.get(inName); ! if(inWhichEnd == 1){ ! Point2D p1 = (Point2D)inPosition; ! Point2D p2 = myLine.getP2(); ! myLine.setLine(p1,p2); ! }else{ ! Point2D p1 = myLine.getP1(); ! Point2D p2 = (Point2D)inPosition; ! myLine.setLine(p1,p2); ! } ! repaint(); ! } ! ! } ! ! /** ! * Overides the standard paint method so that it ! * draws the various lines on the screen. ! */ ! public void paint(Graphics g) ! { ! super.paint(g); ! Graphics2D g2D = (Graphics2D)g; ! g2D.setStroke(stroke); ! g2D.setPaint(linkCol); ! ! Enumeration it = LineTable.elements(); ! ! while(it.hasMoreElements()){ ! Line2D.Double myLine = (Line2D.Double)it.nextElement(); ! g2D.draw(myLine); ! } ! } ! } Index: GuiPC.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiPC.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GuiPC.java 19 Nov 2005 13:07:37 -0000 1.2 --- GuiPC.java 13 Sep 2007 13:38:52 -0000 1.3 *************** *** 1,48 **** ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! package guiUI; ! ! /** ! * <P>The GuiPC class is used to instantiate new PC on the GUI</P> ! * ! * @author VC2 Team. ! * @since 15th November 2004 ! * @version v0.20 ! */ ! ! public class GuiPC extends ApplicationLayerDevice { ! ! /** ! * @param inName The name of the PC ! * @param inMainscreen The JFrame that the router will be created on ! */ ! ! public GuiPC(String inName, MainScreen inMainScreen){ ! super(inName, inMainScreen, "images/simulation/PC_large.gif"); ! } ! } --- 1,48 ---- ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! package guiUI; ! ! /** ! * <P>The GuiPC class is used to instantiate new PC on the GUI</P> ! * ! * @author VC2 Team. ! * @since 15th November 2004 ! * @version v0.20 ! */ ! ! public class GuiPC extends ApplicationLayerDevice { ! ! /** ! * @param inName The name of the PC ! * @param inMainscreen The JFrame that the router will be created on ! */ ! ! public GuiPC(String inName, MainScreen inMainScreen){ ! super(inName, inMainScreen, "images/simulation/PC_large.gif"); ! } ! } Index: EditRoutesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/EditRoutesDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EditRoutesDialog.java 8 Nov 2005 21:04:54 -0000 1.1 --- EditRoutesDialog.java 13 Sep 2007 13:38:52 -0000 1.2 *************** *** 1,565 **** ! /* ! 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. [...1101 lines suppressed...] ! * This method will check for a possible default subnet address as the user ! * is typing in an ip address. Once one is found it will add it to the txtSubnetMak ! * text field. ! * @author luke_hamilton ! * ! */ ! private void checkForDefaultSubnet(){ ! String tempip = txtIpAddress.getText(); ! ! if(Simulation.validateDecIP(tempip)){ ! String tempSubnet = Simulation.getDefaultSubnetMask(tempip); ! txtSubnetMask.setText(tempSubnet); ! txtSubnetMask.setEnabled(true); ! btnOk.setEnabled(true); ! }else{ ! txtSubnetMask.setText("Enter Subnet Mask"); ! txtSubnetMask.setEnabled(false); ! } ! } ! } Index: NodePropertiesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/NodePropertiesDialog.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** NodePropertiesDialog.java 8 Nov 2005 04:04:35 -0000 1.1.1.1 --- NodePropertiesDialog.java 13 Sep 2007 13:38:52 -0000 1.2 *************** *** 1,128 **** ! /* ! 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 javax.swing.JButton; ! import javax.swing.JDialog; ! import javax.swing.JPanel; ! import javax.swing.*; ! import java.awt.event.*; ! import java.awt.*; ! import java.util.*; ! import javax.swing.table.*; ! ! /** ! * This class is used to display general information about a ! * GUINode. It will display the IP Address information including ! * default gateway and any Interface specific information such as ! * the Current IP address and subnetmask. ! * @author Michael ! */ ! public class NodePropertiesDialog extends JDialog implements ActionListener ! { ! ! private JLabel lblNodeNameLabel = new JLabel("Node Name : "); ! private JLabel lblNodeName = new JLabel(); ! private JLabel lblGatewayLabel = new JLabel("Default Gateway : "); ! private JLabel lblGatewayAddress = new JLabel(); ! private JButton btnOK = new JButton("OK"); ! ! JPanel pnlNodeNameDetails = new JPanel(); ! JPanel pnlGatewayDetails = new JPanel(); ! ! JPanel pnlOKButton = new JPanel(); ! ! public NodePropertiesDialog(JFrame frame, Vector inVectorMasterList){ ! super(frame); ! ArrayList aryColumnNames = new ArrayList(); ! aryColumnNames.add("Name"); ! aryColumnNames.add("Gateway"); ! aryColumnNames.add("Interface Name"); ! aryColumnNames.add("MAC Address"); ! aryColumnNames.add("IP Address"); ! aryColumnNames.add("Subnet Mask"); ! aryColumnNames.add("Link Name"); ! ! Vector col = new Vector(aryColumnNames); ! JTable tblInfo = new JTable(inVectorMasterList, col); ! TableModel model = tblInfo.getModel(); ! ! // Remove the first 2 column names ! lblNodeName.setText(tblInfo.getModel().getValueAt(0, 0).toString()); ! tblInfo.getColumnModel().removeColumn(tblInfo.getColumnModel().getColumn(0)); ! lblGatewayAddress.setText(tblInfo.getModel().getValueAt(0, 1).toString()); ! tblInfo.getColumnModel().removeColumn(tblInfo.getColumnModel().getColumn(0)); ! ! //Makes uneditable ! tblInfo.setEnabled(false); ! tblInfo.getTableHeader().setReorderingAllowed(false); ! JScrollPane scrPane = new JScrollPane(tblInfo); ! ! ! //ArrayList temp = (ArrayList)inArrayMasterList.get(0); ! //lblNodeName.setText((String)temp.get(0)); ! //lblGatewayAddress.setText((String)temp.get(1)); ! ! JPanel pnlPropertiesScreen = (JPanel)this.getContentPane(); ! pnlPropertiesScreen.setLayout(new BoxLayout(pnlPropertiesScreen, BoxLayout.Y_AXIS)); ! pnlNodeNameDetails.setLayout(new FlowLayout()); ! pnlOKButton.setLayout(new FlowLayout()); ! ! pnlNodeNameDetails.setPreferredSize(new Dimension(50,50)); ! pnlNodeNameDetails.add(lblNodeNameLabel); ! pnlNodeNameDetails.add(lblNodeName); ! pnlGatewayDetails.add(lblGatewayLabel); ! pnlGatewayDetails.add(lblGatewayAddress); ! pnlPropertiesScreen.add(pnlNodeNameDetails); ! pnlPropertiesScreen.add(pnlGatewayDetails); ! pnlPropertiesScreen.add(scrPane); ! pnlOKButton.add(btnOK); ! pnlPropertiesScreen.add(pnlOKButton); ! ! this.setSize(700,200); ! this.setLocationRelativeTo(null); ! this.setModal(true); ! this.setResizable(false); ! btnOK.setToolTipText("Close the screen"); ! ! //Set default button to be btnOK ! this.getRootPane().setDefaultButton(btnOK); ! btnOK.addActionListener(this); ! } ! ! ! public void actionPerformed(ActionEvent e) ! { ! if(e.getSource() == btnOK) ! { ! ! this.dispose(); ! } ! } ! ! } --- 1,128 ---- ! /* ! 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 javax.swing.JButton; ! import javax.swing.JDialog; ! import javax.swing.JPanel; ! import javax.swing.*; ! import java.awt.event.*; ! import java.awt.*; ! import java.util.*; ! import javax.swing.table.*; ! ! /** ! * This class is used to display general information about a ! * GUINode. It will display the IP Address information including ! * default gateway and any Interface specific information such as ! * the Current IP address and subnetmask. ! * @author Michael ! */ ! public class NodePropertiesDialog extends JDialog implements ActionListener ! { ! ! private JLabel lblNodeNameLabel = new JLabel("Node Name : "); ! private JLabel lblNodeName = new JLabel(); ! private JLabel lblGatewayLabel = new JLabel("Default Gateway : "); ! private JLabel lblGatewayAddress = new JLabel(); ! private JButton btnOK = new JButton("OK"); ! ! JPanel pnlNodeNameDetails = new JPanel(); ! JPanel pnlGatewayDetails = new JPanel(); ! ! JPanel pnlOKButton = new JPanel(); ! ! public NodePropertiesDialog(JFrame frame, Vector inVectorMasterList){ ! super(frame); ! ArrayList aryColumnNames = new ArrayList(); ! aryColumnNames.add("Name"); ! aryColumnNames.add("Gateway"); ! aryColumnNames.add("Interface Name"); ! aryColumnNames.add("MAC Address"); ! aryColumnNames.add("IP Address"); ! aryColumnNames.add("Subnet Mask"); ! aryColumnNames.add("Link Name"); ! ! Vector col = new Vector(aryColumnNames); ! JTable tblInfo = new JTable(inVectorMasterList, col); ! TableModel model = tblInfo.getModel(); ! ! // Remove the first 2 column names ! lblNodeName.setText(tblInfo.getModel().getValueAt(0, 0).toString()); ! tblInfo.getColumnModel().removeColumn(tblInfo.getColumnModel().getColumn(0)); ! lblGatewayAddress.setText(tblInfo.getModel().getValueAt(0, 1).toString()); ! tblInfo.getColumnModel().removeColumn(tblInfo.getColumnModel().getColumn(0)); ! ! //Makes uneditable ! tblInfo.setEnabled(false); ! tblInfo.getTableHeader().setReorderingAllowed(false); ! JScrollPane scrPane = new JScrollPane(tblInfo); ! ! ! //ArrayList temp = (ArrayList)inArrayMasterList.get(0); ! //lblNodeName.setText((String)temp.get(0)); ! //lblGatewayAddress.setText((String)temp.get(1)); ! ! JPanel pnlPropertiesScreen = (JPanel)this.getContentPane(); ! pnlPropertiesScreen.setLayout(new BoxLayout(pnlPropertiesScreen, BoxLayout.Y_AXIS)); ! pnlNodeNameDetails.setLayout(new FlowLayout()); ! pnlOKButton.setLayout(new FlowLayout()); ! ! pnlNodeNameDetails.setPreferredSize(new Dimension(50,50)); ! pnlNodeNameDetails.add(lblNodeNameLabel); ! pnlNodeNameDetails.add(lblNodeName); ! pnlGatewayDetails.add(lblGatewayLabel); ! pnlGatewayDetails.add(lblGatewayAddress); ! pnlPropertiesScreen.add(pnlNodeNameDetails); ! pnlPropertiesScreen.add(pnlGatewayDetails); ! pnlPropertiesScreen.add(scrPane); ! pnlOKButton.add(btnOK); ! pnlPropertiesScreen.add(pnlOKButton); ! ! this.setSize(700,200); ! this.setLocationRelativeTo(null); ! this.setModal(true); ! this.setResizable(false); ! btnOK.setToolTipText("Close the screen"); ! ! //Set default button to be btnOK ! this.getRootPane().setDefaultButton(btnOK); ! btnOK.addActionListener(this); ! } ! ! ! public void actionPerformed(ActionEvent e) ! { ! if(e.getSource() == btnOK) ! { ! ! this.dispose(); ! } ! } ! ! } Index: GuiSwitch.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/GuiSwitch.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** GuiSwitch.java 8 Nov 2005 04:04:28 -0000 1.1.1.1 --- GuiSwitch.java 13 Sep 2007 13:38:52 -0000 1.2 *************** *** 1,47 **** ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! package guiUI; ! ! /** ! * <P>The GuiSwitch class is used to instantiate new Switches on the GUI</P> ! * ! * @author luke_hamilton ! * @since 15th November 2004 ! * @version v0.20 ! */ ! ! public class GuiSwitch extends DataLinkLayerDevice { ! ! /** ! * @param inName The name of the switch ! * @param inMainscreen The JFrame that the Switch will be created on ! */ ! public GuiSwitch(String inName, MainScreen inMainScreen) { ! super(inName, inMainScreen,"images/simulation/switch_large.gif"); ! } ! } --- 1,47 ---- ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! package guiUI; ! ! /** ! * <P>The GuiSwitch class is used to instantiate new Switches on the GUI</P> ! * ! * @author luke_hamilton ! * @since 15th November 2004 ! * @version v0.20 ! */ ! ! public class GuiSwitch extends DataLinkLayerDevice { ! ! /** ! * @param inName The name of the switch ! * @param inMainscreen The JFrame that the Switch will be created on ! */ ! public GuiSwitch(String inName, MainScreen inMainScreen) { ! super(inName, inMainScreen,"images/simulation/switch_large.gif"); ! } ! } Index: SetTCPIPPropertiesDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SetTCPIPPropertiesDialog.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** SetTCPIPPropertiesDialog.java 10 Nov 2006 19:40:15 -0000 1.6 --- SetTCPIPPropertiesDialog.java 13 Sep 2007 13:38:53 -0000 1.7 *************** *** 131,135 **** btnCancel.setText("Cancel"); this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); --- 131,135 ---- btnCancel.setText("Cancel"); this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); this.setLocationRelativeTo(null); this.setModal(true); Index: breakLinkDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/breakLinkDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** breakLinkDialog.java 19 Nov 2005 16:16:32 -0000 1.2 --- breakLinkDialog.java 13 Sep 2007 13:38:53 -0000 1.3 *************** *** 1,310 **** ! /* ! 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 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.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; ! ! /** ! * ! * @author Key ! * ! * This class is a dialog that enables to remove links from the devices ! * ! */ ! public class breakLinkDialog extends javax.swing.JDialog { ! private JPanel backpanel; ! private JLabel lblInterface; ! private JLabel lblNodeName; ! private JComboBox cmbNodeName; ! private JComboBox cmbInterface; ! private JLabel lblError; ! private JButton btnOk; ! ! private MainScreen controller; ! private Simulation Sim; ! private SandBox SBox; ! ! private String NodeName; ! private String Interface; ! ! private boolean ErrorFlag = true; ! ! public breakLinkDialog(JFrame frame, Object nodeArray[], int selectedIndex, Simulation Sim, SandBox SBox) { ! super(frame); ! setResizable(false); ! controller = (MainScreen)frame; ! this.Sim = Sim; ! this.SBox = SBox; ! setTitle("Break link"); ! initGUI(nodeArray,selectedIndex); ! ! final JPanel panel = new JPanel(); ! getContentPane().add(panel, BorderLayout.SOUTH); ! ! btnOk = new JButton(); ! btnOk.setEnabled(true); ! btnOk.setToolTipText("Disconnect selected link!"); ! btnOk.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! okButton(); ! } ! }); ! ! btnOk.setName("btnOK"); ! panel.add(btnOk); ! btnOk.setText("OK"); ! ! final JButton btnCancel = new JButton(); ! btnCancel.setToolTipText("Cancel changes"); ! btnCancel.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! cancelButton(); ! } ! }); ! btnCancel.setName("btnCancel"); ! panel.add(btnCancel); ! btnCancel.setText("Cancel"); ! this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); ! this.setLocationRelativeTo(null); ! this.setModal(true); ! this.setVisible(true); ! ! } ! ! private void initGUI(Object nodeArray[], int selectedIndex) { ! 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[] {}; ! backpanelLayout.rowWeights = new double[] {0.0}; ! backpanelLayout.rowHeights = new int[] {5,5,5,5}; ! backpanel.setLayout(backpanelLayout); ! { ! lblNodeName = new JLabel(); ! backpanel.add(lblNodeName, new GridBagConstraints( ! 0, ! 0, ! 1, ! 1, ! 0.0, ! 1.0, ! GridBagConstraints.LINE_END, ! GridBagConstraints.HORIZONTAL, ! new Insets(0, 0, 0, 0), ! 21, ! 0)); ! lblNodeName.setText("Node Name:"); ! } ! { ! lblInterface = new JLabel(); ! backpanel.add(lblInterface, new GridBagConstraints( ! 0, ! 1, ! 1, ! 1, ! 0.0, ! 1.0, ! GridBagConstraints.LINE_END, ! GridBagConstraints.HORIZONTAL, ! new Insets(0, 0, 0, 27), ! 0, ! 0)); ! lblInterface.setText("Interface:"); ! } ! ! cmbNodeName = new JComboBox(nodeArray); ! cmbNodeName.setMinimumSize(new Dimension(100, 0)); ! cmbNodeName.setSelectedIndex(selectedIndex); ! cmbNodeName.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! selectNode(); ! } ! }); ! final GridBagConstraints gridBagConstraints = new GridBagConstraints(); ! gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; ! gridBagConstraints.anchor = GridBagConstraints.LINE_START; ! gridBagConstraints.gridy = 0; ! gridBagConstraints.gridx = 1; ! backpanel.add(cmbNodeName, gridBagConstraints); ! ! cmbInterface = new JComboBox(); ! cmbInterface.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! selectInterface(); ! } ! }); ! cmbInterface.setEnabled(false); ! ! final GridBagConstraints gridBagConstraints_1 = new GridBagConstraints(); ! gridBagConstraints_1.fill = GridBagConstraints.HORIZONTAL; ! gridBagConstraints_1.anchor = GridBagConstraints.LINE_START; ! gridBagConstraints_1.gridy = 1; ! gridBagConstraints_1.gridx = 1; ! backpanel.add(cmbInterface, gridBagConstraints_1); ! ! lblError = new JLabel(); ! lblError.setHorizontalTextPosition(SwingConstants.CENTER); ! lblError.setHorizontalAlignment(SwingConstants.CENTER); ! lblError.setAlignmentX(Component.CENTER_ALIGNMENT); ! lblError.setMinimumSize(new Dimension(100, 20)); ! lblError.setMaximumSize(new Dimension(100, 20)); ! lblError.setPreferredSize(new Dimension(100, 20)); ! lblError.setVisible(false); ! final GridBagConstraints gridBagConstraints_5 = new GridBagConstraints(); ! gridBagConstraints_5.anchor = GridBagConstraints.WEST; ! gridBagConstraints_5.insets = new Insets(0, 1, 0, 0); ! gridBagConstraints_5.fill = GridBagConstraints.BOTH; ! gridBagConstraints_5.gridwidth = 2; ! gridBagConstraints_5.gridy = 5; ! gridBagConstraints_5.gridx = 0; ! backpanel.add(lblError, gridBagConstraints_5); ! lblError.setText("Error Message!!!! Error"); ! ! ! if(selectedIndex == 0){ ! selectNode(); ! } ! ! } ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! /** ! * This method is executed when the user hit's the enter button. ! * It will delete the link on selected interface. ! * ! * @author Key ! * ! */ ! private void okButton(){ ! try { ! ! if(NodeName != null && Interface != null){ ! String str = Sim.disconnectLink(NodeName, Interface); ! SBox.removeLine(str); ! controller.addToConsole(NodeName +"'s link on interface "+Interface+" has been disconnected!\n"); ! ! } ! ! ! this.dispose(); ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! /** ! * This method is executed when the user hits the cancel button ! * @author luke_hamilton ! * @author Key ! * ! */ ! private void cancelButton(){ ! this.dispose(); ! } ! ! /** ! * This method will generate the data within the Interface combobox based ! * on the node that is selected. It will also get the default gateway if there is one set ! * for the node and add the text to the text field ! * ! * @author luke_hamilton ! * @author Key ! * ! */ ! private void selectNode(){ ! ! //Remove all items before regenerating the combobox. ! //This is because if a users selects the node twice, it would add the interfaces twice. ! cmbInterface.removeAllItems(); ! ! NodeName = (String)cmbNodeName.getSelectedItem(); ! ! try { ! Object nics[] = Sim.getAllInterfaces(NodeName); //Get object array of interface names ! ! //Sort the array ! Arrays.sort(nics); ! ! for (int i = 0; i < nics.length; i++) { //Add them to the combobox ! cmbInterface.addItem(nics[i]); ! } ! cmbInterface.setEnabled(true); ! ! } catch (Exception e) { //This should never happen ! e.printStackTrace(); ! } ! } ! ! /** ! * This method enabled's the IP Address text field once the interface has been selected. ! * This will also check the selected interface to see if the ip address has already been set ! * if so entering that ip address into the text field and then getting the set subnet mask for that ! * ip address. ! * @author Key ! */ ! private void selectInterface(){ ! Interface = (String)cmbInterface.getSelectedItem(); ! } ! ! } --- 1,310 ---- ! /* ! 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 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.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; ! ! /** ! * ! * @author Key ! * ! * This class is a dialog that enables to remove links from the devices ! * ! */ ! public class breakLinkDialog extends javax.swing.JDialog { ! private JPanel backpanel; ! private JLabel lblInterface; ! private JLabel lblNodeName; ! private JComboBox cmbNodeName; ! private JComboBox cmbInterface; ! private JLabel lblError; ! private JButton btnOk; ! ! private MainScreen controller; ! private Simulation Sim; ! private SandBox SBox; ! ! private String NodeName; ! private String Interface; ! ! private boolean ErrorFlag = true; ! ! public breakLinkDialog(JFrame frame, Object nodeArray[], int selectedIndex, Simulation Sim, SandBox SBox) { ! super(frame); ! setResizable(false); ! controller = (MainScreen)frame; ! this.Sim = Sim; ! this.SBox = SBox; ! setTitle("Break link"); ! initGUI(nodeArray,selectedIndex); ! ! final JPanel panel = new JPanel(); ! getContentPane().add(panel, BorderLayout.SOUTH); ! ! btnOk = new JButton(); ! btnOk.setEnabled(true); ! btnOk.setToolTipText("Disconnect selected link!"); ! btnOk.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! okButton(); ! } ! }); ! ! btnOk.setName("btnOK"); ! panel.add(btnOk); ! btnOk.setText("OK"); ! ! final JButton btnCancel = new JButton(); ! btnCancel.setToolTipText("Cancel changes"); ! btnCancel.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! cancelButton(); ! } ! }); ! btnCancel.setName("btnCancel"); ! panel.add(btnCancel); ! btnCancel.setText("Cancel"); ! this.getRootPane().setDefaultButton(btnOk); ! this.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE); ! this.setLocationRelativeTo(null); ! this.setModal(true); ! this.setVisible(true); ! ! } ! ! private void initGUI(Object nodeArray[], int selectedIndex) { ! 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[] {}; ! backpanelLayout.rowWeights = new double[] {0.0}; ! backpanelLayout.rowHeights = new int[] {5,5,5,5}; ! backpanel.setLayout(backpanelLayout); ! { ! lblNodeName = new JLabel(); ! backpanel.add(lblNodeName, new GridBagConstraints( ! 0, ! 0, ! 1, ! 1, ! 0.0, ! 1.0, ! GridBagConstraints.LINE_END, ! GridBagConstraints.HORIZONTAL, ! new Insets(0, 0, 0, 0), ! 21, ! 0)); ! lblNodeName.setText("Node Name:"); ! } ! { ! lblInterface = new JLabel(); ! backpanel.add(lblInterface, new GridBagConstraints( ! 0, ! 1, ! 1, ! 1, ! 0.0, ! 1.0, ! GridBagConstraints.LINE_END, ! GridBagConstraints.HORIZONTAL, ! new Insets(0, 0, 0, 27), ! 0, ! 0)); ! lblInterface.setText("Interface:"); ! } ! ! cmbNodeName = new JComboBox(nodeArray); ! cmbNodeName.setMinimumSize(new Dimension(100, 0)); ! cmbNodeName.setSelectedIndex(selectedIndex); ! cmbNodeName.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! selectNode(); ! } ! }); ! final GridBagConstraints gridBagConstraints = new GridBagConstraints(); ! gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; ! gridBagConstraints.anchor = GridBagConstraints.LINE_START; ! gridBagConstraints.gridy = 0; ! gridBagConstraints.gridx = 1; ! backpanel.add(cmbNodeName, gridBagConstraints); ! ! cmbInterface = new JComboBox(); ! cmbInterface.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! selectInterface(); ! } ! }); ! cmbInterface.setEnabled(false); ! ! final GridBagConstraints gridBagConstraints_1 = new GridBagConstraints(); ! gridBagConstraints_1.fill = GridBagConstraints.HORIZONTAL; ! gridBagConstraints_1.anchor = GridBagConstraints.LINE_START; ! gridBagConstraints_1.gridy = 1; ! gridBagConstraints_1.gridx = 1; ! backpanel.add(cmbInterface, gridBagConstraints_1); ! ! lblError = new JLabel(); ! lblError.setHorizontalTextPosition(SwingConstants.CENTER); ! lblError.setHorizontalAlignment(SwingConstants.CENTER); ! lblError.setAlignmentX(Component.CENTER_ALIGNMENT); ! lblError.setMinimumSize(new Dimension(100, 20)); ! lblError.setMaximumSize(new Dimension(100, 20)); ! lblError.setPreferredSize(new Dimension(100, 20)); ! lblError.setVisible(false); ! final GridBagConstraints gridBagConstraints_5 = new GridBagConstraints(); ! gridBagConstraints_5.anchor = GridBagConstraints.WEST; ! gridBagConstraints_5.insets = new Insets(0, 1, 0, 0); ! gridBagConstraints_5.fill = GridBagConstraints.BOTH; ! gridBagConstraints_5.gridwidth = 2; ! gridBagConstraints_5.gridy = 5; ! gridBagConstraints_5.gridx = 0; ! backpanel.add(lblError, gridBagConstraints_5); ! lblError.setText("Error Message!!!! Error"); ! ! ! if(selectedIndex == 0){ ! selectNode(); ! } ! ! } ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! /** ! * This method is executed when the user hit's the enter button. ! * It will delete the link on selected interface. ! * ! * @author Key ! * ! */ ! private void okButton(){ ! try { ! ! if(NodeName != null && Interface != null){ ! String str = Sim.disconnectLink(NodeName, Interface); ! SBox.removeLine(str); ! controller.addToConsole(NodeName +"'s link on interface "+Interface+" has been disconnected!\n"); ! ! } ! ! ! this.dispose(); ! } catch (Exception e) { ! e.printStackTrace(); ! } ! } ! ! /** ! * This method is executed when the user hits the cancel button ! * @author luke_hamilton ! * @author Key ! * ! */ ! private void cancelButton(){ ! this.dispose(); ! } ! ! /** ! * This method will generate the data within the Interface combobox based ! * on the node that is selected. It will also get the default gateway if there is one set ! * for the node and add the text to the text field ! * ! * @author luke_hamilton ! * @author Key ! * ! */ ! private void selectNode(){ ! ! //Remove all items before regenerating the combobox. ! //This is because if a users selects the node twice, it would add the interfaces twice. ! cmbInterface.removeAllItems(); ! ! NodeName = (String)cmbNodeName.getSelectedItem(); ! ! try { ! Object nics[] = Sim.getAllInterfaces(NodeName); //Get object array of interface names ! ! //Sort the array ! Arrays.sort(nics); ! ! for (int i = 0; i < nics.length; i++) { //Add them to the combobox ! cmbInterface.addItem(nics[i]); ! } ! cmbInterface.setEnabled(true); ! ! } catch (Exception e) { //This should never happen ! e.printStackTrace(); ! } ! } ! ! /** ! * This method enabled's the IP Address text field once the interface has been selected. ! * This will also check the selected interface to see if the ip address has already been set ! * if so entering that ip address into the text field and then getting the set subnet mask for that ! * ip address. ! * @author Key ! */ ! private void selectInterface(){ ! Interface = (String)cmbInterface.getSelectedItem(); ! } ! ! } Index: DataLinkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/DataLinkLayerDevice.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DataLinkLayerDevice.java 23 Feb 2006 11:56:00 -0000 1.2 --- DataLinkLayerDevice.java 13 Sep 2007 13:38:52 -0000 1.3 *************** *** 1,99 **** ! /* ! 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.event.ActionEvent; ! ! import java.awt.event.ActionListener; ! ! import javax.swing.JMenuItem; ! ! /** ! * <P>The DataLinkLayerDevice class is an abstract class used for further classification of Data </P> ! * <P>link layer devices such as Hub's and Switches. ! * ! * @author VC2 Team. ! * @since 15th November 2004 ! * @version v0.20 ! */ ! ! public abstract class DataLinkLayerDevice extends GuiNode { ! ! private JMenuItem mnuProperties = new JMenuItem("Properties ..."); ! 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"); ! ! ! /** ! * @param inName The name of the Data Link Layer Device ! * @param inMainscreen The JFrame that the router will be created on ! * @param imageLocation Location of the Image used on the GUI ! */ ! ! public DataLinkLayerDevice(String inName, MainScreen inMainScreen, String imageLocation) { ! super(inName, inMainScreen, imageLocation); ! ! 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()); ! } ! }); ! ! mnuReset.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.ResetHub(lblNodeName.getText()); ! } ! }); ! ! mnuShowState.addActionListener(new ActionListener(){ ! public void actionPerformed(ActionEvent e){ ! controller.ShowHubState(lblNodeName.getText()); ! } ! }); ! ! 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); ! } ! } --- 1,99 ---- ! /* ! 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.event.ActionEvent; ! ! import java.awt.event.ActionListener; ! ! import javax.swing.JMenuItem; ! ! /** ! * <P>The DataLinkLayerDevice class is an abstract class used for further classification of Data </P> ! * <P>link layer devices such as Hub's and Switches. ! * ! * @author VC2 Team. ! * @since 15th November 2004 ! * @version v0.20 ! */ ! ! public abstract class DataLinkLayerDevice extends GuiNode { ! ! private JMenuItem mnuProperties = new JMenuItem("Properties ..."); ! private JMenuItem mnuShowState = new JMenuItem("Show state"); ! private JMenuItem mnuReset = new JMenuItem("Reset"); ! private JMenuItem mnuLink = new... [truncated message content] |
From: Alexander B. <da...@us...> - 2007-09-13 13:39:00
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv28933/core Modified Files: Link.java NetworkInterfacePort.java Log Message: Fix dev tree; fixed Java 1.66 bug in Set TCP/IP Properties dialog. Index: NetworkInterfacePort.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkInterfacePort.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** NetworkInterfacePort.java 19 Nov 2005 21:53:51 -0000 1.3 --- NetworkInterfacePort.java 13 Sep 2007 13:38:52 -0000 1.4 *************** *** 1,103 **** ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! package core; ! import java.io.Serializable; ! /** ! * A NetworkInterfacePort represents the physical interface between ! * a DataLinkLayerDevice and a physical Link (network cable). Think of it as a port ! * ! * <P>Different DataLinkLayerDevices can contain different numbers of NetworkInterfacesPorts. ! * A Hub often has 4 or 8 and a switch has 8, 16 or 32.</P> ! * ! * <P>In order for a DataLinkLayerDevice to be able to send or receive network information (packets), ! * there must be a Link (network cable) between at least 2 NetworkInterfaces.</P> ! * ! * <P>NetworkInterfacePotrs receive and send packets to and from DatalinkProtocols and ! * the Link object they are connected to.</P> ! * ! * @author bevan_valliess ! * @since 13 Nov 2004 ! * @version v0.20 ! */ ! ! public class NetworkInterfacePort extends NetworkInterface{ ! ! /** ! * Constructs a NetworkInterfacePort object with the name inName ! * and a reference to it's parent Node. ! * @author baven_calliess ! * @param inName - The name to give the NetworkInterface eg: eth0 ! * @param inParent - The Node that the NetworkInterface is to be added to, it's parent. ! * @version v0.20 ! */ ! protected NetworkInterfacePort(String inName, Node inParent) { ! super(inName,inParent); ! } ! ! ! /** ! * This method recevie a packet from a connected link and then pass it ! * to the node's protocolstack. Depending on the network any ! * testing of the packets headers may need to be inserted here. ! * @author bevan_calliess ! * @param inPacket - The packet being recived by this port ! * @version v0.20 ! */ ! protected void receivePacket(Packet inPacket) throws LowLinkException { ! parentNode.receivePacket(inPacket, name); ! return; ! } ! ! /** ! * This method sends a packet to a connected link Depending ! * it is used by the datalinkLayer devices to tansport ! * packets without any validation or data checking. ! * @author bevan_calliess ! * @author angela_brown ! * @param outPacket - A Packet ! * @version v0.20 ! */ ! protected void sendPacket(Packet outPacket) throws LowLinkException{ ! Ethernet_packet tempPacket = (Ethernet_packet)outPacket; ! EthernetLink temp = (EthernetLink)connectedLink; ! ! if(temp!=null){ ! temp.transportPacket(tempPacket,getSourceName()); ! } ! } ! ! /** ! * This method returns information about this InterfacePort ! * @author bevan_calliess ! * @return String - The details of Interface name Mac and Links ! * @version v0.20 ! */ ! protected String getDetails(){ ! return "Interface: "+name+"\t\tMAC: Not Applicable \t\t"+ getConnectLinkDetails(); ! } ! }//EOF --- 1,103 ---- ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! package core; ! import java.io.Serializable; ! /** ! * A NetworkInterfacePort represents the physical interface between ! * a DataLinkLayerDevice and a physical Link (network cable). Think of it as a port ! * ! * <P>Different DataLinkLayerDevices can contain different numbers of NetworkInterfacesPorts. ! * A Hub often has 4 or 8 and a switch has 8, 16 or 32.</P> ! * ! * <P>In order for a DataLinkLayerDevice to be able to send or receive network information (packets), ! * there must be a Link (network cable) between at least 2 NetworkInterfaces.</P> ! * ! * <P>NetworkInterfacePotrs receive and send packets to and from DatalinkProtocols and ! * the Link object they are connected to.</P> ! * ! * @author bevan_valliess ! * @since 13 Nov 2004 ! * @version v0.20 ! */ ! ! public class NetworkInterfacePort extends NetworkInterface{ ! ! /** ! * Constructs a NetworkInterfacePort object with the name inName ! * and a reference to it's parent Node. ! * @author baven_calliess ! * @param inName - The name to give the NetworkInterface eg: eth0 ! * @param inParent - The Node that the NetworkInterface is to be added to, it's parent. ! * @version v0.20 ! */ ! protected NetworkInterfacePort(String inName, Node inParent) { ! super(inName,inParent); ! } ! ! ! /** ! * This method recevie a packet from a connected link and then pass it ! * to the node's protocolstack. Depending on the network any ! * testing of the packets headers may need to be inserted here. ! * @author bevan_calliess ! * @param inPacket - The packet being recived by this port ! * @version v0.20 ! */ ! protected void receivePacket(Packet inPacket) throws LowLinkException { ! parentNode.receivePacket(inPacket, name); ! return; ! } ! ! /** ! * This method sends a packet to a connected link Depending ! * it is used by the datalinkLayer devices to tansport ! * packets without any validation or data checking. ! * @author bevan_calliess ! * @author angela_brown ! * @param outPacket - A Packet ! * @version v0.20 ! */ ! protected void sendPacket(Packet outPacket) throws LowLinkException{ ! Ethernet_packet tempPacket = (Ethernet_packet)outPacket; ! EthernetLink temp = (EthernetLink)connectedLink; ! ! if(temp!=null){ ! temp.transportPacket(tempPacket,getSourceName()); ! } ! } ! ! /** ! * This method returns information about this InterfacePort ! * @author bevan_calliess ! * @return String - The details of Interface name Mac and Links ! * @version v0.20 ! */ ! protected String getDetails(){ ! return "Interface: "+name+"\t\tMAC: Not Applicable \t\t"+ getConnectLinkDetails(); ! } ! }//EOF Index: Link.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Link.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Link.java 19 Nov 2005 16:55:37 -0000 1.2 --- Link.java 13 Sep 2007 13:38:52 -0000 1.3 *************** *** 1,146 **** ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! ! package core; ! ! import java.io.Serializable; ! import java.util.*; ! ! /** ! * A Link represents the physical link between Nodes in a network. Think of it as ! * the network cable that connects (or links) Nodes together. ! * ! * <P>After adding Nodes to a network you need some way to connect them. The Link class ! * and the NetworkInterface class handle these connections between Nodes and the sending ! * of data between Nodes.</P> ! * ! * <P>Note: There are no distinctions between connections currently. There's no such thing as UTP cable or ! * Coax in our simulation but if this functionality were ever to be implemented you ! * will need to modify this class and the NetworkInterface class, perhaps simply by adding type attributes to ! * each with a check in the addInterface method.</P> ! * ! * @author tristan_veness (Original Author) ! * @author luke_hamilton ! * @since 14 June 2004 ! * @version v0.20 ! */ ! ! abstract class Link implements Serializable{ ! /** The interfaceList holds all of the NetworkInterfaces that are connected to the Link */ ! ! /** ! * @link aggregation <{core.NetworkInterface}> ! * @directed directed ! * @supplierCardinality 0..* ! */ ! java.util.Vector NetworkInterfaces = null; ! ! /** Name of the link */ ! protected String name; ! ! protected double sievingCoefficient; ! ! ! /** *TODO*: javaDoc ! * ! */ ! public double getSC(){ ! return sievingCoefficient; ! } ! ! ! /** *TODO*: javaDoc ! * ! */ ! public void setSC(double SC){ ! sievingCoefficient = SC; ! } ! ! /** ! * Constructs a Link with the specified name. Conceptually this will simply create a cable ! * not connected to anything. You need to call the addInterface() method to 'plug' the cable ! * in to NetworkInterfaces. ! * @author luke_hamilton ! * @param inName - The name to give the Link. eg: LINK1 ! * @version v0.20 ! **/ ! protected Link(String inName) { ! NetworkInterfaces = new Vector(); ! name = inName; ! sievingCoefficient = 100; ! } ! ! protected String getName() ! { ! return name; ! } ! ! /** ! * This method returns true is the link is not connected to any ! * network interface ! * @author luke_hamilton ! * @return boolean ! * @version v0.20 ! */ ! protected boolean isNotConnected() { ! if(NetworkInterfaces.isEmpty()){ ! return true; ! } ! return false; ! } ! ! /** ! * This method will disconnect the link from any connect networkinterfaces ! * and then remove them from is Vector ! * @author luke_hamilton ! * @version v0.20 ! */ ! protected void disconnectLink() { ! ! for (int i = 0; i < NetworkInterfaces.size(); i++) { ! NetworkInterface temp = (NetworkInterface)NetworkInterfaces.elementAt(i); ! temp.resetConnectedLink(); ! } ! NetworkInterfaces.removeAllElements(); ! ! } ! ! /** ! * Displays all the interfaces in the interface list through System.out.println() calls. ! * @author tristan_veness ! * @author luke_hamilton ! * @version v0.20 ! */ ! protected void displayDetails(){ ! System.out.println(name); ! for (int i = 0; i < NetworkInterfaces.size(); i++) { ! NetworkInterface NIC = (NetworkInterface)NetworkInterfaces.elementAt(i); ! System.out.println("Connection " +i+ " "+NIC.getDetails()); ! } ! } ! }//EOF --- 1,146 ---- ! /* ! Java Firewall Simulator (jFirewallSim) ! ! Copyright (c) 2004, jFirewallSim development team All rights reserved. ! ! Redistribution and use in source and binary forms, with or without modification, are ! permitted provided that the following conditions are met: ! ! - Redistributions of source code must retain the above copyright notice, this list ! of conditions and the following disclaimer. ! - Redistributions in binary form must reproduce the above copyright notice, this list ! of conditions and the following disclaimer in the documentation and/or other ! materials provided with the distribution. ! - Neither the name of the Canberra Institute of Technology nor the names of its ! contributors may be used to endorse or promote products derived from this software ! without specific prior written permission. ! ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ! OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ! THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ! EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF ! SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ! HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR ! TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ! EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ! */ ! ! package core; ! ! import java.io.Serializable; ! import java.util.*; ! ! /** ! * A Link represents the physical link between Nodes in a network. Think of it as ! * the network cable that connects (or links) Nodes together. ! * ! * <P>After adding Nodes to a network you need some way to connect them. The Link class ! * and the NetworkInterface class handle these connections between Nodes and the sending ! * of data between Nodes.</P> ! * ! * <P>Note: There are no distinctions between connections currently. There's no such thing as UTP cable or ! * Coax in our simulation but if this functionality were ever to be implemented you ! * will need to modify this class and the NetworkInterface class, perhaps simply by adding type attributes to ! * each with a check in the addInterface method.</P> ! * ! * @author tristan_veness (Original Author) ! * @author luke_hamilton ! * @since 14 June 2004 ! * @version v0.20 ! */ ! ! abstract class Link implements Serializable{ ! /** The interfaceList holds all of the NetworkInterfaces that are connected to the Link */ ! ! /** ! * @link aggregation <{core.NetworkInterface}> ! * @directed directed ! * @supplierCardinality 0..* ! */ ! java.util.Vector NetworkInterfaces = null; ! ! /** Name of the link */ ! protected String name; ! ! protected double sievingCoefficient; ! ! ! /** *TODO*: javaDoc ! * ! */ ! public double getSC(){ ! return sievingCoefficient; ! } ! ! ! /** *TODO*: javaDoc ! * ! */ ! public void setSC(double SC){ ! sievingCoefficient = SC; ! } ! ! /** ! * Constructs a Link with the specified name. Conceptually this will simply create a cable ! * not connected to anything. You need to call the addInterface() method to 'plug' the cable ! * in to NetworkInterfaces. ! * @author luke_hamilton ! * @param inName - The name to give the Link. eg: LINK1 ! * @version v0.20 ! **/ ! protected Link(String inName) { ! NetworkInterfaces = new Vector(); ! name = inName; ! sievingCoefficient = 100; ! } ! ! protected String getName() ! { ! return name; ! } ! ! /** ! * This method returns true is the link is not connected to any ! * network interface ! * @author luke_hamilton ! * @return boolean ! * @version v0.20 ! */ ! protected boolean isNotConnected() { ! if(NetworkInterfaces.isEmpty()){ ! return true; ! } ! return false; ! } ! ! /** ! * This method will disconnect the link from any connect networkinterfaces ! * and then remove them from is Vector ! * @author luke_hamilton ! * @version v0.20 ! */ ! protected void disconnectLink() { ! ! for (int i = 0; i < NetworkInterfaces.size(); i++) { ! NetworkInterface temp = (NetworkInterface)NetworkInterfaces.elementAt(i); ! temp.resetConnectedLink(); ! } ! NetworkInterfaces.removeAllElements(); ! ! } ! ! /** ! * Displays all the interfaces in the interface list through System.out.println() calls. ! * @author tristan_veness ! * @author luke_hamilton ! * @version v0.20 ! */ ! protected void displayDetails(){ ! System.out.println(name); ! for (int i = 0; i < NetworkInterfaces.size(); i++) { ! NetworkInterface NIC = (NetworkInterface)NetworkInterfaces.elementAt(i); ! System.out.println("Connection " +i+ " "+NIC.getDetails()); ! } ! } ! }//EOF |
From: Alexander B. <da...@us...> - 2006-12-21 18:18:56
|
Update of /cvsroot/javanetsim/IceScan/vccproject In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16814/vccproject Modified Files: IceScan.suo IceScan.vcproj Log Message: Index: IceScan.suo =================================================================== RCS file: /cvsroot/javanetsim/IceScan/vccproject/IceScan.suo,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 Binary files /tmp/cvsM85ax5 and /tmp/cvsJFMuxv differ Index: IceScan.vcproj =================================================================== RCS file: /cvsroot/javanetsim/IceScan/vccproject/IceScan.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IceScan.vcproj 17 Dec 2006 14:23:15 -0000 1.2 --- IceScan.vcproj 21 Dec 2006 18:18:48 -0000 1.3 *************** *** 173,176 **** --- 173,192 ---- > <File + RelativePath="..\icesockets\cethwrapper.h" + > + </File> + <File + RelativePath="..\config-win.h" + > + </File> + <File + RelativePath="..\icesockets\cpcapreader.h" + > + </File> + <File + RelativePath="..\icesockets\crandom.h" + > + </File> + <File RelativePath="..\icesockets\crawsocket.h" > *************** *** 189,197 **** </File> <File ! RelativePath="..\icesockets\getaddrinfo.h" > </File> <File ! RelativePath="..\icesockets\ice_rand.h" > </File> --- 205,213 ---- </File> <File ! RelativePath="..\defwin.h" > </File> <File ! RelativePath="..\icesockets\getaddrinfo.h" > </File> *************** *** 233,237 **** </File> <File ! RelativePath="..\icesockets\sock_arp.h" > </File> --- 249,253 ---- </File> <File ! RelativePath="..\icesockets\queue.h" > </File> *************** *** 241,261 **** </File> <File - RelativePath="..\icesockets\sock_eth.h" - > - </File> - <File RelativePath="..\icesockets\sock_name.h" > </File> <File ! RelativePath="..\icesockets\sock_pcap.h" ! > ! </File> ! <File ! RelativePath="..\icesockets\sock_time.h" > </File> <File ! RelativePath="..\icesockets\sock_types.h" > </File> --- 257,269 ---- </File> <File RelativePath="..\icesockets\sock_name.h" > </File> <File ! RelativePath="..\icesockets\sock_types.h" > </File> <File ! RelativePath="..\icesockets\sock_utils.h" > </File> *************** *** 281,287 **** --- 289,319 ---- > <File + RelativePath="..\csubtarget.cc" + > + </File> + <File + RelativePath="..\icediscover.cc" + > + </File> + <File RelativePath="..\icescan.cc" > </File> + <File + RelativePath="..\icesockets\sock_name.cc" + > + </File> + <File + RelativePath="..\icesockets\sock_utils.cc" + > + </File> + <File + RelativePath="..\icesockets\sock_win.cc" + > + </File> + <File + RelativePath="..\udpscan.cc" + > + </File> </Filter> </Files> |
From: Alexander B. <da...@us...> - 2006-12-21 18:18:55
|
Update of /cvsroot/javanetsim/IceScan/icesockets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16814/icesockets Modified Files: cethwrapper.h sock_name.cc sock_types.h Log Message: Index: sock_types.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_types.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** sock_types.h 21 Dec 2006 13:59:51 -0000 1.27 --- sock_types.h 21 Dec 2006 18:18:47 -0000 1.28 *************** *** 38,43 **** #ifdef WIN32 #define __WIN32__ ! #undef TRAILING_SLASH ! #define TRAILING_SLASH '\' #else --- 38,43 ---- #ifdef WIN32 #define __WIN32__ ! #undef TRAILING_SLASH ! #define TRAILING_SLASH '\\' #else Index: cethwrapper.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/cethwrapper.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cethwrapper.h 21 Dec 2006 16:29:36 -0000 1.1 --- cethwrapper.h 21 Dec 2006 18:18:47 -0000 1.2 *************** *** 10,13 **** --- 10,14 ---- #include "sock_types.h" + #include "sock_utils.h" #ifdef HAVE_LIBDNET *************** *** 53,57 **** return "127.0.0.1"; } ! #elif //Need to add some code here... #endif --- 54,58 ---- return "127.0.0.1"; } ! #else //Need to add some code here... #endif Index: sock_name.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_name.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sock_name.cc 21 Dec 2006 16:29:36 -0000 1.2 --- sock_name.cc 21 Dec 2006 18:18:47 -0000 1.3 *************** *** 99,106 **** } - bool islocal(icestring &ip){ - - } - icestring get_source_ip(const icestring &destip, icestring &sourceint){ #ifndef HAVE_LIBDNET --- 99,102 ---- |
From: Alexander B. <da...@us...> - 2006-12-21 18:18:52
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv16814 Modified Files: TODO csubtarget.cc defwin.h Added Files: config-win.h Removed Files: Makefile Log Message: Index: TODO =================================================================== RCS file: /cvsroot/javanetsim/IceScan/TODO,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TODO 21 Dec 2006 17:35:08 -0000 1.18 --- TODO 21 Dec 2006 18:18:47 -0000 1.19 *************** *** 1,5 **** IceScan ToDo: ! *** 14 Dec 2006 *** -- UI -- --- 1,5 ---- IceScan ToDo: ! *** 21 Dec 2006 *** -- UI -- *************** *** 25,28 **** --- 25,33 ---- + ARP Scan + Fingerprint + -- WIN32-specific -- + + * fix pcap read interface auto select + + -- Misc -- Index: csubtarget.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** csubtarget.cc 21 Dec 2006 17:35:08 -0000 1.4 --- csubtarget.cc 21 Dec 2006 18:18:47 -0000 1.5 *************** *** 51,55 **** icestring mac = get_arp_from_cache(hostname); ! if(mac != "" && mac != "00:00:00:00:00:00"){ char Mac[24], vmac[7]; --- 51,55 ---- icestring mac = get_arp_from_cache(hostname); ! if(mac != "" && mac != "00:00:00:00:00:00" && mac!="cc:cc:cc:cc:cc:cc"){ char Mac[24], vmac[7]; Index: defwin.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/defwin.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** defwin.h 21 Dec 2006 13:11:46 -0000 1.1 --- defwin.h 21 Dec 2006 18:18:47 -0000 1.2 *************** *** 13,14 **** --- 13,19 ---- #undef HAVE_BZERO + #undef HAVE_SYS_TIME_H + + #define ICESCAN_DATADIR "" + + #define HAVE_LIBDNET 1 \ No newline at end of file --- Makefile DELETED --- --- NEW FILE: config-win.h --- /* config.h. Generated by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ /* freebsd */ /* #undef FREEBSD */ /* Define to 1 if you have the <arpa/inet.h> header file. */ #define HAVE_ARPA_INET_H 1 /* Define to 1 if you have the `bzero' function. */ #define HAVE_BZERO 1 /* Define to 1 if you have the <fcntl.h> header file. */ #define HAVE_FCNTL_H 1 /* Define to 1 if you have the `ftime' function. */ #define HAVE_FTIME 1 /* Define to 1 if you have the `gethostbyaddr' function. */ #define HAVE_GETHOSTBYADDR 1 /* Define to 1 if you have the `gethostbyname' function. */ #define HAVE_GETHOSTBYNAME 1 /* Define to 1 if you have the `gethostname' function. */ #define HAVE_GETHOSTNAME 1 /* Define to 1 if you have the `gettimeofday' function. */ #define HAVE_GETTIMEOFDAY 1 /* Define to 1 if you have the `inet_ntoa' function. */ #define HAVE_INET_NTOA 1 /* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 /* Define to 1 if you have the `dnet' library (-ldnet). */ #define HAVE_LIBDNET 1 /* Define to 1 if you have the <libintl.h> header file. */ #define HAVE_LIBINTL_H 1 /* Define to 1 if you have the `pcap' library (-lpcap). */ #define HAVE_LIBPCAP 1 /* Define to 1 if you have the `pcre' library (-lpcre). */ #define HAVE_LIBPCRE 1 /* Define to 1 if you have the `pcrecpp' library (-lpcrecpp). */ #define HAVE_LIBPCRECPP 1 /* Define to 1 if you have the `pthread' library (-lpthread). */ #define HAVE_LIBPTHREAD 1 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #define HAVE_MALLOC 1 /* Define to 1 if you have the <memory.h> header file. */ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #define HAVE_MEMSET 1 /* Define to 1 if you have the <netdb.h> header file. */ #define HAVE_NETDB_H 1 /* Define to 1 if you have the <netinet/in.h> header file. */ #define HAVE_NETINET_IN_H 1 /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #define HAVE_REALLOC 1 /* Define to 1 if you have the `select' function. */ #define HAVE_SELECT 1 /* Define to 1 if you have the `socket' function. */ #define HAVE_SOCKET 1 /* Define to 1 if stdbool.h conforms to C99. */ #define HAVE_STDBOOL_H 1 /* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 /* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 /* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 /* Define to 1 if you have the `strstr' function. */ #define HAVE_STRSTR 1 /* Define to 1 if you have the <sys/file.h> header file. */ #define HAVE_SYS_FILE_H 1 /* Define to 1 if you have the <sys/ioctl.h> header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define to 1 if you have the <sys/param.h> header file. */ #define HAVE_SYS_PARAM_H 1 /* Define to 1 if you have the <sys/select.h> header file. */ #define HAVE_SYS_SELECT_H 1 /* Define to 1 if you have the <sys/socket.h> header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the <sys/timeb.h> header file. */ #define HAVE_SYS_TIMEB_H 1 /* Define to 1 if you have the <sys/time.h> header file. */ #define HAVE_SYS_TIME_H 1 /* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 /* Define to 1 if the system has the type `_Bool'. */ #define HAVE__BOOL 1 /* releasedate */ #define ICESCAN_DATE "21 December 2006" /* name */ #define ICESCAN_NAME icescan /* version */ #define ICESCAN_VERSION "0.0.6" /* website */ #define ICESCAN_WEBSITE "http://javanetsim.cvs.sourceforge.net/javanetsim/IceScan/" /* linux */ #define LINUX 1 /* netbsd */ /* #undef NETBSD */ /* openbsd */ /* #undef OPENBSD */ /* Name of package */ #define PACKAGE "icescan" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "ke...@ti..." /* Define to the full name of this package. */ #define PACKAGE_NAME "icescan" /* Define to the full name and version of this package. */ #define PACKAGE_STRING "icescan "0.0.6"" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "icescan" /* Define to the version of this package. */ #define PACKAGE_VERSION ""0.0.6"" /* Define to the type of arg 1 for `select'. */ #define SELECT_TYPE_ARG1 int /* Define to the type of args 2, 3 and 4 for `select'. */ #define SELECT_TYPE_ARG234 (fd_set *) /* Define to the type of arg 5 for `select'. */ #define SELECT_TYPE_ARG5 (struct timeval *) /* solaris */ /* #undef SOLARIS */ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ #define TIME_WITH_SYS_TIME 1 /* Version number of package */ #define VERSION ""0.0.6"" /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to rpl_malloc if the replacement function should be used. */ /* #undef malloc */ /* Define to rpl_realloc if the replacement function should be used. */ /* #undef realloc */ /* Define to `unsigned' if <sys/types.h> does not define. */ /* #undef size_t */ |
From: Alexander B. <da...@us...> - 2006-12-21 17:35:11
|
Update of /cvsroot/javanetsim/IceScan/icesockets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30605/icesockets Modified Files: sock_utils.h sock_utils.cc crawsocket.h Added Files: crandom.h Log Message: no message --- NEW FILE: crandom.h --- /* * crandom.h -- Contains the crandom class for random byte * generating. */ /* * Copyright (C) 2006 by Alexander Bolshev[Key] <key(at)timeold.ru> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation, * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef _crandom_H #define _crandom_H #include "sock_types.h" /* Portions of code below are from libdnet package: * Copyright (c) 2000-2004 Dug Song <du...@mo...> * All rights reserved, all wrongs reversed. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. The names of the authors and copyright holders may not be used to * endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED ``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 AUTHOR 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. */ /* start of modified code from libdnet */ #ifdef _WIN32 # undef _WIN32_WINNT # define _WIN32_WINNT 0x0400 # include <wincrypt.h> # define inline __inline #endif struct rand_handle { uint8_t i; uint8_t j; uint8_t s[256]; u_char *tmp; int tmplen; }; typedef rand_handle rand_t; static inline void rand_init(rand_t *rand) { int i; for (i = 0; i < 256; i++) rand->s[i] = i; rand->i = rand->j = 0; } static inline void rand_addrandom(rand_t *rand, u_char *buf, int len) { int i; uint8_t si; rand->i--; for (i = 0; i < 256; i++) { rand->i = (rand->i + 1); si = rand->s[rand->i]; rand->j = (rand->j + si + buf[i % len]); rand->s[rand->i] = rand->s[rand->j]; rand->s[rand->j] = si; } rand->j = rand->i; } /* end of modified code from libdnet */ class crandom{ rand_t *r; public: crandom(){ r = rand_open(); } int get(rand_t *r, void *buf, size_t len){ return rand_get(r, buf, len); } /* start of modified code from libdnet */ uint8_t rand_uint8() { return (rand_getbyte(r)); } uint16_t rand_uint16() { uint16_t val; val = rand_getbyte(r) << 8; val |= rand_getbyte(r); return (val); } uint32_t rand_uint32() { uint32_t val; val = rand_getbyte(r) << 24; val |= rand_getbyte(r) << 16; val |= rand_getbyte(r) << 8; val |= rand_getbyte(r); return (val); } /* end of modified code from libdnet */ ~crandom(){ rand_close(r); } private: /* start of modified code from libdnet */ rand_t *rand_open(void) { rand_t *r; u_char seed[256]; #ifdef _WIN32 HCRYPTPROV hcrypt = 0; CryptAcquireContext(&hcrypt, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); CryptGenRandom(hcrypt, sizeof(seed), seed); CryptReleaseContext(hcrypt, 0); #else struct timeval *tv = (struct timeval *)seed; int fd; if ((fd = open("/dev/arandom", O_RDONLY)) != -1 || (fd = open("/dev/urandom", O_RDONLY)) != -1) { read(fd, seed + sizeof(*tv), sizeof(seed) - sizeof(*tv)); close(fd); } gettimeofday(tv, NULL); #endif if ((r = (rand_t*) malloc(sizeof(*r))) != NULL) { rand_init(r); rand_addrandom(r, seed, 128); rand_addrandom(r, seed + 128, 128); r->tmp = NULL; r->tmplen = 0; } return (r); } static uint8_t rand_getbyte(rand_t *r) { uint8_t si, sj; r->i = (r->i + 1); si = r->s[r->i]; r->j = (r->j + si); sj = r->s[r->j]; r->s[r->i] = sj; r->s[r->j] = si; return (r->s[(si + sj) & 0xff]); } int rand_get(rand_t *r, void *buf, size_t len) { u_char *p; u_int i; for (p = (u_char*) buf, i = 0; i < len; i++) { p[i] = rand_getbyte(r); } return (0); } int rand_set(rand_t *r, const void *buf, size_t len) { rand_init(r); rand_addrandom(r, (u_char *)buf, len); rand_addrandom(r, (u_char *)buf, len); return (0); } int rand_add(rand_t *r, const void *buf, size_t len) { rand_addrandom(r, (u_char *)buf, len); return (0); } rand_t * rand_close(rand_t *r) { if (r != NULL) { if (r->tmp != NULL) free(r->tmp); free(r); } return (NULL); } /* end of modified code from libdnet */ }; #endif /* _crandom_H */ Index: crawsocket.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/crawsocket.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** crawsocket.h 21 Dec 2006 16:29:36 -0000 1.20 --- crawsocket.h 21 Dec 2006 17:35:07 -0000 1.21 *************** *** 2,8 **** #define ICERAWSOCKET_H #include "csocket.h" #include "cethwrapper.h" ! #include "sock_types.h" class crawsocket : csocket{ --- 2,10 ---- #define ICERAWSOCKET_H + #include "sock_types.h" #include "csocket.h" + #include "cpcapreader.h" #include "cethwrapper.h" ! #include "crandom.h" class crawsocket : csocket{ *************** *** 135,138 **** --- 137,141 ---- unsigned long ack, unsigned char flags, unsigned short window, char *data, const unsigned short datalen) { + crandom r; #ifdef WIN32 *************** *** 165,179 **** if (seq) tcp->th_seq = htonl(seq); ! else tcp->th_seq = rand() + rand(); if (flags & TH_ACK && ack) tcp->th_ack = htonl(seq); else if (flags & TH_ACK) ! tcp->th_ack = rand() + rand(); tcp->th_off = 5; tcp->th_flags = flags; ! unsigned short ttl = 121; if (window) --- 168,182 ---- if (seq) tcp->th_seq = htonl(seq); ! else tcp->th_seq = r.rand_uint16(); if (flags & TH_ACK && ack) tcp->th_ack = htonl(seq); else if (flags & TH_ACK) ! tcp->th_ack = r.rand_uint16(); tcp->th_off = 5; tcp->th_flags = flags; ! unsigned short ttl = (r.rand_uint8() + 50) % 255; if (window) *************** *** 188,192 **** ip->ihl = 5; ip->tot_len = htons(sizeof(struct iphdr) + sizeof(struct tcphdr) + datalen); ! ip->id = rand(); ip->ttl = ttl; ip->protocol = IPPROTO_TCP; --- 191,195 ---- ip->ihl = 5; ip->tot_len = htons(sizeof(struct iphdr) + sizeof(struct tcphdr) + datalen); ! ip->id = r.rand_uint16(); ip->ttl = ttl; ip->protocol = IPPROTO_TCP; *************** *** 217,220 **** --- 220,255 ---- } + bool recieved_tcp_segment(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, int dest_port, int MAGIC_PORT, int th_flags, int timeout){ + int bytes; + char *response; + struct iphdr *ip; + struct tcphdr *tcp; + unsigned int len; + struct timeval tv1, tv2; + gettimeofday(&tv1, 0); + bool stop = false; + int port; + + while(!stop){ + response = p.read_packet(&len, NULL); + port = 0; + if(response){ + ip = (struct iphdr *) response; + if(ip->saddr == saddress.sin_addr.s_addr && ip->protocol == IPPROTO_TCP){ + tcp = (struct tcphdr *) (response + 4 * ip->ihl); + + if ((tcp->th_flags & th_flags) && !(th_flags & (TH_ACK|TH_SYN))){ + if(ntohs(tcp->th_sport) == dest_port) + return true; + } + } + } + gettimeofday(&tv2, 0); + + if(SUB_TIMEVALS(tv2,tv1) >= timeout) + stop = true; + } + } + int send_icmp_packet(icestring Hostname, int Icmp_type, int Icmp_code, int Icmp_id, int Icmp_seq, int Icmp_checksum, void* Icmp_data, int Icmp_data_len){ Index: sock_utils.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_utils.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sock_utils.h 21 Dec 2006 16:36:27 -0000 1.2 --- sock_utils.h 21 Dec 2006 17:35:07 -0000 1.3 *************** *** 9,12 **** --- 9,16 ---- #define SUB_TIMEVALS(a,b) (((a).tv_sec - (b).tv_sec) * 1000000 + (a).tv_usec - (b).tv_usec) + #ifndef MAX + #define MAX(a,b) (a > b ? a : b) + #define MIN(a,b) (a < b ? a : b) + #endif #ifdef WIN32 *************** *** 36,43 **** icestring find_icefile_path(char *fname); - // from Fyodor's "The Art of Port Scanning" - int get_random_bytes(void *buf, int numbytes); - - void init_rand(); - #endif --- 40,42 ---- Index: sock_utils.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icesockets/sock_utils.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sock_utils.cc 21 Dec 2006 16:36:27 -0000 1.2 --- sock_utils.cc 21 Dec 2006 17:35:07 -0000 1.3 *************** *** 114,174 **** } - // from Fyodor's "The Art of Port Scanning" - int get_random_bytes(void *buf, int numbytes) { - static char bytebuf[2048]; - static char badrandomwarning = 0; - static int bytesleft = 0; - int tmp; - int res; - struct timeval tv; - FILE *fp = NULL; - unsigned int i; - short *iptr; - - if (numbytes < 0 || numbytes > 0xFFFF) return -1; - - if (bytesleft == 0) { - fp = fopen("/dev/arandom", "r"); - if (!fp) fp = fopen("/dev/urandom", "r"); - if (!fp) fp = fopen("/dev/random", "r"); - if (fp) { - res = (int) fread(bytebuf, 1, sizeof(bytebuf), fp); - if (res != sizeof(bytebuf)) { - printf("Failed to read from /dev/urandom or /dev/random\n"); - fclose(fp); - fp = NULL; - } - bytesleft = sizeof(bytebuf); - } - if (!fp) { - if (badrandomwarning == 0) { - badrandomwarning++; - gettimeofday(&tv, NULL); - srand((tv.tv_sec ^ tv.tv_usec) ^ getpid()); - } - - for(i=0; i < sizeof(bytebuf) / sizeof(short); i++) { - iptr = (short *) ((char *)bytebuf + i * sizeof(short)); - *iptr = rand(); - } - bytesleft = (sizeof(bytebuf) / sizeof(short)) * sizeof(short); - } else fclose(fp); - } - if (numbytes <= bytesleft) { /* we can cover it */ - memcpy(buf, bytebuf + (sizeof(bytebuf) - bytesleft), numbytes); - bytesleft -= numbytes; - return 0; - } - memcpy(buf, bytebuf + (sizeof(bytebuf) - bytesleft), bytesleft); - tmp = bytesleft; - bytesleft = 0; - return get_random_bytes((char *)buf + tmp, numbytes - tmp); - } - void init_rand(){ - unsigned i; - get_random_bytes(&i, sizeof(i)); - srand(i); - } --- 114,118 ---- |
From: Alexander B. <da...@us...> - 2006-12-21 17:35:11
|
Update of /cvsroot/javanetsim/IceScan In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30605 Modified Files: AUTHORS icescan.cc TODO icediscover.cc csubtarget.h csubtarget.cc Log Message: no message Index: icescan.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icescan.cc,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** icescan.cc 21 Dec 2006 16:36:28 -0000 1.40 --- icescan.cc 21 Dec 2006 17:35:08 -0000 1.41 *************** *** 1,5 **** /* * icescan.cc -- Contains the main() function of IceScan and functions ! * to parse command line args and print help; */ --- 1,5 ---- /* * icescan.cc -- Contains the main() function of IceScan and functions ! * to parse command line args and print help. */ *************** *** 361,366 **** wsa = start_sockets(); - init_rand(); - time(&rawtime); --- 361,364 ---- Index: csubtarget.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** csubtarget.cc 21 Dec 2006 16:36:28 -0000 1.3 --- csubtarget.cc 21 Dec 2006 17:35:08 -0000 1.4 *************** *** 387,391 **** maxat++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, 10, 0); } } --- 387,391 ---- maxat++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, 10); } } *************** *** 393,401 **** j++; - //iceusleep(1000); ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, (maxat) * covar + 10000, maxat); - //DBGOUTPUT(covar); } } --- 393,399 ---- j++; ! recieve_tcp_raw(p, rawsend, source, saddress, scanning_ports, MAGIC_PORT, MIN((maxat) * covar + 10000, MAX_RAW_WAIT + maxat * 500)); } } *************** *** 417,421 **** } ! int csubtarget::recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout, int packets){ int bytes; char *response; --- 415,419 ---- } ! void csubtarget::recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout){ int bytes; char *response; *************** *** 423,427 **** struct tcphdr *tcp; unsigned int len; ! int maxtimeval = 0; struct timeval tv1, tv2, tv3; gettimeofday(&tv1, 0); --- 421,425 ---- struct tcphdr *tcp; unsigned int len; ! bool at_least_one_recieved = false; struct timeval tv1, tv2, tv3; gettimeofday(&tv1, 0); *************** *** 443,451 **** if ((tcp->th_flags & TH_RST) && (par->scan_type == FIN_SCAN || par->scan_type == NULL_SCAN || par->scan_type == XMAS_SCAN)) { port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ if(!scanning_ports[port].done){ set_port_status(port, PORT_CLOSED, "tcp"); ! scanning_ports[port].done = true; } } --- 441,449 ---- if ((tcp->th_flags & TH_RST) && (par->scan_type == FIN_SCAN || par->scan_type == NULL_SCAN || par->scan_type == XMAS_SCAN)) { port = ntohs(tcp->th_sport); ! if(scanning_ports.find(port) != scanning_ports.end()){ if(!scanning_ports[port].done){ set_port_status(port, PORT_CLOSED, "tcp"); ! scanning_ports[port].done = true; } } *************** *** 504,517 **** gettimeofday(&tv2, 0); ! if(port){ ! if(SUB_TIMEVALS(tv2,scanning_ports[port].tv) > maxtimeval) ! maxtimeval = SUB_TIMEVALS(tv2,scanning_ports[port].tv); ! } ! ! if(SUB_TIMEVALS(tv2,tv1) >= timeout || SUB_TIMEVALS(tv2,tv1) > MAX_RAW_WAIT + packets * 500) stop = true; } - - return maxtimeval; } --- 502,508 ---- gettimeofday(&tv2, 0); ! if(SUB_TIMEVALS(tv2,tv1) >= timeout) stop = true; } } Index: csubtarget.h =================================================================== RCS file: /cvsroot/javanetsim/IceScan/csubtarget.h,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** csubtarget.h 21 Dec 2006 16:29:36 -0000 1.55 --- csubtarget.h 21 Dec 2006 17:35:08 -0000 1.56 *************** *** 6,10 **** #include "nbt_wrapper.h" #include "iceprotocol.h" ! #include "icesockets/sock_pcap.h" #include "icediscover.h" #include "portdef.h" --- 6,10 ---- #include "nbt_wrapper.h" #include "iceprotocol.h" ! #include "icesockets/crawsocket.h" #include "icediscover.h" #include "portdef.h" *************** *** 105,109 **** void raw_tcp_scan(icestring scan_type); ! int recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout, int packets); void shutdown_scansocket(int j); --- 105,109 ---- void raw_tcp_scan(icestring scan_type); ! void recieve_tcp_raw(cpcapreader &p, crawsocket &rawsend, icestring &source, struct sockaddr_in &saddress, std::map <int, scanning_port> &scanning_ports, int MAGIC_PORT, int timeout); void shutdown_scansocket(int j); Index: icediscover.cc =================================================================== RCS file: /cvsroot/javanetsim/IceScan/icediscover.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** icediscover.cc 21 Dec 2006 15:37:23 -0000 1.1 --- icediscover.cc 21 Dec 2006 17:35:08 -0000 1.2 *************** *** 174,178 **** std::map <int, scanning_port> scanning_ports; ! //add privileges checking!!! if(par->pu_ports.size() > 0){ --- 174,185 ---- std::map <int, scanning_port> scanning_ports; ! #if (__CYGWIN__) ! if(!par->forceuid){ ! #else ! if(getuid() && (par->forceuid != true)){ ! #endif ! out->line("UID isn't 0, so can't create raw socket/load pcap => no RAW tcp scan..."); ! return false; ! } if(par->pu_ports.size() > 0){ *************** *** 193,199 **** else{ struct scanning_port sp; ! unsigned i; ! get_random_bytes(&i, sizeof(i)); ! i = ((unsigned)rand() % 35536) + 30000; // return "random" number [30000, 65535] sp.port_number = i; --- 200,207 ---- else{ struct scanning_port sp; ! crandom c; ! unsigned i = 0; ! ! i = ((unsigned)c.rand_uint16() % 35536) + 30000; // return "random" number [30000, 65535] sp.port_number = i; Index: AUTHORS =================================================================== RCS file: /cvsroot/javanetsim/IceScan/AUTHORS,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AUTHORS 21 Dec 2006 13:13:34 -0000 1.1 --- AUTHORS 21 Dec 2006 17:35:08 -0000 1.2 *************** *** 23,27 **** Dug Song <dugsong(at)monkey.org> for his GREAT libdnet library ! (some modified code from it used in icesockets/sock_eth.h) Andrew Tridgell and other Samba (http://samba.org) developers --- 23,29 ---- Dug Song <dugsong(at)monkey.org> for his GREAT libdnet library ! (some modified code from it used in icesockets/cethwrapper.h and ! int icesockets/crandom.h; some systems doesn't have libdnet ! so i copied some code into IceScan). Andrew Tridgell and other Samba (http://samba.org) developers Index: TODO =================================================================== RCS file: /cvsroot/javanetsim/IceScan/TODO,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** TODO 21 Dec 2006 13:59:50 -0000 1.17 --- TODO 21 Dec 2006 17:35:08 -0000 1.18 *************** *** 10,14 **** -- Discovering -- ! + TCP SYN/FIN Ping (-PS [portlist]) + ARP/RAW Discovery --- 10,14 ---- -- Discovering -- ! + TCP SYN/FIN Ping (-PS/PF [portlist]) + ARP/RAW Discovery *************** *** 18,24 **** * Fix udp scan timeouts. * Fix Raw TCP scan timeouts. - * Rewrite raw_tcp_scan to make it support ping. + IP Protocol Scan (-SI) - * do setting random window/seq(ack and seg) for raw scanning + --ttl option and ttl random generation. + --badchksum option. --- 18,22 ---- *************** *** 29,31 **** -- Misc -- ! * test auto-selecting interface (to listen) and source ip to scan \ No newline at end of file --- 27,29 ---- -- Misc -- ! * test auto-selecting interface (to listen) and source ip to scan |
From: Alexander B. <da...@us...> - 2006-12-21 17:35:11
|
Update of /cvsroot/javanetsim/IceScan/nbproject In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv30605/nbproject Modified Files: configurations.xml Log Message: no message Index: configurations.xml =================================================================== RCS file: /cvsroot/javanetsim/IceScan/nbproject/configurations.xml,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** configurations.xml 21 Dec 2006 16:36:27 -0000 1.26 --- configurations.xml 21 Dec 2006 17:35:07 -0000 1.27 *************** *** 4,7 **** --- 4,9 ---- <logicalFolder name="icesockets" displayName="icesockets" projectFiles="true"> <itemPath>icesockets/cethwrapper.h</itemPath> + <itemPath>icesockets/cpcapreader.h</itemPath> + <itemPath>icesockets/crandom.h</itemPath> <itemPath>icesockets/crawsocket.h</itemPath> <itemPath>icesockets/csocket.h</itemPath> *************** *** 12,16 **** <itemPath>icesockets/sock_name.cc</itemPath> <itemPath>icesockets/sock_name.h</itemPath> - <itemPath>icesockets/sock_pcap.h</itemPath> <itemPath>icesockets/sock_types.h</itemPath> <itemPath>icesockets/sock_utils.cc</itemPath> --- 14,17 ---- *************** *** 120,126 **** <itemTool>3</itemTool> </item> - <item path="icesockets/sock_pcap.h"> - <itemTool>3</itemTool> - </item> <item path="icesockets/sock_win.h"> <itemTool>3</itemTool> --- 121,124 ---- *************** *** 180,183 **** --- 178,187 ---- </ccCompilerTool> </item> + <item path="icesockets/cpcapreader.h"> + <itemTool>3</itemTool> + </item> + <item path="icesockets/crandom.h"> + <itemTool>3</itemTool> + </item> </conf> </confs> |