getsockopt

Discussion in 'Python' started by Fabian Deutsch, Dec 16, 2005.

  1. 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
     
    Fabian Deutsch, Dec 16, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Holden

    Re: getsockopt

    Steve Holden, Dec 16, 2005, in forum: Python
    Replies:
    0
    Views:
    423
    Steve Holden
    Dec 16, 2005
  2. Ashwin Rao
    Replies:
    2
    Views:
    1,057
    Martien Verbruggen
    Dec 3, 2009
  3. chris
    Replies:
    0
    Views:
    859
    chris
    May 21, 2010
  4. chris
    Replies:
    0
    Views:
    1,213
    chris
    May 21, 2010
Loading...

Share This Page