INET Framework for OMNeT++/OMNEST
inet::ieee80211::Ieee80211MgmtSta Class Reference

Used in 802.11 infrastructure mode: handles management frames for a station (STA). More...

#include <Ieee80211MgmtSta.h>

Inheritance diagram for inet::ieee80211::Ieee80211MgmtSta:
inet::ieee80211::Ieee80211MgmtBase inet::OperationalBase inet::OperationalMixin< cSimpleModule > inet::ILifecycle

Classes

struct  ApInfo
 
struct  AssociatedApInfo
 
struct  ScanningInfo
 

Public Member Functions

 Ieee80211MgmtSta ()
 
virtual const ApInfogetAssociatedAp ()
 
- Public Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual ~OperationalMixin ()
 }@ More...
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 

Protected Types

typedef std::list< ApInfoAccessPointList
 
- Protected Types inherited from inet::OperationalMixin< cSimpleModule >
enum  State
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void handleTimer (cMessage *msg) override
 Implements abstract Ieee80211MgmtBase method. More...
 
virtual void handleCommand (int msgkind, cObject *ctrl) override
 Implements abstract Ieee80211MgmtBase method. More...
 
virtual void startAuthentication (ApInfo *ap, simtime_t timeout)
 Utility function: sends authentication request. More...
 
virtual void startAssociation (ApInfo *ap, simtime_t timeout)
 Utility function: sends association request. More...
 
virtual ApInfolookupAP (const MacAddress &address)
 Utility function: looks up AP in our AP list. More...
 
virtual void clearAPList ()
 Utility function: clear the AP list, and cancel any pending authentications. More...
 
virtual void changeChannel (int channelNum)
 Utility function: switches to the given radio channel. More...
 
virtual void storeAPInfo (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header, const Ptr< const Ieee80211BeaconFrame > &body)
 Stores AP info received in a beacon or probe response. More...
 
