Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Oct 1997 10:00:19 +1000 (EST)
From:      Darren Reed <darrenr@cyber.com.au>
To:        julian@whistle.com (Julian Elischer)
Cc:        hackers@freebsd.org
Subject:   Re: Freebsd 3.0 current fails ipfilter 3.2b8 build (fwd)
Message-ID:  <199710170000.KAA22494@plum.cyber.com.au>
In-Reply-To: <Pine.BSF.3.95.971015233553.12735A-100000@current1.whistle.com> from "Julian Elischer" at Oct 15, 97 11:37:25 pm

next in thread | previous in thread | raw e-mail | index | archive | help
In some mail I received from Julian Elischer, sie wrote
> 
> On Thu, 16 Oct 1997, Darren Reed wrote:
> 
> > In some mail I received from Julian Elischer, sie wrote
> > > 
> > > All the "_var.h" files contain variables who'se scope is within the
> > > kernel only.
> > 
> > Yup, I think that's a reasonable approach to take.
> > 
> But these are structures that are not exported, and
> which ARE changing.
> 
> > I don't think it should extend, however, to structure definitions.
> > 
> > > The only exception is LKMs which should define KERNEL.
> > > I don't know who did this, (I see in the logs it was garrett)
> > > but the idea is simply to make it more obvios when you are
> > > doing the WRONG thing
> > > and including kernel private variables (that are subject to change, 
> > > and not part of the API) .

Well, I just had a look at net/if.h & net/if_var.h for -current and it
appears as if someone has really created a good ol' mess in there.
(Sort of inline with what the rumour mill is saying about FreeBSD
 networking code...)

In if.h, "struct ifnet" is gone, but if_var.h is included if KERNEL is
defined.  However, all the #define's for the if_flags are still in if.h.
If someone feels the need to change something, please ensure that the
structs from if_var.h get into if.h by if if.h is included, no matter
what.

Cripes, not even Solaris2 is this brain dead.  In the new inet include
directory, they have a similar sort of thing, but they did it right.
Some files contain just extern's whilst others contain structures and
externs.

Might I suggest that this is the way to go ?

Structures defined in .h files, whilst maybe used in the kernel, are
not always used only in that fashion.  If there are changes made to
them, then it should not harm user code if dependencies can be
correctly determined.

Putting things into different .h files doesn't stop people from using
what you think are "kernel private" in other ways, it just makes them
angry and annoyed that something has changed (for no good reason) and
they now must deal with it.  If something like the name for "loif" had
moved and changed, then you'd be quite right with the assertion of it
being "kernel private", etc.

Darren



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710170000.KAA22494>