|
INET Framework for OMNeT++/OMNEST
|
Used in 802.11 infrastructure mode: handles management frames for a station (STA).
More...
#include <Ieee80211MgmtSta.h>
|
| 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 ApInfo * | lookupAP (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...
|
| |
|
| 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 |
| |
|
| 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) |
| |
| 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 () |
| |
| 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 () |
| |
Used in 802.11 infrastructure mode: handles management frames for a station (STA).
See corresponding NED file for a detailed description.
◆ AccessPointList
◆ Ieee80211MgmtSta()
| inet::ieee80211::Ieee80211MgmtSta::Ieee80211MgmtSta |
( |
| ) |
|
|
inline |
◆ beaconLost()
| void inet::ieee80211::Ieee80211MgmtSta::beaconLost |
( |
| ) |
|
|
protectedvirtual |
Missed a few consecutive beacons.
222 EV <<
"Missed a few consecutive beacons -- AP is considered lost\n";
◆ changeChannel()
| void inet::ieee80211::Ieee80211MgmtSta::changeChannel |
( |
int |
channelNum | ) |
|
|
protectedvirtual |
Utility function: switches to the given radio channel.
211 EV <<
"Tuning to channel #" << channelNum <<
"\n";
213 Ieee80211ConfigureRadioCommand *configureCommand =
new Ieee80211ConfigureRadioCommand();
214 configureCommand->setChannelNumber(channelNum);
216 request->setControlInfo(configureCommand);
217 send(request,
"macOut");
◆ clearAPList()
| void inet::ieee80211::Ieee80211MgmtSta::clearAPList |
( |
| ) |
|
|
protectedvirtual |
Utility function: clear the AP list, and cancel any pending authentications.
203 if (elem.authTimeoutMsg)
204 cancelAndDelete(elem.authTimeoutMsg);
◆ disassociate()
| void inet::ieee80211::Ieee80211MgmtSta::disassociate |
( |
| ) |
|
|
protectedvirtual |
Utility function: Cancel the existing association.
479 EV <<
"Disassociating from AP address=" <<
assocAP.
address <<
"\n";
480 ASSERT(
mib->bssStationData.isAssociated);
481 mib->bssStationData.isAssociated =
false;
◆ getAssociatedAp()
| virtual const ApInfo* inet::ieee80211::Ieee80211MgmtSta::getAssociatedAp |
( |
| ) |
|
|
inlinevirtual |
◆ handleAssociationRequestFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleAssociationRequestFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleAssociationResponseFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleAssociationResponseFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
616 EV <<
"Received Association Response frame\n";
619 EV <<
"No association in progress, ignoring frame\n";
625 const auto& responseBody = packet->peekData<Ieee80211AssociationResponseFrame>();
626 MacAddress address = header->getTransmitterAddress();
627 int statusCode = responseBody->getStatusCode();
635 throw cRuntimeError(
"handleAssociationResponseFrame: AP not known: address=%s", address.str().c_str());
637 if (
mib->bssStationData.isAssociated) {
638 EV <<
"Breaking existing association with AP address=" <<
assocAP.
address <<
"\n";
639 mib->bssStationData.isAssociated =
false;
649 EV <<
"Association failed with AP address=" << ap->address <<
"\n";
652 EV <<
"Association successful, AP address=" << ap->address <<
"\n";
655 mib->bssData.ssid = ap->ssid;
656 mib->bssData.bssid = ap->address;
657 mib->bssStationData.isAssociated =
true;
◆ handleAuthenticationFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleAuthenticationFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
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";
521 EV <<
"AP not known, discarding authentication frame\n";
527 if (ap->isAuthenticated) {
528 EV <<
"AP already authenticated, ignoring frame\n";
534 if (!ap->authTimeoutMsg) {
535 EV <<
"No authentication in progress with AP, ignoring frame\n";
541 if (frameAuthSeq != ap->authSeqExpected) {
543 EV <<
"Wrong sequence number, " << ap->authSeqExpected <<
" expected\n";
544 const auto& body = makeShared<Ieee80211AuthenticationFrame>();
550 cancelAndDelete(ap->authTimeoutMsg);
551 ap->authTimeoutMsg =
nullptr;
557 int statusCode = requestBody->getStatusCode();
560 EV <<
"More steps required, sending another Authentication frame\n";
563 const auto& body = makeShared<Ieee80211AuthenticationFrame>();
564 body->setSequenceNumber(frameAuthSeq + 1);
568 ap->authSeqExpected += 2;
572 EV <<
"Authentication successful\n";
574 EV <<
"Authentication failed\n";
578 cancelAndDelete(ap->authTimeoutMsg);
579 ap->authTimeoutMsg =
nullptr;
◆ handleBeaconFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleBeaconFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
705 EV <<
"Received Beacon frame\n";
706 const auto& beaconBody = packet->peekData<Ieee80211BeaconFrame>();
710 if (
mib->bssStationData.isAssociated && header->getTransmitterAddress() ==
assocAP.
address) {
711 EV <<
"Beacon is from associated AP, restarting beacon timeout timer\n";
◆ handleCommand()
| void inet::ieee80211::Ieee80211MgmtSta::handleCommand |
( |
int |
msgkind, |
|
|
cObject * |
ctrl |
|
) |
| |
|
overrideprotectedvirtual |
Implements abstract Ieee80211MgmtBase method.
Implements inet::ieee80211::Ieee80211MgmtBase.
172 if (
auto cmd =
dynamic_cast<Ieee80211Prim_ScanRequest *
>(
ctrl))
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))
185 throw cRuntimeError(
"handleCommand(): unrecognized control info class `%s'",
ctrl->getClassName());
187 throw cRuntimeError(
"handleCommand(): control info is nullptr");
◆ handleDeauthenticationFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleDeauthenticationFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
588 EV <<
"Received Deauthentication frame\n";
589 const MacAddress& address = header->getAddress3();
591 if (!ap || !ap->isAuthenticated) {
592 EV <<
"Unknown AP, or not authenticated with that AP -- ignoring frame\n";
596 if (ap->authTimeoutMsg) {
597 cancelAndDelete(ap->authTimeoutMsg);
598 ap->authTimeoutMsg =
nullptr;
599 EV <<
"Cancelling pending authentication\n";
604 EV <<
"Setting isAuthenticated flag for that AP to false\n";
605 ap->isAuthenticated =
false;
◆ handleDisassociationFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleDisassociationFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
683 EV <<
"Received Disassociation frame\n";
684 const MacAddress& address = header->getAddress3();
692 EV <<
"Not associated with that AP -- ignoring frame\n";
697 EV <<
"Setting isAssociated flag to false\n";
698 mib->bssStationData.isAssociated =
false;
◆ handleProbeRequestFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleProbeRequestFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleProbeResponseFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleProbeResponseFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
729 EV <<
"Received Probe Response frame\n";
730 const auto& probeResponseBody = packet->peekData<Ieee80211ProbeResponseFrame>();
◆ handleReassociationRequestFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleReassociationRequestFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleReassociationResponseFrame()
| void inet::ieee80211::Ieee80211MgmtSta::handleReassociationResponseFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleTimer()
| void inet::ieee80211::Ieee80211MgmtSta::handleTimer |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
Implements abstract Ieee80211MgmtBase method.
Implements inet::ieee80211::Ieee80211MgmtBase.
118 ApInfo *ap = (ApInfo *)msg->getContextPointer();
119 EV <<
"Authentication timed out, AP address = " << ap->address <<
"\n";
126 ApInfo *ap = (ApInfo *)msg->getContextPointer();
127 EV <<
"Association timed out, AP address = " << ap->address <<
"\n";
150 EV <<
"Busy channel detected during minChannelTime, continuing listening until maxChannelTime elapses\n";
155 EV <<
"Channel was empty during minChannelTime, going to next channel\n";
166 throw cRuntimeError(
"internal error: unrecognized timer '%s'", msg->getName());
◆ initialize()
| void inet::ieee80211::Ieee80211MgmtSta::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
◆ lookupAP()
Utility function: looks up AP in our AP list.
Returns nullptr if not found.
194 if (elem.address == address)
◆ numInitStages()
| virtual int inet::ieee80211::Ieee80211MgmtSta::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ processAssociateCommand()
444 const MacAddress& address =
ctrl->getAddress();
447 throw cRuntimeError(
"processAssociateCommand: AP not known: address = %s", address.str().c_str());
◆ processAuthenticateCommand()
410 const MacAddress& address =
ctrl->getAddress();
413 throw cRuntimeError(
"processAuthenticateCommand: AP not known: address = %s", address.str().c_str());
◆ processDeauthenticateCommand()
419 const MacAddress& address =
ctrl->getAddress();
422 throw cRuntimeError(
"processDeauthenticateCommand: AP not known: address = %s", address.str().c_str());
427 if (ap->isAuthenticated)
428 ap->isAuthenticated =
false;
431 if (ap->authTimeoutMsg) {
432 cancelAndDelete(ap->authTimeoutMsg);
433 ap->authTimeoutMsg =
nullptr;
437 const auto& body = makeShared<Ieee80211DeauthenticationFrame>();
438 body->setReasonCode(
ctrl->getReasonCode());
◆ processDisassociateCommand()
460 const MacAddress& address =
ctrl->getAddress();
472 const auto& body = makeShared<Ieee80211DisassociationFrame>();
473 body->setReasonCode(
ctrl->getReasonCode());
◆ processReassociateCommand()
◆ processScanCommand()
304 EV <<
"Received Scan Request from agent, clearing AP list and starting scanning...\n";
307 throw cRuntimeError(
"processScanCommand: scanning already in progress");
308 if (
mib->bssStationData.isAssociated) {
312 EV <<
"Cancelling ongoing association process\n";
332 for (
size_t i = 0; i <
ctrl->getChannelListArraySize(); i++)
◆ 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.
290 Enter_Method(
"%s", cComponent::getSignalName(signalID));
296 EV <<
"busy radio channel detected during scanning\n";
◆ 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).
350 EV <<
"Finished scanning last channel\n";
◆ sendAssociationConfirm()
Sends back result of association to the agent.
496 sendConfirm(
new Ieee80211Prim_AssociateConfirm(), resultCode);
◆ sendAuthenticationConfirm()
Sends back result of authentication to the agent.
489 Ieee80211Prim_AuthenticateConfirm *confirm =
new Ieee80211Prim_AuthenticateConfirm();
490 confirm->setAddress(ap->address);
◆ sendConfirm()
Utility function: sends a confirmation to the agent.
501 confirm->setResultCode(resultCode);
502 cMessage *msg =
new cMessage(confirm->getClassName());
503 msg->setControlInfo(confirm);
504 send(msg,
"agentOut");
◆ 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.
228 auto packet =
new Packet(name);
229 packet->addTag<MacAddressReq>()->setDestAddress(address);
230 packet->addTag<Ieee80211SubtypeReq>()->setSubtype(subtype);
231 packet->insertAtBack(body);
◆ sendProbeRequest()
| void inet::ieee80211::Ieee80211MgmtSta::sendProbeRequest |
( |
| ) |
|
|
protectedvirtual |
Broadcasts a Probe Request.
379 const auto& body = makeShared<Ieee80211ProbeRequestFrame>();
381 body->setChunkLength(
B((2 +
scanning.
ssid.length()) + (2 + body->getSupportedRates().numRates)));
◆ sendScanConfirm()
| void inet::ieee80211::Ieee80211MgmtSta::sendScanConfirm |
( |
| ) |
|
|
protectedvirtual |
Sends back result of scanning to the agent.
387 EV <<
"Scanning complete, found " <<
apList.size() <<
" APs, sending confirmation to agent\n";
391 Ieee80211Prim_ScanConfirm *confirm =
new Ieee80211Prim_ScanConfirm();
392 confirm->setBssListArraySize(n);
395 for (
int i = 0; i < n; i++, 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);
◆ startAssociation()
| void inet::ieee80211::Ieee80211MgmtSta::startAssociation |
( |
ApInfo * |
ap, |
|
|
simtime_t |
timeout |
|
) |
| |
|
protectedvirtual |
Utility function: sends association request.
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());
272 const auto& body = makeShared<Ieee80211AssociationRequestFrame>();
278 body->setChunkLength(
B(2 + 2 + strlen(body->getSSID()) + 2 + body->getSupportedRates().numRates + 2));
◆ startAuthentication()
| void inet::ieee80211::Ieee80211MgmtSta::startAuthentication |
( |
ApInfo * |
ap, |
|
|
simtime_t |
timeout |
|
) |
| |
|
protectedvirtual |
Utility function: sends authentication request.
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());
244 EV <<
"Sending initial Authentication frame with seqNum=1\n";
247 const auto& body = makeShared<Ieee80211AuthenticationFrame>();
248 body->setSequenceNumber(1);
252 ap->authSeqExpected = 2;
255 ASSERT(ap->authTimeoutMsg ==
nullptr);
257 ap->authTimeoutMsg->setContextPointer(ap);
258 scheduleAfter(timeout, ap->authTimeoutMsg);
◆ statusCodeToPrimResultCode()
Utility function: converts Ieee80211StatusCode (->frame) to Ieee80211PrimResultCode (->primitive)
◆ storeAPInfo()
Stores AP info received in a beacon or probe response.
737 auto address = header->getTransmitterAddress();
740 EV <<
"AP address=" << address <<
", SSID=" << body->getSSID() <<
" already in our AP list, refreshing the info\n";
743 EV <<
"Inserting AP address=" << address <<
", SSID=" << body->getSSID() <<
" into our AP list\n";
744 apList.push_back(ApInfo());
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();
◆ apList
◆ assocAP
◆ 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
The documentation for this class was generated from the following files:
bool busyChannelDetected
Definition: Ieee80211MgmtSta.h:38
ScanningInfo scanning
Definition: Ieee80211MgmtSta.h:86
virtual void clearAPList()
Utility function: clear the AP list, and cancel any pending authentications.
Definition: Ieee80211MgmtSta.cc:200
@ RECEPTION_STATE_IDLE
The radio medium is free, no signal is detected.
Definition: IRadio.h:136
simsignal_t l2BeaconLostSignal
Signals for publish/subscribe mechanisms.
Definition: Simsignals.cc:14
@ ST_PROBEREQUEST
Definition: Ieee80211Frame_m.h:153
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
@ PRC_TIMEOUT
Definition: Ieee80211Primitives_m.h:168
ModuleRefByPar< Ieee80211Mib > mib
Definition: Ieee80211MgmtBase.h:33
simtime_t beaconInterval
Definition: Ieee80211MgmtSta.h:51
@ INFRASTRUCTURE
Definition: Ieee80211Mib.h:21
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
virtual void changeChannel(int channelNum)
Utility function: switches to the given radio channel.
Definition: Ieee80211MgmtSta.cc:209
virtual void processDeauthenticateCommand(Ieee80211Prim_DeauthenticateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:417
simsignal_t l2AssociatedSignal
Definition: Simsignals.cc:15
bool isScanning
Definition: Ieee80211MgmtSta.h:85
simtime_t maxChannelTime
Definition: Ieee80211MgmtSta.h:40
@ STATION
Definition: Ieee80211Mib.h:28
virtual void beaconLost()
Missed a few consecutive beacons.
Definition: Ieee80211MgmtSta.cc:220
cModule * host
Definition: Ieee80211MgmtSta.h:79
virtual void dropManagementFrame(Packet *frame)
Utility method to dispose of an unhandled frame.
Definition: Ieee80211MgmtBase.cc:75
MacAddress address
Definition: Ieee80211MgmtSta.h:48
virtual ApInfo * lookupAP(const MacAddress &address)
Utility function: looks up AP in our AP list.
Definition: Ieee80211MgmtSta.cc:191
@ RECEPTION_STATE_UNDEFINED
The radio medium state is unknown, reception state is meaningless, signal detection is not possible.
Definition: IRadio.h:130
virtual void processDisassociateCommand(Ieee80211Prim_DisassociateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:458
AssociatedApInfo assocAP
Definition: Ieee80211MgmtSta.h:95
ReceptionState
This enumeration specifies the reception state of the radio.
Definition: IRadio.h:124
virtual Ieee80211PrimResultCode statusCodeToPrimResultCode(int statusCode)
Utility function: converts Ieee80211StatusCode (->frame) to Ieee80211PrimResultCode (->primitive)
Definition: Ieee80211MgmtSta.cc:507
NetworkInterface * myIface
Definition: Ieee80211MgmtBase.h:35
@ PRC_REFUSED
Definition: Ieee80211Primitives_m.h:170
virtual void sendAssociationConfirm(ApInfo *ap, Ieee80211PrimResultCode resultCode)
Sends back result of association to the agent.
Definition: Ieee80211MgmtSta.cc:494
virtual void disassociate()
Utility function: Cancel the existing association.
Definition: Ieee80211MgmtSta.cc:477
removed ctrl
Definition: IUdp-gates.txt:7
#define MK_SCAN_MAXCHANNELTIME
Definition: Ieee80211MgmtSta.cc:43
bool activeScan
Definition: Ieee80211MgmtSta.h:34
virtual void sendConfirm(Ieee80211PrimConfirm *confirm, Ieee80211PrimResultCode resultCode)
Utility function: sends a confirmation to the agent.
Definition: Ieee80211MgmtSta.cc:499
@ ST_ASSOCIATIONREQUEST
Definition: Ieee80211Frame_m.h:149
virtual void startAuthentication(ApInfo *ap, simtime_t timeout)
Utility function: sends authentication request.
Definition: Ieee80211MgmtSta.cc:235
intscale< b, 1, 8 > B
Definition: Units.h:1168
@ ST_AUTHENTICATION
Definition: Ieee80211Frame_m.h:158
int numChannels
Definition: Ieee80211MgmtSta.h:82
simtime_t minChannelTime
Definition: Ieee80211MgmtSta.h:39
virtual void startAssociation(ApInfo *ap, simtime_t timeout)
Utility function: sends association request.
Definition: Ieee80211MgmtSta.cc:261
@ ST_DEAUTHENTICATION
Definition: Ieee80211Frame_m.h:159
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
virtual void sendDown(Packet *frame)
Utility method for implementing handleUpperMessage(): send message to MAC.
Definition: Ieee80211MgmtBase.cc:68
std::vector< int > channelList
Definition: Ieee80211MgmtSta.h:36
#define MK_AUTH_TIMEOUT
Definition: Ieee80211MgmtSta.cc:39
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
@ SC_SUCCESSFUL
Definition: Ieee80211MgmtFrame_m.h:196
@ PRC_SUCCESS
Definition: Ieee80211Primitives_m.h:166
virtual void initialize(int) override
Definition: Ieee80211MgmtBase.cc:26
simtime_t probeDelay
Definition: Ieee80211MgmtSta.h:35
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
#define MK_SCAN_MINCHANNELTIME
Definition: Ieee80211MgmtSta.cc:42
@ BSSTYPE_INFRASTRUCTURE
Definition: Ieee80211Primitives_m.h:139
@ ST_DISASSOCIATION
Definition: Ieee80211Frame_m.h:157
virtual void sendAuthenticationConfirm(ApInfo *ap, Ieee80211PrimResultCode resultCode)
Sends back result of authentication to the agent.
Definition: Ieee80211MgmtSta.cc:487
@ RADIO_C_CONFIGURE
Definition: RadioControlInfo_m.h:62
virtual void processAuthenticateCommand(Ieee80211Prim_AuthenticateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:408
double rxPower
Definition: Ieee80211MgmtSta.h:52
cMessage * assocTimeoutMsg
Definition: Ieee80211MgmtSta.h:94
#define Enter_Method(...)
Definition: SelfDoc.h:71
int currentChannelIndex
Definition: Ieee80211MgmtSta.h:37
#define MAX_BEACONS_MISSED
Definition: Ieee80211MgmtSta.cc:46
static const MacAddress BROADCAST_ADDRESS
The broadcast MAC address, ff:ff:ff:ff:ff:ff.
Definition: MacAddress.h:34
std::string ssid
Definition: Ieee80211MgmtSta.h:33
cMessage * beaconTimeoutMsg
Definition: Ieee80211MgmtSta.h:73
MacAddress bssid
Definition: Ieee80211MgmtSta.h:32
#define MK_SCAN_SENDPROBE
Definition: Ieee80211MgmtSta.cc:41
@ SC_AUTH_OUT_OF_SEQ
Definition: Ieee80211MgmtFrame_m.h:202
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
virtual void processReassociateCommand(Ieee80211Prim_ReassociateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:451
#define MK_ASSOC_TIMEOUT
Definition: Ieee80211MgmtSta.cc:40
virtual void sendProbeRequest()
Broadcasts a Probe Request.
Definition: Ieee80211MgmtSta.cc:376
#define MK_BEACON_TIMEOUT
Definition: Ieee80211MgmtSta.cc:44
virtual void sendScanConfirm()
Sends back result of scanning to the agent.
Definition: Ieee80211MgmtSta.cc:385
static simsignal_t receptionStateChangedSignal
This signal is emitted when the radio reception state of the radio is changed.
Definition: IRadio.h:54
virtual void processScanCommand(Ieee80211Prim_ScanRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:302
virtual void processAssociateCommand(Ieee80211Prim_AssociateRequest *ctrl)
Definition: Ieee80211MgmtSta.cc:442
AccessPointList apList
Definition: Ieee80211MgmtSta.h:91