You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to omnetpp
I have modified some source code of the mobility framework and written
some code with my own application.
Here is a part of the function for appl layer I have written:
cModule *nmod = getParentModule()->getSubmodule("net");
SimpleNetwLayer *netP = (SimpleNetwLayer *) nmod;
int netAddr = netP->getNetAddr(); // a function written by me and
it returns the net address of the host
cModule *mmod = getParentModule()->getSubmodule("nic")-
>getSubmodule("mac");
Mac80211 *macP = (Mac80211 *) mmod;
int index = macP->randNeighborAddr(); // a function written by me
and it returns the module index of a neighbor host
ApplPkt *pkt = new ApplPkt("DATAFRAME_MESSAGE",
DATAFRAME_MESSAGE);
pkt->setDestAddr(index);
// we use the host modules getIndex() as a appl address
pkt->setSrcAddr( myApplAddr() );
pkt->setBitLength(headerLength);
// set the control info to tell the network layer the layer 3
// address;
pkt->setControlInfo( new NetwControlInfo(netAddr) );
EV << "Sending data frame packet!\n";
sendDown( pkt );
When I ran this function, the application just terminated with exit
code: -1073741819