virtual bool scanNextChannel ()
 Switches to the next channel to scan; returns true if done (there wasn't any more channel to scan). More...
 
virtual void sendProbeRequest ()
 Broadcasts a Probe Request. More...
 
virtual void beaconLost ()
 Missed a few consecutive beacons. More...
 
virtual void sendScanConfirm ()
 Sends back result of scanning to the agent. More...
 
virtual void sendAuthenticationConfirm (ApInfo *ap, Ieee80211PrimResultCode resultCode)
 Sends back result of authentication to the agent. More...
 
virtual void sendAssociationConfirm (ApInfo *ap, Ieee80211PrimResultCode resultCode)
 Sends back result of association to the agent. More...
 
virtual void disassociate ()
 Utility function: Cancel the existing association. More...
 
virtual void sendConfirm (Ieee80211PrimConfirm *confirm, Ieee80211PrimResultCode resultCode)
 Utility function: sends a confirmation to the agent. More...
 
virtual void sendManagementFrame (const char *name, const Ptr< Ieee80211MgmtFrame > &body, int subtype, const MacAddress &address)
 Utility function: sends a management frame. More...
 
virtual void receiveSignal (cComponent *source, simsignal_t signalID, intval_t value, cObject *details) override
 Called by the signal handler whenever a change occurs we're interested in. More...
 
virtual Ieee80211PrimResultCode statusCodeToPrimResultCode (int statusCode)
 Utility function: converts Ieee80211StatusCode (->frame) to Ieee80211PrimResultCode (->primitive) More...
 
Processing of different frame types
virtual void handleAuthenticationFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleDeauthenticationFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleAssociationRequestFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleAssociationResponseFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleReassociationRequestFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleReassociationResponseFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleDisassociationFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleBeaconFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleProbeRequestFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
virtual void handleProbeResponseFrame (Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header) override
 
Processing of different agent commands
virtual void processScanCommand (Ieee80211Prim_ScanRequest *ctrl)
 
virtual void processAuthenticateCommand (Ieee80211Prim_AuthenticateRequest *ctrl)
 
virtual void processDeauthenticateCommand (Ieee80211Prim_DeauthenticateRequest *ctrl)
 
virtual void processAssociateCommand (Ieee80211Prim_AssociateRequest *ctrl)
 
virtual void processReassociateCommand (Ieee80211Prim_ReassociateRequest *ctrl)
 
virtual void processDisassociateCommand (Ieee80211Prim_DisassociateRequest *ctrl)
 
- Protected Member Functions inherited from inet::ieee80211::Ieee80211MgmtBase
virtual void handleMessageWhenUp (cMessage *msg) override
 Dispatches incoming messages to handleTimer(), handleUpperMessage() or processFrame(). More...
 
virtual void sendDown (Packet *frame)
 Utility method for implementing handleUpperMessage(): send message to MAC. More...
 
virtual void dropManagementFrame (Packet *frame)
 Utility method to dispose of an unhandled frame. More...
 
virtual void processFrame (Packet *packet, const Ptr< const Ieee80211DataOrMgmtHeader > &header)
 Dispatch to frame processing methods according to frame type. More...
 
virtual bool isInitializeStage (int stage) const override
 lifecycle support More...
 
virtual bool isModuleStartStage (int stage) const override
 
virtual bool isModuleStopStage (int stage) const override
 
virtual void handleStartOperation (LifecycleOperation *operation) override
 
virtual void handleStopOperation (LifecycleOperation *operation) override
 
virtual void handleCrashOperation (LifecycleOperation *operation) override
 
virtual void start ()
 
virtual void stop ()
 
- Protected Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual int numInitStages () const override
 
virtual void refreshDisplay () const override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void handleMessageWhenDown (cMessage *msg)
 
virtual bool handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual State getInitialOperationalState () const
 Returns initial operational state: OPERATING or NOT_OPERATING. More...
 
virtual void handleActiveOperationTimeout (cMessage *message)
 
virtual bool isUp () const
 utility functions More...
 
virtual bool isDown () const
 
virtual void setOperationalState (State newState)
 
virtual void scheduleOperationTimeout (simtime_t timeout)
 
virtual void setupActiveOperation (LifecycleOperation *operation, IDoneCallback *doneCallback, State)
 
virtual void delayActiveOperationFinish (simtime_t timeout)
 
virtual void startActiveOperationExtraTime (simtime_t delay=SIMTIME_ZERO)
 
virtual void startActiveOperationExtraTimeOrFinish (simtime_t extraTime)
 
virtual void finishActiveOperation ()
 

Protected Attributes

cModule * host
 
int numChannels
 
bool isScanning
 
ScanningInfo scanning
 
AccessPointList apList
 
cMessage * assocTimeoutMsg
 
AssociatedApInfo assocAP
 
- Protected Attributes inherited from inet::ieee80211::Ieee80211MgmtBase
ModuleRefByPar< Ieee80211Mibmib
 
ModuleRefByPar< IInterfaceTableinterfaceTable
 
NetworkInterfacemyIface = nullptr
 
long numMgmtFramesReceived
 
long numMgmtFramesDropped
 
- Protected Attributes inherited from inet::OperationalMixin< cSimpleModule >
State operationalState
 
simtime_t lastChange
 
Operation activeOperation
 
cMessage * activeOperationTimeout
 
cMessage * activeOperationExtraTimer
 

Detailed Description

Used in 802.11 infrastructure mode: handles management frames for a station (STA).

See corresponding NED file for a detailed description.

Member Typedef Documentation

◆ AccessPointList

Constructor & Destructor Documentation

◆ Ieee80211MgmtSta()

inet::ieee80211::Ieee80211MgmtSta::Ieee80211MgmtSta ( )
inline
98 : host(nullptr), numChannels(-1), isScanning(false), assocTimeoutMsg(nullptr) {}

Member Function Documentation

◆ beaconLost()

void inet::ieee80211::Ieee80211MgmtSta::beaconLost ( )
protectedvirtual

Missed a few consecutive beacons.

221 {
222  EV << "Missed a few consecutive beacons -- AP is considered lost\n";
224 }

◆ changeChannel()

void inet::ieee80211::Ieee80211MgmtSta::changeChannel ( int  channelNum)
protectedvirtual

Utility function: switches to the given radio channel.

210 {
211  EV << "Tuning to channel #" << channelNum << "\n";
212 
213  Ieee80211ConfigureRadioCommand *configureCommand = new Ieee80211ConfigureRadioCommand();
214  configureCommand->setChannelNumber(channelNum);
215  auto request = new Request("changeChannel", RADIO_C_CONFIGURE);
216  request->setControlInfo(configureCommand);
217  send(request, "macOut");
218 }

◆ clearAPList()

void inet::ieee80211::Ieee80211MgmtSta::clearAPList ( )
protectedvirtual

Utility function: clear the AP list, and cancel any pending authentications.

201 {
202  for (auto& elem : apList)
203  if (elem.authTimeoutMsg)
204  cancelAndDelete(elem.authTimeoutMsg);
205 
206  apList.clear();
207 }

◆ disassociate()

void inet::ieee80211::Ieee80211MgmtSta::disassociate ( )
protectedvirtual

Utility function: Cancel the existing association.

478 {
479  EV << "Disassociating from AP address=" << assocAP.address << "\n";
480  ASSERT(mib->bssStationData.isAssociated);
481  mib->bssStationData.isAssociated = false;
482  cancelAndDelete(assocAP.beaconTimeoutMsg);
483  assocAP.beaconTimeoutMsg = nullptr;
484  assocAP = AssociatedApInfo(); // clear it
485 }

◆ getAssociatedAp()

virtual const ApInfo* inet::ieee80211::Ieee80211MgmtSta::getAssociatedAp ( )
inlinevirtual

◆ handleAssociationRequestFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleAssociationRequestFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

610 {
611  dropManagementFrame(packet);
612 }

◆ handleAssociationResponseFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleAssociationResponseFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

615 {
616  EV << "Received Association Response frame\n";
617 
618  if (!assocTimeoutMsg) {
619  EV << "No association in progress, ignoring frame\n";
620  delete packet;
621  return;
622  }
623 
624  // extract frame contents
625  const auto& responseBody = packet->peekData<Ieee80211AssociationResponseFrame>();
626  MacAddress address = header->getTransmitterAddress();
627  int statusCode = responseBody->getStatusCode();
628  // TODO short aid;
629  // TODO Ieee80211SupportedRatesElement supportedRates;
630  delete packet;
631 
632  // look up AP data structure
633  ApInfo *ap = lookupAP(address);
634  if (!ap)
635  throw cRuntimeError("handleAssociationResponseFrame: AP not known: address=%s", address.str().c_str());
636 
637  if (mib->bssStationData.isAssociated) {
638  EV << "Breaking existing association with AP address=" << assocAP.address << "\n";
639  mib->bssStationData.isAssociated = false;
640  cancelAndDelete(assocAP.beaconTimeoutMsg);
641  assocAP.beaconTimeoutMsg = nullptr;
642  assocAP = AssociatedApInfo();
643  }
644 
645  cancelAndDelete(assocTimeoutMsg);
646  assocTimeoutMsg = nullptr;
647 
648  if (statusCode != SC_SUCCESSFUL) {
649  EV << "Association failed with AP address=" << ap->address << "\n";
650  }
651  else {
652  EV << "Association successful, AP address=" << ap->address << "\n";
653 
654  // change our state to "associated"
655  mib->bssData.ssid = ap->ssid;
656  mib->bssData.bssid = ap->address;
657  mib->bssStationData.isAssociated = true;
658  (ApInfo&)assocAP = (*ap);
659 
660  emit(l2AssociatedSignal, myIface, ap);
661 
662  assocAP.beaconTimeoutMsg = new cMessage("beaconTimeout", MK_BEACON_TIMEOUT);
664  }
665 
666  // report back to agent
668 }

◆ handleAuthenticationFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleAuthenticationFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

513 {
514  const auto& requestBody = packet->peekData<Ieee80211AuthenticationFrame>();
515  MacAddress address = header->getTransmitterAddress();
516  int frameAuthSeq = requestBody->getSequenceNumber();
517  EV << "Received Authentication frame from address=" << address << ", seqNum=" << frameAuthSeq << "\n";
518 
519  ApInfo *ap = lookupAP(address);
520  if (!ap) {
521  EV << "AP not known, discarding authentication frame\n";
522  delete packet;
523  return;
524  }
525 
526  // what if already authenticated with AP
527  if (ap->isAuthenticated) {
528  EV << "AP already authenticated, ignoring frame\n";
529  delete packet;
530  return;
531  }
532 
533  // is authentication is in progress with this AP?
534  if (!ap->authTimeoutMsg) {
535  EV << "No authentication in progress with AP, ignoring frame\n";
536  delete packet;
537  return;
538  }
539 
540  // check authentication sequence number is OK
541  if (frameAuthSeq != ap->authSeqExpected) {
542  // wrong sequence number: send error and return
543  EV << "Wrong sequence number, " << ap->authSeqExpected << " expected\n";
544  const auto& body = makeShared<Ieee80211AuthenticationFrame>();
545  body->setStatusCode(SC_AUTH_OUT_OF_SEQ);
546  sendManagementFrame("Auth-ERROR", body, ST_AUTHENTICATION, header->getTransmitterAddress());
547  delete packet;
548 
549  // cancel timeout, send error to agent
550  cancelAndDelete(ap->authTimeoutMsg);
551  ap->authTimeoutMsg = nullptr;
552  sendAuthenticationConfirm(ap, PRC_REFUSED); // TODO or what resultCode?
553  return;
554  }
555 
556  // check if more exchanges are needed for auth to be complete
557  int statusCode = requestBody->getStatusCode();
558 
559  if (statusCode == SC_SUCCESSFUL && !requestBody->isLast()) {
560  EV << "More steps required, sending another Authentication frame\n";
561 
562  // more steps required, send another Authentication frame
563  const auto& body = makeShared<Ieee80211AuthenticationFrame>();
564  body->setSequenceNumber(frameAuthSeq + 1);
565  body->setStatusCode(SC_SUCCESSFUL);
566  // TODO frame length could be increased to account for challenge text length etc.
567  sendManagementFrame("Auth", body, ST_AUTHENTICATION, address);
568  ap->authSeqExpected += 2;
569  }
570  else {
571  if (statusCode == SC_SUCCESSFUL)
572  EV << "Authentication successful\n";
573  else
574  EV << "Authentication failed\n";
575 
576  // authentication completed
577  ap->isAuthenticated = (statusCode == SC_SUCCESSFUL);
578  cancelAndDelete(ap->authTimeoutMsg);
579  ap->authTimeoutMsg = nullptr;
581  }
582 
583  delete packet;
584 }

◆ handleBeaconFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleBeaconFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

704 {
705  EV << "Received Beacon frame\n";
706  const auto& beaconBody = packet->peekData<Ieee80211BeaconFrame>();
707  storeAPInfo(packet, header, beaconBody);
708 
709  // if it is out associate AP, restart beacon timeout
710  if (mib->bssStationData.isAssociated && header->getTransmitterAddress() == assocAP.address) {
711  EV << "Beacon is from associated AP, restarting beacon timeout timer\n";
712  ASSERT(assocAP.beaconTimeoutMsg != nullptr);
714 
715 // ApInfo *ap = lookupAP(frame->getTransmitterAddress());
716 // ASSERT(ap!=nullptr);
717  }
718 
719  delete packet;
720 }

◆ handleCommand()

void inet::ieee80211::Ieee80211MgmtSta::handleCommand ( int  msgkind,
cObject *  ctrl 
)
overrideprotectedvirtual

Implements abstract Ieee80211MgmtBase method.

Implements inet::ieee80211::Ieee80211MgmtBase.

171 {
172  if (auto cmd = dynamic_cast<Ieee80211Prim_ScanRequest *>(ctrl))
173  processScanCommand(cmd);
174  else if (auto cmd = dynamic_cast<Ieee80211Prim_AuthenticateRequest *>(ctrl))
176  else if (auto cmd = dynamic_cast<Ieee80211Prim_DeauthenticateRequest *>(ctrl))
178  else if (auto cmd = dynamic_cast<Ieee80211Prim_AssociateRequest *>(ctrl))
180  else if (auto cmd = dynamic_cast<Ieee80211Prim_ReassociateRequest *>(ctrl))
182  else if (auto cmd = dynamic_cast<Ieee80211Prim_DisassociateRequest *>(ctrl))
184  else if (ctrl)
185  throw cRuntimeError("handleCommand(): unrecognized control info class `%s'", ctrl->getClassName());
186  else
187  throw cRuntimeError("handleCommand(): control info is nullptr");
188  delete ctrl;
189 }

◆ handleDeauthenticationFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleDeauthenticationFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

587 {
588  EV << "Received Deauthentication frame\n";
589  const MacAddress& address = header->getAddress3(); // source address
590  ApInfo *ap = lookupAP(address);
591  if (!ap || !ap->isAuthenticated) {
592  EV << "Unknown AP, or not authenticated with that AP -- ignoring frame\n";
593  delete packet;
594  return;
595  }
596  if (ap->authTimeoutMsg) {
597  cancelAndDelete(ap->authTimeoutMsg);
598  ap->authTimeoutMsg = nullptr;
599  EV << "Cancelling pending authentication\n";
600  delete packet;
601  return;
602  }
603 
604  EV << "Setting isAuthenticated flag for that AP to false\n";
605  ap->isAuthenticated = false;
606  delete packet;
607 }

◆ handleDisassociationFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleDisassociationFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

682 {
683  EV << "Received Disassociation frame\n";
684  const MacAddress& address = header->getAddress3(); // source address
685 
686  if (assocTimeoutMsg) {
687  // pending association
688  cancelAndDelete(assocTimeoutMsg);
689  assocTimeoutMsg = nullptr;
690  }
691  if (!mib->bssStationData.isAssociated || address != assocAP.address) {
692  EV << "Not associated with that AP -- ignoring frame\n";
693  delete packet;
694  return;
695  }
696 
697  EV << "Setting isAssociated flag to false\n";
698  mib->bssStationData.isAssociated = false;
699  cancelAndDelete(assocAP.beaconTimeoutMsg);
700  assocAP.beaconTimeoutMsg = nullptr;
701 }

◆ handleProbeRequestFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleProbeRequestFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

723 {
724  dropManagementFrame(packet);
725 }

◆ handleProbeResponseFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleProbeResponseFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

728 {
729  EV << "Received Probe Response frame\n";
730  const auto& probeResponseBody = packet->peekData<Ieee80211ProbeResponseFrame>();
731  storeAPInfo(packet, header, probeResponseBody);
732  delete packet;
733 }

◆ handleReassociationRequestFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleReassociationRequestFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

671 {
672  dropManagementFrame(packet);
673 }

◆ handleReassociationResponseFrame()

void inet::ieee80211::Ieee80211MgmtSta::handleReassociationResponseFrame ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header 
)
overrideprotectedvirtual

