Results 1 to 1 of 1
Hi, I'm new to these forums, but I've found a lot of answers here in the past. I couldn't find an answer to this particular question anywhere on the internet, ...
- 08-29-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 1
sock_create_kern vs inet_add_protocol
Hi, I'm new to these forums, but I've found a lot of answers here in the past. I couldn't find an answer to this particular question anywhere on the internet, so I figured I would register and ask it here.
I am looking at defining a new (proprietary) IP protocol. This protocol would exist entirely within the kernel, and not work its way up to user space (throughput is an issue, and I'm looking to avoid the expense of copying to and from kernel and user space - some processing has to be done in the kernel already).
My question is: would it be more efficient to open and bind to a raw kernel socket with my protocol number (using sock_create_kern), or to register a receive callback for my protocol (using inet_add_protocol). Should I do both? I need to both send and receive data with this new protocol.
It looks like the ICMP module uses the inet_add_protocol to receive ICMP messages, and a kernel socket to send ICMP messages. Is this the standard way of doing things?
Thanks!


Reply With Quote