Advertisement

IP-Options. Need Help!

Started by February 24, 2003 09:20 AM
-1 comments, last by FUnger 21 years, 11 months ago
Hi, I hope you can help me. It''s drive me mad! In the book "Network Programming For Microsoft Windows" is an example how to make a socket with IP-options:
  
struct ip_option_hdr 
{
    unsigned char    code;
    unsigned char    length;
    unsigned char    offset;
    unsigned long    addrs[9];
} opthdr;

...

ZeroMemory((char *)&opthdr, sizeof(opthdr));
opthdr.code = 0x7;
opthdr.length = 39;
opthdr.offset = 4;  // Offset to first address (addrs)

ret = setsockopt(s, IPPROTO_IP, IP_OPTIONS, (char *)&opthdr,
        sizeof(opthdr));
  
Unfortunatly I am not able to get this work. I made a little client/server test. You can download the source here: "http:\\members.aol.com\cedox\IP-Options-Test.zip". The connection runs well, the packets arrive. But with a sniffer, you can see, that there are no IP-Options! Any idea why it fails? Thanx Felix

This topic is closed to new replies.

Advertisement