low level ethernet device access in linux

Tom Brown brown at esteem.com
Fri Aug 31 13:14:29 EDT 2007


Hi,

I have a windows application, written in delphi, that communicates to our 
devices using raw ethernet frames. I am trying to port this application to 
linux using python. However, when I try to open a socket, I get this error:

  File "/home/tbrown/projects/discovery/trunk/comm.py", line 9, in __init__
    self.s = socket(AF_PACKET, SOCK_RAW, proto)
  File "/usr/local/lib/python2.5/socket.py", line 156, in __init__
    _sock = _realsocket(family, type, proto)
socket.error: (1, 'Operation not permitted')

I understand that I am getting this error because I am running the application 
as a user and not as root. I would like to be able to run this app. as a 
user. Is there a way to create a socket without running the app. as root or 
sudo? When I run the app. as root I get this error:

discovery.py: cannot connect to X server

Thanks,
Tom



More information about the Python-list mailing list