Feature: "misc" pseudo protocol family

From: Martin Rosenau <hidden>
Date: 2020-02-07 06:59:46

Hello,

Unlike other OSs, Linux is often used to run experimental software. In 
my case it was an uncommon network protocol that I wanted to implement 
in a kernel module.

Unfortunately, it is not possible to add additional "AF_xxx" protocols 
to Linux without re-compiling the kernel because there are arrays with 
the size "AF_MAX" so Linux does not allow "AF_xxx" constants above "AF_MAX".

Simply increasing "AF_MAX" and leaving a range free for experimental 
protocols might be a solution; however, in this case the constants 
"AF_xxx" would have a different meaning on different computers, so 
programs using such protocols are not interchangable between computers.

To solve this, I'd like to propose a "protocol multiplexer" using 
string-based protocol IDs instead of integers intended for experimental 
or uncommon protocols:

Instead of doing:

   mySocket = socket(PF_INET3, SOCK_STREAM, IPPROTO_TCP);

... you would do:

   mySocket = socket(PF_MISC, SOCK_DGRAM, 0);

   protocolId = ioctl(mySocket, SIOCPFMISCQUERYNAME, "TCP_IPV3");

   close(mySocket);

   mySocket = socket(PF_MISC, SOCK_STREAM, protocolId);

A loadable kernel module implementing such a protocol would register 
itself using its string ID at the "PF_MISC" implementation instead of 
using "sock_register()" and an "AF_xxx" constant.

The actual PF_MISC implementation can be done in a kernel module; 
however, the change of the AF_MAX constant and the definition of PF_MISC 
has to be done in the kernel itself.

I'm new to kernel development, so I apologize if posting this message 
here was not a good idea.

I was already posting this proposal to the Linux kernel bugzilla; there 
I was told to post this idea to this mailing list.

Thanks for reading

Martin

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help