I added this line in my example program :
stdma.StdmaHelper::EnablePcapInternal("simple-stdma", stdmaDevices.Get(0),false,false);
EnablePcapInternal is defined in stdma-helper as follows :
void
StdmaHelper::EnablePcapInternal (std::string prefix, ns3::Ptr<ns3::NetDevice> nd, bool promiscuous, bool explicitFilename)
{
ns3::PcapHelper pcapHelper;
ns3::Ptr<StdmaNetDevice> device = nd->GetObject<StdmaNetDevice> ();
std::string filename;
if (explicitFilename)
{
filename = prefix;
}
else
{
filename = pcapHelper.GetFilenameFromDevice (prefix, device);
}
ns3::Ptr<ns3::PcapFileWrapper> file = pcapHelper.CreateFile (filename, std::ios::out,
ns3::PcapHelper::DLT_NULL);
pcapHelper.HookDefaultSink<StdmaNetDevice> (device, "Sniffer", file);
}
On running, i get this error message - assert failed. cond="result == true",
msg="PcapHelper::HookDefaultSink(): Unable to hook "Sniffer"",
file=./ns3/trace-helper.h, line=99
terminate called without an active exception
What does unable to hook Sniffer mean? Im new to ns3 and this is my first try at writing a Pcap trace. Any help would be much appreciated
PS . I have attached the example code and the stdma-helper.cc and stdma-helper.h files