Implements inet::ieee80211::Ieee80211MgmtBase.

676 {
677  EV << "Received Reassociation Response frame\n";
678  // TODO handle with the same code as Association Response?
679 }

◆ handleTimer()

void inet::ieee80211::Ieee80211MgmtSta::handleTimer ( cMessage *  msg)
overrideprotectedvirtual

Implements abstract Ieee80211MgmtBase method.

Implements inet::ieee80211::Ieee80211MgmtBase.

115 {
116  if (msg->getKind() == MK_AUTH_TIMEOUT) {
117  // authentication timed out
118  ApInfo *ap = (ApInfo *)msg->getContextPointer();
119  EV << "Authentication timed out, AP address = " << ap->address << "\n";
120 
121  // send back failure report to agent
123  }
124  else if (msg->getKind() == MK_ASSOC_TIMEOUT) {
125  // association timed out
126  ApInfo *ap = (ApInfo *)msg->getContextPointer();
127  EV << "Association timed out, AP address = " << ap->address << "\n";
128 
129  // send back failure report to agent
131  }
132  else if (msg->getKind() == MK_SCAN_MAXCHANNELTIME) {
133  // go to next channel during scanning
134  bool done = scanNextChannel();
135  if (done)
136  sendScanConfirm(); // send back response to agents' "scan" command
137  delete msg;
138  }
139  else if (msg->getKind() == MK_SCAN_SENDPROBE) {
140  // Active Scan: send a probe request, then wait for minChannelTime (11.1.3.2.2)
141  delete msg;
143  cMessage *timerMsg = new cMessage("minChannelTime", MK_SCAN_MINCHANNELTIME);
144  scheduleAfter(scanning.minChannelTime, timerMsg); // TODO actually, we should start waiting after ProbeReq actually got transmitted
145  }
146  else if (msg->getKind() == MK_SCAN_MINCHANNELTIME) {
147  // Active Scan: after minChannelTime, possibly listen for the remaining time until maxChannelTime
148  delete msg;
150  EV << "Busy channel detected during minChannelTime, continuing listening until maxChannelTime elapses\n";
151  cMessage *timerMsg = new cMessage("maxChannelTime", MK_SCAN_MAXCHANNELTIME);
152  scheduleAfter(scanning.maxChannelTime - scanning.minChannelTime, timerMsg);
153  }
154  else {
155  EV << "Channel was empty during minChannelTime, going to next channel\n";
156  bool done = scanNextChannel();
157  if (done)
158  sendScanConfirm(); // send back response to agents' "scan" command
159  }
160  }
161  else if (msg->getKind() == MK_BEACON_TIMEOUT) {
162  // missed a few consecutive beacons
163  beaconLost();
164  }
165  else {
166  throw cRuntimeError("internal error: unrecognized timer '%s'", msg->getName());
167  }
168 }

