jist.swans.mac
Class MacMessage.Rts

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

public static class MacMessage.Rts
extends MacMessage

An 802_11 Request-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
          RTS packet size.
private  MacAddress src
          packet source address.
 
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.Rts(MacAddress dst, MacAddress src, int duration)
          Create an 802_11 RTS 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.
 MacAddress getSrc()
          Return packet source address.
 
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
RTS packet size.

See Also:
Constant Field Values

dst

private MacAddress dst
packet destination address.


src

private MacAddress src
packet source address.


duration

private int duration
packet transmission duration.

Constructor Detail

MacMessage.Rts

public MacMessage.Rts(MacAddress dst,
                      MacAddress src,
                      int duration)
Create an 802_11 RTS packet.

Parameters:
dst - packet destination address
src - packet source 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

getSrc

public MacAddress getSrc()
Return packet source address.

Returns:
packet source 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