Skip to content

Commit

Permalink
Rather than using hidden includes (with cicular dependencies),
Browse files Browse the repository at this point in the history
directly include only the header files needed. This reduces the
unneeded spamming of various headers into lots of files.

For now, this leaves us with very few modules including vnet.h
and thus needing to depend on opt_route.h.

Reviewed by:	brooks, gnn, des, zec, imp
Sponsored by:	The FreeBSD Foundation
Bjoern A. Zeeb authored and Bjoern A. Zeeb committed Dec 2, 2008
1 parent 8372089 commit 4b79449
Showing 125 changed files with 212 additions and 56 deletions.
1 change: 1 addition & 0 deletions sys/compat/linprocfs/linprocfs.c
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
#include <sys/vimage.h>

#include <net/if.h>
#include <net/vnet.h>

#include <vm/vm.h>
#include <vm/pmap.h>
1 change: 1 addition & 0 deletions sys/compat/linux/linux_ioctl.c
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/vnet.h>

#ifdef COMPAT_LINUX32
#include <machine/../linux32/linux.h>
3 changes: 3 additions & 0 deletions sys/compat/linux/linux_socket.c
Original file line number Diff line number Diff line change
@@ -52,12 +52,15 @@ __FBSDID("$FreeBSD$");
#include <sys/un.h>
#include <sys/vimage.h>

#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
#ifdef INET6
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet6/in6_var.h>
#include <netinet6/vinet6.h>
#endif

#ifdef COMPAT_LINUX32
1 change: 1 addition & 0 deletions sys/compat/svr4/svr4_sockio.c
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/vimage.h>

#include <net/if.h>
#include <net/vnet.h>

#include <compat/svr4/svr4.h>
#include <compat/svr4/svr4_util.h>
1 change: 1 addition & 0 deletions sys/contrib/altq/altq/altq_subr.c
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/vnet.h>

#include <netinet/in.h>
#include <netinet/in_systm.h>
3 changes: 3 additions & 0 deletions sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
Original file line number Diff line number Diff line change
@@ -112,6 +112,9 @@ static const char rcsid[] = "@(#)$Id: ip_fil_freebsd.c,v 2.53.2.50 2007/09/20 12
#include "netinet/ip_scan.h"
#endif
#include "netinet/ip_pool.h"
#if defined(__FreeBSD_version) && (__FreeBSD_version >= 800056)
# include <netinet/vinet.h>
#endif
#if defined(__FreeBSD_version) && (__FreeBSD_version >= 300000)
# include <sys/malloc.h>
#endif
2 changes: 0 additions & 2 deletions sys/contrib/ipfilter/netinet/mlfk_ipl.c
Original file line number Diff line number Diff line change
@@ -43,9 +43,7 @@ static int sysctl_ipf_int ( SYSCTL_HANDLER_ARGS );
static int ipf_modload(void);
static int ipf_modunload(void);

#if __FreeBSD_version < 800055
SYSCTL_DECL(_net_inet);
#endif
#define SYSCTL_IPF(parent, nbr, name, access, ptr, val, descr) \
SYSCTL_OID(parent, nbr, name, CTLTYPE_INT|access, \
ptr, val, sysctl_ipf_int, "I", descr);
4 changes: 4 additions & 0 deletions sys/contrib/pf/net/pf.c
Original file line number Diff line number Diff line change
@@ -120,6 +120,9 @@ __FBSDID("$FreeBSD$");
#include <netinet/udp_var.h>
#include <netinet/icmp_var.h>
#include <netinet/if_ether.h>
#ifdef __FreeBSD__
#include <netinet/vinet.h>
#endif

#ifndef __FreeBSD__
#include <dev/rndvar.h>
@@ -139,6 +142,7 @@ __FBSDID("$FreeBSD$");
#ifdef __FreeBSD__
#include <netinet6/ip6_var.h>
#include <netinet6/in6_pcb.h>
#include <netinet6/vinet6.h>
#endif
#endif /* INET6 */

5 changes: 5 additions & 0 deletions sys/contrib/pf/net/pf_if.c
Original file line number Diff line number Diff line change
@@ -54,10 +54,15 @@ __FBSDID("$FreeBSD$");
#include <sys/device.h>
#endif
#include <sys/time.h>
#ifdef __FreeBSD__
#include <sys/vimage.h>
#endif

