IP_HDRINCL Option for raw IP sockets

IP_HDRINCL Option for raw IP sockets

Post by Sudheer Tumulur » Sun, 30 Mar 1997 04:00:00



Hi,
        I have root access to a machine and thus have the ability to
create raw sockets. The OS is FreeBSD 2.2-CURRENT. I am trying to
reroute an IP packet from one machine to another based on some
criteria and I don't want to do kernel modification. I tried using the
IP_HDRINCL option for opening a raw socket, but it doesn't seem to do
that. I treied to isolate the error and when I tried "perror" the
error message says "no buffers available". I tried this many times and
still the same error appears. Any suggestions/ part of code to
implement this?

Thanks in advance,

Cheers,
Sudheer

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*     SUDHEER TUMULURU        *     Research Assistant              *
*     307 SW 16th Avenue      *     E331  CSE                       *
*     Apt. #307               *     Dept. of Computer & Information *
*     Gainesville             *              Sciences & Engineering *
*     FL 32601-8508, USA      *     UNIVERSITY OF FLORIDA           *
* Phone : (352) 335-8869      * Phone : (352) 392-5770              *
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

              GO FLORIDA GATORS! 1996 NATIONAL CHAMPIONS!

 
 
 

IP_HDRINCL Option for raw IP sockets

Post by Brian Some » Thu, 03 Apr 1997 04:00:00




Quote:> Hi,
>    I have root access to a machine and thus have the ability to
> create raw sockets. The OS is FreeBSD 2.2-CURRENT. I am trying to
> reroute an IP packet from one machine to another based on some
> criteria and I don't want to do kernel modification. I tried using the
> IP_HDRINCL option for opening a raw socket, but it doesn't seem to do
> that. I treied to isolate the error and when I tried "perror" the
> error message says "no buffers available". I tried this many times and
> still the same error appears. Any suggestions/ part of code to
> implement this?

> Thanks in advance,

> Cheers,
> Sudheer

natd is a good example:

    ftp://kn6-045.ktvlpr.inet.fi/pub/natd.

--

      <http://www.awfulhak.demon.co.uk>
Don't _EVER_ lose your sense of humour !

 
 
 

1. IP_HDRINCL and IP_PKTINFO on RAW sockets with sendmsg

Hello,

I am using IP_HDRINCL and IP_PKTINFO (to choose by which interface the
packet leaves) on a RAW socket.

I'm using the udphdr structure with IPPROTO_RAW but I keep Malformed
Packet in the Ethereal traces and the IP header can't even be read by
Ethereal.

Is there something wrong with my approach? Please advise. Thank you.

Regards,
Se-Hsieng

Attached: test_iphdr.c

  test_rawhdr.c
3K Download

2. Lame question abou child procesess and sessions...

3. Help with sendto() and IP_HDRINCL socket option

4. Backup Help Please

5. IP_HDRINCL in HPUX10.20? Raw IP programming

6. How to use large memory in kernel?

7. raw IP and raw ICMP socket???

8. TCP sockets and shell scripts

9. Guru Q: recvfrom on IP_HDRINCL socket

10. IP Checksum in Raw Sockets

11. Incorrect IP header data in RAW Sockets

12. Linux Raw Socket for IP Multicast

13. PATCH for Multicast bug in RAW IP sockets 2.4.0