/*
 * @DEC_COPYRIGHT@
 */
/*
 * HISTORY
 * $Log:	include_sec,v $
 * Revision 4.1.2.2  92/05/20  15:06:32  Michael_Fairbrother
 * 	Added OSF1.1 fixes
 * 	[92/05/07  14:16:59  Michael_Fairbrother]
 * 
 * $EndLog$
 */
/*
 * @(#)$RCSfile: include_sec,v $ $Revision: 4.1.2.2 $ (DEC) $Date: 92/05/20 15:06:32 $
 */
/*
 * (c) Copyright 1990, OPEN SOFTWARE FOUNDATION, INC.
 * ALL RIGHTS RESERVED
 */
/*
 * OSF/1 Release 1.0
 */
/*
 * @(#)include_sec    3.1 10:01:25 6/7/90 SecureWare
 *
 * OSF/1 Include File Header
 *
 * This file is included by all files in the sec kernel directory
 * to avoid large sections of vendor-dependent code at the top of
 * each kernel module that SecureWare adds to the vendor's kernel.
 */

/*
 * Set up conditional compilation symbols.
 */

#include <sys/secdefines.h>

#include <kern/lock.h>

/*
 * SecureWare-specific include files.
 */

#include <sys/security.h>
#include <sys/audit.h>
#include <sys/secpolicy.h>
#include <sys/secioctl.h>

/*
 * These are vendor include files, which may or may not depend
 * on the SecureWare base or derived conditionals.
 */

#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/uio.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/conf.h>
#include <sys/vnode.h>
#include <ufs/inode.h>
#include <ufs/fs.h>
#include <ufs/ufsmount.h>
#include <sys/kernel.h>
#include <sys/msg.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <sys/utsname.h>
#include <sys/user.h>
#include <kern/parallel.h>

/*
 * Define various vendor-dependent macros that are
 * used by SecureWare kernel modules.
 */

/* Locking and unlocking macros for vnodes */

#define SEC_LOCKIP(ip)		ILOCK(ip)
#define SEC_UNLOCKIP(ip)	IUNLOCK(ip)

/* Group membership checking macro */

#define	GROUPMEMBER(gid)	groupmember(gid, u.u_cred)

/* Get the current time in seconds as a long */

#define SYSTEM_TIME	time.tv_sec

/*
 * Tell whether a given shared memory segment is in use.
 * Use the "number attached" to determin if this secment is 
 * currently attacked.
 * XXX Need a way for our caller to prevent changes to the reference
 * count  between this test and the actions that are based on the
 * result of it.
 */

#define shm_active(OBJ)	(((struct shmid_internal *)(OBJ))->s.shm_nattch != 0)


