Network stack design

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
Bietje
Member
Member
Posts: 100
Joined: Wed Apr 20, 2011 6:57 am

Network stack design

Post 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
Bietje
Member
Member
Posts: 100
Joined: Wed Apr 20, 2011 6:57 am

Re: Network stack design

Post by Bietje »

berkus wrote:Using a protocol handler registry.

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