◆ initialize()

void inet::ieee80211::Ieee80211MgmtSta::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::ieee80211::Ieee80211MgmtBase.

92 {
94 
95  if (stage == INITSTAGE_LOCAL) {
97  mib->bssStationData.stationType = Ieee80211Mib::STATION;
98  mib->bssStationData.isAssociated = false;
99 
100  isScanning = false;
101  assocTimeoutMsg = nullptr;
102  numChannels = par("numChannels");
103 
104  host = getContainingNode(this);
105 
106  WATCH(isScanning);
107 
108  WATCH(scanning);
109  WATCH(assocAP);
110  WATCH_LIST(apList);
111  }
112 }

◆ lookupAP()

Ieee80211MgmtSta::ApInfo * inet::ieee80211::Ieee80211MgmtSta::lookupAP ( const MacAddress address)
protectedvirtual

Utility function: looks up AP in our AP list.

Returns nullptr if not found.

192 {
193  for (auto& elem : apList)
194  if (elem.address == address)
195  return &(elem);
196 
197  return nullptr;
198 }

◆ numInitStages()

virtual int inet::ieee80211::Ieee80211MgmtSta::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented from inet::ieee80211::Ieee80211MgmtBase.

103 { return NUM_INIT_STAGES; }

◆ processAssociateCommand()

void inet::ieee80211::Ieee80211MgmtSta::processAssociateCommand ( Ieee80211Prim_AssociateRequest ctrl)
protectedvirtual
443 {
444  const MacAddress& address = ctrl->getAddress();
445  ApInfo *ap = lookupAP(address);
446  if (!ap)
447  throw cRuntimeError("processAssociateCommand: AP not known: address = %s", address.str().c_str());
448  startAssociation(ap, ctrl->getTimeout());
449 }

◆ processAuthenticateCommand()

void inet::ieee80211::Ieee80211MgmtSta::processAuthenticateCommand ( Ieee80211Prim_AuthenticateRequest ctrl)
protectedvirtual
409 {
410  const MacAddress& address = ctrl->getAddress();
411  ApInfo *ap = lookupAP(address);
412  if (!ap)
413  throw cRuntimeError("processAuthenticateCommand: AP not known: address = %s", address.str().c_str());
414  startAuthentication(ap, ctrl->getTimeout());
415 }

◆ processDeauthenticateCommand()

void inet::ieee80211::Ieee80211MgmtSta::processDeauthenticateCommand ( Ieee80211Prim_DeauthenticateRequest ctrl)
protectedvirtual
418 {
419  const MacAddress& address = ctrl->getAddress();
420  ApInfo *ap = lookupAP(address);
421  if (!ap)
422  throw cRuntimeError("processDeauthenticateCommand: AP not known: address = %s", address.str().c_str());
423 
424  if (mib->bssStationData.isAssociated && assocAP.address == address)
425  disassociate();
426 
427  if (ap->isAuthenticated)
428  ap->isAuthenticated = false;
429 
430  // cancel possible pending authentication timer
431  if (ap->authTimeoutMsg) {
432  cancelAndDelete(ap->authTimeoutMsg);
433  ap->authTimeoutMsg = nullptr;
434  }
435 
436  // create and send deauthentication request
437  const auto& body = makeShared<Ieee80211DeauthenticationFrame>();
438  body->setReasonCode(ctrl->getReasonCode());
439  sendManagementFrame("Deauth", body, ST_DEAUTHENTICATION, address);
440 }

◆ processDisassociateCommand()

void inet::ieee80211::Ieee80211MgmtSta::processDisassociateCommand ( Ieee80211Prim_DisassociateRequest ctrl)
protectedvirtual
459 {
460  const MacAddress& address = ctrl->getAddress();
461 
462  if (mib->bssStationData.isAssociated && address == assocAP.address) {
463  disassociate();
464  }
465  else if (assocTimeoutMsg) {
466  // pending association
467  cancelAndDelete(assocTimeoutMsg);
468  assocTimeoutMsg = nullptr;
469  }
470 
471  // create and send disassociation request
472  const auto& body = makeShared<Ieee80211DisassociationFrame>();
473  body->setReasonCode(ctrl->getReasonCode());
474  sendManagementFrame("Disass", body, ST_DISASSOCIATION, address);
475 }

◆ processReassociateCommand()

void inet::ieee80211::Ieee80211MgmtSta::processReassociateCommand ( Ieee80211Prim_ReassociateRequest ctrl)
protectedvirtual
452 {
453  // treat the same way as association
454  // TODO refine
456 }

