|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hypercast.HC.HC_Message
This class encapsulates a HC protocol message.
Field Summary | |
static byte |
Beacon
Hypercast protocol message type (used to beacon all) |
static byte |
Kill
Hypercast protocol message type (used to kill a node) |
static byte |
Leave
Hypercast protocol message type (used to leave the hypercube) |
static byte |
Ping
Hypercast protocol message type (used to ping neighbor periodically) |
byte |
Proto_num
|
byte |
Proto_sub
|
static byte |
PROTONUM_HC30
Protocol Number value in Protocol field for HC3.0 protocol message |
Constructor Summary | |
HC_Message(byte[] data,
int offset,
hypercast.I_UnicastAdapter adapter)
Constructs a HC_Message with a byte array and an I_UnicastAdapter |
|
HC_Message(byte proto_sub,
byte type,
int gh,
hypercast.I_PhysicalAddress srcp,
hypercast.HC.HC_LogicalAddress srcl,
hypercast.I_PhysicalAddress desp,
hypercast.HC.HC_LogicalAddress desl,
hypercast.HC.HC_LogicalAddress hrootl,
int hrootsn,
byte[] data,
hypercast.I_UnicastAdapter adapter)
New Constructor of HC_Message. |
|
HC_Message(byte type,
int gh,
hypercast.I_PhysicalAddress srcp,
hypercast.HC.HC_LogicalAddress srcl,
hypercast.I_PhysicalAddress desp,
hypercast.HC.HC_LogicalAddress desl,
hypercast.HC.HC_LogicalAddress hrootl,
int hrootsn,
byte[] data,
hypercast.I_UnicastAdapter adapter)
Constructs a HC_Message with all the components |
Method Summary | |
hypercast.HC.HC_LogicalAddress |
getDestLA()
Returns the destination logical address of the message |
hypercast.I_PhysicalAddress |
getDestPA()
Returns the destination physical address of the message |
hypercast.HC.HC_LogicalAddress |
getHRootLA()
Returns the HRoot logical address of the message |
int |
getHRootSeqNum()
Returns the HRoot sequence number of the message |
int |
getOverlayHash()
Returns the overlayHash of this message. |
hypercast.HC.HC_LogicalAddress |
getSrcLA()
Returns the source logical address of the message |
hypercast.I_PhysicalAddress |
getSrcPA()
Returns the source physical address of the message |
int |
getType()
Returns the type of the message |
static hypercast.HC.HC_Message |
restoreMessage(byte[] recvbuff,
int[] validBytesStart,
int validBytesEnd,
hypercast.I_UnicastAdapter adapter,
int thisOverlaysHash)
Reconstruct HC message from byte array. |
byte[] |
toByteArray()
Converts message to byte array |
java.lang.String |
toString()
Converts the message object to String |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte Ping
public static final byte Kill
public static final byte Beacon
public static final byte Leave
public static final byte PROTONUM_HC30
public byte Proto_num
public byte Proto_sub
Constructor Detail |
public HC_Message(byte[] data, int offset, hypercast.I_UnicastAdapter adapter)
The following is the byte format followed
Byte 0 : Type
Bytes 1-4 : overlayHash
Bytes 5-10 : SrcPA
Bytes 11-14: SrcLA
BYtes 15-20: DestPA
Bytes 21-24: DestLA
Bytes 25-28: HRootLA
Bytes 29-32: HRootSeqNum
data
- an input byte arrayadapter
- an I_UnicastAdapter object
if
- the packet has an invalid typepublic HC_Message(byte type, int gh, hypercast.I_PhysicalAddress srcp, hypercast.HC.HC_LogicalAddress srcl, hypercast.I_PhysicalAddress desp, hypercast.HC.HC_LogicalAddress desl, hypercast.HC.HC_LogicalAddress hrootl, int hrootsn, byte[] data, hypercast.I_UnicastAdapter adapter)
type
- the typesrcp
- source PhysicalAddress objectsrcl
- source LogicalAddress objectdesp
- destination PhysicalAddress objectdesl
- destination LogicalAddress objecthrootl
- HRoot LogicalAddress objecthrootsn
- HRoot sequence numberdata
- payload data array
if
- the packet has an invalid typepublic HC_Message(byte proto_sub, byte type, int gh, hypercast.I_PhysicalAddress srcp, hypercast.HC.HC_LogicalAddress srcl, hypercast.I_PhysicalAddress desp, hypercast.HC.HC_LogicalAddress desl, hypercast.HC.HC_LogicalAddress hrootl, int hrootsn, byte[] data, hypercast.I_UnicastAdapter adapter)
Method Detail |
public static hypercast.HC.HC_Message restoreMessage(byte[] recvbuff, int[] validBytesStart, int validBytesEnd, hypercast.I_UnicastAdapter adapter, int thisOverlaysHash)
public byte[] toByteArray()
toByteArray
in interface I_Message
public int getType()
public int getOverlayHash()
public hypercast.I_PhysicalAddress getDestPA()
public hypercast.HC.HC_LogicalAddress getSrcLA()
public hypercast.HC.HC_LogicalAddress getDestLA()
public hypercast.HC.HC_LogicalAddress getHRootLA()
public int getHRootSeqNum()
public hypercast.I_PhysicalAddress getSrcPA()
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 |