Kernel Level Network Sockets

Submitted by vixu
on August 18, 2005 - 5:58am

Hi all!

I am facing a problem, whiting one transport protocol. It is sitting on top of IPv4 atm and I am trying to make it as a module.

I am receiving sk_buff from ip layer and there is no socket open of receiving port, so I need to send a reply with something like "no connection". For that it seems that I have to open a new "temporal" socket and pass it to the output routine.

So, what are the alternatives for

socket(); (sock_create_kern ?)
close(); (???)

I am trying to use sock_creat_kern() but then, what routine should I use to clean all the memory and things when I am closing the socket, so that module would become removable and there will be no memory leak.

I am puzzeled, since my implementation of proto_init() and proto_close() work fine for the user level sockets.

B.R.
Vix