Page 1 of 1

Network stack design

Posted: Sun Jan 29, 2012 9:21 am
by Bietje
Hi,

I'm designing a network stack. The idea is a bit linuxish. Above the drivers is a protocol independent core driver. But my question is, how can this core driver call the correct protocol handler without using a huge switch case and using every protocol as a case..

I hope someone can help,
Bietje

Re: Network stack design

Posted: Sun Jan 29, 2012 5:30 pm
by Bietje
berkus wrote:Using a protocol handler registry.

protocols[protocol_number]->do_something_with(packet);
Nice, thank you.