Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 1998 21:35:31 +0200
From:      Pierre Beyssac <pb@fasterix.freenix.org>
To:        freebsd-current@FreeBSD.ORG
Subject:   kernel includes dependencies
Message-ID:  <19980505213531.A22439@fasterix.frmug.fr.net>

next in thread | raw e-mail | index | archive | help

I'd like to know how nested dependencies on kernel includes are
supposed to be resolved.

Example: while working on NetBSD's ipflow stuff for inclusion in
FreeBSD, I had to add a structure declaration to ip_var.h. This
structure introduces a new dependency on net/route.h. But as nested
includes seem to be avoided in FreeBSD in the kernel, it looks like
I need to add an #include <net/route.h> at every place that includes
netinet/ip_var.h. This includes userland stuff such as ipfw.

[ In that particular case, there is the solution of putting this
  in a private include ipflow.h, because that new structure isn't
  used outside of the ipflow stuff ]

This all seems odd to me, as I consider such dependencies an
implementation issue, and avoiding includes in includes forces the
caller to be aware of these supposedly internal dependencies.

Is there something I missed ? Is there a magic solution to my
problem, which is that it looks a bit painful and error prone to
grep through the whole source tree to catch and update utilities
such as ipfw which depend on such includes ?
-- 
Pierre Beyssac	      pb@fasterix.frmug.org pb@fasterix.freenix.org
{Free,Net,Open}BSD, Linux : il y a moins bien, mais c'est plus cher
    Free domains: http://www.eu.org/ or mail dns-manager@EU.org

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



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