jist.swans.mac
Class MacMessage

java.lang.Object
  extended by jist.swans.mac.MacMessage
All Implemented Interfaces:
JistAPI.Timeless, Message
Direct Known Subclasses:
MacMessage.Ack, MacMessage.Cts, MacMessage.Data, MacMessage.Rts

public abstract class MacMessage
extends java.lang.Object
implements Message

Defines the various message used by the Mac entity.

Since:
SWANS1.0
Version:
$Id: MacMessage.java,v 1.17 2005/03/13 16:11:55 barr Exp $
Author:
Rimon Barr <barr+jist@cs.cornell.edu>

Nested Class Summary
static class MacMessage.Ack
          An 802_11 Acknowlege packet.
static class MacMessage.Cts
          An 802_11 Clear-To-Send packet.
static class MacMessage.Data
          An 802_11 Data packet.
static class MacMessage.Rts
          An 802_11 Request-To-Send packet.
 
Field Summary
private  boolean retry
          packet retry bit.
private  byte type
          packet type.
static byte TYPE_ACK
          ACK packet constant: type = 01, subtype = 1101.
static byte TYPE_CTS
          CTS packet constant: type = 01, subtype = 1100.
static byte TYPE_DATA
          DATA packet constant: type = 10, subtype = 0000.
static byte TYPE_RTS
          RTS packet constant: type = 01, subtype = 1011.
 
Fields inherited from interface jist.swans.misc.Message
NULL
 
Constructor Summary
protected MacMessage(byte type, boolean retry)
          Create a mac packet.
 
Method Summary
abstract  MacAddress getDst()
          Return packet destination address.
abstract  int getDuration()
          Return packet transmission duration.
 boolean getRetry()
          Return retry bit.
 byte getType()
          Return packet type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jist.swans.misc.Message
getBytes, getSize
 

Field Detail

TYPE_RTS

public static final byte TYPE_RTS
RTS packet constant: type = 01, subtype = 1011.

See Also:
Constant Field Values

TYPE_CTS

public static final byte TYPE_CTS
CTS packet constant: type = 01, subtype = 1100.

See Also:
Constant Field Values

TYPE_ACK

public static final byte TYPE_ACK
ACK packet constant: type = 01, subtype = 1101.

See Also:
Constant Field Values

TYPE_DATA

public static final byte TYPE_DATA
DATA packet constant: type = 10, subtype = 0000.

See Also:
Constant Field Values

type

private byte type
packet type.


retry

private boolean retry
packet retry bit.

Constructor Detail

MacMessage

protected MacMessage(byte type,
                     boolean retry)
Create a mac packet.

Parameters:
type - packet type
retry - packet retry bit
Method Detail

getType

public byte getType()
Return packet type.

Returns:
packet type

getRetry

public boolean getRetry()
Return retry bit.

Returns:
retry bit

getDst

public abstract MacAddress getDst()
Return packet destination address.

Returns:
packet destination address

getDuration

public abstract int getDuration()
Return packet transmission duration.

Returns:
packet transmission duration