Hi,
Thanks a lot for your reply and support.
I have attached my code. If you could have a brief look.
I also add the following code (before "void AdhocWifiMac::SetLinkUpCallback (Callback<void> linkUp)") to adhoc-wifi-mac.cc
bool
AdhocWifiMac::SupportsSendFrom (void) const
{
NS_LOG_FUNCTION (this);
return true;
}
and adhoc-wifi-mac.h (after " virtual void Enqueue (Ptr<const Packet> packet, Mac48Address to);"):
virtual bool SupportsSendFrom (void) const;
And here is the error:
(gdb) run
Starting program: /home/farzaneh/ns-allinone-3.25/ns-3.25/build/scratch/openflow-switch-wifi
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7998d85 in ns3::Object::GetObject<ns3::MobilityModel> (this=0x0)
at ./ns3/object.h:459
459 T *result = dynamic_cast<T *> (m_aggregates->buffer[0]);
(gdb) where
#0 0x00007ffff7998d85 in ns3::Object::GetObject<ns3::MobilityModel> (this=0x0)
at ./ns3/object.h:459
#1 0x00007ffff1d4c557 in ns3::YansWifiChannel::Send (this=0x727c80,
sender=..., packet=..., txPowerDbm=17.020600000000002, txVector=...,
preamble=ns3::WIFI_PREAMBLE_LONG, mpdutype=ns3::NORMAL_MPDU, duration=...)
at ../src/wifi/model/yans-wifi-channel.cc:84
#2 0x00007ffff1d40550 in ns3::YansWifiPhy::SendPacket (this=0x72b9b0,
packet=..., txVector=..., preamble=ns3::WIFI_PREAMBLE_LONG,
mpdutype=ns3::NORMAL_MPDU) at ../src/wifi/model/yans-wifi-phy.cc:829
#3 0x00007ffff1d3fa3a in ns3::YansWifiPhy::SendPacket (this=0x72b9b0,
packet=..., txVector=..., preamble=ns3::WIFI_PREAMBLE_LONG)
at ../src/wifi/model/yans-wifi-phy.cc:776
#4 0x00007ffff1d61092 in ns3::MacLow::ForwardDown (this=0x729290, packet=...,
hdr=0x729420, txVector=..., preamble=ns3::WIFI_PREAMBLE_LONG)
at ../src/wifi/model/mac-low.cc:1653
#5 0x00007ffff1d66988 in ns3::MacLow::SendDataPacket (this=0x729290)
at ../src/wifi/model/mac-low.cc:2069
#6 0x00007ffff1d57660 in ns3::MacLow::StartTransmission (this=0x729290,
packet=..., hdr=0x729b20, params=..., listener=0x729b90)
at ../src/wifi/model/mac-low.cc:818
#7 0x00007ffff1d90bdf in ns3::DcaTxop::NotifyAccessGranted (this=0x729aa0)
at ../src/wifi/model/dca-txop.cc:460
#8 0x00007ffff1d95916 in ns3::DcaTxop::Dcf::DoNotifyAccessGranted (
---Type <return> to continue, or q <return> to quit---
Would you please let me know if I did it correctly or not?
Best regards,
Farzaneh