getsockopt

F

Fabian Deutsch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top