DRCL J-Sim API

drcl.inet.mac
Class Mac_802_11_Packet

java.lang.Object
  extended bydrcl.net.Packet
      extended bydrcl.inet.mac.Mac_802_11_Packet
All Implemented Interfaces:
java.lang.Cloneable, Countable, ObjectCloneable, PacketWrapper
Direct Known Subclasses:
Mac_802_11_ACK_Frame, Mac_802_11_ATIM_Frame, Mac_802_11_Beacon_Frame, Mac_802_11_CTS_Frame, Mac_802_11_Data_Frame, Mac_802_11_RTS_Frame

public abstract class Mac_802_11_Packet
extends Packet

This class is the base class of IEEE802.11 RTS, CTS, ACK and Data frame classes.

Author:
Ye Ge
See Also:
Mac_802_11, Mac_802_11_ACK_Frame, Mac_802_11_CTS_Frame, Mac_802_11_RTS_Frame, Mac_802_11_Data_Frame, Mac_802_11_Frame_Control

Field Summary
static int EHTER_FCS_LEN
           
static int ETHER_ADDR_LEN
           
static int ETHER_TYPE_LEN
           
 
Fields inherited from class drcl.net.Packet
body, headerSize, id, size
 
Constructor Summary
Mac_802_11_Packet()
          Construct a 802_11 packet
Mac_802_11_Packet(int hsize_, int bsize_, java.lang.Object body_)
          Construct a 802_11 packet
Mac_802_11_Packet(int hsize_, int bsize_, java.lang.Object body_, boolean ferror_)
          Construct a 802_11 packet
Mac_802_11_Packet(int hsize_, int bsize_, java.lang.Object body_, Mac_802_11_Frame_Control fc_, int duration_, int fcs_, boolean ferror_)
          Construct a 802_11 packet
Mac_802_11_Packet(Mac_802_11_Frame_Control fc_, int duration_, int fcs_)
          Construct a non-corrupted 802_11 packet with empty body
Mac_802_11_Packet(Mac_802_11_Frame_Control fc_, int duration_, int fcs_, boolean ferror_)
          Construct a 802_11 packet with empty body
 
Method Summary
 java.lang.String _toString(java.lang.String separator_)
          Prints the packet header.
 int getDuration()
          Get the frame duration field (2 Byte)
 Mac_802_11_Frame_Control getFc()
          Get the frame control field (2 Byte)
 int getFcs()
          Get the frame check sequence (4 Byte)
 java.lang.String getName()
          Returns the name of this packet.
 boolean isForcedError()
           
 void set_fc_flags(boolean order_, boolean wep_, boolean more_data_, boolean pwr_mgt_, boolean retry_, boolean more_frag_, boolean from_ds_, boolean to_ds_)
          Set the frame control flags
 void setDuration(int d_)
          Set the frame duration field (2 Byte)
 void setFc(Mac_802_11_Frame_Control fc_)
          Set the frame control field (2 Byte)
 void setFcs(int fcs_)
          Set the frame check sequence (4 Byte)
 void setForcedError(boolean b_)
           
 
Methods inherited from class drcl.net.Packet
clone, equals, getBody, getByteCount, getHeaderSize, getNumberCount, getPacketCount, getPacketSize, getPacketType, getSize, getSizeCount, getTimestamp, isByteCountSupported, isPacketCountSupported, isTimestampSupported, setBody, setBody, setHeaderSize, setPacketSize, setSize, setTimestamp, toString, toString, wraps
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ETHER_ADDR_LEN

public static final int ETHER_ADDR_LEN
See Also:
Constant Field Values

ETHER_TYPE_LEN

public static final int ETHER_TYPE_LEN
See Also:
Constant Field Values

EHTER_FCS_LEN

public static final int EHTER_FCS_LEN
See Also:
Constant Field Values
Constructor Detail

Mac_802_11_Packet

public Mac_802_11_Packet()
Construct a 802_11 packet


Mac_802_11_Packet

public Mac_802_11_Packet(int hsize_,
                         int bsize_,
                         java.lang.Object body_)
Construct a 802_11 packet

Parameters:
bsize_ - - body size
body_ - - packet body

Mac_802_11_Packet

public Mac_802_11_Packet(int hsize_,
                         int bsize_,
                         java.lang.Object body_,
                         boolean ferror_)
Construct a 802_11 packet

Parameters:
bsize_ - - body size
body_ - - packet body
ferror_ - - indicating if the packet is corrupted

Mac_802_11_Packet

public Mac_802_11_Packet(int hsize_,
                         int bsize_,
                         java.lang.Object body_,
                         Mac_802_11_Frame_Control fc_,
                         int duration_,
                         int fcs_,
                         boolean ferror_)
Construct a 802_11 packet

Parameters:
bsize_ - - body size
body_ - - packet body
fc_ - - MAC frame control
duration_ - - duration
fcs_ - - frame check sequence
ferror_ - - indicating if the packet is corrupted

Mac_802_11_Packet

public Mac_802_11_Packet(Mac_802_11_Frame_Control fc_,
                         int duration_,
                         int fcs_,
                         boolean ferror_)
Construct a 802_11 packet with empty body

Parameters:
fc_ - - MAC frame control
duration_ - - duration
fcs_ - - frame check sequence
ferror_ - - indicating if the packet is corrupted

Mac_802_11_Packet

public Mac_802_11_Packet(Mac_802_11_Frame_Control fc_,
                         int duration_,
                         int fcs_)
Construct a non-corrupted 802_11 packet with empty body

Parameters:
fc_ - - MAC frame control
duration_ - - duration
fcs_ - - frame check sequence
Method Detail

getName

public java.lang.String getName()
Description copied from class: Packet
Returns the name of this packet.

Specified by:
getName in class Packet

setForcedError

public void setForcedError(boolean b_)

isForcedError

public boolean isForcedError()

getFc

public Mac_802_11_Frame_Control getFc()
Get the frame control field (2 Byte)


setFc

public void setFc(Mac_802_11_Frame_Control fc_)
Set the frame control field (2 Byte)


getDuration

public int getDuration()
Get the frame duration field (2 Byte)


setDuration

public void setDuration(int d_)
Set the frame duration field (2 Byte)


getFcs

public int getFcs()
Get the frame check sequence (4 Byte)


setFcs

public void setFcs(int fcs_)
Set the frame check sequence (4 Byte)


set_fc_flags

public void set_fc_flags(boolean order_,
                         boolean wep_,
                         boolean more_data_,
                         boolean pwr_mgt_,
                         boolean retry_,
                         boolean more_frag_,
                         boolean from_ds_,
                         boolean to_ds_)
Set the frame control flags

Parameters:
order_ - - 0, 1 order field
wep_ - - set to 1 if the frame body field contains information processed by WEP algorithm
more_data_ - - set to 1 if AP has more data to transmit to the STA
pwr_mgt_ - - set to 1 if a STA is in power-saving
retry_ - - set to 1 if it is a retransmission of an earlier frame
more_frag_ - - set to 1 if there is one or more fragments to follow
from_ds_ - - set to 1 if data type frames existing the DS
to_ds_ - - set to 1 if data type frames destined the DS

_toString

public java.lang.String _toString(java.lang.String separator_)
Description copied from class: Packet
Prints the packet header.

Overrides:
_toString in class Packet

DRCL J-Sim API

Copyright © 1998-2003 Distributed Real-time Computing Lab (DRCL). All Rights Reserved.     ~ To J-Sim Home ~