[Javanetsim-cvs] javaNetSim/guiUI MainScreen.java, 1.106, 1.107 SNMPSendDataDialog.java, 1.5, 1.6
Status: Beta
Brought to you by:
darkkey
From: QweR <qw...@us...> - 2009-10-23 20:06:50
|
Update of /cvsroot/javanetsim/javaNetSim/guiUI In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31328 Modified Files: MainScreen.java SNMPSendDataDialog.java Log Message: fixed problems with spaces in IP addresses Index: MainScreen.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/MainScreen.java,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** MainScreen.java 2 Oct 2009 16:37:24 -0000 1.106 --- MainScreen.java 23 Oct 2009 20:06:33 -0000 1.107 *************** *** 122,125 **** --- 122,126 ---- import core.protocolsuite.tcp_ip.Echo; import core.protocolsuite.tcp_ip.Echo_tcp; + import core.protocolsuite.tcp_ip.IPV4Address; import core.protocolsuite.tcp_ip.Route_entry; import core.protocolsuite.tcp_ip.SNMP; *************** *** 4172,4177 **** public void EchoSend(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE); if (ip == null) --- 4173,4178 ---- public void EchoSend(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE)); if (ip == null) *************** *** 4286,4291 **** public void EchotcpSend(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE); if (ip == null) --- 4287,4292 ---- public void EchotcpSend(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Send msg over Echo.", JOptionPane.QUESTION_MESSAGE)); if (ip == null) *************** *** 4338,4343 **** public void TelnetConnect(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", --- 4339,4344 ---- public void TelnetConnect(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE)); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", *************** *** 4363,4368 **** public void PosixTelnet(String inNodeName) { ! String ip = JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", --- 4364,4369 ---- public void PosixTelnet(String inNodeName) { ! String ip = IPV4Address.sanitizeDecIPorName(JOptionPane.showInputDialog(this, "Server IP:", ! "Telnet connect to...", JOptionPane.QUESTION_MESSAGE)); if (ip != null) { String port = JOptionPane.showInputDialog(this, "Server Port:", Index: SNMPSendDataDialog.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/guiUI/SNMPSendDataDialog.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SNMPSendDataDialog.java 17 Sep 2009 12:02:49 -0000 1.5 --- SNMPSendDataDialog.java 23 Oct 2009 20:06:33 -0000 1.6 *************** *** 47,50 **** --- 47,51 ---- import core.Simulation; + import core.protocolsuite.tcp_ip.IPV4Address; import core.protocolsuite.tcp_ip.SNMP; *************** *** 240,263 **** Vector<String> vars = new Vector<String>(0); Vector<String> vals = new Vector<String>(0); if(parseVariablesList(txtVariables.getText(),vars,vals)) { String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(txtIPAddress.getText(), Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + txtIPAddress.getText() + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); --- 241,265 ---- Vector<String> vars = new Vector<String>(0); Vector<String> vals = new Vector<String>(0); + String ip = IPV4Address.sanitizeDecIPorName(txtIPAddress.getText()); if(parseVariablesList(txtVariables.getText(),vars,vals)) { String s = txtMessage.getText().toLowerCase(); if(s.compareTo("get")==0) { ! controller.addToConsole("Trying to send get-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + ip + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getRequest(ip, Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + ip + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("getnext")==0) { ! controller.addToConsole("Trying to send getnext-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + ip + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).getNextRequest(ip, Integer.valueOf(txtPort.getText()).intValue(), vars, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + ip + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); } else if(s.compareTo("set")==0) { ! controller.addToConsole("Trying to send set-Request with variables: {" + txtVariables.getText() + "} from " + NodeName + " to " + ip + ":" + txtPort.getText() + "\n"); ! if(!((SNMP)((core.ApplicationLayerDevice)Sim.getNode(NodeName)).getApp(30161)).setRequest(ip, Integer.valueOf(txtPort.getText()).intValue(), vars, vals, txtPassword.getText())) { ! controller.addToConsole("Message '" + txtMessage.getText() + "' from " + NodeName + " to " + ip + ":" + txtPort.getText() + " not sent\n"); } this.dispose(); |