how to construct the sk_buff structure by myself?

how to construct the sk_buff structure by myself?

Post by fangweiw » Wed, 18 Feb 2004 20:13:49

I want to ask for help about the sk_buff.
How can I construct an packet by myself?use sk_buff structure.

If as the following?
   sk = alloc_skb(sizeof(struct sk_buff),GFP_ATOMIC);
   sk->data=mydata;//mydata is data what we know

but I don't know if I should fill in  other part of sk.

besides ,I found document about sk_buff is too little, so can you give
me some faq or document about it?

thank you very much!!


1. construct IP packets by myself?


I've checked my version of the ping program, and it finally works (I had
problems with the checksum calculation...). The ICMP packets are being
sent with socket(AF_INET,SOCK_RAW,IPPROTO_ICMP), and the Linux kernel
appends the IP packets by itself. I would like to construct the IP
packets manually, but I don't know how to tell the OS to stop appending
its own copy of IP. If somebody has a working example (a simple one?) of
a program which constructs packets from scratch, please, let me have it.
Also, I would appreciate any comments on the subject.
Thank you,


2. G200?

3. I want to know something about the usage of data_len in sk_buff structure

4. getting lilo back into MBR

5. Tutorial for TCP sk_buff and sock structure.

6. Logging to a WinNT proxy

7. Structures in structures

8. root/login shell

9. Constructing date using RCS or SCCS.

10. allocating sk_buff

11. Solaris 10 x86: Constructing a shared disk set between two hosts

12. hogging transmitted sk_buff's

13. Information on constructing UNIX nets