#include <net/if.h>
#include <net/if_types.h>
#ifdef __FreeBSD__
#include <net/vnet.h>
#endif

#include <netinet/in.h>
#include <netinet/in_var.h>
3 changes: 3 additions & 0 deletions sys/contrib/pf/net/pf_ioctl.c
Original file line number Diff line number Diff line change
@@ -102,6 +102,9 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_types.h>
#include <net/route.h>
#ifdef __FreeBSD__
#include <net/vnet.h>
#endif

#include <netinet/in.h>
#include <netinet/in_var.h>
1 change: 1 addition & 0 deletions sys/contrib/pf/net/pf_subr.c
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
#include <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/if_ether.h>
#include <netinet/vinet.h>
#include <net/pfvar.h>

/*
1 change: 1 addition & 0 deletions sys/contrib/rdma/rdma_cma.c
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/in_pcb.h>
#include <netinet/vinet.h>

#include <contrib/rdma/rdma_cm.h>
#include <contrib/rdma/ib_cache.h>
3 changes: 3 additions & 0 deletions sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
Original file line number Diff line number Diff line change
@@ -62,6 +62,9 @@ __FBSDID("$FreeBSD$");

#include <net/if.h>
#include <net/if_var.h>
#if __FreeBSD_version >= 800056
#include <net/vnet.h>
#endif

#include <netinet/in.h>

3 changes: 3 additions & 0 deletions sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
Original file line number Diff line number Diff line change
@@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$");
#include <netinet/tcp_seq.h>
#include <netinet/tcp_syncache.h>
#include <netinet/tcp_timer.h>
#if __FreeBSD_version >= 800056
#include <netinet/vinet.h>
#endif
#include <net/route.h>

#include <t3cdev.h>
1 change: 1 addition & 0 deletions sys/kern/kern_poll.c
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");

#include <net/if.h> /* for IFF_* flags */
#include <net/netisr.h> /* for NETISR_POLL */
#include <net/vnet.h>

#include <sys/proc.h>
#include <sys/resourcevar.h>
1 change: 1 addition & 0 deletions sys/kern/kern_uuid.c
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <net/if.h>
#include <net/if_dl.h>
#include <net/if_types.h>
#include <net/vnet.h>

