|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ants.core.Capsule | +--ants.route.DynamicRouteCapsule
Route update capsule.
Used to be a built-in capsule type. Now it is not.
XXX fix the -accessible fields. (Need to be accessible in DynamicRouteApp.)
Fields inherited from class ants.core.Capsule |
MAX_TTL |
Constructor Summary | |
DynamicRouteCapsule()
Construct an empty DynamicRouteCapsule. |
|
DynamicRouteCapsule(int activeDest,
java.lang.String protocolSpec,
java.lang.String addressSpec,
java.util.Vector routeVec)
Create a DynamicRouteCapsule to send to a remote host. |
Method Summary | |
Xdr |
decode()
Decode a capsule header from this Capsule's xdr field. |
Xdr |
encode()
Encode this capsule's header into a new Xdr. |
boolean |
evaluate(Node node)
When an update capsule arrives at its destination Node, it gets delivered to the app that maintains the routing table. |
int |
length()
The length of this capsule. |
java.lang.String |
toString()
String representation of a Capsule. |
Methods inherited from class ants.core.Capsule |
create,
encodeCapsuleForSend,
findExtension,
findMID,
findPID,
getDst,
getPrevious,
getSrc,
getTTL,
prime,
setDst |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public DynamicRouteCapsule()
public DynamicRouteCapsule(int activeDest, java.lang.String protocolSpec, java.lang.String addressSpec, java.util.Vector routeVec)
It contains the *physical address* of the host that sends it. (Because, hey, that's what routing does.)
Lastly, it will contain a suite of DynamicRouteEntries for the destination host to store in its RouteTable.
activeDest
- the destination for this capsule. Must be 1 hop away.protocolSpec
- the protocol spec for the sender's input.addressSpec
- the address spec for the sender's input.routeVec
- a list of updated route entries for the remote nodeMethod Detail |
public int length()
physAddr
string, 4 bytes for the
nroutes
word, and zero or more bytes for the
routes
array.public Xdr encode()
Because this header must go first in the Xdr, this encoder unilaterally sets the xdr buffer pointer to the beginning of the buffer and writes its data there.
The format of the Xdr is:
MethodID (16 bytes) src address ( 4 bytes) dst address ( 4 bytes) previous address ( 4 bytes) TTL ( 4 bytes)
#xdr
public Xdr decode()
public boolean evaluate(Node node)
node
- the local node interfacepublic java.lang.String toString()
|
ANTS v2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |