[Javanetsim-cvs] javaNetSim/core AccessListEngine.java, 1.5, 1.6 ApplicationLayerDevice.java, 1.11,
Status: Beta
Brought to you by:
darkkey
Update of /cvsroot/javanetsim/javaNetSim/core In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4280/core Modified Files: AccessListEngine.java ApplicationLayerDevice.java CSUDSU.java CommandInterface.java CommandProcessor.java CommandsTree.java CommunicationException.java ConsoleLink.java ConsoleNetworkInterface.java DataLinkLayerDevice.java DeviceConfig.java Error.java EthernetLink.java EthernetNetworkInterface.java ExternalProxy.java FalseRandom.java FiberEthernetLink.java FiberEthernetNetworkInterface.java FiberLink.java FiberNetworkInterfacePort.java Hub.java InvalidDataLinkLayerDeviceException.java InvalidDefaultGatewayException.java InvalidLinkConnectionException.java InvalidLinkNameException.java InvalidNetworkInterfaceNameException.java InvalidNetworkLayerDeviceException.java InvalidNodeNameException.java InvalidProtocolStackException.java Laptop.java LayerInfoHandler.java Link.java LowLinkException.java MultilayerSwitch.java NATEngine.java NetworkInterface.java NetworkInterfacePort.java NetworkLayerDevice.java Node.java PC.java Packet.java Printer.java Router.java SerialLink.java SerialNetworkInterface.java Simulation.java SimulationException.java Switch.java TransportLayerException.java TransportLayerPortException.java W80211_packet.java WANCorbaClient.java WANCorbaHelper.java WANCorbaPOA.java WANCorbaServer.java WANDatagram.java WANNetworkInterface.java WANRMI.java WANRMICallback.java WANRMIClient.java WANRMIServer.java WANSocket.java WiFiInterface.java WiFiPort.java WirelessAP.java _WANCorbaStub.java Log Message: Refactoring && bugfixing Index: EthernetLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/EthernetLink.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** EthernetLink.java 5 Oct 2008 19:12:30 -0000 1.16 --- EthernetLink.java 24 Oct 2008 16:18:48 -0000 1.17 *************** *** 29,34 **** package core; ! import java.util.*; ! import core.FalseRandom; /** * EthernetLink extends Link. It sets two Interface links to a pc. --- 29,33 ---- package core; ! import java.util.Iterator; /** * EthernetLink extends Link. It sets two Interface links to a pc. *************** *** 41,45 **** public class EthernetLink extends Link { ! java.security.SecureRandom rng; /** --- 40,48 ---- public class EthernetLink extends Link { ! /** ! * ! */ ! private static final long serialVersionUID = 5723796766035188219L; ! java.security.SecureRandom rng; /** Index: Hub.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Hub.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Hub.java 19 Oct 2007 17:40:33 -0000 1.8 --- Hub.java 24 Oct 2008 16:18:48 -0000 1.9 *************** *** 28,32 **** */ package core; ! import java.util.*; /** --- 28,32 ---- */ package core; ! import java.util.Enumeration; /** *************** *** 43,46 **** --- 43,51 ---- /** + * + */ + private static final long serialVersionUID = 5903950146027279730L; + + /** * This creates a layer 1 hub with a default of 4 interface (ports) * @author luke_hamilton *************** *** 60,68 **** ! public void Reset(){ sz = 0; } ! public int getState(){ return sz; } --- 65,75 ---- ! @Override ! public void Reset(){ sz = 0; } ! @Override ! public int getState(){ return sz; } *************** *** 76,79 **** --- 83,87 ---- */ + @Override protected void receivePacket(Packet inPacket,String inInterfaceName) throws LowLinkException{ if(sz!=1){ Index: Error.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Error.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Error.java 3 Sep 2006 14:32:08 -0000 1.2 --- Error.java 24 Oct 2008 16:18:48 -0000 1.3 *************** *** 1,4 **** package core; - import java.io.*; --- 1,3 ---- Index: TransportLayerPortException.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/TransportLayerPortException.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TransportLayerPortException.java 20 Nov 2005 20:32:52 -0000 1.1 --- TransportLayerPortException.java 24 Oct 2008 16:18:48 -0000 1.2 *************** *** 72,76 **** { ! /** Creates a new instance of TransportLayerException */ public TransportLayerPortException(String inExceptionMsg) { --- 72,81 ---- { ! /** ! * ! */ ! private static final long serialVersionUID = -4761215933031049021L; ! ! /** Creates a new instance of TransportLayerException */ public TransportLayerPortException(String inExceptionMsg) { *************** *** 84,87 **** --- 89,93 ---- */ + @Override public String toString() { Index: InvalidNetworkInterfaceNameException.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/InvalidNetworkInterfaceNameException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InvalidNetworkInterfaceNameException.java 20 Nov 2005 20:30:53 -0000 1.2 --- InvalidNetworkInterfaceNameException.java 24 Oct 2008 16:18:48 -0000 1.3 *************** *** 38,41 **** --- 38,46 ---- /** + * + */ + private static final long serialVersionUID = -809986480259836522L; + + /** * This method throw inExceptionMsg up to the super class Simulation * Excpetion Index: WANRMIServer.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/WANRMIServer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WANRMIServer.java 27 Nov 2007 16:56:27 -0000 1.3 --- WANRMIServer.java 24 Oct 2008 16:18:48 -0000 1.4 *************** *** 2,7 **** package core; ! import java.rmi.*; ! import java.rmi.server.*; /** --- 2,7 ---- package core; ! import java.rmi.RemoteException; ! import java.rmi.server.UnicastRemoteObject; /** *************** *** 10,14 **** */ public class WANRMIServer extends UnicastRemoteObject implements WANRMI{ ! WANNetworkInterface parentInterface; /** Creates a new instance of WANRMIServer */ --- 10,18 ---- */ public class WANRMIServer extends UnicastRemoteObject implements WANRMI{ ! /** ! * ! */ ! private static final long serialVersionUID = -1790660178112345871L; ! WANNetworkInterface parentInterface; /** Creates a new instance of WANRMIServer */ Index: Laptop.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Laptop.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Laptop.java 18 Oct 2008 20:07:24 -0000 1.1 --- Laptop.java 24 Oct 2008 16:18:48 -0000 1.2 *************** *** 57,70 **** - import core.protocolsuite.tcp_ip.Echo; - import core.protocolsuite.tcp_ip.RIP; - import core.protocolsuite.tcp_ip.Telnet_server; - import core.protocolsuite.tcp_ip.Telnet_client; import core.protocolsuite.tcp_ip.DHCPC; - import core.protocolsuite.tcp_ip.DHCPD; import core.protocolsuite.tcp_ip.DNS; import core.protocolsuite.tcp_ip.Echo_tcp; import core.protocolsuite.tcp_ip.PosixTelnetClient; import core.protocolsuite.tcp_ip.SNMP; --- 57,67 ---- import core.protocolsuite.tcp_ip.DHCPC; import core.protocolsuite.tcp_ip.DNS; + import core.protocolsuite.tcp_ip.Echo; import core.protocolsuite.tcp_ip.Echo_tcp; import core.protocolsuite.tcp_ip.PosixTelnetClient; import core.protocolsuite.tcp_ip.SNMP; + import core.protocolsuite.tcp_ip.Telnet_client; *************** *** 89,92 **** --- 86,94 ---- /** + * + */ + private static final long serialVersionUID = -8692117217516199205L; + + /** * Constructs a PC with the specified name. * @author tristan_veness *************** *** 98,102 **** } ! public void initApplications(){ super.initApplications(); --- 100,105 ---- } ! @Override ! public void initApplications(){ super.initApplications(); *************** *** 108,114 **** Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.Simulation.UIDGen++); ! SNMP snmpManager = new SNMP((ApplicationLayerDevice)this, NodeProtocolStack, 0, 1, core.Simulation.UIDGen++); ! Telnet_client telnetClient = new Telnet_client((ApplicationLayerDevice)this, NodeProtocolStack, 0, 0, core.Simulation.UIDGen++); PosixTelnetClient ptc = new PosixTelnetClient(NodeProtocolStack, core.Simulation.UIDGen++); --- 111,117 ---- Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.Simulation.UIDGen++); ! SNMP snmpManager = new SNMP(this, NodeProtocolStack, 0, 1, core.Simulation.UIDGen++); ! Telnet_client telnetClient = new Telnet_client(this, NodeProtocolStack, 0, 0, core.Simulation.UIDGen++); PosixTelnetClient ptc = new PosixTelnetClient(NodeProtocolStack, core.Simulation.UIDGen++); *************** *** 118,136 **** DNS dnsClient = new DNS(NodeProtocolStack, 91, 0, core.Simulation.UIDGen++); ! addApp(echoServer, ECHO_SERVER_ID); ! addApp(echoClient, ECHO_CLIENT_ID); ! addApp(echotcpServer, ECHO_TCP_SERVER_ID); ! addApp(echotcpClient, ECHO_TCP_CLIENT_ID); ! addApp(telnetClient, TELNET_CLIENT_ID); ! addApp(ptc, POSIX_TELNET_CLIENT_ID); ! addApp(snmpManager, SNMP_MANAGER_ID); ! addApp(dhcpc, DHCP_CLIENT_ID); ! addApp(dnsClient,DNS_CLIENT_ID); } --- 121,139 ---- DNS dnsClient = new DNS(NodeProtocolStack, 91, 0, core.Simulation.UIDGen++); ! addApp(echoServer, ApplicationLayerDevice.ECHO_SERVER_ID); ! addApp(echoClient, ApplicationLayerDevice.ECHO_CLIENT_ID); ! addApp(echotcpServer, ApplicationLayerDevice.ECHO_TCP_SERVER_ID); ! addApp(echotcpClient, ApplicationLayerDevice.ECHO_TCP_CLIENT_ID); ! addApp(telnetClient, ApplicationLayerDevice.TELNET_CLIENT_ID); ! addApp(ptc, ApplicationLayerDevice.POSIX_TELNET_CLIENT_ID); ! addApp(snmpManager, ApplicationLayerDevice.SNMP_MANAGER_ID); ! addApp(dhcpc, ApplicationLayerDevice.DHCP_CLIENT_ID); ! addApp(dnsClient,ApplicationLayerDevice.DNS_CLIENT_ID); } Index: ConsoleLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/ConsoleLink.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ConsoleLink.java 14 Oct 2007 17:19:07 -0000 1.1 --- ConsoleLink.java 24 Oct 2008 16:18:48 -0000 1.2 *************** *** 29,34 **** package core; - import java.util.*; - import core.FalseRandom; /** * ConsoleLink extends Link. It sets two Interface links to a pc. --- 29,32 ---- *************** *** 43,46 **** --- 41,49 ---- /** + * + */ + private static final long serialVersionUID = 3739538944636179176L; + + /** * Constructor to be used by the Simulation when connecting 2 PC's * We have made a design decision to restrict a Ethernet link to only has 2 ends. Index: SerialLink.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/SerialLink.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** SerialLink.java 5 Oct 2008 19:12:31 -0000 1.5 --- SerialLink.java 24 Oct 2008 16:18:48 -0000 1.6 *************** *** 29,33 **** package core; ! import java.util.*; /** * SerialLink extends Link. It sets two Interface links to a pc. --- 29,33 ---- package core; ! import java.util.Iterator; /** * SerialLink extends Link. It sets two Interface links to a pc. *************** *** 41,44 **** --- 41,50 ---- public class SerialLink extends Link { + /** + * + */ + private static final long serialVersionUID = -8760714768329454957L; + + public SerialLink(String inName, NetworkInterface inFirstNodeInterface, NetworkInterface inSecondNodeInterface)throws InvalidLinkConnectionException { super(inName); *************** *** 70,74 **** if (!temp.getSourceName().equals(inSourceName)) { ! temp.receivePacket(inPacket); } } --- 76,80 ---- if (!temp.getSourceName().equals(inSourceName)) { ! temp.receivePacket(inPacket); } } Index: SimulationException.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/SimulationException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimulationException.java 20 Nov 2005 20:30:53 -0000 1.2 --- SimulationException.java 24 Oct 2008 16:18:48 -0000 1.3 *************** *** 37,40 **** --- 37,44 ---- */ public class SimulationException extends Exception{ + /** + * + */ + private static final long serialVersionUID = -6246457071432271373L; protected String exceptionMsg; /** *************** *** 55,58 **** --- 59,63 ---- * @version v0.20 */ + @Override public String toString(){ return "Exception Details: "+exceptionMsg; Index: WANSocket.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/WANSocket.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** WANSocket.java 23 Sep 2008 15:22:13 -0000 1.7 --- WANSocket.java 24 Oct 2008 16:18:48 -0000 1.8 *************** *** 9,14 **** package core; ! import java.io.*; ! import java.net.*; /** --- 9,19 ---- package core; ! import java.io.BufferedReader; ! import java.io.InputStream; ! import java.io.InputStreamReader; ! import java.io.OutputStreamWriter; ! import java.io.PrintWriter; ! import java.net.ServerSocket; ! import java.net.Socket; /** *************** *** 111,118 **** WANNetworkInterface parentInterface; - private InputStream in; - private BufferedReader reader; - - IncomeConnectionHandler(ServerSocket s, WANSocket w, WANNetworkInterface parentInterface) { this.s = s; --- 116,119 ---- *************** *** 122,126 **** } ! public void run() { try{ while(s != null){ --- 123,128 ---- } ! @Override ! public void run() { try{ while(s != null){ *************** *** 155,161 **** WANSocket w; - private InputStream in; - private BufferedReader reader; - WANNetworkInterface parentInterface; --- 157,160 ---- *************** *** 168,172 **** } ! public void run() { try{ parentInterface.addLayerInfo("Wan interface", "Connected to peer."); --- 167,172 ---- } ! @Override ! public void run() { try{ parentInterface.addLayerInfo("Wan interface", "Connected to peer."); Index: CommandProcessor.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/CommandProcessor.java,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** CommandProcessor.java 23 Oct 2008 17:08:27 -0000 1.32 --- CommandProcessor.java 24 Oct 2008 16:18:48 -0000 1.33 *************** *** 10,13 **** --- 10,28 ---- package core; + import java.util.ArrayList; + import java.util.Calendar; + import java.util.Enumeration; + import java.util.Hashtable; + import java.util.Iterator; + import java.util.TreeSet; + import java.util.Vector; + import java.util.regex.Matcher; + import java.util.regex.Pattern; + + import core.AccessListEngine.access_list; + import core.CommandInterface.Modes; + import core.NATEngine.NAT_rule; + import core.NATEngine.NAT_session; + import core.WiFiPort.APClient; import core.protocolsuite.tcp_ip.DHCPC; import core.protocolsuite.tcp_ip.DHCPD; *************** *** 26,45 **** import core.protocolsuite.tcp_ip.jnSocket; - import java.util.ArrayList; - import java.util.Calendar; - import java.util.Enumeration; - import java.util.Hashtable; - import java.util.Iterator; - import java.util.TreeSet; - import java.util.Vector; - import java.util.regex.Matcher; - import java.util.regex.Pattern; - - import core.CommandInterface.Modes; - import core.NATEngine.NAT_rule; - import core.NATEngine.NAT_session; - import core.WiFiPort.APClient; - import core.AccessListEngine.access_list; - /** * --- 41,44 ---- *************** *** 445,459 **** public String call(Vector<String> params){ String out = ""; ! if(device instanceof NetworkLayerDevice){ ! NetworkLayerDevice ndev = (NetworkLayerDevice) device; ! if(params.size()==0){ ! ndev.clearVlan(); ! } ! else{ ! out += "error: invalid parameters\n"; ! } } else{ ! out += "This instruction not supported by device\n"; } return out; --- 444,453 ---- public String call(Vector<String> params){ String out = ""; ! NetworkLayerDevice ndev = device; ! if(params.size()==0){ ! ndev.clearVlan(); } else{ ! out += "error: invalid parameters\n"; } return out; Index: NATEngine.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NATEngine.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NATEngine.java 13 Oct 2008 21:20:21 -0000 1.8 --- NATEngine.java 24 Oct 2008 16:18:48 -0000 1.9 *************** *** 1,9 **** package core; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; ! import java.util.ArrayList; ! import core.protocolsuite.tcp_ip.*; public class NATEngine { --- 1,14 ---- package core; + import java.util.ArrayList; import java.util.Enumeration; import java.util.Hashtable; import java.util.Vector; ! ! import core.protocolsuite.tcp_ip.ICMP_packet; ! import core.protocolsuite.tcp_ip.IPV4Address; ! import core.protocolsuite.tcp_ip.IP_packet; ! import core.protocolsuite.tcp_ip.TCP_packet; ! import core.protocolsuite.tcp_ip.UDP_packet; public class NATEngine { *************** *** 58,62 **** public final static int UDP = 2; public final static int TCP = 3; ! public int protocol = IP; public String in_ip = ""; --- 63,67 ---- public final static int UDP = 2; public final static int TCP = 3; ! public int protocol = NAT_rule.IP; public String in_ip = ""; Index: InvalidProtocolStackException.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/InvalidProtocolStackException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InvalidProtocolStackException.java 20 Nov 2005 20:30:53 -0000 1.2 --- InvalidProtocolStackException.java 24 Oct 2008 16:18:48 -0000 1.3 *************** *** 38,41 **** --- 38,46 ---- public class InvalidProtocolStackException extends SimulationException { /** + * + */ + private static final long serialVersionUID = -4162090886186590648L; + + /** * This method throw inExceptionMsg up to the super class Simulation * Excpetion Index: LayerInfoHandler.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/LayerInfoHandler.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** LayerInfoHandler.java 10 Nov 2007 13:25:38 -0000 1.3 --- LayerInfoHandler.java 24 Oct 2008 16:18:48 -0000 1.4 *************** *** 29,33 **** ! import java.util.*; /** --- 29,34 ---- ! import java.util.Iterator; ! import java.util.Vector; /** Index: ExternalProxy.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/ExternalProxy.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ExternalProxy.java 13 Oct 2008 12:36:15 -0000 1.6 --- ExternalProxy.java 24 Oct 2008 16:18:48 -0000 1.7 *************** *** 28,35 **** package core; ! import core.protocolsuite.tcp_ip.*; ! import java.util.*; ! import java.io.*; ! import java.net.*; /** --- 28,38 ---- package core; ! import java.io.IOException; ! import java.net.Socket; ! import java.util.Hashtable; ! ! import core.protocolsuite.tcp_ip.ExternalProxyApp; ! import core.protocolsuite.tcp_ip.IP_packet; ! import core.protocolsuite.tcp_ip.TCP_packet; /** *************** *** 43,47 **** public class ExternalProxy extends NetworkLayerDevice { ! int externalPort; String externalIP; ExternalProxyApp NE; --- 46,54 ---- public class ExternalProxy extends NetworkLayerDevice { ! /** ! * ! */ ! private static final long serialVersionUID = -426558271140634982L; ! int externalPort; String externalIP; ExternalProxyApp NE; *************** *** 78,82 **** } ! public void receivePacket(Packet inPacket) throws LowLinkException { if(inPacket instanceof IP_packet){ if(busy) return; --- 85,90 ---- } ! @Override ! public void receivePacket(Packet inPacket) throws LowLinkException { if(inPacket instanceof IP_packet){ if(busy) return; *************** *** 129,133 **** ! public void sendPacket(String inDestMACAddress, Packet inPacket, String inInterfaceKey) throws InvalidNetworkInterfaceNameException, CommunicationException, LowLinkException{ if (NetworkInterfacetable.containsKey(inInterfaceKey)) { --- 137,142 ---- ! @Override ! public void sendPacket(String inDestMACAddress, Packet inPacket, String inInterfaceKey) throws InvalidNetworkInterfaceNameException, CommunicationException, LowLinkException{ if (NetworkInterfacetable.containsKey(inInterfaceKey)) { Index: InvalidNetworkLayerDeviceException.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/InvalidNetworkLayerDeviceException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** InvalidNetworkLayerDeviceException.java 20 Nov 2005 20:30:53 -0000 1.2 --- InvalidNetworkLayerDeviceException.java 24 Oct 2008 16:18:48 -0000 1.3 *************** *** 35,38 **** --- 35,43 ---- public class InvalidNetworkLayerDeviceException extends SimulationException { /** + * + */ + private static final long serialVersionUID = -281417850697407145L; + + /** * This method throw inExceptionMsg up to the super class Simulation * Excpetion Index: AccessListEngine.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/AccessListEngine.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** AccessListEngine.java 13 Oct 2008 12:36:15 -0000 1.5 --- AccessListEngine.java 24 Oct 2008 16:18:48 -0000 1.6 *************** *** 118,122 **** Enumeration e = ACLl.keys(); while(e.hasMoreElements()){ ! temp_acl = (access_list)ACLl.get((Integer)e.nextElement()); if(temp_acl.action == action && temp_acl.IP1.equals(IP1) && --- 118,122 ---- Enumeration e = ACLl.keys(); while(e.hasMoreElements()){ ! temp_acl = (access_list)ACLl.get(e.nextElement()); if(temp_acl.action == action && temp_acl.IP1.equals(IP1) && *************** *** 143,147 **** Enumeration e = ACLl.keys(); while(e.hasMoreElements()){ ! temp_acl = (access_list)ACLl.get((Integer)e.nextElement()); if(temp_acl.action == action && (protocol==-1 || temp_acl.protocol == protocol) && --- 143,147 ---- Enumeration e = ACLl.keys(); while(e.hasMoreElements()){ ! temp_acl = (access_list)ACLl.get(e.nextElement()); if(temp_acl.action == action && (protocol==-1 || temp_acl.protocol == protocol) && *************** *** 213,217 **** Enumeration e = ACLl.keys(); while(e.hasMoreElements()){ ! temp_acl = (access_list)ACLl.get((Integer)e.nextElement()); if(temp_acl.action>0){ --- 213,217 ---- Enumeration e = ACLl.keys(); while(e.hasMoreElements()){ ! temp_acl = (access_list)ACLl.get(e.nextElement()); if(temp_acl.action>0){ Index: Router.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Router.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Router.java 6 Oct 2008 13:20:39 -0000 1.11 --- Router.java 24 Oct 2008 16:18:48 -0000 1.12 *************** *** 46,49 **** --- 46,54 ---- /** + * + */ + private static final long serialVersionUID = -6546396346550074138L; + + /** * Constructs a new Router with the specified name and is given two * Network Interfaces *************** *** 56,67 **** } ! public void initApplications(){ super.initApplications(); RIP ripServer=new RIP(NodeProtocolStack,core.Simulation.UIDGen++); ! SNMP snmpAgent = new SNMP((ApplicationLayerDevice)this, NodeProtocolStack, SNMP.DEFAULT_PORT, 0, core.Simulation.UIDGen++); ! Telnet_server telnetServer = new Telnet_server((ApplicationLayerDevice)this, NodeProtocolStack, 23, 1, core.Simulation.UIDGen++); DHCPD dhcpd = new DHCPD(NodeProtocolStack, core.Simulation.UIDGen++); --- 61,73 ---- } ! @Override ! public void initApplications(){ super.initApplications(); RIP ripServer=new RIP(NodeProtocolStack,core.Simulation.UIDGen++); ! SNMP snmpAgent = new SNMP(this, NodeProtocolStack, SNMP.DEFAULT_PORT, 0, core.Simulation.UIDGen++); ! Telnet_server telnetServer = new Telnet_server(this, NodeProtocolStack, 23, 1, core.Simulation.UIDGen++); DHCPD dhcpd = new DHCPD(NodeProtocolStack, core.Simulation.UIDGen++); *************** *** 70,83 **** DNS dnsClient = new DNS(NodeProtocolStack, 91, 0, core.Simulation.UIDGen++); ! addApp(ripServer,RIP_SERVER_ID); ! addApp(telnetServer, TELNET_SERVER_ID); ! addApp(snmpAgent, SNMP_AGENT_ID); ! addApp(dhcpd, DHCP_SERVER_ID); ! addApp(dhcpc, DHCP_CLIENT_ID); ! addApp(dnsClient,DNS_CLIENT_ID); } --- 76,89 ---- DNS dnsClient = new DNS(NodeProtocolStack, 91, 0, core.Simulation.UIDGen++); ! addApp(ripServer,ApplicationLayerDevice.RIP_SERVER_ID); ! addApp(telnetServer, ApplicationLayerDevice.TELNET_SERVER_ID); ! addApp(snmpAgent, ApplicationLayerDevice.SNMP_AGENT_ID); ! addApp(dhcpd, ApplicationLayerDevice.DHCP_SERVER_ID); ! addApp(dhcpc, ApplicationLayerDevice.DHCP_CLIENT_ID); ! addApp(dnsClient,ApplicationLayerDevice.DNS_CLIENT_ID); } Index: SerialNetworkInterface.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/SerialNetworkInterface.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** SerialNetworkInterface.java 5 Oct 2008 18:41:06 -0000 1.7 --- SerialNetworkInterface.java 24 Oct 2008 16:18:48 -0000 1.8 *************** *** 30,34 **** public class SerialNetworkInterface extends NetworkInterface{ ! /** * FrameRelay ClockRate * */ --- 30,38 ---- public class SerialNetworkInterface extends NetworkInterface{ ! /** ! * ! */ ! private static final long serialVersionUID = -4159063989094846370L; ! /** * FrameRelay ClockRate * */ *************** *** 40,51 **** protected SerialNetworkInterface(long UID, String inName, Node parent) { super(UID, inName,parent); ! ClockRate = DEFAULT_CLOCKRATE; } ! protected void receivePacket(Packet inPacket) throws LowLinkException { Serial_packet tempPacket = (Serial_packet)inPacket; ! if(tempPacket.getClockRate() == ClockRate ){ LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); --- 44,56 ---- protected SerialNetworkInterface(long UID, String inName, Node parent) { super(UID, inName,parent); ! ClockRate = SerialNetworkInterface.DEFAULT_CLOCKRATE; } ! @Override ! protected void receivePacket(Packet inPacket) throws LowLinkException { Serial_packet tempPacket = (Serial_packet)inPacket; ! if((tempPacket.getClockRate() == 0 && ClockRate>0) || (tempPacket.getClockRate() > 0 && ClockRate == 0)){ LayerInfo pingInfo = new LayerInfo(getClass().getName()); pingInfo.setObjectName(parentNode.getName()); *************** *** 67,74 **** } ! public int getType(){ return NetworkInterface.Serial; } protected void sendPacket(Packet inPacket) throws LowLinkException { --- 72,81 ---- } ! @Override ! public int getType(){ return NetworkInterface.Serial; } + @Override protected void sendPacket(Packet inPacket) throws LowLinkException { *************** *** 112,116 **** } ! public boolean isActive(){ return true; } --- 119,124 ---- } ! @Override ! public boolean isActive(){ return true; } *************** *** 128,131 **** --- 136,140 ---- * @version v0.20 */ + @Override protected String getDetails(){ *************** *** 133,136 **** --- 142,146 ---- } + @Override public void Timer(int temp){ } } Index: CommandsTree.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/CommandsTree.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CommandsTree.java 10 Sep 2008 21:35:37 -0000 1.7 --- CommandsTree.java 24 Oct 2008 16:18:48 -0000 1.8 *************** *** 12,15 **** --- 12,16 ---- import java.util.LinkedList; import java.util.Vector; + import core.CommandInterface.Modes; *************** *** 71,75 **** CommandNode node = (CommandNode)tree.get(i); String nodename = node.getName(); ! if(!nodename.equals(ANYWORD)){ if(nodename.length()>cmdsize) nodename = nodename.substring(0,cmdsize); int cmp = command.compareToIgnoreCase(nodename); --- 72,76 ---- CommandNode node = (CommandNode)tree.get(i); String nodename = node.getName(); ! if(!nodename.equals(CommandsTree.ANYWORD)){ if(nodename.length()>cmdsize) nodename = nodename.substring(0,cmdsize); int cmp = command.compareToIgnoreCase(nodename); *************** *** 270,274 **** public String call(String command, Modes mode){ String result = null; ! if(command.startsWith(COMMENT)){ //result = command; //result = command.substring(COMMENT.length()); --- 271,275 ---- public String call(String command, Modes mode){ String result = null; ! if(command.startsWith(CommandsTree.COMMENT)){ //result = command; //result = command.substring(COMMENT.length()); *************** *** 288,292 **** node = node.getNode(cmds[i], mode); if(node != null){ ! if(node.getName().equals(ANYWORD)){ vprms.add(cmds[i]); } --- 289,293 ---- node = node.getNode(cmds[i], mode); if(node != null){ ! if(node.getName().equals(CommandsTree.ANYWORD)){ vprms.add(cmds[i]); } *************** *** 365,370 **** CommandNode node = root; - CommandInterface func = null; - int modes = 0; for(int i=0; i<cmds.length && node!=null && node.modes.isContain(mode); i++){ if(i<cmds.length-1){ --- 366,369 ---- Index: Simulation.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** Simulation.java 22 Oct 2008 08:54:15 -0000 1.35 --- Simulation.java 24 Oct 2008 16:18:48 -0000 1.36 *************** *** 29,43 **** package core; import java.io.Serializable; ! import java.util.*; ! import java.lang.reflect.*; ! ! import core.protocolsuite.tcp_ip.IPV4Address; ! import core.protocolsuite.tcp_ip.Route_entry; ! import core.protocolsuite.tcp_ip.InvalidIPAddressException; ! import core.protocolsuite.tcp_ip.InvalidSubnetMaskException; public class Simulation implements Serializable { /** * @link aggregation <{core.Link}> * @directed directed --- 29,48 ---- package core; import java.io.Serializable; ! import java.lang.reflect.Constructor; ! import java.util.ArrayList; ! import java.util.Collections; ! import java.util.Enumeration; ! import java.util.Hashtable; ! import java.util.Iterator; ! import java.util.Vector; public class Simulation implements Serializable { /** + * + */ + private static final long serialVersionUID = -3851012405328883446L; + + /** * @link aggregation <{core.Link}> * @directed directed *************** *** 92,97 **** //layerInfoHandler = new LayerInfoHandler(); ! if(Sim!=null){ ! Sim = null; } --- 97,102 ---- //layerInfoHandler = new LayerInfoHandler(); ! if(Simulation.Sim!=null){ ! Simulation.Sim = null; } *************** *** 101,111 **** wifiMedium = new Hashtable<java.lang.Long, WiFiPort>(); ! UIDGen = 0; ! Sim = this; } public void clear(){ ! Sim = null; } --- 106,116 ---- wifiMedium = new Hashtable<java.lang.Long, WiFiPort>(); ! Simulation.UIDGen = 0; ! Simulation.Sim = this; } public void clear(){ ! Simulation.Sim = null; } *************** *** 349,353 **** **/ private void setProtocolType(int inProtocolType) { ! PROTOCOL_TYPE = inProtocolType; } --- 354,358 ---- **/ private void setProtocolType(int inProtocolType) { ! Simulation.PROTOCOL_TYPE = inProtocolType; } *************** *** 360,364 **** **/ public static int getProtocolType() { ! return PROTOCOL_TYPE; } --- 365,369 ---- **/ public static int getProtocolType() { ! return Simulation.PROTOCOL_TYPE; } *************** *** 983,987 **** **/ public static void addLayerInfo(LayerInfo inInfo){ ! Info.receiveInfo(inInfo); } --- 988,992 ---- **/ public static void addLayerInfo(LayerInfo inInfo){ ! Simulation.Info.receiveInfo(inInfo); } *************** *** 992,996 **** inInfo.setLayer(layer); inInfo.setDescription(desc); ! Info.receiveInfo(inInfo); } --- 997,1001 ---- inInfo.setLayer(layer); inInfo.setDescription(desc); ! Simulation.Info.receiveInfo(inInfo); } *************** *** 1002,1006 **** */ public void clearLayerInfo(){ ! Info.clear(); } --- 1007,1011 ---- */ public void clearLayerInfo(){ ! Simulation.Info.clear(); } *************** *** 1014,1018 **** */ public Vector getRecordedInfo(){ ! return Info.getRecordedInfo(); } --- 1019,1023 ---- */ public Vector getRecordedInfo(){ ! return Simulation.Info.getRecordedInfo(); } *************** *** 1119,1136 **** vecInterfaceInfo.add(strInterfaceName); try{ ! vecInterfaceInfo.add((String)tempNetwork.getIntSType(strInterfaceName)); ! vecInterfaceInfo.add((String)tempNetwork.getMACAddress(strInterfaceName)); String tempIP = tempNetwork.getIPAddress(strInterfaceName); if(tempIP != null) { ! vecInterfaceInfo.add((String)tempNetwork.getIPAddress(strInterfaceName)); } else { ! vecInterfaceInfo.add((String)"IP Address not set"); } ! vecInterfaceInfo.add((String)tempNetwork.getSubnetMask(strInterfaceName)); NetworkInterface tempNetworkCard = tempNetwork.getNetworkInterface(strInterfaceName); ! vecInterfaceInfo.add((String)tempNetworkCard.getConnectLinkName()); } --- 1124,1141 ---- vecInterfaceInfo.add(strInterfaceName); try{ ! vecInterfaceInfo.add(tempNetwork.getIntSType(strInterfaceName)); ! vecInterfaceInfo.add(tempNetwork.getMACAddress(strInterfaceName)); String tempIP = tempNetwork.getIPAddress(strInterfaceName); if(tempIP != null) { ! vecInterfaceInfo.add(tempNetwork.getIPAddress(strInterfaceName)); } else { ! vecInterfaceInfo.add("IP Address not set"); } ! vecInterfaceInfo.add(tempNetwork.getSubnetMask(strInterfaceName)); NetworkInterface tempNetworkCard = tempNetwork.getNetworkInterface(strInterfaceName); ! vecInterfaceInfo.add(tempNetworkCard.getConnectLinkName()); } *************** *** 1161,1170 **** vecInterfaceInfo.add("Not Applicable"); vecInterfaceInfo.add(strInterfaceName); ! vecInterfaceInfo.add((String)tempData.getIntSType(strInterfaceName)); vecInterfaceInfo.add("Not Applicable"); vecInterfaceInfo.add("Not Applicable"); vecInterfaceInfo.add("Not Applicable"); NetworkInterface tempNetworkCard = tempData.getNetworkInterface(strInterfaceName); ! vecInterfaceInfo.add((String)tempNetworkCard.getConnectLinkName()); } --- 1166,1175 ---- vecInterfaceInfo.add("Not Applicable"); vecInterfaceInfo.add(strInterfaceName); ! vecInterfaceInfo.add(tempData.getIntSType(strInterfaceName)); vecInterfaceInfo.add("Not Applicable"); vecInterfaceInfo.add("Not Applicable"); vecInterfaceInfo.add("Not Applicable"); NetworkInterface tempNetworkCard = tempData.getNetworkInterface(strInterfaceName); ! vecInterfaceInfo.add(tempNetworkCard.getConnectLinkName()); } Index: Link.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/Link.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Link.java 13 Sep 2007 13:38:52 -0000 1.3 --- Link.java 24 Oct 2008 16:18:48 -0000 1.4 *************** *** 30,34 **** import java.io.Serializable; ! import java.util.*; /** --- 30,34 ---- import java.io.Serializable; ! import java.util.Vector; /** Index: NetworkInterfacePort.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/NetworkInterfacePort.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** NetworkInterfacePort.java 22 Oct 2008 21:22:55 -0000 1.12 --- NetworkInterfacePort.java 24 Oct 2008 16:18:48 -0000 1.13 *************** *** 55,59 **** package core; - import java.io.Serializable; /** --- 55,58 ---- *************** *** 98,101 **** --- 97,104 ---- /** + * + */ + private static final long serialVersionUID = 2453643722253335811L; + /** * Constructs a NetworkInterfacePort object with the name inName *************** *** 117,121 **** final static int MODE_ACCESS = 0; final static int MODE_TRUNK = 1; ! public int mode = MODE_ACCESS; protected NetworkInterfacePort(long UID, String inName, Node inParent) { --- 120,124 ---- final static int MODE_ACCESS = 0; final static int MODE_TRUNK = 1; ! public int mode = NetworkInterfacePort.MODE_ACCESS; protected NetworkInterfacePort(long UID, String inName, Node inParent) { *************** *** 135,139 **** ! public void Timer(int temp){ } --- 138,143 ---- ! @Override ! public void Timer(int temp){ } *************** *** 154,157 **** --- 158,162 ---- */ + @Override protected void receivePacket(Packet inPacket) throws LowLinkException { if(!parentNode.On) return; *************** *** 161,168 **** boolean drop = false; ! if(mode == MODE_ACCESS && tempPacket.vlan_id == 1 && parentNode instanceof NetworkLayerDevice) tempPacket.vlan_id = vlan; ! if(mode == MODE_ACCESS && tempPacket.vlan_id != vlan && parentNode instanceof NetworkLayerDevice) drop = true; --- 166,173 ---- boolean drop = false; ! if(mode == NetworkInterfacePort.MODE_ACCESS && tempPacket.vlan_id == 1 && parentNode instanceof NetworkLayerDevice) tempPacket.vlan_id = vlan; ! if(mode == NetworkInterfacePort.MODE_ACCESS && tempPacket.vlan_id != vlan && parentNode instanceof NetworkLayerDevice) drop = true; *************** *** 194,197 **** --- 199,203 ---- */ + @Override protected void sendPacket(Packet outPacket) throws LowLinkException{ *************** *** 204,208 **** EthernetLink temp = (EthernetLink)connectedLink; ! if(mode == MODE_ACCESS && (tempPacket.vlan_id != vlan)) drop = true; --- 210,214 ---- EthernetLink temp = (EthernetLink)connectedLink; ! if(mode == NetworkInterfacePort.MODE_ACCESS && (tempPacket.vlan_id != vlan)) drop = true; *************** *** 217,221 **** } ! public int getType(){ return NetworkInterface.Ethernet10T; } --- 223,228 ---- } ! @Override ! public int getType(){ return NetworkInterface.Ethernet10T; } *************** *** 234,238 **** */ ! protected String getDetails(){ return "Interface: "+name+"\t\tMAC: Not Applicable \t\t"+ getConnectLinkDetails(); --- 241,246 ---- */ ! @Override ! protected String getDetails(){ return "Interface: "+name+"\t\tMAC: Not Applicable \t\t"+ getConnectLinkDetails(); Index: WiFiPort.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/WiFiPort.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** WiFiPort.java 6 Oct 2008 13:20:39 -0000 1.11 --- WiFiPort.java 24 Oct 2008 16:18:48 -0000 1.12 *************** *** 1,11 **** package core; import core.protocolsuite.tcp_ip.ARP_packet; import core.protocolsuite.tcp_ip.IP_packet; - import java.util.Hashtable; - import java.util.Enumeration; public class WiFiPort extends EthernetNetworkInterface { protected int channel = 1; --- 1,17 ---- package core; + import java.util.Enumeration; + import java.util.Hashtable; + import core.protocolsuite.tcp_ip.ARP_packet; import core.protocolsuite.tcp_ip.IP_packet; public class WiFiPort extends EthernetNetworkInterface { + /** + * + */ + private static final long serialVersionUID = -1737841009400766734L; + protected int channel = 1; *************** *** 20,24 **** public static final int MODE_REPEATER = 2; ! protected int Mode = MODE_AP; // 0 - AP, 1 - Station, 2 - Repeater protected boolean shared_auth = false; // true -- shared, false -- open --- 26,30 ---- public static final int MODE_REPEATER = 2; ! protected int Mode = WiFiPort.MODE_AP; // 0 - AP, 1 - Station, 2 - Repeater protected boolean shared_auth = false; // true -- shared, false -- open *************** *** 71,75 **** public APClient(String BSSID){ this.BSSID = BSSID; ! state = PROBE; } } --- 77,81 ---- public APClient(String BSSID){ this.BSSID = BSSID; ! state = WiFiPort.PROBE; } } *************** *** 88,92 **** associated = false; ! state = OFFLINE; failed = false; --- 94,98 ---- associated = false; ! state = WiFiPort.OFFLINE; failed = false; *************** *** 101,105 **** associated = false; ! state = PROBE; lineFree=false; --- 107,111 ---- associated = false; ! state = WiFiPort.PROBE; lineFree=false; *************** *** 119,123 **** ResendPackets.put(p.packet.getID(), p); ! if(Mode == MODE_STATION && inWP.Type == 2){ canSend = checkLineFree(); if(!canSend) --- 125,129 ---- ResendPackets.put(p.packet.getID(), p); ! if(Mode == WiFiPort.MODE_STATION && inWP.Type == 2){ canSend = checkLineFree(); if(!canSend) *************** *** 268,272 **** try{ ! if(Mode == MODE_STATION && p.packet.Type == 2){ canSend = checkLineFree(); --- 274,278 ---- try{ ! if(Mode == WiFiPort.MODE_STATION && p.packet.Type == 2){ canSend = checkLineFree(); *************** *** 288,296 **** ResendPackets.remove(pID); ! if(Mode == MODE_STATION){ ! if(state > ASSOC){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Deassociated at AP " + apBSSID + "/" + SSID + " due to network timeout."); ! }else if(state == PROBE){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Probing AP " + SSID + " failed: no such AP found."); --- 294,302 ---- ResendPackets.remove(pID); ! if(Mode == WiFiPort.MODE_STATION){ ! if(state > WiFiPort.ASSOC){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Deassociated at AP " + apBSSID + "/" + SSID + " due to network timeout."); ! }else if(state == WiFiPort.PROBE){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Probing AP " + SSID + " failed: no such AP found."); *************** *** 306,311 **** ! }else if(Mode == MODE_AP){ ! if(state >= ASSOC){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Deassociating client " + p.packet.getDstBSSID() + " due to network timeout."); --- 312,317 ---- ! }else if(Mode == WiFiPort.MODE_AP){ ! if(state >= WiFiPort.ASSOC){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Deassociating client " + p.packet.getDstBSSID() + " due to network timeout."); *************** *** 342,346 **** public void setBSSID(String bssid) { ! if(Mode != MODE_STATION) BSSID = bssid; } --- 348,352 ---- public void setBSSID(String bssid) { ! if(Mode != WiFiPort.MODE_STATION) BSSID = bssid; } *************** *** 395,399 **** this.MACAddress = macAddress; } ! if(Mode == MODE_STATION) this.BSSID = this.MACAddress; } --- 401,405 ---- this.MACAddress = macAddress; } ! if(Mode == WiFiPort.MODE_STATION) this.BSSID = this.MACAddress; } *************** *** 406,410 **** super.UP(); ! if(!active) Mode = MODE_AP; failed = false; --- 412,416 ---- super.UP(); ! if(!active) Mode = WiFiPort.MODE_AP; failed = false; *************** *** 413,417 **** ResendPackets = new Hashtable<Long, ResendPacket>(); ! if(Mode != MODE_STATION){ APClients = new Hashtable<String, APClient>(); } --- 419,423 ---- ResendPackets = new Hashtable<Long, ResendPacket>(); ! if(Mode != WiFiPort.MODE_STATION){ APClients = new Hashtable<String, APClient>(); } *************** *** 420,424 **** parentNode.startTimerTask(this, 500); ! if(Mode == MODE_STATION){ try{ associate(); --- 426,430 ---- parentNode.startTimerTask(this, 500); ! if(Mode == WiFiPort.MODE_STATION){ try{ associate(); *************** *** 512,516 **** }else{ ! if(Mode == MODE_STATION){ if(tempWiFi.getDstBSSID() == "FF:FF:FF:FF:FF:FF"){ --- 518,522 ---- }else{ ! if(Mode == WiFiPort.MODE_STATION){ if(tempWiFi.getDstBSSID() == "FF:FF:FF:FF:FF:FF"){ *************** *** 520,524 **** } ! if(state == PROBE && tempWiFi.Type == 0 && tempWiFi.subType == 5){ ResendPackets.remove(tempWiFi.getID()); apBSSID = tempWiFi.getSrcBSSID(); --- 526,530 ---- } ! if(state == WiFiPort.PROBE && tempWiFi.Type == 0 && tempWiFi.subType == 5){ ResendPackets.remove(tempWiFi.getID()); apBSSID = tempWiFi.getSrcBSSID(); *************** *** 527,537 **** ResendPackets.clear(); if(!isSecureEnabled()){ ! state = ASSOC; sendAssocReq(apBSSID); }else{ ! state = AUTH; sendAuthReq(apBSSID, 0); } ! }else if(state == AUTH && tempWiFi.Type == 0 && tempWiFi.subType == 11){ if(!shared_auth && !tempWiFi.shared){ --- 533,543 ---- ResendPackets.clear(); if(!isSecureEnabled()){ ! state = WiFiPort.ASSOC; sendAssocReq(apBSSID); }else{ ! state = WiFiPort.AUTH; sendAuthReq(apBSSID, 0); } ! }else if(state == WiFiPort.AUTH && tempWiFi.Type == 0 && tempWiFi.subType == 11){ if(!shared_auth && !tempWiFi.shared){ *************** *** 539,543 **** "Link", "Recieved successful auth reply from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = ASSOC; sendAssocReq(apBSSID); }else if(shared_auth && tempWiFi.shared){ --- 545,549 ---- "Link", "Recieved successful auth reply from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = WiFiPort.ASSOC; sendAssocReq(apBSSID); }else if(shared_auth && tempWiFi.shared){ *************** *** 546,550 **** "Link", "Recieved auth challenge from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = AUTH; sendAuthReq(apBSSID, 2); }else{ --- 552,556 ---- "Link", "Recieved auth challenge from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = WiFiPort.AUTH; sendAuthReq(apBSSID, 2); }else{ *************** *** 552,556 **** "Link", "Recieved successful auth reply from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = ASSOC; sendAssocReq(apBSSID); } --- 558,562 ---- "Link", "Recieved successful auth reply from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = WiFiPort.ASSOC; sendAssocReq(apBSSID); } *************** *** 563,581 **** } ! }else if(state == ASSOC && tempWiFi.Type == 0 && tempWiFi.subType == 1){ ResendPackets.remove(tempWiFi.getID()); Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Recieved assoc reply from " + apBSSID + " on interface "+ name + ". Association successfull."); ! state = DATA; ResendPackets.clear(); Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Associated at AP " + apBSSID + "/" + SSID + "."); associated = true; ! }else if(state == DATA && tempWiFi.Type == 1 && tempWiFi.subType == 12){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Control Packet", "Link", "Recieved CTS packet from " + tempWiFi.getSrcBSSID() + " on interface "+ name + "."); lineFree=true; } ! }else if(Mode == MODE_AP){ if(tempWiFi.Type == 0 && tempWiFi.subType == 4){ --- 569,587 ---- } ! }else if(state == WiFiPort.ASSOC && tempWiFi.Type == 0 && tempWiFi.subType == 1){ ResendPackets.remove(tempWiFi.getID()); Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Recieved assoc reply from " + apBSSID + " on interface "+ name + ". Association successfull."); ! state = WiFiPort.DATA; ResendPackets.clear(); Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Management Packet", "Link", "Associated at AP " + apBSSID + "/" + SSID + "."); associated = true; ! }else if(state == WiFiPort.DATA && tempWiFi.Type == 1 && tempWiFi.subType == 12){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "802.11 Control Packet", "Link", "Recieved CTS packet from " + tempWiFi.getSrcBSSID() + " on interface "+ name + "."); lineFree=true; } ! }else if(Mode == WiFiPort.MODE_AP){ if(tempWiFi.Type == 0 && tempWiFi.subType == 4){ *************** *** 601,605 **** "Link", "Recieved auth req from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = AUTH; sendAuthReply(tempWiFi.getSrcBSSID(), 1); }else if(shared_auth && tempWiFi.shared){ --- 607,611 ---- "Link", "Recieved auth req from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = WiFiPort.AUTH; sendAuthReply(tempWiFi.getSrcBSSID(), 1); }else if(shared_auth && tempWiFi.shared){ *************** *** 608,612 **** "Link", "Recieved auth req from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = AUTH; sendAuthReply(tempWiFi.getSrcBSSID(), 1); }else{ --- 614,618 ---- "Link", "Recieved auth req from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = WiFiPort.AUTH; sendAuthReply(tempWiFi.getSrcBSSID(), 1); }else{ *************** *** 614,618 **** "Link", "Recieved auth challenge reply from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = AUTH; sendAuthReply(tempWiFi.getSrcBSSID(), 3); } --- 620,624 ---- "Link", "Recieved auth challenge reply from " + apBSSID + " on interface "+ name); ResendPackets.clear(); ! state = WiFiPort.AUTH; sendAuthReply(tempWiFi.getSrcBSSID(), 3); } *************** *** 631,635 **** "Link", "Station " + tempWiFi.getSrcBSSID() + " associated."); ! APClients.get(tempWiFi.getSrcBSSID()).state = DATA; sendAssocReply(tempWiFi.getSrcBSSID(), tempWiFi.getID()); }else{ --- 637,641 ---- "Link", "Station " + tempWiFi.getSrcBSSID() + " associated."); ! APClients.get(tempWiFi.getSrcBSSID()).state = WiFiPort.DATA; sendAssocReply(tempWiFi.getSrcBSSID(), tempWiFi.getID()); }else{ *************** *** 659,663 **** if(!parentNode.On) return; ! if(Mode == MODE_AP){ Ethernet_packet tempPacket = (Ethernet_packet)outPacket; --- 665,669 ---- if(!parentNode.On) return; ! if(Mode == WiFiPort.MODE_AP){ Ethernet_packet tempPacket = (Ethernet_packet)outPacket; *************** *** 676,680 **** sendWirelessConfirmPacket(tempWiFi, 200); ! }else if(Mode == MODE_STATION){ if(failed){ --- 682,686 ---- sendWirelessConfirmPacket(tempWiFi, 200); ! }else if(Mode == WiFiPort.MODE_STATION){ if(failed){ *************** *** 684,688 **** } ! if(!associated && state == OFFLINE){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "Ethernet Packet", "Link", "Can't send over air: no AP; AP searching process will be started immediately"); --- 690,694 ---- } ! if(!associated && state == WiFiPort.OFFLINE){ Simulation.addLayerInfo(getClass().getName(), parentNode.getName(), "Ethernet Packet", "Link", "Can't send over air: no AP; AP searching process will be started immediately"); Index: NetworkInterface.java =================================================================== RCS file:... [truncated message content] |