> Trying to sniff Ethernet packets, I do this: > > s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) > > but it results in this: > > $ sudo python3 sniff_survey.py > Traceback (most recent call last): > File "sniff_survey.py", line 118, in <module> > s = socket.socket(socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_IP) > File "/usr/lib/python3.2/socket.py", line 94, in __init__ > _socket.socket.__init__(self, family, type, proto, fileno) > socket.error: [Errno 93] Protocol not supported > > Anybody know what I'm doing wrong? (Python 3.2.3 under Debian 3.2.84-1.)
Have a look at the bottom of this SO question: http://stackoverflow.com/questions/5385312/ipproto-ip-vs-ipproto-tcp-ipproto-udp -- https://mail.python.org/mailman/listinfo/python-list