Skip to content

Instantly share code, notes, and snippets.

@ashiqopu
Created April 1, 2019 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ashiqopu/0346359297143866f1748322a9e6f125 to your computer and use it in GitHub Desktop.
Save ashiqopu/0346359297143866f1748322a9e6f125 to your computer and use it in GitHub Desktop.
.
.
.
uint32_t MacTxDropCount, PhyTxDropCount, PhyRxDropCount;
void
MacTxDrop(Ptr<const Packet> p)
{
NS_LOG_INFO("Packet Drop");
MacTxDropCount++;
}
void
PhyTxDrop(Ptr<const Packet> p)
{
NS_LOG_INFO("Packet Drop");
PhyTxDropCount++;
}
void
PhyRxDrop(Ptr<const Packet> p)
{
NS_LOG_INFO("Packet Drop");
PhyRxDropCount++;
}
.
.
.
int main()
{
.
.
.
Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Mac/MacTxDrop", MakeCallback(&MacTxDrop));
Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyRxDrop", MakeCallback(&PhyRxDrop));
Config::ConnectWithoutContext("/NodeList/*/DeviceList/*/$ns3::WifiNetDevice/Phy/PhyTxDrop", MakeCallback(&PhyTxDrop));
.
.
.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment