|
INET Framework for OMNeT++/OMNEST
|
Used in 802.11 infrastructure mode: handles management frames for an access point (AP).
More...
#include <Ieee80211MgmtAp.h>
|
| virtual int | numInitStages () const override |
| |
| virtual void | initialize (int) override |
| |
| virtual void | handleTimer (cMessage *msg) override |
| | Implements abstract Ieee80211MgmtBase method. More...
|
| |
| virtual void | handleCommand (int msgkind, cObject *ctrl) override |
| | Implements abstract Ieee80211MgmtBase method – throws an error (no commands supported) 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 StaInfo * | lookupSenderSTA (const Ptr< const Ieee80211MgmtHeader > &header) |
| | Utility function: return sender STA's entry from our STA list, or nullptr if not in there. More...
|
| |
| virtual void | sendManagementFrame (const char *name, const Ptr< Ieee80211MgmtFrame > &body, int subtype, const MacAddress &destAddr) |
| | Utility function: set fields in the given frame and send it out to the address. More...
|
| |
| virtual void | sendBeacon () |
| | Utility function: creates and sends a beacon frame. 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 |
| |
| void | sendAssocNotification (const MacAddress &addr) |
| |
| void | sendDisAssocNotification (const MacAddress &addr) |
| |
| virtual void | start () override |
| | lifecycle support More...
|
| |
| virtual void | stop () override |
| |
| 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 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 an access point (AP).
See corresponding NED file for a detailed description.
◆ StaList
◆ Ieee80211MgmtAp()
| inet::ieee80211::Ieee80211MgmtAp::Ieee80211MgmtAp |
( |
| ) |
|
|
inline |
◆ ~Ieee80211MgmtAp()
| inet::ieee80211::Ieee80211MgmtAp::~Ieee80211MgmtAp |
( |
| ) |
|
|
virtual |
◆ handleAssociationRequestFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleAssociationRequestFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
211 EV <<
"Processing AssociationRequest frame\n";
217 const auto& body = makeShared<Ieee80211DeauthenticationFrame>();
232 const auto& body = makeShared<Ieee80211AssociationResponseFrame>();
236 body->setChunkLength(
B(2 + 2 + 2 + body->getSupportedRates().numRates + 2));
◆ handleAssociationResponseFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleAssociationResponseFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleAuthenticationFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleAuthenticationFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
125 const auto& requestBody = packet->peekData<Ieee80211AuthenticationFrame>();
126 int frameAuthSeq = requestBody->getSequenceNumber();
127 EV <<
"Processing Authentication frame, seqNum=" << frameAuthSeq <<
"\n";
132 MacAddress staAddress = header->getTransmitterAddress();
134 sta->address = staAddress;
136 sta->authSeqExpected = 1;
146 if (frameAuthSeq == 1) {
150 sta->authSeqExpected = 1;
154 if (frameAuthSeq != sta->authSeqExpected) {
156 EV <<
"Wrong sequence number, " << sta->authSeqExpected <<
" expected\n";
157 const auto& body = makeShared<Ieee80211AuthenticationFrame>();
161 sta->authSeqExpected = 1;
170 EV <<
"Sending Authentication frame, seqNum=" << (frameAuthSeq + 1) <<
"\n";
171 const auto& body = makeShared<Ieee80211AuthenticationFrame>();
172 body->setSequenceNumber(frameAuthSeq + 1);
174 body->setIsLast(isLast);
185 EV <<
"STA authenticated\n";
188 sta->authSeqExpected += 2;
189 EV <<
"Expecting Authentication frame " << sta->authSeqExpected <<
"\n";
◆ handleBeaconFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleBeaconFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleCommand()
| void inet::ieee80211::Ieee80211MgmtAp::handleCommand |
( |
int |
msgkind, |
|
|
cObject * |
ctrl |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleDeauthenticationFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleDeauthenticationFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleDisassociationFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleDisassociationFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleProbeRequestFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleProbeRequestFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
298 EV <<
"Processing ProbeRequest frame\n";
300 const auto& requestBody = packet->peekData<Ieee80211ProbeRequestFrame>();
301 if (strcmp(requestBody->getSSID(),
"") != 0 && strcmp(requestBody->getSSID(),
ssid.c_str()) != 0) {
302 EV <<
"SSID `" << requestBody->getSSID() <<
"' does not match, ignoring frame\n";
307 MacAddress staAddress = header->getTransmitterAddress();
310 EV <<
"Sending ProbeResponse frame\n";
311 const auto& body = makeShared<Ieee80211ProbeResponseFrame>();
312 body->setSSID(
ssid.c_str());
◆ handleProbeResponseFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleProbeResponseFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleReassociationRequestFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleReassociationRequestFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::ieee80211::Ieee80211MgmtBase.
247 EV <<
"Processing ReassociationRequest frame\n";
253 const auto& body = makeShared<Ieee80211DeauthenticationFrame>();
266 const auto& body = makeShared<Ieee80211ReassociationResponseFrame>();
◆ handleReassociationResponseFrame()
| void inet::ieee80211::Ieee80211MgmtAp::handleReassociationResponseFrame |
( |
Packet * |
packet, |
|
|
const Ptr< const Ieee80211MgmtHeader > & |
header |
|
) |
| |
|
overrideprotectedvirtual |
◆ handleTimer()
| void inet::ieee80211::Ieee80211MgmtAp::handleTimer |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
◆ initialize()
| void inet::ieee80211::Ieee80211MgmtAp::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::ieee80211::Ieee80211MgmtApBase.
47 ssid = par(
"ssid").stdstringValue();
51 throw cRuntimeError(
"parameter 'numAuthSteps' (number of frames exchanged during authentication) must be 2 or 4, not %d",
numAuthSteps);
62 cModule *radioModule = getModuleFromPar<cModule>(par(
"radioModule"),
this);
◆ lookupSenderSTA()
Utility function: return sender STA's entry from our STA list, or nullptr if not in there.
98 auto it =
staList.find(header->getTransmitterAddress());
99 return it ==
staList.end() ? nullptr : &(it->second);
◆ numInitStages()
| virtual int inet::ieee80211::Ieee80211MgmtAp::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ receiveSignal()
| void inet::ieee80211::Ieee80211MgmtAp::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.
91 EV <<
"updating channel number\n";
◆ sendAssocNotification()
| void inet::ieee80211::Ieee80211MgmtAp::sendAssocNotification |
( |
const MacAddress & |
addr | ) |
|
|
protected |
327 NotificationInfoSta notif;
328 notif.setApAddress(
mib->address);
329 notif.setStaAddress(addr);
◆ sendBeacon()
| void inet::ieee80211::Ieee80211MgmtAp::sendBeacon |
( |
| ) |
|
|
protectedvirtual |
Utility function: creates and sends a beacon frame.
113 EV <<
"Sending beacon\n";
114 const auto& body = makeShared<Ieee80211BeaconFrame>();
115 body->setSSID(
ssid.c_str());
◆ sendDisAssocNotification()
| void inet::ieee80211::Ieee80211MgmtAp::sendDisAssocNotification |
( |
const MacAddress & |
addr | ) |
|
|
protected |
335 NotificationInfoSta notif;
336 notif.setApAddress(
mib->address);
337 notif.setStaAddress(addr);
◆ sendManagementFrame()
| void inet::ieee80211::Ieee80211MgmtAp::sendManagementFrame |
( |
const char * |
name, |
|
|
const Ptr< Ieee80211MgmtFrame > & |
body, |
|
|
int |
subtype, |
|
|
const MacAddress & |
destAddr |
|
) |
| |
|
protectedvirtual |
Utility function: set fields in the given frame and send it out to the address.
104 auto packet =
new Packet(name);
105 packet->addTag<MacAddressReq>()->setDestAddress(destAddr);
106 packet->addTag<Ieee80211SubtypeReq>()->setSubtype(subtype);
107 packet->insertAtBack(body);
◆ start()
| void inet::ieee80211::Ieee80211MgmtAp::start |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ stop()
| void inet::ieee80211::Ieee80211MgmtAp::stop |
( |
| ) |
|
|
overrideprotectedvirtual |
◆ beaconInterval
| simtime_t inet::ieee80211::Ieee80211MgmtAp::beaconInterval |
|
protected |
◆ beaconTimer
| cMessage* inet::ieee80211::Ieee80211MgmtAp::beaconTimer = nullptr |
|
protected |
◆ channelNumber
| int inet::ieee80211::Ieee80211MgmtAp::channelNumber = -1 |
|
protected |
◆ numAuthSteps
| int inet::ieee80211::Ieee80211MgmtAp::numAuthSteps = 0 |
|
protected |
◆ ssid
| std::string inet::ieee80211::Ieee80211MgmtAp::ssid |
|
protected |
◆ staList
| StaList inet::ieee80211::Ieee80211MgmtAp::staList |
|
protected |
◆ supportedRates
The documentation for this class was generated from the following files:
int channelNumber
Definition: Ieee80211MgmtAp.h:54
simtime_t beaconInterval
Definition: Ieee80211MgmtAp.h:55
simsignal_t l2ApDisassociatedSignal
Definition: Simsignals.cc:20
virtual void sendManagementFrame(const char *name, const Ptr< Ieee80211MgmtFrame > &body, int subtype, const MacAddress &destAddr)
Utility function: set fields in the given frame and send it out to the address.
Definition: Ieee80211MgmtAp.cc:102
StaList staList
list of STAs
Definition: Ieee80211MgmtAp.h:60
Ieee80211SupportedRatesElement supportedRates
Definition: Ieee80211MgmtAp.h:57
void sendDisAssocNotification(const MacAddress &addr)
Definition: Ieee80211MgmtAp.cc:333
ModuleRefByPar< Ieee80211Mib > mib
Definition: Ieee80211MgmtBase.h:33
@ RC_NONAUTH_ASS_REQUEST
Definition: Ieee80211MgmtFrame_m.h:149
@ NOT_AUTHENTICATED
Definition: Ieee80211Mib.h:32
virtual StaInfo * lookupSenderSTA(const Ptr< const Ieee80211MgmtHeader > &header)
Utility function: return sender STA's entry from our STA list, or nullptr if not in there.
Definition: Ieee80211MgmtAp.cc:96
virtual void dropManagementFrame(Packet *frame)
Utility method to dispose of an unhandled frame.
Definition: Ieee80211MgmtBase.cc:75
@ AUTHENTICATED
Definition: Ieee80211Mib.h:33
@ ST_REASSOCIATIONRESPONSE
Definition: Ieee80211Frame_m.h:152
intscale< b, 1, 8 > B
Definition: Units.h:1168
@ ST_AUTHENTICATION
Definition: Ieee80211Frame_m.h:158
simsignal_t l2ApAssociatedSignal
Definition: Simsignals.cc:19
virtual void initialize(int) override
Definition: Ieee80211MgmtApBase.cc:24
short numRates
Definition: Ieee80211MgmtFrame_m.h:245
@ ST_DEAUTHENTICATION
Definition: Ieee80211Frame_m.h:159
cMessage * beaconTimer
Definition: Ieee80211MgmtAp.h:61
virtual void sendDown(Packet *frame)
Utility method for implementing handleUpperMessage(): send message to MAC.
Definition: Ieee80211MgmtBase.cc:68
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
@ ST_BEACON
Definition: Ieee80211Frame_m.h:155
@ ST_PROBERESPONSE
Definition: Ieee80211Frame_m.h:154
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
static simsignal_t radioChannelChangedSignal
This signal is emitted every time the radio channel changes.
Definition: Ieee80211Radio.h:29
@ ST_ASSOCIATIONRESPONSE
Definition: Ieee80211Frame_m.h:150
virtual void stop()
Definition: Ieee80211MgmtBase.cc:144
virtual void sendBeacon()
Utility function: creates and sends a beacon frame.
Definition: Ieee80211MgmtAp.cc:111
#define Enter_Method(...)
Definition: SelfDoc.h:71
void sendAssocNotification(const MacAddress &addr)
Definition: Ieee80211MgmtAp.cc:325
static const MacAddress BROADCAST_ADDRESS
The broadcast MAC address, ff:ff:ff:ff:ff:ff.
Definition: MacAddress.h:34
int numAuthSteps
Definition: Ieee80211MgmtAp.h:56
@ SC_AUTH_OUT_OF_SEQ
Definition: Ieee80211MgmtFrame_m.h:202
virtual void start()
Definition: Ieee80211MgmtBase.cc:140
@ ASSOCIATED
Definition: Ieee80211Mib.h:34
std::string ssid
Definition: Ieee80211MgmtAp.h:53