📄 routetableentry.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -