[Javanetsim-cvs] javaNetSim/core CommandProcessor.java, 1.17, 1.18 DeviceConfig.java, 1.14, 1.15 Ne
Status: Beta
Brought to you by:
darkkey
|
From: QweR <qw...@us...> - 2008-10-03 22:29:33
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29998/core Modified Files: CommandProcessor.java DeviceConfig.java NetworkLayerDevice.java Log Message: ICMP unreacheable in ping correct sh run toString for DeviceConfig Index: NetworkLayerDevice.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkLayerDevice.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** NetworkLayerDevice.java 26 Sep 2008 17:53:49 -0000 1.18 --- NetworkLayerDevice.java 3 Oct 2008 22:29:10 -0000 1.19 *************** *** 31,34 **** --- 31,35 ---- import core.protocolsuite.tcp_ip.InvalidIPAddressException; import core.InvalidNetworkInterfaceNameException; + import core.protocolsuite.tcp_ip.ICMP_packet; import core.protocolsuite.tcp_ip.InvalidSubnetMaskException; import core.protocolsuite.tcp_ip.Route_entry; *************** *** 134,141 **** * @param inDestIPAddress - The Destination IP Addres eg: 192.168.0.2 * @throws CommunicationException ! * @return ICMP message ID * @version v0.20 */ ! public int sendPing(String inDestIPAddress) throws CommunicationException, LowLinkException{ return NodeProtocolStack.sendPing(inDestIPAddress); --- 135,142 ---- * @param inDestIPAddress - The Destination IP Addres eg: 192.168.0.2 * @throws CommunicationException ! * @return ICMP packet * @version v0.20 */ ! public ICMP_packet sendPing(String inDestIPAddress) throws CommunicationException, LowLinkException{ return NodeProtocolStack.sendPing(inDestIPAddress); *************** *** 143,154 **** /** ! * This method returns receive time of ICMP packet with messageID. * @author QweR * @param messageID - ICMP packet message ID ! * @return receive time of ICMP packet or zero if packet was not received * @version v0.21 */ ! public long getTimeICMPPacketReceived(int messageID){ ! return NodeProtocolStack.getTimeICMPPacketReceived(messageID); } --- 144,166 ---- /** ! * This method returns received ICMP packet with messageID. * @author QweR * @param messageID - ICMP packet message ID ! * @return received ICMP packet or null if packet was not received * @version v0.21 */ ! public ICMP_packet getReceivedICMPPacket(int messageID){ ! return NodeProtocolStack.getReceivedICMPPacket(messageID); ! } ! ! /** ! * This method remove and returns received ICMP packet with messageID. ! * @author QweR ! * @param messageID - ICMP packet message ID ! * @return received ICMP packet or null if packet was not received ! * @version v0.21 ! */ ! public ICMP_packet removeReceivedICMPPacket(int messageID){ ! return NodeProtocolStack.removeReceivedICMPPacket(messageID); } Index: CommandProcessor.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/CommandProcessor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CommandProcessor.java 3 Oct 2008 14:49:54 -0000 1.17 --- CommandProcessor.java 3 Oct 2008 22:29:09 -0000 1.18 *************** *** 2604,2613 **** } public String call(Vector<String> params){ ! String out = ""; ! Iterator<String> cnf = device.getConfig().getConfig(DeviceConfig.RUNNING_CONFIG).iterator(); ! while(cnf.hasNext()){ ! out += cnf.next() + "\n"; ! } ! return out; } }; --- 2604,2608 ---- } public String call(Vector<String> params){ ! return device.getConfig().toString(DeviceConfig.RUNNING_CONFIG); } }; *************** *** 2772,2781 **** } public String call(Vector<String> params){ ! String out = ""; ! Iterator<String> cnf = device.getConfig().getConfig(DeviceConfig.RUNNING_CONFIG).iterator(); ! while(cnf.hasNext()){ ! out += cnf.next() + "\n"; ! } ! return out; } }; --- 2767,2771 ---- } public String call(Vector<String> params){ ! return device.getConfig().toString(DeviceConfig.RUNNING_CONFIG); } }; *************** *** 2899,2908 **** } public String call(Vector<String> params){ ! String out = ""; ! Iterator<String> cnf = device.getConfig().getConfig(DeviceConfig.STARTUP_CONFIG).iterator(); ! while(cnf.hasNext()){ ! out += cnf.next() + "\n"; ! } ! return out; } }; --- 2889,2893 ---- } public String call(Vector<String> params){ ! return device.getConfig().toString(DeviceConfig.STARTUP_CONFIG); } }; *************** *** 3311,3320 **** } public String call(Vector<String> params){ ! String out = ""; ! Iterator<String> cnf = device.getConfig().getConfig(DeviceConfig.RUNNING_CONFIG).iterator(); ! while(cnf.hasNext()){ ! out += cnf.next() + "\n"; ! } ! return out; } }; --- 3296,3300 ---- } public String call(Vector<String> params){ ! return device.getConfig().toString(DeviceConfig.RUNNING_CONFIG); } }; Index: DeviceConfig.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/DeviceConfig.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** DeviceConfig.java 3 Oct 2008 14:49:54 -0000 1.14 --- DeviceConfig.java 3 Oct 2008 22:29:10 -0000 1.15 *************** *** 83,86 **** --- 83,95 ---- return config; } + + public String toString(int config_name){ + String out = ""; + Iterator<String> cnf = device.getConfig().getConfig(config_name).iterator(); + while(cnf.hasNext()){ + out += cnf.next() + "\n"; + } + return out; + } protected LinkedList getRealConfig(int config_name){ *************** *** 419,425 **** if(ni.isUP()) conf.add("no interface "+intName+" shutdown"); if(eni!=null && !eni.getMACAddress().equalsIgnoreCase(eni.defaultMACAddress)) conf.add("interface "+intName+" mac-address "+eni.getMACAddress()); ! if((eni!=null || sni!=null || wfi!=null) && device.getIPAddress((String)ins[i])!=null && !device.getIPAddress((String)ins[i]).equals("")) conf.add("interface "+intName+" ip address "+device.getIPAddress((String)ins[i])+" "+device.getSubnetMask((String)ins[i])); if(sni!=null && sni.getClockRate()!=sni.DEFAULT_CLOCKRATE) --- 428,436 ---- if(ni.isUP()) conf.add("no interface "+intName+" shutdown"); + else + conf.add("interface "+intName+" shutdown"); if(eni!=null && !eni.getMACAddress().equalsIgnoreCase(eni.defaultMACAddress)) conf.add("interface "+intName+" mac-address "+eni.getMACAddress()); ! if((eni!=null || sni!=null || wfi!=null) && device.getIPAddress((String)ins[i])!=null && !device.getIPAddress((String)ins[i]).equals("") && ni.isActive()) conf.add("interface "+intName+" ip address "+device.getIPAddress((String)ins[i])+" "+device.getSubnetMask((String)ins[i])); if(sni!=null && sni.getClockRate()!=sni.DEFAULT_CLOCKRATE) |