[En-Nut-Discussion] RFC: Registering Protocols
Matthias Ringwald
mringwal at inf.ethz.ch
Mon Aug 11 12:12:06 CEST 2008
HI Harald,
sounds reasonable to me. Keep it simple (tm)!
I've never used Ethernet procols oterwise. :)
matthias
On 11.08.2008, at 10:44, Harald Kipp wrote:
> Hi,
>
> I need to implement a new Ethernet protocol
> http://en.wikipedia.org/wiki/Data_Link_Control
>
> Of course it must be avoided, that existing applications will
> suffer. No
> DLC code should be included if not used. One of the following
> techniques
> 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
> function.
>
> An additional problem exists in the current code. If an application
> uses
> 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
> expected,
> that Nut/OS based nodes respond to ICMP echo requests. Registering
> these
> 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
> called
> 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.
>
> Comments?
>
More information about the En-Nut-Discussion
mailing list