/**********************************************************************/
/*                                                                    */
/* Copyright (c) 2001 by Sun Microsystems, Inc.                       */
/* All rights reserved.                                               */
/*                                                                    */
/**********************************************************************/


/* $Date:   19 Sep 2001 16:40:18  $ */
/* $Modtime:   18 Sep 2001 16:34:12  $ */

/*
 * $Log:   /unikix/source2/SunMTP7.2.0/unikixsrc/lib/public/PVCS/security.h_v  $
 * 
 *    Rev 1.0   19 Sep 2001 16:40:18   unikix
 * Initial 7.2
 * 
 *    Rev 1.1   19 May 2000 08:16:14   daved
 * Remove references to UniKix.
 * 
 *    Rev 1.0   30 Jan 2000 11:42:30   unikix
 * Initial 7.0
 * 
 *    Rev 1.0   15 Mar 1999 19:55:08   unikix
 * Initial 6.0
 * 
 *    Rev 1.1   03 Sep 1998 15:33:36   steve
 * B003328
 * Cleaned up dependency on & moved macros to kxconst.h, to support user exit code.
 * 
 *    Rev 1.0   05/22/97 17:03:54   unikix
 * Initial 5.1
 * 
 *    Rev 1.0   07/26/96 14:11:44   steve
 * Initial revision.
 * 
 *    Rev 1.0   07/01/96 08:45:30   unikix
 * UniKix 5.0 version
 */

/*------------	declarations for security manager constants ---------------*/

enum asset_type {	/* asset-types for kxsec_rescheck */
   	KIX_FILES = 0,
   	KIX_PROGRAMS,
	KIX_JOURNALS,
	KIX_COMMANDS,
	KIX_START_TRANS,
	KIX_ATTACH_TRANS,
	KIX_TD_QUEUE,
	KIX_TS_QUEUE,
	KIX_TERMINALS,
	UNIX_APPLS
};
   
enum access_type {	/* access-types for kxsec_rescheck */
   	ReadAccess = 0,
	WriteAccess,
	UpdateAccess,
	ExecuteAccess,
	CreateAccess,
	DeleteAccess
};

#ifndef _KXCONST_H
typedef char  boolean;
#ifndef TRUE
#define  TRUE        1
#endif
#ifndef FALSE
#define  FALSE       0
#endif
#endif

/*-------------------------------------------------------------------------*/

/*-------------	declarations for security manager functions ---------------*/

boolean kxsec_rescheck(		/*	resource access check 	*/
#ifdef __STDC__
		       enum asset_type asset_type_req, 
		       char *asset_name, int asset_name_length, 
		       char *username, int username_length, 
		       enum access_type access_type_req
#endif
			);
void kxsec_docache(		/*	enable caching of asset check results */
#ifdef __STDC__
			void
#endif
			);

void kxsec_clearcache(		/*	clear current results cache contents */
#ifdef __STDC__
			void
#endif
			);

void kxsec_dontcache(		/*	disable caching of asset check results */
#ifdef __STDC__
			void
#endif
			);

boolean kxsec_login(		/*	user login check	*/
#ifdef __STDC__
		    char *username, int username_length, 
		    char *password, int password_length, 
		    char *newpw, int newpw_length
#endif
		    );

boolean kxsec_logout(		/*	user logout check	*/
#ifdef __STDC__
		    char *username, int username_length 
#endif
		    );

boolean kxsec_mgrstatus(		/*	external security manager status */
#ifdef __STDC__
			void
#endif
			);

