From owner-p4-projects@FreeBSD.ORG Sun Apr 24 15:58:58 2005 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 61B5516A4D0; Sun, 24 Apr 2005 15:58:58 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 202DC16A4CE for ; Sun, 24 Apr 2005 15:58:58 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C7C0343D41 for ; Sun, 24 Apr 2005 15:58:57 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j3OFwvS6091209 for ; Sun, 24 Apr 2005 15:58:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j3OFwvlW091206 for perforce@freebsd.org; Sun, 24 Apr 2005 15:58:57 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sun, 24 Apr 2005 15:58:57 GMT Message-Id: <200504241558.j3OFwvlW091206@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Subject: PERFORCE change 75886 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2005 15:58:59 -0000 http://perforce.freebsd.org/chv.cgi?CH=75886 Change 75886 by rwatson@rwatson_paprika on 2005/04/24 15:58:48 Try to clean up the state of nested includes a bit: - #ifdef KERNEL interfaces related to struct vattr, which is kernel-only. - Avoid nested includes from include files where possible, and instead rely on forward declarations of structures. Include in .c files only where necessary. Affected files ... .. //depot/projects/trustedbsd/openbsm/bsm/audit.h#4 edit .. //depot/projects/trustedbsd/openbsm/bsm/audit_kernel.h#4 edit .. //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#3 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#4 edit .. //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#4 edit .. //depot/projects/trustedbsd/openbsm/libbsm/libbsm.h#5 edit Differences ... ==== //depot/projects/trustedbsd/openbsm/bsm/audit.h#4 (text+ko) ==== @@ -24,13 +24,6 @@ #ifndef _BSM_AUDIT_H #define _BSM_AUDIT_H -#include -#include -#include -#include -#include -#include - #define AUDIT_RECORD_MAGIC 0x828a0f1b #define MAX_AUDIT_RECORDS 20 #define MAX_AUDIT_RECORD_SIZE 4096 ==== //depot/projects/trustedbsd/openbsm/bsm/audit_kernel.h#4 (text+ko) ==== @@ -26,12 +26,6 @@ #if defined(_KERNEL) || defined(KERNEL) -#include - -#include -#include -#include - /* * Audit subsystem condition flags. The audit_enabled flag is set and * removed automatically as a result of configuring log files, and ==== //depot/projects/trustedbsd/openbsm/bsm/audit_record.h#3 (text+ko) ==== @@ -24,15 +24,6 @@ #ifndef _BSM_AUDIT_RECORD_H_ #define _BSM_AUDIT_RECORD_H_ -#include -#include -#include -#include -#include -#include -#include -#include - /* We could determined the header and trailer sizes by * defining appropriate structures. We hold off that approach * till we have a consistant way of using structures for all tokens. @@ -228,6 +219,18 @@ __BEGIN_DECLS +struct in_addr; +struct in6_addr; +struct ip; +struct ipc_perm; +struct kevent; +struct sockaddr_in; +struct sockaddr_in6; +struct sockaddr_un; +#if defined(_KERNEL) || defined(KERNEL) +struct vattr; +#endif + int au_open(void); int au_write(int d, token_t *m); int au_close(int d, int keep, short event); @@ -243,9 +246,11 @@ token_t *au_to_arg(char n, char *text, u_int32_t v); token_t *au_to_arg32(char n, char *text, u_int32_t v); token_t *au_to_arg64(char n, char *text, u_int64_t v); +#if defined(_KERNEL) || defined(KERNEL) token_t *au_to_attr(struct vattr *attr); token_t *au_to_attr32(struct vattr *attr); token_t *au_to_attr64(struct vattr *attr); +#endif token_t *au_to_data(char unit_print, char unit_type, char unit_count, char *p); token_t *au_to_exit(int retval, int err); ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_token.c#4 (text+ko) ==== @@ -27,8 +27,15 @@ */ #include +#include #include +#include + +#include +#include +#include + #include #include #include @@ -125,6 +132,7 @@ return au_to_arg32(n, text, v); } +#if defined(_KERNEL) || defined(_KERNEL) /* * token ID 1 byte * file access mode 4 bytes @@ -186,7 +194,7 @@ return au_to_attr32(attr); } - +#endif /* !(defined(_KERNEL) || defined(KERNEL) */ /* * token ID 1 byte ==== //depot/projects/trustedbsd/openbsm/libbsm/bsm_wrappers.c#4 (text+ko) ==== @@ -29,12 +29,12 @@ /* * XXX lib_wrappers.c is a provisional name */ -#include /* [f]stat(), sysctl(), gete[ug]id(), getpid() */ -#include /* [f]stat() */ -#include /* sysctl() */ -#include /* STDIN_FILENO, gete[ug]id(), getpid() */ -#include /* syslog() */ -#include /* syslog() */ +#include +#include +#include +#include +#include +#include #include #include ==== //depot/projects/trustedbsd/openbsm/libbsm/libbsm.h#5 (text+ko) ==== @@ -38,13 +38,15 @@ #define MAX_ARGS 10 #define MAX_ENV 10 -#include #include +#include #include -#include /* __{BEGIN,END}_DECLS */ #include #include + +#include + #ifdef __APPLE__ #include /* audit_token_t */ #endif