RAW Socket

RAW Socket

Post by Yichun Di » Thu, 30 Apr 1998 04:00:00



Hi,

   I have a question regarding sending a raw packet.
What I want to do is to send an additional information
along with the packet down to IP stack, using RAW_SOCK.
This additional information will be used to build an
another header in front of the IP header of the packet
before sending it to layer 2.

   What is the best approach to resolve this problme?

   Can I build both headers before call sendto? I am
trying to use

 IF (sock = socket(AF_INET, SOCK_RAW, OSPF_PROTO)) > 0
   setsockopt(sock, IPPROTO_TP, IP_HDRINCL, &on, sizeof(on));

 /*  build both private header and IP header */
  .....

 sendto (sock, .....);

to resolve this problem.

   Is this the right way to do it?


know the answer.

   Thank you very much for your attention.

Yichun

 
 
 

RAW Socket

Post by shado » Fri, 01 May 1998 04:00:00



>Hi,

>   I have a question regarding sending a raw packet.
>What I want to do is to send an additional information
>along with the packet down to IP stack, using RAW_SOCK.
>This additional information will be used to build an
>another header in front of the IP header of the packet
>before sending it to layer 2.

[snip]

Sure, just put the data after the IP and Transport level header. You cannot
however put it between the IP and the Transport level header, it would'nt be
handled correctly by tcp/ip stacks on other OSs.

--
Thamer Al-Herbish                          <URL http://www.whitefang.com/>
[    The Raw IP Networking FAQ <URL http://www.whitefang.com/rin/ >      ]

 
 
 

1. Information of the RAW socket interface for Berkely sockets

Sorry for the big cross-posting,

I was wondering if anyone out there had any information or knows where I
could get information on the RAW mode sockets. Any help would be
appreciated.

Please respond via e-mail.
--

-----------------------------------------------------------------------------

2. pipeline OR async cache??

3. Raw socket question?

4. Installing Xfree 4.0 from source.

5. Raw Socket Programming

6. How to simulate high server loads

7. how to know a datagram has been fragmented, from a raw socket point-of-view ?

8. Signal 8 message

9. debugging the raw sockets - how to capture the output?

10. Raw socket programming

11. raw sockets

12. Raw Sockets + !superuser, possible?

13. use of raw sockets / libcap ?