Re: working of setsockopt() and getsockopt()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Got it !! Thanks :)

On Tue, 14 May 2002, Glynn Clements wrote:

> > So what you mean is that they are not _IP_ options; they are
> > more of _raw_ socket options?
> 
> Yes.
> 
> [Note: This is incorrect; tcph would be offset by 20 TCP headers (400
> bytes), not 20 bytes. You would need to enclose the addition in
> parentheses (and "buffer" needs to be "char *" or similar).]
> 
> 	tcph = (struct tcphdr *) (ra + 4);
> 
> >    printf("Set pointer to IP and TCP headers!\n");
> >    
> >    memset(buffer, 0, PACKET_SIZE); /* zero out the buffer */
> >    
> >    /* fill in the ip header */
> 
> -    iph->ihl = 5;
> 
> +    iph->ihl = 6;
> 
> >    iph->version = 4;
> >    iph->tos = 0;
> 
[snip]

-- 
I'm an angel!!! Honest!
The horns are just there to hold the halo up straight.
^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^
                  Amit Kucheria
          EECS Grad. Research Assistant
         University of Kansas @ Lawrence
   (R): +1-785-830-8521 ||| (C): +1-785-760-2871
____________________________________________________

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux