Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > getsockopt

Reply
Thread Tools

getsockopt

 
 
Fabian Deutsch
Guest
Posts: n/a
 
      12-16-2005
Hello,

my name is fabian and i'm a student from northern germany. right now i
try to create som kind of decapsulation of esp-udp packets using python.

therefor i need to use the socket.getsockopt (SOL_IP, IP_OPTIONS, 20)
method. But al i get is some empty value. Nothin.

Does someone know or have an working exmaple of how to use this method??

The lines:
s = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)
s.bind(('',4500))
while 1: # Run until cancelled
message, client = s.recvfrom(1400) # <=256 byte datagram
hdr = s.getsockopt (SOL_IP, IP_OPTIONS, 20)
print "Client connected:", client
print "HDR:" + binascii.hexlify(hdr)


greetings and ta
- fabiand

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.getsockopt() and SO_ORIGINAL_DST chris Python 0 05-21-2010 08:26 AM
socket.getsockopt() and SO_ORIGINAL_DST chris Python 0 05-21-2010 06:51 AM
Incorrect number of bytes returned by getsockopt(socket.SOL_SOCKET,socket.TCP_INFO, buflen) Ashwin Rao Python 2 12-03-2009 09:36 PM
Re: getsockopt Steve Holden Python 0 12-16-2005 09:50 AM



Advertisments