|
INET Framework for OMNeT++/OMNEST
|
Used in 802.11 infrastructure mode: in a station (STA), this module controls channel scanning, association and handovers, by sending commands (e.g.
More...
#include <Ieee80211AgentSta.h>
Used in 802.11 infrastructure mode: in a station (STA), this module controls channel scanning, association and handovers, by sending commands (e.g.
Ieee80211Prim_ScanRequest) to the management module (Ieee80211MgmtSta).
See corresponding NED file for a detailed description.
◆ Ieee80211AgentSta()
| inet::ieee80211::Ieee80211AgentSta::Ieee80211AgentSta |
( |
| ) |
|
|
inline |
◆ chooseBSS()
Choose one AP from the list to associate with.
254 if (resp->getBssListArraySize() == 0)
260 for (
size_t i = 0; i < resp->getBssListArraySize(); i++)
261 if (resp->getBssList(i).getRxPower() > resp->getBssList(bestIndex).getRxPower())
Referenced by processScanConfirm().
◆ dumpAPList()
238 EV <<
"Received AP list:\n";
239 for (
size_t i = 0; i < resp->getBssListArraySize(); i++) {
240 const Ieee80211Prim_BssDescription& bssDesc = resp->getBssList(i);
241 EV <<
" " << i <<
". "
242 <<
" address=" << bssDesc.getBSSID()
243 <<
" channel=" << bssDesc.getChannelNumber()
244 <<
" SSID=" << bssDesc.getSSID()
245 <<
" beaconIntvl=" << bssDesc.getBeaconInterval()
246 <<
" rxPower=" << bssDesc.getRxPower()
Referenced by processScanConfirm().
◆ handleMessage()
| void inet::ieee80211::Ieee80211AgentSta::handleMessage |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
Overridden cSimpleModule method.
68 if (msg->isSelfMessage())
◆ handleResponse()
| void inet::ieee80211::Ieee80211AgentSta::handleResponse |
( |
cMessage * |
msg | ) |
|
|
protectedvirtual |
Handle responses from mgmgt.
88 cObject *
ctrl = msg->removeControlInfo();
91 EV <<
"Processing confirmation from mgmt: " <<
ctrl->getClassName() <<
"\n";
93 if (
auto ptr =
dynamic_cast<Ieee80211Prim_ScanConfirm *
>(
ctrl))
95 else if (
auto ptr =
dynamic_cast<Ieee80211Prim_AuthenticateConfirm *
>(
ctrl))
97 else if (
auto ptr =
dynamic_cast<Ieee80211Prim_AssociateConfirm *
>(
ctrl))
99 else if (
auto ptr =
dynamic_cast<Ieee80211Prim_ReassociateConfirm *
>(
ctrl))
102 throw cRuntimeError(
"handleResponse(): unrecognized control info class `%s'",
ctrl->getClassName());
104 throw cRuntimeError(
"handleResponse(): control info is nullptr");
Referenced by handleMessage().
◆ handleTimer()
| void inet::ieee80211::Ieee80211AgentSta::handleTimer |
( |
cMessage * |
msg | ) |
|
|
protectedvirtual |
Handle timers.
77 EV <<
"Starting up\n";
82 throw cRuntimeError(
"internal error: unrecognized timer '%s'", msg->getName());
Referenced by handleMessage().
◆ initialize()
| void inet::ieee80211::Ieee80211AgentSta::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
29 cSimpleModule::initialize(stage);
39 cStringTokenizer tokenizer(par(
"channelsToScan"));
41 while ((token = tokenizer.nextToken()) !=
nullptr)
51 simtime_t startingTime = par(
"startingTime");
52 if (startingTime < SIMTIME_ZERO)
54 scheduleAfter(startingTime,
new cMessage(
"startUp",
MK_STARTUP));
59 IInterfaceTable *ift = findModuleFromPar<IInterfaceTable>(par(
"interfaceTableModule"),
this);
◆ numInitStages()
| virtual int inet::ieee80211::Ieee80211AgentSta::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ processAssociateConfirm()
287 EV <<
"Association error\n";
291 EV <<
"Going back to scanning\n";
295 EV <<
"Association successful\n";
301 prevAP = resp->getAddress();
Referenced by handleResponse().
◆ processAuthenticateConfirm()
270 EV <<
"Authentication error\n";
274 EV <<
"Going back to scanning\n";
278 EV <<
"Authentication successful, let's try to associate\n";
Referenced by handleResponse().
◆ processReassociateConfirm()
312 EV <<
"Reassociation error\n";
314 EV <<
"Going back to scanning\n";
318 EV <<
"Reassociation successful\n";
Referenced by handleResponse().
◆ processScanConfirm()
Processing Confirm primitives.
211 for (
size_t i = 0; i < resp->getBssListArraySize(); i++) {
212 std::string resp_ssid = resp->getBssList(i).getSSID();
214 EV <<
"found default SSID " << resp_ssid << endl;
221 if (bssIndex == -1) {
222 EV <<
"No (suitable) AP found, continue scanning\n";
231 const Ieee80211Prim_BssDescription& bssDesc = resp->getBssList(bssIndex);
232 EV <<
"Chosen AP address=" << bssDesc.getBSSID() <<
" from list, starting authentication\n";
Referenced by handleResponse().
◆ receiveSignal()
| void inet::ieee80211::Ieee80211AgentSta::receiveSignal |
( |
cComponent * |
source, |
|
|
simsignal_t |
signalID, |
|
|
cObject * |
obj, |
|
|
cObject * |
details |
|
) |
| |
|
overrideprotectedvirtual |
Redefined from cListener; called by signal handler.
110 Enter_Method(
"%s", cComponent::getSignalName(signalID));
116 EV <<
"beacon lost, starting scanning again\n";
◆ sendAssociateRequest()
| void inet::ieee80211::Ieee80211AgentSta::sendAssociateRequest |
( |
const MacAddress & |
address | ) |
|
|
protectedvirtual |
171 EV <<
"Sending AssociateRequest primitive to mgmt\n";
172 Ieee80211Prim_AssociateRequest *req =
new Ieee80211Prim_AssociateRequest();
173 req->setAddress(address);
Referenced by processAuthenticateConfirm().
◆ sendAuthenticateRequest()
| void inet::ieee80211::Ieee80211AgentSta::sendAuthenticateRequest |
( |
const MacAddress & |
address | ) |
|
|
protectedvirtual |
151 EV <<
"Sending AuthenticateRequest primitive to mgmt\n";
152 Ieee80211Prim_AuthenticateRequest *req =
new Ieee80211Prim_AuthenticateRequest();
153 req->setAddress(address);
Referenced by processScanConfirm().
◆ sendDeauthenticateRequest()
161 EV <<
"Sending DeauthenticateRequest primitive to mgmt\n";
162 Ieee80211Prim_DeauthenticateRequest *req =
new Ieee80211Prim_DeauthenticateRequest();
163 req->setAddress(address);
164 req->setReasonCode(reasonCode);
◆ sendDisassociateRequest()
191 EV <<
"Sending DisassociateRequest primitive to mgmt\n";
192 Ieee80211Prim_DisassociateRequest *req =
new Ieee80211Prim_DisassociateRequest();
193 req->setAddress(address);
194 req->setReasonCode(reasonCode);
◆ sendReassociateRequest()
| void inet::ieee80211::Ieee80211AgentSta::sendReassociateRequest |
( |
const MacAddress & |
address | ) |
|
|
protectedvirtual |
181 EV <<
"Sending ReassociateRequest primitive to mgmt\n";
182 Ieee80211Prim_ReassociateRequest *req =
new Ieee80211Prim_ReassociateRequest();
183 req->setAddress(address);
◆ sendRequest()
◆ sendScanRequest()
| void inet::ieee80211::Ieee80211AgentSta::sendScanRequest |
( |
| ) |
|
|
protectedvirtual |
◆ acceptConfirmSignal
| simsignal_t inet::ieee80211::Ieee80211AgentSta::acceptConfirmSignal = registerSignal("acceptConfirm") |
|
staticprotected |
◆ activeScan
| bool inet::ieee80211::Ieee80211AgentSta::activeScan = false |
|
protected |
◆ associationTimeout
| simtime_t inet::ieee80211::Ieee80211AgentSta::associationTimeout |
|
protected |
◆ authenticationTimeout
| simtime_t inet::ieee80211::Ieee80211AgentSta::authenticationTimeout |
|
protected |
◆ channelsToScan
| std::vector<int> inet::ieee80211::Ieee80211AgentSta::channelsToScan |
|
protected |
◆ defaultSsid
| std::string inet::ieee80211::Ieee80211AgentSta::defaultSsid |
|
protected |
◆ dropConfirmSignal
| simsignal_t inet::ieee80211::Ieee80211AgentSta::dropConfirmSignal = registerSignal("dropConfirm") |
|
staticprotected |
◆ maxChannelTime
| simtime_t inet::ieee80211::Ieee80211AgentSta::maxChannelTime |
|
protected |
◆ minChannelTime
| simtime_t inet::ieee80211::Ieee80211AgentSta::minChannelTime |
|
protected |
◆ myIface
◆ prevAP
| MacAddress inet::ieee80211::Ieee80211AgentSta::prevAP |
|
protected |
◆ probeDelay
| simtime_t inet::ieee80211::Ieee80211AgentSta::probeDelay |
|
protected |
◆ sentRequestSignal
| simsignal_t inet::ieee80211::Ieee80211AgentSta::sentRequestSignal = registerSignal("sentRequest") |
|
staticprotected |
The documentation for this class was generated from the following files:
static simsignal_t acceptConfirmSignal
Definition: Ieee80211AgentSta.h:45
#define MK_STARTUP
Definition: Ieee80211AgentSta.cc:21
virtual void processScanConfirm(Ieee80211Prim_ScanConfirm *resp)
Processing Confirm primitives.
Definition: Ieee80211AgentSta.cc:199
virtual int chooseBSS(Ieee80211Prim_ScanConfirm *resp)
Choose one AP from the list to associate with.
Definition: Ieee80211AgentSta.cc:252
simsignal_t l2BeaconLostSignal
Signals for publish/subscribe mechanisms.
Definition: Simsignals.cc:14
virtual void sendAuthenticateRequest(const MacAddress &address)
Definition: Ieee80211AgentSta.cc:149
simtime_t authenticationTimeout
Definition: Ieee80211AgentSta.h:38
simtime_t maxChannelTime
Definition: Ieee80211AgentSta.h:37
virtual void processAuthenticateConfirm(Ieee80211Prim_AuthenticateConfirm *resp)
Definition: Ieee80211AgentSta.cc:267
simtime_t minChannelTime
Definition: Ieee80211AgentSta.h:36
NetworkInterface * myIface
Definition: Ieee80211AgentSta.h:31
cModule * getContainingNode(const cModule *from)
Find the node containing the given module.
Definition: ModuleAccess.cc:40
virtual void processAssociateConfirm(Ieee80211Prim_AssociateConfirm *resp)
Definition: Ieee80211AgentSta.cc:284
void printSignalBanner(simsignal_t signalID, const cObject *obj, const cObject *details)
Utility function.
Definition: Simsignals.cc:126
std::string defaultSsid
Definition: Ieee80211AgentSta.h:41
@ PR_ASSOCIATE_REQUEST
Definition: Ieee80211Primitives_m.h:85
NetworkInterface * getContainingNicModule(const cModule *from)
Find the nic module (inside the networkNode) containing the given module.
Definition: NetworkInterface.cc:691
virtual void sendRequest(Ieee80211PrimRequest *req)
Definition: Ieee80211AgentSta.cc:124
bool activeScan
Definition: Ieee80211AgentSta.h:33
simsignal_t l2DisassociatedSignal
Definition: Simsignals.cc:18
removed ctrl
Definition: IUdp-gates.txt:7
virtual void dumpAPList(Ieee80211Prim_ScanConfirm *resp)
Definition: Ieee80211AgentSta.cc:236
@ PR_ASSOCIATE_CONFIRM
Definition: Ieee80211Primitives_m.h:118
virtual void handleResponse(cMessage *msg)
Handle responses from mgmgt.
Definition: Ieee80211AgentSta.cc:86
@ PR_SCAN_REQUEST
Definition: Ieee80211Primitives_m.h:82
simsignal_t l2AssociatedNewApSignal
Definition: Simsignals.cc:16
static simsignal_t sentRequestSignal
Definition: Ieee80211AgentSta.h:44
simsignal_t l2AssociatedOldApSignal
Definition: Simsignals.cc:17
static simsignal_t dropConfirmSignal
Definition: Ieee80211AgentSta.h:46
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
@ PRC_SUCCESS
Definition: Ieee80211Primitives_m.h:166
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
@ BSSTYPE_INFRASTRUCTURE
Definition: Ieee80211Primitives_m.h:139
@ PR_AUTHENTICATE_REQUEST
Definition: Ieee80211Primitives_m.h:83
bool isUnspecified() const
Returns true if all address bytes are zero.
Definition: MacAddress.h:136
#define Enter_Method(...)
Definition: SelfDoc.h:71
@ PR_SCAN_CONFIRM
Definition: Ieee80211Primitives_m.h:115
@ PR_REASSOCIATE_CONFIRM
Definition: Ieee80211Primitives_m.h:119
virtual void handleTimer(cMessage *msg)
Handle timers.
Definition: Ieee80211AgentSta.cc:74
MacAddress prevAP
Definition: Ieee80211AgentSta.h:32
virtual void sendScanRequest()
Sending of Request primitives.
Definition: Ieee80211AgentSta.cc:131
simtime_t associationTimeout
Definition: Ieee80211AgentSta.h:39
simtime_t probeDelay
Definition: Ieee80211AgentSta.h:35
virtual void sendAssociateRequest(const MacAddress &address)
Definition: Ieee80211AgentSta.cc:169
virtual void processReassociateConfirm(Ieee80211Prim_ReassociateConfirm *resp)
Definition: Ieee80211AgentSta.cc:308
@ PR_AUTHENTICATE_CONFIRM
Definition: Ieee80211Primitives_m.h:116
std::vector< int > channelsToScan
Definition: Ieee80211AgentSta.h:34
@ PR_DEAUTHENTICATE_REQUEST
Definition: Ieee80211Primitives_m.h:84
INET_API InitStage INITSTAGE_LINK_LAYER
Initialization of link-layer protocols.
@ PR_REASSOCIATE_REQUEST
Definition: Ieee80211Primitives_m.h:86
@ PR_DISASSOCIATE_REQUEST
Definition: Ieee80211Primitives_m.h:87