Subject: Re: Getting rid of in_protox[]
To: Darren Reed <darrenr@reed.wattle.id.au>
From: Matt Thomas <matt@3am-software.com>
List: tech-net
Date: 07/01/2001 16:14:40
At 08:42 AM 7/2/2001 +1000, Darren Reed wrote:
>I was mulling over a few things whilst having breakfast and it occurred
>to me that maybe it's time to get rid of in_protox[]. What's it used
>for ? It's an array of ip protocol numbers that provide an index into
>in_proto[] so that inetsw[] doesn't need to be [256] with initializers
>all over the place.
>
>What I'd like to see would be for inetsw[] to become an array of pointers
>to struct protosw (struct protosw *inetsw[256]) and for this to be populated
>using a "protocol foo" type directive in kernel config files. As a bonus,
>this allows protocols to be added on the fly at run time, making development
>of new ones easier, as LKMs.
Thta doesn't work. a protosw is not indexable, it's a linear searchable
list.
>The config file statement would need to be capable of specifying ipv4 or
>ipv6, so maybe that should be "protocol tcp ipv6" (for example).
>
>I haven't thought thing through much further than this. Is this a
>worthwhile change or just silliness ?
Silliness. :) The semantics of protosw tables don't allow the change.
--
Matt Thomas Internet: matt@3am-software.com
3am Software Foundry WWW URL: http://www.3am-software.com/bio/matt/
Cupertino, CA Disclaimer: I avow all knowledge of this message