[Twisted-Python] RAW Sockets, IP in UDP

Kuba Konczyk jakamkon at gmail.com
Wed Oct 22 08:08:17 MDT 2008


Hi,

2008/10/21 Lars Reimann <lars.reimann at googlemail.com>:
> Hi all,
>
> I need to implement a listening RAW sockets which gives me all packets
> at that particular interface. Next, I need to put this data into a
> normal UDP container to send it to another host, where it is unpacked
> again.

Low level packet handling part of Twisted (twisted.pair) isn't really
usable for your use case and hasn't been updated for a quite a long
time.

As it comes to receiving and sending raw packets you have a few
options to choose from.If you don't care about portability you can
just use AF_PACKET socket from  python's standard library which is
supported only on linux.Otherwise you need to use one of many python
libpcap wrappers like  pypcap, pylibcap or python-pcapy.Not all of
them support sending packets.If you choose one that doesn't you can
always use python bindings for libdnet.

After all that you still have to choose packet parsing/contruction
library like dpkt, umit umpa or scapy.

--
Kuba




More information about the Twisted-Python mailing list