python libpcap equivalent

Steve Holden steve at holdenweb.com
Tue Feb 3 17:38:02 EST 2009


Unknown wrote:
> On 2009-02-03, Gabriel <dunmer at dreams.sk> wrote:
> 
>> I need to write a software router [yes, software equivalent to
>> hardware box that is routing packets .)]. It's a school work..
> 
>> Question is: is possible write this kind of application in
>> python?
> 
> Hmm.  It's going to be rather difficult, but you might be able
> to.
> 
>> and if it's, what module should i use? I tried search for some
>> libpcap equivalent in python and found pylibpcap, but can't
>> find documentation and tutorial.
> 
> You can use pylibpcap to capture packets, and then use a raw
> socket to send them out again on whatever interface you want.
> You'll have to make sure that the host's OS's network stack
> isn't going to process the packets at all.  I'm not sure how
> you go about that.
> 
> The documentation for pylibpcap is built into the module. See
> doc.i in the tarball.
> 
> 
And note that this won't work on Vista, where the raw socket interface
is no longer available to standard applications.

regards
 Steve

-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list