Res: Adding new protocol to linux.
From: Daniel <hidden>
Date: 2016-03-26 23:49:50
Enviado?do?meu?smartphone?BlackBerry?10. ? Mensagem original ? De: Valdis.Kletnieks at vt.edu Enviada: s?bado, 26 de mar?o de 2016 16:59 Para: Daniel. Cc: kernelnewbies Assunto: Re: Adding new protocol to linux. On Fri, 25 Mar 2016 23:00:48 -0300, "Daniel." said:
Hi everybody, I'm planing to write a socket API for Nordic's nRF24L01+ and I was digging on socket code and find all supported protocols at include/linux/socket.h with all that #define AF_x y. So my questions are: 1) Is it possible to write a new protocol for linux with an out of tree module without modifing socket.h file?
Rami Rosen gave a good outline of what's needed. But the *first* question you should ask is why a hardware device needs its own socket API rather than re-using an existing one. Basically, if it's an intelligent enough device or SOC, you should be able to get it to talk at least UDP or something. And if it's not that smart, maybe you shouldn't be trying to use sockets to talk to it. So what are the reasons you're doing a new socket API instead of using the existing stuff? Hi Valdis, thanks for the answer. The big problem here is that this piece of hardware has really tiny payloads, only 32 bytes long and is not of standard type. Also I want to add some routing bits, the final goal is to have something like xbee but GPL and cheaper. I thought to use IP at first but the hw payloads are too small, so I think in writing a new protocol module and then I found the socket.h file. Thanks for your reply Cheers