[Twisted-Python] New user, help needed with raw UDP packets

exarkun at divmod.com exarkun at divmod.com
Fri Apr 16 09:44:38 EDT 2004


On Fri, 16 Apr 2004 09:34:49 -0400, Itamar Shtull-Trauring <itamar at itamarst.org> wrote:
>On Fri, 2004-04-16 at 03:00, Richard Taylor wrote:
> 
> > I have been looking at how to subclass usp.Port to get what I want but I have 
> > come up against a problem that looks like a show stopper to me. It does not 
> > look like Python's socket library supports SOCK_RAW. I may be mistaken, but I 
> > think that I need to put the socket into RAW mode to get the incoming headers 
> > and to set my own headers on the outgoing packets. Without SOCK_RAW I am 
> > stuffed.
> 
> Were you running as root? That would be a requirement.

  Moreover, "Python's" socket library is really just a thin wrapper around the platform socket library.  Restrictions such as "Raw sockets can only be created by root" are imposed by the platform, not by Python.  Similarly, if the platform socket library does not support raw sockets, Python will not support raw sockets.

  Since you seem to have the SOCK_RAW name in the socket module, I'm guessing that Itamar's guess of privileges being the problem is correct, rather than support being completely missing.

  Jp





More information about the Twisted-Python mailing list