DCE-ns3 : ioctl operation for wifiNetdevice

35 views
Skip to first unread message

Mohammad Abu Shattal

unread,
Jul 24, 2015, 12:44:32 PM7/24/15
to ns-3-users
Hi all,

I'm trying to sniff packets over Wifi DCE-ns3 nodes online "while packets are transmitted".I did that since I need to investigate traffic before it written to .pcap files.  I compiled sniffer.c and tested it for my Linux machine. it works fine when I tried to run it over DCE it compiles well but I received the following error messages in the code below and appended to it: File exists

I obtained the name of the wifinet device in ns3:
ns3::WifiNetDevice

if (ioctl (raw_socket, SIOCGIFFLAGS, &ifr) == -1)
{
perror ("Error: Could not retrieve the flags from the device.\n");
exit (1);
}

ifr.ifr_flags |= IFF_PROMISC;
if (ioctl (raw_socket, SIOCSIFFLAGS, &ifr) == -1)
{
perror ("Error: Could not set flag IFF_PROMISC");
exit (1);
}

This happens due to the ioctl operation I run on devices in order to put it in promisc mode. Does DCE support ioctl operations in ns3 wifi net devices?
Can I set WifiNet devices in promisc mode using C program run on top of DCE.
I'm scripting ns3 in Python. Is it Ok to run python script to set promisc mode on top of DCE?
I investigated node.RegisterProtocolhandler to set ns3 node to promisc mode but couldn't find a way to call it correctly in python.

If this operations are not supported is there any alternative to access packets in promisc mode online for wifi nodes.


thanks ......
Reply all
Reply to author
Forward
0 new messages