jist.swans.mac
Class MacDumb.MacDumbMessage

java.lang.Object
  extended by jist.swans.mac.MacDumb.MacDumbMessage
All Implemented Interfaces:
JistAPI.Timeless, Message
Enclosing class:
MacDumb

private static class MacDumb.MacDumbMessage
extends java.lang.Object
implements Message

MacDumbMessage is the packet sent out by the MacDumb mac.

   src address:    size=6
   dst address:    size=6
   size:           size=2
   body:           0-65535
 


Field Summary
private  Message body
          mac message payload.
private  MacAddress dst
          mac message destination address.
static int HEADER_SIZE
          fixed mac packet header length.
private  MacAddress src
          mac message source address.
 
Fields inherited from interface jist.swans.misc.Message
NULL
 
Constructor Summary
MacDumb.MacDumbMessage(MacAddress src, MacAddress dst, Message body)
          Create new mac packet.
 
Method Summary
 void getBytes(byte[] msg, int offset)
          Store packet into byte array.
 MacAddress getDst()
          Return mac message destination.
 Message getPayload()
          Return mac message payload.
 int getSize()
          Return packet size or Constants.ZERO_WIRE_SIZE.
 MacAddress getSrc()
          Return mac message source.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HEADER_SIZE

public static int HEADER_SIZE
fixed mac packet header length.


src

private MacAddress src
mac message source address.


dst

private MacAddress dst
mac message destination address.


body

private Message body
mac message payload.

Constructor Detail

MacDumb.MacDumbMessage

public MacDumb.MacDumbMessage(MacAddress src,
                              MacAddress dst,
                              Message body)
Create new mac packet.

Parameters:
src - source mac address
dst - destination mac address
body - mac packet payload
Method Detail

getSrc

public MacAddress getSrc()
Return mac message source.

Returns:
mac message source

getDst

public MacAddress getDst()
Return mac message destination.

Returns:
mac message destination

getPayload

public Message getPayload()
Return mac message payload.

Returns:
mac message payload

getSize

public int getSize()
Return packet size or Constants.ZERO_WIRE_SIZE.

Specified by:
getSize in interface Message
Returns:
packet size

getBytes

public void getBytes(byte[] msg,
                     int offset)
Store packet into byte array.

Specified by:
getBytes in interface Message
Parameters:
msg - destination byte array
offset - byte array starting offset

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object