jist.swans.mac
Class MacMessage.Cts

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

public static class MacMessage.Cts
extends MacMessage

An 802_11 Clear-To-Send packet.

Since:
SWANS1.0
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
 
Nested classes/interfaces inherited from class jist.swans.mac.MacMessage
MacMessage.Ack, MacMessage.Cts, MacMessage.Data, MacMessage.Rts
 
Field Summary
private  MacAddress dst
          packet destination address.
private  int duration
          packet transmission duration.
static int SIZE
          CTS packet size.
 
Fields inherited from class jist.swans.mac.MacMessage
TYPE_ACK, TYPE_CTS, TYPE_DATA, TYPE_RTS
 
Fields inherited from interface jist.swans.misc.Message
NULL
 
Constructor Summary
MacMessage.Cts(MacAddress dst, int duration)
          Create an 802_11 CTS packet.
 
Method Summary
 void getBytes(byte[] msg, int offset)
          Store packet into byte array.
 MacAddress getDst()
          Return packet destination address.
 int getDuration()
          Return packet transmission duration.
 int getSize()
          Return packet size or Constants.ZERO_WIRE_SIZE.
 
Methods inherited from class jist.swans.mac.MacMessage
getRetry, getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE
CTS packet size.

See Also:
Constant Field Values

dst

private MacAddress dst
packet destination address.


duration

private int duration
packet transmission duration.

Constructor Detail

MacMessage.Cts

public MacMessage.Cts(MacAddress dst,
                      int duration)
Create an 802_11 CTS packet.

Parameters:
dst - packet destination address
duration - packet transmission duration
Method Detail

getDst

public MacAddress getDst()
Return packet destination address.

Specified by:
getDst in class MacMessage
Returns:
packet destination address

getDuration

public int getDuration()
Return packet transmission duration.

Specified by:
getDuration in class MacMessage
Returns:
packet transmission duration

getSize

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

Returns:
packet size

getBytes

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

Parameters:
msg - destination byte array
offset - byte array starting offset