[Javanetsim-cvs] javaNetSim/core/protocolsuite/tcp_ip IpV4.java,1.1,1.2 ProtocolStack.java,1.1,1.2 R
Status: Beta
Brought to you by:
darkkey
From: Alexander B. <da...@us...> - 2005-11-08 20:58:24
|
Update of /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29458/javaNetSim/core/protocolsuite/tcp_ip Modified Files: IpV4.java ProtocolStack.java Route_entry.java Log Message: Index: Route_entry.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/Route_entry.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Route_entry.java 8 Nov 2005 16:10:47 -0000 1.1 --- Route_entry.java 8 Nov 2005 20:58:14 -0000 1.2 *************** *** 21,31 **** public String genMask; public String iFace; /** Creates a new instance of Route_entry */ ! public Route_entry(String destIP, String gateway, String genMask, String iFace) { this.destIP = destIP; this.gateway = gateway; this.genMask = genMask; this.iFace = iFace; } --- 21,33 ---- public String genMask; public String iFace; + public int Type; //0 - Static; >0 - Dynamic /** Creates a new instance of Route_entry */ ! public Route_entry(String destIP, String gateway, String genMask, String iFace, int Type) { this.destIP = destIP; this.gateway = gateway; this.genMask = genMask; this.iFace = iFace; + this.Type = Type; } Index: ProtocolStack.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/ProtocolStack.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProtocolStack.java 8 Nov 2005 16:10:47 -0000 1.1 --- ProtocolStack.java 8 Nov 2005 20:58:14 -0000 1.2 *************** *** 570,572 **** --- 570,597 ---- return name; } + + + + /** + * Routing tables functions... Use carefully! + * Shall be documented as well. + * @author Key + * @version v0.21 + */ + + public void addRoute(Route_entry r){ + mIPprotocol.addRoute(r); + } + + public void removeRoute(String destIP){ + mIPprotocol.removeRoute(destIP); + } + + public String[] getRouteTableEntries(){ + return mIPprotocol.getRouteTableEntries(); + } + + public Route_entry getRouteTableEntry(String destIP){ + return mIPprotocol.getRouteTableEntry(destIP); + } }//EOF Index: IpV4.java =================================================================== RCS file: /cvsroot/javanetsim/javaNetSim/core/protocolsuite/tcp_ip/IpV4.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IpV4.java 8 Nov 2005 16:10:47 -0000 1.1 --- IpV4.java 8 Nov 2005 20:58:14 -0000 1.2 *************** *** 80,85 **** } ! public Hashtable getRouteTable(){ ! return routingTable; } --- 80,95 ---- } ! public String[] getRouteTableEntries(){ ! String output[] = new String[routingTable.size()+1]; ! Enumeration keys1 = routingTable.keys(); ! int i = 0; ! while(keys1.hasMoreElements()) ! output[i++] = (String)keys1.nextElement(); ! ! return output; ! } ! ! public Route_entry getRouteTableEntry(String destIP){ ! return (Route_entry)routingTable.get(destIP); } |