SOCK_RAW with python socket library?

Grant Edwards ge at nowhere.none
Mon Jun 19 17:14:25 EDT 2000


In article <slrn8ksreq.i2.tim.lavoie at goibniu.beyondtv.net>, Tim Lavoie wrote:

>I've been tinkering with some socket programming lately, basically trying
>out ideas I get from browsing W. Richard Stevens' "UNIX Network
>Programming". Anyway, I'd like to play in Python too, so I'm using the
>socket library functions. When I try to use SOCK_RAW though, I get:
>
>   socket.error: (93, 'Protocol not supported')
>
>I understand the "operation not permitted" if I try it as a non-root user,
>but why this? Is SOCK_RAW not supported yet? The docs mention that it isn't
>generally useful, but it is quite specifically useful for say, ping.

It's also quite useful if you're dealing with devices that
implement a non-standard protocol (I do have to deal with these
types of devices).  I currently have a small C program that
does the raw stuff, so I run it using
commands.getstatusoutput() everytime I want to send a command
to the device.  Raw socket support would be nice...


-- 
Grant Edwards                   grante             Yow!  World War III? No
                                  at               thanks!
                               visi.com            



More information about the Python-list mailing list