|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSim.Routing.DSR.DataHeader
public class DataHeader
DataHeader represents a packet with an explicit route. A DataHeader is put onto any routed (opposed to flooded) packet, and can contain a user data Packet or a nexted ProtocolFrame as extra data.
Constructor Summary | |
---|---|
DataHeader(Route route,
PacketId id)
Constructs a new DataHeader that is for routing a user packet. |
|
DataHeader(Route route,
PacketId id,
ProtocolFrame extraData)
Constructs a new DataHeader to contain a nested ProtocolFrame. |
Method Summary | |
---|---|
ProtocolFrame |
getExtraData()
DataHeaders can carry additional data for use by DSR itself, and if a DSR-internal packet is being routed, it is contained as extra data. |
PacketId |
getId()
|
int |
getNextAddress()
Returns the next hop. |
Route |
getRouteRemaining()
Returns the remaining portion of the route to the destination. |
int |
getSecondAddress()
Returns the address of the hop after this one, or an invalid address less than 0 if there is no next hop. |
int |
getSize()
Returns the "serialized" size of this portion of the packet. |
boolean |
isSingleHop()
Returns true if the contained route has only a single hop (usually this means the packet is at the destination). |
DataHeader |
makeForward()
Constructs a new DataHeader that is a forwarded version of this header. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DataHeader(Route route, PacketId id)
route
- non-null Route to takeid
- non-null id to be used throughout this packet's lifetimepublic DataHeader(Route route, PacketId id, ProtocolFrame extraData)
route
- non-null Route to takeid
- non-null id to be used throughout this packet's lifetimeextraData
- nullable ProtocolFrame (if null, works like
DataHeader( Route, PacketId )
Method Detail |
---|
public Route getRouteRemaining()
public PacketId getId()
public ProtocolFrame getExtraData()
public boolean isSingleHop()
public int getNextAddress()
public int getSecondAddress()
public DataHeader makeForward()
public int getSize()
getSize
in interface ProtocolFrame
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |