A
download RoutingTableEntry.java
Language: Java
LOC: 24
Project Info
Teaseme Java Virtual Machine(teaseme)
Server: SourceForge
Type: cvs
...sspath\jos\system\net\jeps\
   ARP.java
   ARPPacket.java
   ARPTableEntry.java
   DatagramPacket.java
   DatagramSocket.java
   DummyNetworkInterface.java
   EtherHostDriver.java
   ...etNetworkInterface.java
   EtherPacket.java
   HWAddr.java
   ICMP.java
   ICMPPacket.java
   IllegalRouteException.java
   InetAddress.java
   IP.java
   IPAddr.java
   IPPacket.java
   Main.java
   ...medPacketException.java
   NetworkInterface.java
   NetworkInterfaceCard.java
   NoRouteException.java
   Packet.java
   Protocol.java
   QuoteServerThread.java
   RoutingTableEntry.java
   StackPanic.java
   TCP.java
   UDP.java
   UDPPacket.java
   UDPQueue.java

package jos.system.net.jeps;

/*
 * Entries into the IP Routing Table
 *
 * We mantain a global linked-list.
 * Might be moved into a hash-table thing to speed up lookups.
 */

class RoutingTableEntry
{
   RoutingTableEntry next=null;		// Linked List reference.
   IPAddr net;				// Network Adress for route.
   IPAddr mask;				// Subnet Mask for Route.
   IPAddr gateway;			// Next Hop.
   int metric;				// Distance Metric.
   long timestamp;			// Last Updated.
   NetworkInterface ni;			// Interface to use.
   
   RoutingTableEntry(IPAddr net,IPAddr mask,IPAddr gateway,int metric,NetworkInterface ni)
   {
     this.net=net;
     this.mask=mask;
     this.gateway=gateway;
     this.metric=metric;
     this.ni=ni;
     touch();
   }
   
   public void touch()	// Update the timestamp
   { this.timestamp=System.currentTimeMillis();}

   public RoutingTableEntry getNextEntry()  {return next;}
   
   public void setNextEntry(RoutingTableEntry next)  {this.next=next;}
}

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us