[En-Nut-Discussion] RFC: Registering Protocols
mringwal at inf.ethz.ch
Mon Aug 11 12:12:06 CEST 2008
sounds reasonable to me. Keep it simple (tm)!
I've never used Ethernet procols oterwise. :)
On 11.08.2008, at 10:44, Harald Kipp wrote:
> I need to implement a new Ethernet protocol
> Of course it must be avoided, that existing applications will
> suffer. No
> DLC code should be included if not used. One of the following
> can be used to maintain this:
> 1. Using the Configurator to enable or disable a specific protocol.
> 2. Using NutRegisterXXX to create a reference.
> Option 1 is easy to implement, but will clutter up the code ifdefs and
> requires re-compilation of the libraries for different applications.
> Option 2 is more elegant, but someone needs to call the registering
> An additional problem exists in the current code. If an application
> UDP only, it still gets the TCP routines linked in. That's because
> NutIpInput() refers to NutTcpInput().
> After reconsidering the situation, I came to the conclusion that
> actually all networking applications will use IP and, if based on
> Ethernet, they need ARP as well. Furthermore, it is generally
> that Nut/OS based nodes respond to ICMP echo requests. Registering
> protocols would introduce additional code without benefit.
> However, the IP protocols UDP and TCP should be optional, because some
> applications may use one of them only. The decision can be based on
> NutTcpCreateSocket() and NutUdpCreateSocket(). If any of these is
> for the first time, they will register the related protocol in the
> IP layer.
> The protocol switch in NutIpInput() will be partly (UDP, TCP, IGMP)
> replaced by a loop through a linked list of registered protocols.
More information about the En-Nut-Discussion