routetableentry.java

来自「DSr project for the java applications」· Java 代码 · 共 48 行

JAVA
48
字号
package dsr;import java.net.*;//this class implements an entry in the routing tableclass RouteTableEntry {  InetAddress  dstIP;      //destination ip Address  //int dstSeq;  //int floodID;  byte hopCount;           //hop count to that particular destination  //byte lastHopCount;  InetAddress nextHop;     //next hop to that destination  //long lifetime;  //long responseTime;  //char routeSearch;  //short rtFlags;  byte selfRoute;          //if it is self route or not  //Vector precursors;  //default constructor  public RouteTableEntry(){}  //constructor  public RouteTableEntry(InetAddress dstIP, InetAddress nextHop, byte hopCount, byte selfRoute){    this.dstIP = dstIP;    this.nextHop = nextHop;    this.hopCount = hopCount;    this.selfRoute = selfRoute;  }  //copy constructor  public RouteTableEntry(RouteTableEntry rhs){    dstIP = rhs.dstIP;    nextHop = rhs.nextHop;    selfRoute = rhs.selfRoute;    hopCount = rhs.hopCount;  }  //displayable format  public String toString(){    String value = "\nDestination address " + dstIP.toString() +                   "\nNext Hop address " + nextHop.toString() +                   "\nHop Count " + hopCount +                   "\nself route " + selfRoute;    return value;  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?