[Javanetsim-cvs] javaNetSim/core PC.java,1.6,1.7
Status: Beta
Brought to you by:
darkkey
From: QweR <qw...@us...> - 2006-02-09 23:12:47
|
Update of /cvsroot/javanetsim/javaNetSim/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2985/core Modified Files: PC.java Log Message: Index: PC.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/PC.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PC.java 27 Nov 2005 14:28:22 -0000 1.6 --- PC.java 9 Feb 2006 23:12:39 -0000 1.7 *************** *** 1,67 **** ! package core; ! /* ! 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. ! */ ! ! import core.protocolsuite.tcp_ip.Echo; ! import core.protocolsuite.tcp_ip.Echo_tcp; ! ! /** ! * A PC is considered to be a client PC in a network which only has one NetworkInterface. The addInterface ! * method of the inherited Node class is overridden to only allow one NetworkInterface to be added. ! * @author tristan_veness ! * @since 13 June 2004 ! * @version v0.10 ! */ ! ! class PC extends ApplicationLayerDevice { ! ! ! /** ! * Constructs a PC with the specified name. ! * @author tristan_veness ! * @param inName - A name to give the new PC Node. eg: PC1 ! * @version v0.10 ! */ ! protected PC(String inName) { ! super(inName,7); ! ! Echo echoServer = new Echo(NodeProtocolStack, 7, 1, core.ProtocolStack.UIDGen++); ! Echo echoClient = new Echo(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); ! ! Echo_tcp echotcpServer = new Echo_tcp(NodeProtocolStack, 17, 1, core.ProtocolStack.UIDGen++); ! Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); ! ! addApp(echoServer, 7); ! addApp(echoClient, 30007); ! ! addApp(echotcpServer, 17); ! addApp(echotcpClient, 30017); ! ! addNetworkInterface("eth0"); ! } ! }//EOF --- 1,141 ---- ! package core; ! ! /* ! ! 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. ! ! */ ! ! ! ! import core.protocolsuite.tcp_ip.Echo; ! ! import core.protocolsuite.tcp_ip.Echo_tcp; ! import core.protocolsuite.tcp_ip.SNMP; ! ! ! ! /** ! ! * A PC is considered to be a client PC in a network which only has one NetworkInterface. The addInterface ! ! * method of the inherited Node class is overridden to only allow one NetworkInterface to be added. ! ! * @author tristan_veness ! ! * @since 13 June 2004 ! ! * @version v0.10 ! ! */ ! ! ! ! class PC extends ApplicationLayerDevice { ! ! ! ! ! ! /** ! ! * Constructs a PC with the specified name. ! ! * @author tristan_veness ! ! * @param inName - A name to give the new PC Node. eg: PC1 ! ! * @version v0.10 ! ! */ ! ! protected PC(String inName) { ! ! super(inName,7); ! ! ! ! Echo echoServer = new Echo(NodeProtocolStack, 7, 1, core.ProtocolStack.UIDGen++); ! ! Echo echoClient = new Echo(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); ! ! ! ! Echo_tcp echotcpServer = new Echo_tcp(NodeProtocolStack, 17, 1, core.ProtocolStack.UIDGen++); ! ! Echo_tcp echotcpClient = new Echo_tcp(NodeProtocolStack, 0, 0, core.ProtocolStack.UIDGen++); ! ! SNMP snmpAgent = new SNMP(NodeProtocolStack, 161, 0, core.ProtocolStack.UIDGen++); ! SNMP snmpManager = new SNMP(NodeProtocolStack, 0, 1, core.ProtocolStack.UIDGen++); ! ! ! ! addApp(echoServer, 7); ! ! addApp(echoClient, 30007); ! ! ! ! addApp(echotcpServer, 17); ! ! addApp(echotcpClient, 30017); ! ! addApp(snmpAgent, 161); ! addApp(snmpManager, 30161); ! ! ! ! addNetworkInterface("eth0"); ! ! } ! ! }//EOF ! |