Where to hook onto the tcp stack?
I recently discussed with a diagram, exactly where I plan to hook onto the existing structure in Linux. My plan is to bypass the Socket ioctl and the Socket structure, and plug in directly to the sk structure, which is a common interface to the various transport layer protocols. I plan to write my own connection create and sendpkt functions, which work with the sk structure. Initially I had planned to plug these functions into the .connect , .sendmsg etc. of proto_ops structure, but it seems unnecessary to do that. I now think I’ll call those functions directly in my FS code, when relevant commands are written to the ctl and data files.
I was recommended to look at ksocket by a friend. While the package is looking to provide BSD-style network programming in kernel I cannot hook onto the functions they are hooking on to. ksocket is simply a wrapper on top of the socket structure, and does not help me gain insight on what’s underneath. My plan currently is to work at a much lower layer than they are doing, even though we are both in kernel-space. I just find it useless overhead to maintain a socket structure, for what I am working to achieve. Doing it my way might be much harder though!
Current issue that needs solving: If I dont have sock->sk element, because I dont use a socket to represent a connection, but use a folder /net/tcp/n , then how to I associate the sk structure with it? struct file has no sk element like struct socket does…
No comments yet.
Leave a Reply
-
Recent
- A test script to fetch over HTTP on command-line
- Where to hook onto the tcp stack?
- Basic framework ready!
- “fsnet_create” a good plan?
- Glendix on Routers?
- DNS: A hard to crack nut!
- My first /net code commited!
- Learning to write a Systhetic Filesystem on Linux
- Discussion on 9Fans
- Plan 9 Cheat Sheet
- Network internals of Plan 9
- Initial reading and analysis
-
Links
-
Archives
- April 2009 (3)
- March 2009 (3)
- February 2009 (5)
- January 2009 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS