|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjist.swans.route.RouteZrpZdp.MessageZdp
public static class RouteZrpZdp.MessageZdp
ZDP (Zone Discovery Protocol) packet.
todo: TBD (see draft ZDP specification)
| Field Summary | |
|---|---|
private byte |
compress
type of packet compression/structure. |
private boolean[] |
drops
link failure indicators. |
private boolean |
frozen
whether packet is immutable. |
private short[] |
ids
link identifiers. |
private Link[] |
links
link source-destination pairs. |
private int |
num
number of links in packet. |
private int |
size
precomputed packet size. |
| Fields inherited from interface jist.swans.misc.Message |
|---|
NULL |
| Constructor Summary | |
|---|---|
RouteZrpZdp.MessageZdp(int capacity,
byte compress)
Create new packet with given initial capacity. |
|
| Method Summary | |
|---|---|
void |
addLink(Link link,
short id,
boolean drop)
Add link to the packet structure. |
private void |
ensureCapacity()
Expand internal arrays to ensure room for one more link. |
void |
freeze()
Freeze packet; make it immutable. |
void |
getBytes(byte[] b,
int offset)
Store packet into byte array. |
Link |
getLink(int i)
Return link source-destination pair. |
boolean |
getLinkDrop(int i)
Return whether link has drop bit set. |
short |
getLinkId(int i)
Return link identifier. |
int |
getNumLinks()
Return number of links in packet. |
int |
getSize()
Return packet size or Constants.ZERO_WIRE_SIZE. |
private int |
getSizeCompressNode()
Compute size of link state compressed at the node level. |
private int |
getSizeCompressNone()
Compute size of uncompressed link state delta. |
private int |
getSizeCompressZone()
Compute size of link state compressed at the zone level. |
private int |
getSizeCompressZoneReverse()
Compute size of link state compressed at the zone level, with reversal bit. |
private int |
getUniqueAddresses()
Return number of unique addresses in packet. |
private int |
getUniqueDstAddresses()
Return number of unique link destinations in packet. |
boolean |
isFrozen()
Return whether packet is immutable. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int num
private Link[] links
private short[] ids
private boolean[] drops
private boolean frozen
private byte compress
private int size
| Constructor Detail |
|---|
public RouteZrpZdp.MessageZdp(int capacity,
byte compress)
capacity - initial packet link capacitycompress - packet compression mode/format| Method Detail |
|---|
private void ensureCapacity()
public void addLink(Link link,
short id,
boolean drop)
link - source-destination pairid - destination sequenced link identifierdrop - whether link is up or downpublic void freeze()
public boolean isFrozen()
public int getNumLinks()
public Link getLink(int i)
i - link number
public short getLinkId(int i)
i - link number
public boolean getLinkDrop(int i)
i - link number
public int getSize()
getSize in interface Messageprivate int getSizeCompressNone()
- added links count 1 byte - dropped links count 1 byte - array of links: - src address 4 bytes - dst address 4 bytes - seq-id 1 byte
private int getSizeCompressNode()
- number of unique dsts 1 byte
- list of dst entries:
- dst address 4 bytes
- seq-id 1 byte
- number of added 1 byte
- number of dropped 1 byte
- list of src addresses:
- src address 4 bytes
private int getUniqueDstAddresses()
private int getUniqueAddresses()
private int getSizeCompressZone()
- number of unique addr k byte(s)
- list of addr entries:
- addr 4 bytes
- seq-id 1 byte
- list of links:
- dst index k byte(s)
- list list srcs:
- src index k byte(s)
- flags 1 byte
- drop
- another-src
- another-dst
private int getSizeCompressZoneReverse()
- number of unique addr k byte(s)
- list of addr entries:
- addr 4 bytes
- seq-id 1 byte
- list of links:
- dst index k byte(s)
- list list srcs:
- src index k byte(s)
- flags 1 byte
- drop
- and-reverse ****** ADDITONAL FLAG
- another-src
- another-dst
public void getBytes(byte[] b,
int offset)
getBytes in interface Messageb - destination byte arrayoffset - byte array starting offsetpublic 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 | ||||||||