|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjist.swans.route.RouteZrpIerp.MessageIerp
private static class RouteZrpIerp.MessageIerp
IERP (IntErzone Routing Protocol) packet.
type (req, rep) size: 1 length size: 1 -- computed node pointer size: 1 RESERVED size: 1 query ID size: 2 RESERVED size: 2 src .. route .. dst size: 4 * n
| Field Summary | |
|---|---|
static int |
FIXED_SIZE
fixed ierp packet size. |
static int |
INC_SIZE
incremental ierp packet size. |
private NetAddress[] |
route
route. |
private short |
seq
unique source-sequence request identifier. |
private byte |
type
packet type. |
static byte |
TYPE_RREP
ierp packet type constant: reply. |
static byte |
TYPE_RREQ
ierp packet type constant: request. |
| Fields inherited from interface jist.swans.misc.Message |
|---|
NULL |
| Constructor Summary | |
|---|---|
private |
RouteZrpIerp.MessageIerp(byte type,
short seq,
NetAddress[] route)
Create new IERP packet. |
|
RouteZrpIerp.MessageIerp(short seq,
NetAddress dst)
Create new IERP route request packet. |
| Method Summary | |
|---|---|
RouteZrpIerp.MessageIerp |
appendHop(NetAddress nextHop)
Create new packet and append hop to packet route. |
void |
getBytes(byte[] b,
int offset)
Store packet into byte array. |
NetAddress |
getDst()
Return packet destination address, if available. |
short |
getID()
Return packet identifier, if available. |
byte |
getLength()
Return packet length. |
NetAddress[] |
getRoute()
Return route. |
int |
getSize()
Return packet size or Constants.ZERO_WIRE_SIZE. |
NetAddress |
getSrc()
Return packet source address, if available. |
byte |
getType()
Return packet type. |
RouteZrpIerp.MessageIerp |
makeReply(NetAddress finder,
NetAddress[] routeToDst)
Create a reply IERP packet. |
private static NetAddress[] |
routeAppend(NetAddress[] route,
NetAddress nextHop)
Helper method: append hop to route. |
private static boolean |
routeDupCheck(NetAddress[] route)
Return whether is a cycle in the route. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int FIXED_SIZE
public static final int INC_SIZE
public static final byte TYPE_RREQ
public static final byte TYPE_RREP
private byte type
private short seq
private NetAddress[] route
| Constructor Detail |
|---|
public RouteZrpIerp.MessageIerp(short seq,
NetAddress dst)
seq - source-sequence request numberdst - route request destination
private RouteZrpIerp.MessageIerp(byte type,
short seq,
NetAddress[] route)
type - ierp packet typeseq - source-sequence request numberroute - route| Method Detail |
|---|
public byte getType()
public byte getLength()
public short getID()
getID in interface RouteInterface.Zrp.MessageIerppublic NetAddress getSrc()
getSrc in interface RouteInterface.Zrp.MessageIerppublic NetAddress getDst()
getDst in interface RouteInterface.Zrp.MessageIerppublic NetAddress[] getRoute()
public java.lang.String toString()
toString in class java.lang.Objectpublic int getSize()
getSize in interface Message
public void getBytes(byte[] b,
int offset)
getBytes in interface Messageb - destination byte arrayoffset - byte array starting offset
private static NetAddress[] routeAppend(NetAddress[] route,
NetAddress nextHop)
route - existing route (source .. route .. destination)nextHop - next hop to append (before destination)
private static boolean routeDupCheck(NetAddress[] route)
route - route to check for cycle
public RouteZrpIerp.MessageIerp appendHop(NetAddress nextHop)
nextHop - next hop to append to route
public RouteZrpIerp.MessageIerp makeReply(NetAddress finder,
NetAddress[] routeToDst)
finder - address of node that found destinationrouteToDst - remaining route to destination
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||