[Twisted-Python] sniffing multicast traffic
ben at bbarker.co.uk
Wed Mar 10 08:03:46 EST 2010
>> But I seem to have trouble getting them to receive anything at all.
> That's a little vague. Does "trouble" mean "it sometimes works" or
> "never works"?
Sorry - yes, it was very vague! Never works. If I run wiresahrk I can
see udp packets addressed to 188.8.131.52, port 901, flying past, however
when I run my python script it does not appear to ever receive
The scritp I am running is almost identical to an exampel I found here:
>> I have managed to use tshark to display the packets :
>> tshark -i eth0 -x -l -f udp
> Can you post a complete example that isn't working for you?
> When your code is running, have a look "/sbin/ip maddr" to ensure the
> group has been added to the socket listen filter
That's interesting.... eth1 is the wrong interface! In fact, it isn't
connected to anything at all. eth0 is the interface that should be
being used. I will try to swap them around, but presumably this is
something I can specify somwhere...
As I said, the code I am using is taken from the above link, but the
exact listing is given below:
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer
print 'Started Listening'
# Join a specific multicast group, which is the IP we will respond to
def datagramReceived(self, datagram, address):
print "Server Received:" + repr(datagram)
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
More information about the Twisted-Python