◆ processScanCommand()

void inet::ieee80211::Ieee80211MgmtSta::processScanCommand ( Ieee80211Prim_ScanRequest ctrl)
protectedvirtual
303 {
304  EV << "Received Scan Request from agent, clearing AP list and starting scanning...\n";
305 
306  if (isScanning)
307  throw cRuntimeError("processScanCommand: scanning already in progress");
308  if (mib->bssStationData.isAssociated) {
309  disassociate();
310  }
311  else if (assocTimeoutMsg) {
312  EV << "Cancelling ongoing association process\n";
313  cancelAndDelete(assocTimeoutMsg);
314  assocTimeoutMsg = nullptr;
315  }
316 
317  // clear existing AP list (and cancel any pending authentications) -- we want to start with a clean page
318  clearAPList();
319 
320  // fill in scanning state
321  ASSERT(ctrl->getBSSType() == BSSTYPE_INFRASTRUCTURE);
322  scanning.bssid = ctrl->getBSSID().isUnspecified() ? MacAddress::BROADCAST_ADDRESS : ctrl->getBSSID();
323  scanning.ssid = ctrl->getSSID();
324  scanning.activeScan = ctrl->getActiveScan();
325  scanning.probeDelay = ctrl->getProbeDelay();
326  scanning.channelList.clear();
327  scanning.minChannelTime = ctrl->getMinChannelTime();
328  scanning.maxChannelTime = ctrl->getMaxChannelTime();
330 
331  // channel list to scan (default: all channels)
332  for (size_t i = 0; i < ctrl->getChannelListArraySize(); i++)
333  scanning.channelList.push_back(ctrl->getChannelList(i));
334  if (scanning.channelList.empty())
335  for (int i = 0; i < numChannels; i++)
336  scanning.channelList.push_back(i);
337 
338  // start scanning
339  if (scanning.activeScan)
340  host->subscribe(IRadio::receptionStateChangedSignal, this);
341  scanning.currentChannelIndex = -1; // so we'll start with index==0
342  isScanning = true;
343  scanNextChannel();
344 }

◆ receiveSignal()

void inet::ieee80211::Ieee80211MgmtSta::receiveSignal ( cComponent *  source,
simsignal_t  signalID,
intval_t  value,
cObject *  details 
)
overrideprotectedvirtual

Called by the signal handler whenever a change occurs we're interested in.

289 {
290  Enter_Method("%s", cComponent::getSignalName(signalID));
291 
292  // Note that we are only subscribed during scanning!
293  if (signalID == IRadio::receptionStateChangedSignal) {
294  IRadio::ReceptionState newReceptionState = static_cast<IRadio::ReceptionState>(value);
295  if (newReceptionState != IRadio::RECEPTION_STATE_UNDEFINED && newReceptionState != IRadio::RECEPTION_STATE_IDLE) {
296  EV << "busy radio channel detected during scanning\n";
298  }
299  }
300 }

◆ scanNextChannel()

bool inet::ieee80211::Ieee80211MgmtSta::scanNextChannel ( )
protectedvirtual