/*
* See also:
2 changes: 1 addition & 1 deletion sys/modules/ae/Makefile
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
.PATH: ${.CURDIR}/../../dev/ae

KMOD= if_ae
SRCS= if_ae.c device_if.h bus_if.h pci_if.h miibus_if.h opt_route.h
SRCS= if_ae.c device_if.h bus_if.h pci_if.h miibus_if.h

.include <bsd.kmod.mk>
2 changes: 1 addition & 1 deletion sys/modules/ath/Makefile
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ SRCS+= ${AR5211_SRCS}
SRCS+= ${AR5212_SRCS}
SRCS+= ${AR5416_SRCS}
SRCS+= ${AR9160_SRCS}
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_route.h opt_ath.h opt_ah.h
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h

CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal

2 changes: 1 addition & 1 deletion sys/modules/ath_rate_amrr/Makefile
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@

KMOD= ath_rate
SRCS= amrr.c
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_route.h opt_ah.h opt_wlan.h
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ah.h opt_wlan.h

CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal

2 changes: 1 addition & 1 deletion sys/modules/ath_rate_onoe/Makefile
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@

KMOD= ath_rate
SRCS= onoe.c
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_route.h opt_ah.h opt_wlan.h
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ah.h opt_wlan.h

CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal

2 changes: 1 addition & 1 deletion sys/modules/ath_rate_sample/Makefile
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@

KMOD= ath_rate
SRCS= sample.c
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_route.h opt_ah.h opt_wlan.h
SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ah.h opt_wlan.h

CFLAGS+= -I. -I${.CURDIR}/../../dev/ath -I${.CURDIR}/../../dev/ath/ath_hal

2 changes: 1 addition & 1 deletion sys/modules/bridgestp/Makefile
Original file line number Diff line number Diff line change
@@ -3,6 +3,6 @@
.PATH: ${.CURDIR}/../../net

KMOD= bridgestp
SRCS= bridgestp.c
SRCS= bridgestp.c opt_route.h

.include <bsd.kmod.mk>
3 changes: 2 additions & 1 deletion sys/modules/cxgb/iw_cxgb/Makefile
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@ KMOD= iw_cxgb
SRCS= iw_cxgb.c iw_cxgb_cm.c iw_cxgb_hal.c
SRCS+= iw_cxgb_provider.c iw_cxgb_qp.c iw_cxgb_resource.c
SRCS+= iw_cxgb_ev.c iw_cxgb_mem.c iw_cxgb_dbg.c iw_cxgb_cq.c
SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h opt_inet.h
SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h opt_ktr.h
SRCS+= opt_inet.h opt_route.h
CFLAGS+= -g -I${CXGB}
#CFLAGS+= -DDEBUG

2 changes: 1 addition & 1 deletion sys/modules/if_ef/Makefile
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
.PATH: ${.CURDIR}/../../net

KMOD= if_ef
SRCS= if_ef.c opt_ipx.h opt_inet.h opt_ef.h
SRCS= if_ef.c opt_ipx.h opt_inet.h opt_ef.h opt_route.h

.if defined(EFDEBUG)
CFLAGS+= -DEF_DEBUG
2 changes: 1 addition & 1 deletion sys/modules/if_vlan/Makefile
Original file line number Diff line number Diff line change
@@ -4,6 +4,6 @@

KMOD= if_vlan
SRCS= if_vlan.c
SRCS+= opt_inet.h opt_vlan.h
SRCS+= opt_inet.h opt_vlan.h opt_route.h

.include <bsd.kmod.mk>
2 changes: 1 addition & 1 deletion sys/modules/ip_mroute_mod/Makefile
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
KMOD= ip_mroute

SRCS= ip_mroute.c
SRCS+= opt_inet.h opt_mac.h opt_mrouting.h
SRCS+= opt_inet.h opt_mac.h opt_mrouting.h opt_route.h
SRCS+= opt_inet6.h

.if ${MK_INET6_SUPPORT} != "no"
2 changes: 1 addition & 1 deletion sys/modules/ipfw/Makefile
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

KMOD= ipfw
SRCS= ip_fw2.c ip_fw_pfil.c
SRCS+= opt_inet6.h opt_ipsec.h opt_mac.h
SRCS+= opt_inet6.h opt_ipsec.h opt_mac.h opt_route.h

CFLAGS+= -DIPFIREWALL
CFLAGS+= -I${.CURDIR}/../../contrib/pf
3 changes: 2 additions & 1 deletion sys/modules/linprocfs/Makefile
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@
KMOD= linprocfs
SRCS= vnode_if.h \
linprocfs.c \
opt_compat.h
opt_compat.h \
opt_route.h

.if ${MACHINE_ARCH} == "amd64"
CFLAGS+=-DCOMPAT_LINUX32
2 changes: 1 addition & 1 deletion sys/modules/linux/Makefile
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ SRCS= linux${SFX}_dummy.c linux_emul.c linux_file.c \
linux${SFX}_machdep.c linux_mib.c linux_misc.c linux_signal.c \
linux_socket.c linux_stats.c linux_sysctl.c linux${SFX}_sysent.c \
linux${SFX}_sysvec.c linux_uid16.c linux_util.c linux_time.c \
opt_inet6.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \
opt_inet6.h opt_route.h opt_mac.h opt_compat.h opt_posix.h vnode_if.h \
device_if.h bus_if.h assym.s

# XXX: for assym.s
2 changes: 1 addition & 1 deletion sys/modules/netgraph/atm/atm/Makefile
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
.PATH: ${.CURDIR}/../../../../netgraph/atm

KMOD= ng_atm
SRCS= ng_atm.c
SRCS= ng_atm.c opt_route.h
# CFLAGS+= -DNGATM_DEBUG

.include <bsd.kmod.mk>
2 changes: 1 addition & 1 deletion sys/modules/netgraph/ether/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# $FreeBSD$

KMOD= ng_ether
SRCS= ng_ether.c
SRCS= ng_ether.c opt_route.h

.include <bsd.kmod.mk>
2 changes: 1 addition & 1 deletion sys/modules/netgraph/gif/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $FreeBSD$

KMOD= ng_gif
SRCS= ng_gif.c opt_inet.h opt_inet6.h
SRCS= ng_gif.c opt_inet.h opt_inet6.h opt_route.h

.if !defined(KERNBUILDDIR)
opt_inet.h:
2 changes: 1 addition & 1 deletion sys/modules/nfsclient/Makefile
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ SRCS= vnode_if.h \
opt_inet.h opt_nfs.h opt_bootp.h opt_nfsroot.h
SRCS+= nfs4_dev.c nfs4_idmap.c nfs4_socket.c nfs4_subs.c \
nfs4_vfs_subs.c nfs4_vfsops.c nfs4_vn_subs.c nfs4_vnops.c
SRCS+= opt_inet6.h opt_kgssapi.h
SRCS+= opt_inet6.h opt_kgssapi.h opt_route.h

# USE THE RPCCLNT:
CFLAGS+= -DRPCCLNT_DEBUG
2 changes: 1 addition & 1 deletion sys/modules/pf/Makefile
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ KMOD= pf
SRCS = pf.c pf_if.c pf_subr.c pf_osfp.c pf_ioctl.c pf_norm.c pf_table.c \
pf_ruleset.c \
in4_cksum.c \
opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_mac.h
opt_pf.h opt_inet.h opt_inet6.h opt_bpf.h opt_mac.h opt_route.h

CFLAGS+= -I${.CURDIR}/../../contrib/pf

3 changes: 2 additions & 1 deletion sys/modules/wlan/Makefile
Original file line number Diff line number Diff line change
@@ -10,7 +10,8 @@ SRCS= ieee80211.c ieee80211_crypto.c ieee80211_crypto_none.c ieee80211_dfs.c \
ieee80211_regdomain.c ieee80211_ht.c \
ieee80211_adhoc.c ieee80211_hostap.c ieee80211_monitor.c \
ieee80211_sta.c ieee80211_wds.c ieee80211_ddb.c
SRCS+= bus_if.h device_if.h opt_inet.h opt_ipx.h opt_wlan.h opt_ddb.h
SRCS+= bus_if.h device_if.h opt_inet.h opt_ipx.h opt_wlan.h opt_ddb.h \
opt_route.h

.if !defined(KERNBUILDDIR)
opt_wlan.h:
1 change: 1 addition & 0 deletions sys/net/bridgestp.c
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <net/if_types.h>
#include <net/if_llc.h>
#include <net/if_media.h>
#include <net/vnet.h>

#include <netinet/in.h>
#include <netinet/in_systm.h>
2 changes: 2 additions & 0 deletions sys/net/if.c
Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@
#include <net/if_var.h>
#include <net/radix.h>
#include <net/route.h>
#include <net/vnet.h>

#if defined(INET) || defined(INET6)
/*XXX*/
@@ -79,6 +80,7 @@
#endif
#ifdef INET
#include <netinet/if_ether.h>
#include <netinet/vinet.h>
#endif
#ifdef DEV_CARP
#include <netinet/ip_carp.h>
2 changes: 2 additions & 0 deletions sys/net/if_bridge.c
Original file line number Diff line number Diff line change
@@ -115,9 +115,11 @@ __FBSDID("$FreeBSD$");
#include <netinet/in_var.h>
#include <netinet/ip.h>
#include <netinet/ip_var.h>
#include <netinet/vinet.h>
#ifdef INET6
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet6/vinet6.h>
#endif
#ifdef DEV_CARP
#include <netinet/ip_carp.h>
1 change: 1 addition & 0 deletions sys/net/if_ef.c
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@
#include <net/netisr.h>
#include <net/route.h>
#include <net/bpf.h>
#include <net/vnet.h>

#ifdef INET
#include <netinet/in.h>
1 change: 1 addition & 0 deletions sys/net/if_ethersubr.c
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@
#include <net/if_bridgevar.h>
#include <net/if_vlan_var.h>
#include <net/pf_mtag.h>
#include <net/vnet.h>

#if defined(INET) || defined(INET6)
#include <netinet/in.h>
1 change: 1 addition & 0 deletions sys/net/if_faith.c
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@
#include <netinet6/in6_var.h>
#include <netinet/ip6.h>
#include <netinet6/ip6_var.h>
#include <netinet6/vinet6.h>
#endif

#define FAITHNAME "faith"
Loading

0 comments on commit 4b79449

Please sign in to comment.