/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* bos720 src/bos/usr/ccs/lib/libs/acl_module.h 1.3                       */
/*                                                                        */
/* Licensed Materials - Property of IBM                                   */
/*                                                                        */
/* Restricted Materials of IBM                                            */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2002,2004              */
/* All Rights Reserved                                                    */
/*                                                                        */
/* US Government Users Restricted Rights - Use, duplication or            */
/* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.      */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
/*
 *   COMPONENT_NAME: LIBSDAC
 *
 *   @(#)93	1.3  src/bos/usr/ccs/lib/libs/acl_module.h, libsdac, bos720 5/27/04 19:28:58
 *
 *   ORIGINS: 27
 */

/*
 * Declare some virtual ACL types.  These are used to specify the
 * two ACL types which are supported by all ACL modules.
 */

#define	ACL_VFSTYPE_MODEBITS	0xfe
#define	ACL_VFSTYPE_PORTABLE	0xfd

/*
 * The real data structure for an ACL object.
 *
 *	ta_type		-- The actual type of the ACL
 *	ta_size		-- The size of the ACL itself
 *	ta_limit	-- The size of ta_acl
 *	ta_acl		-- The ACL itself
 */

struct typed_acl {
	int	ta_type;
	int	ta_size;
	int	ta_limit;
	char	ta_acl[1];
};
typedef struct typed_acl typed_acl_t;

/*
 * The ACL method table.
 *
 * This structure defines all of the method entry points for
 * ACL modules.
 */

struct	acl_methods {
	int	(*method_bin_acl_from_file) (char *, int, void **, int *, int);
	int	(*method_bin_acl_from_fd) (int, int, void **, int *, int);
	int	(*method_bin_acl_to_file) (char *, void *, int, int);
	int	(*method_bin_acl_to_fd) (int, void *, int, int);
	int	(*method_bin_acl_to_text) (void *, int, char **);
	int	(*method_text_to_bin_acl) (char *, void **, int *);
	int	(*method_port_to_bin) (void *, int, void **, int *);
	int	(*method_bin_to_port) (void *, int, void **, int *);
	int	(*method_init_acl) (void **, int *, int, int, int);
	int	(*method_init_entry) (void **, int *, int, unsigned int, int);
	int	(*method_calc_mask) (void *, int, void **, int *);
	int	(*method_find_acl_entry) (void *, int, void *, int, void **, int *);
	int	(*method_get_acl_entry) (void *, int, void *, int, void **, int *);
	int	(*method_get_acl_entry_info) (void *, int, int *, unsigned int *, int *);
	int	(*method_acl_entry_to_port) (void *, int, void **, int *);
	int	(*method_port_to_acl_entry) (void *, int, void **, int *);
	int	(*method_add_acl_entry) (void *, int, void *, int, void **, int *);
	int	(*method_remove_acl_entry) (void *, int, void *, int, int, void **, int *);
	int	(*method_change_acl_entry) (void *, int, void *, int, int, void *, int, void **, int *);
	int	(*method_change_acl_entries) (void *, int, int, int, int, void **, int *);
	int	(*method_validate_acl) (void *, int, void **, int *);
};
typedef struct acl_methods acl_methods_t;

/*
 * Path to the new ACL load modules.
 *
 * "%s" will be replaced by ACL type.
 */
#define ACL_LOAD_MODULE_PATH        "/usr/lib/security/acl/%s"
#define ACL_LOAD_MODULE_PATH_64     "/usr/lib/security/acl/%s_64"

/*
 * Function names in the new ACL load modules
 *
 * "%s" will be replaced by ACL type.
 */
#define CONVERT_ACL_FROM            "convert_acl_from_%s"
#define CONVERT_ACL_TO              "convert_acl_to_%s"
#define GET_MODE_FROM_ACL           "get_mode_from_acl"
#define BIN_TO_TEXT_ACL             "bin_to_text_acl"
#define BIN_TO_TEXT_ACL_STR         "bin_to_text_aclStr"
#define TEXT_TO_BIN_ACL             "text_to_bin_acl"
#define TEXT_TO_BIN_ACL_STR         "text_to_bin_aclStr"
#define ACL_LOADMODULE_INIT_STR     "acl_loadmodule_init"

/*
 * Structure used by acl_loadmodule_init()
 */
typedef struct _acl_lm_init_t {
	uint32_t fw_version; /* Frame Work Version */
	uint32_t lm_version; /* Load Module Version */
} acl_lm_init_t;


/*
 * Definitions used by acl_loadmodule_init()
 */
#define USR_AIXC_LM_VER	1
#define USR_NFS4_LM_VER	1