Switches to the next channel to scan; returns true if done (there wasn't any more channel to scan).

347 {
348  // if we're already at the last channel, we're through
349  if (scanning.currentChannelIndex == (int)scanning.channelList.size() - 1) {
350  EV << "Finished scanning last channel\n";
351  if (scanning.activeScan)
352  host->unsubscribe(IRadio::receptionStateChangedSignal, this);
353  isScanning = false;
354  return true; // we're done
355  }
356 
357  // tune to next channel
358  int newChannel = scanning.channelList[++scanning.currentChannelIndex];
359  changeChannel(newChannel);
361 
362  if (scanning.activeScan) {
363  // Active Scan: first wait probeDelay, then send a probe. Listening
364  // for minChannelTime or maxChannelTime takes place after that. (11.1.3.2)
365  scheduleAfter(scanning.probeDelay, new cMessage("sendProbe", MK_SCAN_SENDPROBE));
366  }
367  else {
368  // Passive Scan: spend maxChannelTime on the channel (11.1.3.1)
369  cMessage *timerMsg = new cMessage("maxChannelTime", MK_SCAN_MAXCHANNELTIME);
370  scheduleAfter(scanning.maxChannelTime, timerMsg);
371  }
372 
373  return false;
374 }

◆ sendAssociationConfirm()

void inet::ieee80211::Ieee80211MgmtSta::sendAssociationConfirm ( ApInfo ap,
Ieee80211PrimResultCode  resultCode 
)
protectedvirtual

Sends back result of association to the agent.

495 {
496  sendConfirm(new Ieee80211Prim_AssociateConfirm(), resultCode);
497 }

◆ sendAuthenticationConfirm()

void inet::ieee80211::Ieee80211MgmtSta::sendAuthenticationConfirm ( ApInfo ap,
Ieee80211PrimResultCode  resultCode 
)
protectedvirtual

Sends back result of authentication to the agent.

488 {
489  Ieee80211Prim_AuthenticateConfirm *confirm = new Ieee80211Prim_AuthenticateConfirm();
490  confirm->setAddress(ap->address);
491  sendConfirm(confirm, resultCode);
492 }

◆ sendConfirm()

void inet::ieee80211::Ieee80211MgmtSta::sendConfirm ( Ieee80211PrimConfirm confirm,
Ieee80211PrimResultCode  resultCode 
)
protectedvirtual

Utility function: sends a confirmation to the agent.

500 {
501  confirm->setResultCode(resultCode);
502  cMessage *msg = new cMessage(confirm->getClassName());
503  msg->setControlInfo(confirm);
504  send(msg, "agentOut");
505 }

◆ sendManagementFrame()

void inet::ieee80211::Ieee80211MgmtSta::sendManagementFrame ( const char *  name,
const Ptr< Ieee80211MgmtFrame > &  body,
int  subtype,
const MacAddress address 
)
protectedvirtual

Utility function: sends a management frame.

227 {
228  auto packet = new Packet(name);
229  packet->addTag<MacAddressReq>()->setDestAddress(address);
230  packet->addTag<Ieee80211SubtypeReq>()->setSubtype(subtype);
231  packet->insertAtBack(body);
232  sendDown(packet);
233 }

◆ sendProbeRequest()

void inet::ieee80211::Ieee80211MgmtSta::sendProbeRequest ( )
protectedvirtual

Broadcasts a Probe Request.

377 {
378  EV << "Sending Probe Request, BSSID=" << scanning.bssid << ", SSID=\"" << scanning.ssid << "\"\n";
379  const auto& body = makeShared<Ieee80211ProbeRequestFrame>();
380  body->setSSID(scanning.ssid.c_str());
381  body->setChunkLength(B((2 + scanning.ssid.length()) + (2 + body->getSupportedRates().numRates)));
383 }

◆ sendScanConfirm()

void inet::ieee80211::Ieee80211MgmtSta::sendScanConfirm ( )
protectedvirtual

Sends back result of scanning to the agent.

386 {
387  EV << "Scanning complete, found " << apList.size() << " APs, sending confirmation to agent\n";
388 
389  // copy apList contents into a ScanConfirm primitive and send it back
390  int n = apList.size();
391  Ieee80211Prim_ScanConfirm *confirm = new Ieee80211Prim_ScanConfirm();
392  confirm->setBssListArraySize(n);
393  auto it = apList.begin();
394  // TODO filter for req'd bssid and ssid
395  for (int i = 0; i < n; i++, it++) {
396  ApInfo *ap = &(*it);
397  Ieee80211Prim_BssDescription& bss = confirm->getBssListForUpdate(i);
398  bss.setChannelNumber(ap->channel);
399  bss.setBSSID(ap->address);
400  bss.setSSID(ap->ssid.c_str());
401  bss.setSupportedRates(ap->supportedRates);
402  bss.setBeaconInterval(ap->beaconInterval);
403  bss.setRxPower(ap->rxPower);
404  }
405  sendConfirm(confirm, PRC_SUCCESS);
406 }

◆ startAssociation()

void inet::ieee80211::Ieee80211MgmtSta::startAssociation ( ApInfo ap,
simtime_t  timeout 
)
protectedvirtual

Utility function: sends association request.

262 {
263  if (mib->bssStationData.isAssociated || assocTimeoutMsg)
264  throw cRuntimeError("startAssociation: already associated or association currently in progress");
265  if (!ap->isAuthenticated)
266  throw cRuntimeError("startAssociation: not yet authenticated with AP address='%s'", ap->address.str().c_str());
267 
268  // switch to that channel
269  changeChannel(ap->channel);
270 
271  // create and send association request
272  const auto& body = makeShared<Ieee80211AssociationRequestFrame>();
273 
274  // TODO set the following too?
275  // string SSID
276 // Ieee80211SupportedRatesElement supportedRates;
277 
278  body->setChunkLength(B(2 + 2 + strlen(body->getSSID()) + 2 + body->getSupportedRates().numRates + 2));
279  sendManagementFrame("Assoc", body, ST_ASSOCIATIONREQUEST, ap->address);
280 
281  // schedule timeout
282  ASSERT(assocTimeoutMsg == nullptr);
283  assocTimeoutMsg = new cMessage("assocTimeout", MK_ASSOC_TIMEOUT);
284  assocTimeoutMsg->setContextPointer(ap);
285  scheduleAfter(timeout, assocTimeoutMsg);
286 }

◆ startAuthentication()

void inet::ieee80211::Ieee80211MgmtSta::startAuthentication ( ApInfo ap,
simtime_t  timeout 
)
protectedvirtual

Utility function: sends authentication request.

236 {
237  if (ap->authTimeoutMsg)
238  throw cRuntimeError("startAuthentication: authentication currently in progress with AP address='%s'", ap->address.str().c_str());
239  if (ap->isAuthenticated)
240  throw cRuntimeError("startAuthentication: already authenticated with AP address='%s'", ap->address.str().c_str());
241 
242  changeChannel(ap->channel);
243 
244  EV << "Sending initial Authentication frame with seqNum=1\n";
245 
246  // create and send first authentication frame
247  const auto& body = makeShared<Ieee80211AuthenticationFrame>();
248  body->setSequenceNumber(1);
249  // TODO frame length could be increased to account for challenge text length etc.
250  sendManagementFrame("Auth", body, ST_AUTHENTICATION, ap->address);
251 
252  ap->authSeqExpected = 2;
253 
254  // schedule timeout
255  ASSERT(ap->authTimeoutMsg == nullptr);
256  ap->authTimeoutMsg = new cMessage("authTimeout", MK_AUTH_TIMEOUT);
257  ap->authTimeoutMsg->setContextPointer(ap);
258  scheduleAfter(timeout, ap->authTimeoutMsg);
259 }

◆ statusCodeToPrimResultCode()

Ieee80211PrimResultCode inet::ieee80211::Ieee80211MgmtSta::statusCodeToPrimResultCode ( int  statusCode)
protectedvirtual

Utility function: converts Ieee80211StatusCode (->frame) to Ieee80211PrimResultCode (->primitive)

508 {
509  return statusCode == SC_SUCCESSFUL ? PRC_SUCCESS : PRC_REFUSED;
510 }

◆ storeAPInfo()

void inet::ieee80211::Ieee80211MgmtSta::storeAPInfo ( Packet packet,
const Ptr< const Ieee80211MgmtHeader > &  header,
const Ptr< const Ieee80211BeaconFrame > &  body 
)
protectedvirtual

Stores AP info received in a beacon or probe response.

736 {
737  auto address = header->getTransmitterAddress();
738  ApInfo *ap = lookupAP(address);
739  if (ap) {
740  EV << "AP address=" << address << ", SSID=" << body->getSSID() << " already in our AP list, refreshing the info\n";
741  }
742  else {
743  EV << "Inserting AP address=" << address << ", SSID=" << body->getSSID() << " into our AP list\n";
744  apList.push_back(ApInfo());
745  ap = &apList.back();
746  }
747 
748  ap->channel = body->getChannelNumber();
749  ap->address = address;
750  ap->ssid = body->getSSID();
751  ap->supportedRates = body->getSupportedRates();
752  ap->beaconInterval = body->getBeaconInterval();
753  auto signalPowerInd = packet->getTag<SignalPowerInd>();
754  if (signalPowerInd != nullptr) {
755  ap->rxPower = signalPowerInd->getPower().get();
756  if (ap->address == assocAP.address)
757  assocAP.rxPower = ap->rxPower;
758  }
759 }

Member Data Documentation

◆ apList

AccessPointList inet::ieee80211::Ieee80211MgmtSta::apList
protected

◆ assocAP

AssociatedApInfo inet::ieee80211::Ieee80211MgmtSta::assocAP
protected

◆ assocTimeoutMsg

cMessage* inet::ieee80211::Ieee80211MgmtSta::assocTimeoutMsg
protected

◆ host

cModule* inet::ieee80211::Ieee80211MgmtSta::host
protected

◆ isScanning

bool inet::ieee80211::Ieee80211MgmtSta::isScanning
protected

◆ numChannels

int inet::ieee80211::Ieee80211MgmtSta::numChannels
protected

◆ scanning

ScanningInfo inet::ieee80211::Ieee80211MgmtSta::scanning
protected

The documentation for this class was generated from the following files:
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::busyChannelDetected
bool busyChannelDetected
Definition: Ieee80211MgmtSta.h:38
inet::ieee80211::Ieee80211MgmtSta::scanning
ScanningInfo scanning
Definition: Ieee80211MgmtSta.h:86
inet::ieee80211::Ieee80211MgmtSta::clearAPList
virtual void clearAPList()
Utility function: clear the AP list, and cancel any pending authentications.
Definition: Ieee80211MgmtSta.cc:200
inet::physicallayer::IRadio::RECEPTION_STATE_IDLE
@ RECEPTION_STATE_IDLE
The radio medium is free, no signal is detected.
Definition: IRadio.h:136
inet::l2BeaconLostSignal
simsignal_t l2BeaconLostSignal
Signals for publish/subscribe mechanisms.
Definition: Simsignals.cc:14
inet::ieee80211::ST_PROBEREQUEST
@ ST_PROBEREQUEST
Definition: Ieee80211Frame_m.h:153
inet::ieee80211::Ieee80211MgmtSta::sendManagementFrame
virtual void sendManagementFrame(const char *name, const Ptr< Ieee80211MgmtFrame > &body, int subtype, const MacAddress &address)
Utility function: sends a management frame.
Definition: Ieee80211MgmtSta.cc:226
inet::ieee80211::PRC_TIMEOUT
@ PRC_TIMEOUT
Definition: Ieee80211Primitives_m.h:168
inet::ieee80211::Ieee80211MgmtBase::mib
ModuleRefByPar< Ieee80211Mib > mib
Definition: Ieee80211MgmtBase.h:33
inet::ieee80211::Ieee80211MgmtSta::ApInfo::beaconInterval
simtime_t beaconInterval
Definition: Ieee80211MgmtSta.h:51
inet::ieee80211::Ieee80211Mib::INFRASTRUCTURE
@ INFRASTRUCTURE
Definition: Ieee80211Mib.h:21
inet::getContainingNode
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
inet::ieee80211::Ieee80211MgmtSta::changeChannel
virtual void changeChannel(int channelNum)
Utility function: switches to the given radio channel.
Definition: Ieee80211MgmtSta.cc:209
inet::ieee80211::Ieee80211MgmtSta::processDeauthenticateCommand
virtual void processDeauthenticateCommand(Ieee80211Prim_DeauthenticateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:417
inet::l2AssociatedSignal
simsignal_t l2AssociatedSignal
Definition: Simsignals.cc:15
inet::ieee80211::Ieee80211MgmtSta::isScanning
bool isScanning
Definition: Ieee80211MgmtSta.h:85
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::maxChannelTime
simtime_t maxChannelTime
Definition: Ieee80211MgmtSta.h:40
inet::ieee80211::Ieee80211Mib::STATION
@ STATION
Definition: Ieee80211Mib.h:28
inet::ieee80211::Ieee80211MgmtSta::beaconLost
virtual void beaconLost()
Missed a few consecutive beacons.
Definition: Ieee80211MgmtSta.cc:220
inet::ieee80211::Ieee80211MgmtSta::host
cModule * host
Definition: Ieee80211MgmtSta.h:79
inet::ieee80211::Ieee80211MgmtBase::dropManagementFrame
virtual void dropManagementFrame(Packet *frame)
Utility method to dispose of an unhandled frame.
Definition: Ieee80211MgmtBase.cc:75
inet::ieee80211::Ieee80211MgmtSta::ApInfo::address
MacAddress address
Definition: Ieee80211MgmtSta.h:48
inet::ieee80211::Ieee80211MgmtSta::lookupAP
virtual ApInfo * lookupAP(const MacAddress &address)
Utility function: looks up AP in our AP list.
Definition: Ieee80211MgmtSta.cc:191
inet::physicallayer::IRadio::RECEPTION_STATE_UNDEFINED
@ RECEPTION_STATE_UNDEFINED
The radio medium state is unknown, reception state is meaningless, signal detection is not possible.
Definition: IRadio.h:130
inet::ieee80211::Ieee80211MgmtSta::processDisassociateCommand
virtual void processDisassociateCommand(Ieee80211Prim_DisassociateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:458
inet::ieee80211::Ieee80211MgmtSta::assocAP
AssociatedApInfo assocAP
Definition: Ieee80211MgmtSta.h:95
inet::physicallayer::IRadio::ReceptionState
ReceptionState
This enumeration specifies the reception state of the radio.
Definition: IRadio.h:124
inet::ieee80211::Ieee80211MgmtSta::statusCodeToPrimResultCode
virtual Ieee80211PrimResultCode statusCodeToPrimResultCode(int statusCode)
Utility function: converts Ieee80211StatusCode (->frame) to Ieee80211PrimResultCode (->primitive)
Definition: Ieee80211MgmtSta.cc:507
inet::ieee80211::Ieee80211MgmtBase::myIface
NetworkInterface * myIface
Definition: Ieee80211MgmtBase.h:35
inet::ieee80211::PRC_REFUSED
@ PRC_REFUSED
Definition: Ieee80211Primitives_m.h:170
inet::ieee80211::Ieee80211MgmtSta::sendAssociationConfirm
virtual void sendAssociationConfirm(ApInfo *ap, Ieee80211PrimResultCode resultCode)
Sends back result of association to the agent.
Definition: Ieee80211MgmtSta.cc:494
inet::ieee80211::Ieee80211MgmtSta::disassociate
virtual void disassociate()
Utility function: Cancel the existing association.
Definition: Ieee80211MgmtSta.cc:477
ctrl
removed ctrl
Definition: IUdp-gates.txt:7
MK_SCAN_MAXCHANNELTIME
#define MK_SCAN_MAXCHANNELTIME
Definition: Ieee80211MgmtSta.cc:43
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::activeScan
bool activeScan
Definition: Ieee80211MgmtSta.h:34
inet::ieee80211::Ieee80211MgmtSta::sendConfirm
virtual void sendConfirm(Ieee80211PrimConfirm *confirm, Ieee80211PrimResultCode resultCode)
Utility function: sends a confirmation to the agent.
Definition: Ieee80211MgmtSta.cc:499
inet::ieee80211::ST_ASSOCIATIONREQUEST
@ ST_ASSOCIATIONREQUEST
Definition: Ieee80211Frame_m.h:149
inet::ieee80211::Ieee80211MgmtSta::startAuthentication
virtual void startAuthentication(ApInfo *ap, simtime_t timeout)
Utility function: sends authentication request.
Definition: Ieee80211MgmtSta.cc:235
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::ieee80211::ST_AUTHENTICATION
@ ST_AUTHENTICATION
Definition: Ieee80211Frame_m.h:158
inet::ieee80211::Ieee80211MgmtSta::numChannels
int numChannels
Definition: Ieee80211MgmtSta.h:82
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::minChannelTime
simtime_t minChannelTime
Definition: Ieee80211MgmtSta.h:39
inet::ieee80211::Ieee80211MgmtSta::startAssociation
virtual void startAssociation(ApInfo *ap, simtime_t timeout)
Utility function: sends association request.
Definition: Ieee80211MgmtSta.cc:261
inet::ieee80211::ST_DEAUTHENTICATION
@ ST_DEAUTHENTICATION
Definition: Ieee80211Frame_m.h:159
inet::ieee80211::Ieee80211MgmtSta::scanNextChannel
virtual bool scanNextChannel()
Switches to the next channel to scan; returns true if done (there wasn't any more channel to scan).
Definition: Ieee80211MgmtSta.cc:346
inet::ieee80211::Ieee80211MgmtBase::sendDown
virtual void sendDown(Packet *frame)
Utility method for implementing handleUpperMessage(): send message to MAC.
Definition: Ieee80211MgmtBase.cc:68
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::channelList
std::vector< int > channelList
Definition: Ieee80211MgmtSta.h:36
MK_AUTH_TIMEOUT
#define MK_AUTH_TIMEOUT
Definition: Ieee80211MgmtSta.cc:39
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::ieee80211::SC_SUCCESSFUL
@ SC_SUCCESSFUL
Definition: Ieee80211MgmtFrame_m.h:196
inet::ieee80211::PRC_SUCCESS
@ PRC_SUCCESS
Definition: Ieee80211Primitives_m.h:166
inet::ieee80211::Ieee80211MgmtBase::initialize
virtual void initialize(int) override
Definition: Ieee80211MgmtBase.cc:26
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::probeDelay
simtime_t probeDelay
Definition: Ieee80211MgmtSta.h:35
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
MK_SCAN_MINCHANNELTIME
#define MK_SCAN_MINCHANNELTIME
Definition: Ieee80211MgmtSta.cc:42
inet::ieee80211::BSSTYPE_INFRASTRUCTURE
@ BSSTYPE_INFRASTRUCTURE
Definition: Ieee80211Primitives_m.h:139
inet::ieee80211::ST_DISASSOCIATION
@ ST_DISASSOCIATION
Definition: Ieee80211Frame_m.h:157
inet::ieee80211::Ieee80211MgmtSta::sendAuthenticationConfirm
virtual void sendAuthenticationConfirm(ApInfo *ap, Ieee80211PrimResultCode resultCode)
Sends back result of authentication to the agent.
Definition: Ieee80211MgmtSta.cc:487
inet::physicallayer::RADIO_C_CONFIGURE
@ RADIO_C_CONFIGURE
Definition: RadioControlInfo_m.h:62
inet::ieee80211::Ieee80211MgmtSta::processAuthenticateCommand
virtual void processAuthenticateCommand(Ieee80211Prim_AuthenticateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:408
inet::ieee80211::Ieee80211MgmtSta::ApInfo::rxPower
double rxPower
Definition: Ieee80211MgmtSta.h:52
inet::ieee80211::Ieee80211MgmtSta::assocTimeoutMsg
cMessage * assocTimeoutMsg
Definition: Ieee80211MgmtSta.h:94
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::currentChannelIndex
int currentChannelIndex
Definition: Ieee80211MgmtSta.h:37
MAX_BEACONS_MISSED
#define MAX_BEACONS_MISSED
Definition: Ieee80211MgmtSta.cc:46
inet::MacAddress::BROADCAST_ADDRESS
static const MacAddress BROADCAST_ADDRESS
The broadcast MAC address, ff:ff:ff:ff:ff:ff.
Definition: MacAddress.h:34
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::ssid
std::string ssid
Definition: Ieee80211MgmtSta.h:33
inet::ieee80211::Ieee80211MgmtSta::AssociatedApInfo::beaconTimeoutMsg
cMessage * beaconTimeoutMsg
Definition: Ieee80211MgmtSta.h:73
inet::ieee80211::Ieee80211MgmtSta::ScanningInfo::bssid
MacAddress bssid
Definition: Ieee80211MgmtSta.h:32
MK_SCAN_SENDPROBE
#define MK_SCAN_SENDPROBE
Definition: Ieee80211MgmtSta.cc:41
inet::ieee80211::SC_AUTH_OUT_OF_SEQ
@ SC_AUTH_OUT_OF_SEQ
Definition: Ieee80211MgmtFrame_m.h:202
inet::ieee80211::Ieee80211MgmtSta::storeAPInfo
virtual void storeAPInfo(Packet *packet, const Ptr< const Ieee80211MgmtHeader > &header, const Ptr< const Ieee80211BeaconFrame > &body)
Stores AP info received in a beacon or probe response.
Definition: Ieee80211MgmtSta.cc:735
inet::ieee80211::Ieee80211MgmtSta::processReassociateCommand
virtual void processReassociateCommand(Ieee80211Prim_ReassociateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:451
MK_ASSOC_TIMEOUT
#define MK_ASSOC_TIMEOUT
Definition: Ieee80211MgmtSta.cc:40
inet::ieee80211::Ieee80211MgmtSta::sendProbeRequest
virtual void sendProbeRequest()
Broadcasts a Probe Request.
Definition: Ieee80211MgmtSta.cc:376
MK_BEACON_TIMEOUT
#define MK_BEACON_TIMEOUT
Definition: Ieee80211MgmtSta.cc:44
inet::ieee80211::Ieee80211MgmtSta::sendScanConfirm
virtual void sendScanConfirm()
Sends back result of scanning to the agent.
Definition: Ieee80211MgmtSta.cc:385
inet::physicallayer::IRadio::receptionStateChangedSignal
static simsignal_t receptionStateChangedSignal
This signal is emitted when the radio reception state of the radio is changed.
Definition: IRadio.h:54
inet::ieee80211::Ieee80211MgmtSta::processScanCommand
virtual void processScanCommand(Ieee80211Prim_ScanRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:302
inet::ieee80211::Ieee80211MgmtSta::processAssociateCommand
virtual void processAssociateCommand(Ieee80211Prim_AssociateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:442
inet::ieee80211::Ieee80211MgmtSta::apList
AccessPointList apList
Definition: Ieee80211MgmtSta.h:91