Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Ieee80211MgmtAPBase Class Reference

#include <Ieee80211MgmtAPBase.h>

Inheritance diagram for Ieee80211MgmtAPBase:

Ieee80211MgmtBase PassiveQueueBase INotifiable IPassiveQueue Ieee80211MgmtAP Ieee80211MgmtAPSimplified List of all members.

Detailed Description

Used in 802.11 infrastructure mode: abstract base class for management frame handling for access points (APs). This class extends Ieee80211MgmtBase with utility functions that are useful for implementing AP functionality.

Author:
Andras Varga


Protected Member Functions

virtual int numInitStages () const
virtual void initialize (int)
virtual void distributeReceivedDataFrame (Ieee80211DataFrame *frame)
virtual Ieee80211DataFrameconvertFromEtherFrame (EtherFrame *ethframe)
virtual EtherFrameconvertToEtherFrame (Ieee80211DataFrame *frame)

Protected Attributes

bool hasRelayUnit


Member Function Documentation

Ieee80211DataFrame * Ieee80211MgmtAPBase::convertFromEtherFrame EtherFrame ethframe  )  [protected, virtual]
 

Utility function: converts EtherFrame to Ieee80211Frame. This is needed because MACRelayUnit which we use for LAN bridging functionality deals with EtherFrames.

00071 {
00072     // create new frame
00073     Ieee80211DataFrame *frame = new Ieee80211DataFrame(ethframe->name());
00074     frame->setFromDS(true);
00075 
00076     // copy addresses from ethernet frame (transmitter addr will be set to our addr by MAC)
00077     frame->setReceiverAddress(ethframe->getDest());
00078     frame->setAddress3(ethframe->getSrc());
00079 
00080     // encapsulate payload
00081     cMessage *payload = ethframe->decapsulate();
00082     if (!payload)
00083         error("received empty EtherFrame from upper layer");
00084     frame->encapsulate(payload);
00085     delete ethframe;
00086 
00087     // done
00088     return frame;
00089 }

EtherFrame * Ieee80211MgmtAPBase::convertToEtherFrame Ieee80211DataFrame frame  )  [protected, virtual]
 

Utility function: converts the given frame to EtherFrame, deleting the original frame. This function is needed for LAN bridging functionality: MACRelayUnit deals with EtherFrames.

00053 {
00054     // create a matching ethernet frame
00055     EtherFrame *ethframe = new EthernetIIFrame(frame->name()); //TODO option to use EtherFrameWithSNAP instead
00056     ethframe->setDest(frame->getAddress3());
00057     ethframe->setSrc(frame->getTransmitterAddress());
00058     //XXX set ethertype
00059 
00060     // encapsulate the payload in there
00061     cMessage *payload = frame->decapsulate();
00062     delete frame;
00063     ASSERT(payload!=NULL);
00064     ethframe->encapsulate(payload);
00065 
00066     // done
00067     return ethframe;
00068 }

void Ieee80211MgmtAPBase::distributeReceivedDataFrame Ieee80211DataFrame frame  )  [protected, virtual]
 

Utility function for APs: sends back a data frame we received from a STA to the wireless LAN, after tweaking fromDS/toDS bits and shuffling addresses as needed.

00037 {
00038     // adjust toDS/fromDS bits, and shuffle addresses
00039     frame->setToDS(false);
00040     frame->setFromDS(true);
00041 
00042     // move destination address to address1 (receiver address),
00043     // and fill address3 with original source address;
00044     // sender address (address2) will be filled in by MAC
00045     ASSERT(!frame->getAddress3().isUnspecified());
00046     frame->setReceiverAddress(frame->getAddress3());
00047     frame->setAddress3(frame->getTransmitterAddress());
00048 
00049     sendOrEnqueue(frame);
00050 }

void Ieee80211MgmtAPBase::initialize int   )  [protected, virtual]
 

Reimplemented from Ieee80211MgmtBase.

Reimplemented in Ieee80211MgmtAP, and Ieee80211MgmtAPSimplified.

00026 {
00027     Ieee80211MgmtBase::initialize(stage);
00028 
00029     if (stage==0)
00030     {
00031         hasRelayUnit = gate("uppergateOut")->destinationGate()->isConnected();
00032         WATCH(hasRelayUnit);
00033     }
00034 }

virtual int Ieee80211MgmtAPBase::numInitStages  )  const [inline, protected, virtual]
 

Reimplemented from Ieee80211MgmtBase.

Reimplemented in Ieee80211MgmtAP, and Ieee80211MgmtAPSimplified.

00041 {return 2;}


Member Data Documentation

bool Ieee80211MgmtAPBase::hasRelayUnit [protected]
 


The documentation for this class was generated from the following files:
Generated on Thu Oct 19 18:22:23 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.0