SOCK_RAW

Grant Edwards grante at visi.com
Thu Apr 5 17:08:21 EDT 2001


In article <ht4z6.2168$Dh2.173527 at paloalto-snr1.gtei.net>, HW wrote:

>Does Python socket module support raw socket? 

Yes, under Linux, Python >= 2.0, for some values of "support
raw socket".

>I tries to create socket with AF_INET and SOCK_RAW.

I don't believe that AF_INET,SOCK_RAW is supported (I don't
know what it would do if it were).

I know that  socket(PF_PACKET, SOCK_RAW, EthernetProtoNumber)
works.

>But when I tried to pass a string which contains null byte to
>sendto(). It complains about "expected string without null
>bytes, string found". Anybody has same experience?

With PF_PACKET,SOCK_RAW sockets you should use send() and
recv() methods.

-- 
Grant Edwards                   grante             Yow!  Why are these
                                  at               athletic shoe salesmen
                               visi.com            following me??



More information about the Python-list mailing list