/* @(#)src/common/cmd/dmapi/libxdsm/dmapi.h	3.3 07/04/01 00:26:58 */
/* #ident "@(#)vxfs:src/common/cmd/dmapi/libxdsm/dmapi.h	3.3" */

/*
 * (c) Copyright 1991-2004 VERITAS Software Corporation. All rights reserved.
 */

#ifndef _DMAPI_H
#define _DMAPI_H

#ifdef __cplusplus
extern "C" {
#endif

#include <sys/fs/dmapi.h>

#ifndef __P
#ifdef	__STDC__
#define __P(x) x
#else
#define __P(x) ()
#endif
#endif /* __P */

extern int	dm_clear_inherit __P((dm_sessid_t, void *, size_t,
				      dm_token_t, dm_attrname_t *));
extern int	dm_create_by_handle __P((dm_sessid_t, void *, size_t,
					 dm_token_t, void *, size_t, char *));
extern int	dm_create_session __P((dm_sessid_t, char *, dm_sessid_t *));
extern int	dm_create_userevent __P((dm_sessid_t, size_t, void *,
					 dm_token_t *));
extern int	dm_destroy_session __P((dm_sessid_t));
extern int	dm_event_query __P((dm_sessid_t, dm_token_t, dm_eventquery_t,
				    dm_size_t *));
extern int	dm_find_eventmsg __P((dm_sessid_t, dm_token_t, size_t,
				 void *, size_t *));
extern int	dm_get_allocinfo __P((dm_sessid_t, void *, size_t, dm_token_t,
				      dm_off_t *, u_int, dm_extent_t *,
				      u_int *));
extern int	dm_get_bulkall __P((dm_sessid_t, void *, size_t, dm_token_t,
				    u_int, dm_attrname_t *, dm_attrloc_t *,
				    size_t, void *, size_t *));
extern int	dm_get_bulkattr __P((dm_sessid_t, void *, size_t, dm_token_t,
				     u_int, dm_attrloc_t *, size_t,
				     void *, size_t *));
extern int	dm_get_dirattrs __P((dm_sessid_t, void *, size_t, dm_token_t,
				     u_int, dm_attrloc_t *, size_t, void *,
				     size_t *));
extern int	dm_init_attrloc __P((dm_sessid_t, void *, size_t, dm_token_t,
				     dm_attrloc_t *));
extern int	dm_get_config __P((void *, size_t, dm_config_t, dm_size_t *));
extern int	dm_get_config_events __P((void *, size_t, u_int,
					  dm_eventset_t *, u_int *));
extern int	dm_get_dmattr __P((dm_sessid_t, void *, size_t, dm_token_t,
				   dm_attrname_t *, size_t, void *, size_t *));
extern int	dm_get_eventlist __P((dm_sessid_t, void *, size_t, dm_token_t,
				      u_int, dm_eventset_t *, u_int	*));
extern int	dm_get_events __P((dm_sessid_t, u_int, u_int, size_t, void *,
				   size_t *));
extern int	dm_get_fileattr __P((dm_sessid_t, void *, size_t, dm_token_t,
				     u_int, dm_stat_t *));
extern int	dm_get_mountinfo __P((dm_sessid_t, void *, size_t, dm_token_t,
				      size_t, void *, size_t *));
extern int	dm_get_region __P((dm_sessid_t, void *, size_t, dm_token_t,
				   u_int, dm_region_t *, u_int *));
extern int	dm_getall_disp __P((dm_sessid_t, size_t, void *, size_t *));
extern int	dm_getall_dmattr __P((dm_sessid_t, void *, size_t, dm_token_t,
				      size_t, void *, size_t *));
extern int	dm_getall_inherit __P((dm_sessid_t, void *, size_t, dm_token_t,
				       u_int, dm_inherit_t *, u_int *));
extern int	dm_getall_sessions __P((u_int, dm_sessid_t *, u_int *));
extern int	dm_getall_tokens __P((dm_sessid_t, u_int, dm_token_t *,
				      u_int *));
extern int	dm_handle_cmp __P((void *, size_t, void *, size_t));
extern dm_boolean_t dm_handle_is_valid __P((void *, size_t));
extern u_int	dm_handle_hash __P((void *, size_t));
extern int	dm_handle_to_fshandle __P((void *, size_t, void **, size_t *));
extern int	dm_handle_to_path __P((void *, size_t, void *, size_t,
				       size_t, char *, size_t *));
extern int	dm_init_service __P((char **));
extern int	dm_mkdir_by_handle __P((dm_sessid_t, void *, size_t, dm_token_t,
					void *, size_t, char *));
extern int	dm_move_event __P((dm_sessid_t, dm_token_t, dm_sessid_t,
				   dm_token_t *));
extern int	dm_fd_to_handle __P((int, void **, size_t *));
extern int	dm_path_to_fshandle __P((char *, void **, size_t *));
extern int	dm_path_to_handle __P((char *, void **, size_t *));
extern void	dm_handle_free __P((void *, size_t));
extern int	dm_punch_hole __P((dm_sessid_t, void *, size_t, dm_token_t,
				   dm_off_t, dm_size_t));
extern int	dm_probe_hole __P((dm_sessid_t, void *, size_t, dm_token_t,
				   dm_off_t, dm_size_t, dm_off_t *,
				   dm_size_t *));
extern int	dm_query_right __P((dm_sessid_t, void *, size_t, dm_token_t,
				    dm_right_t *));
extern int	dm_query_session __P((dm_sessid_t, size_t, void *, size_t *));
extern dm_ssize_t dm_read_invis __P((dm_sessid_t, void *, size_t, dm_token_t,
				     dm_off_t, dm_size_t, void *));
extern dm_ssize_t dm_write_invis __P((dm_sessid_t, void *, size_t, dm_token_t,
				      int, dm_off_t, dm_size_t, void *));
extern int	dm_release_right __P((dm_sessid_t, void *, size_t, dm_token_t));
extern int	dm_remove_dmattr __P((dm_sessid_t, void *, size_t, dm_token_t,
				      int, dm_attrname_t *));
extern int	dm_request_right __P((dm_sessid_t, void *, size_t, dm_token_t,
				      u_int, dm_right_t));
extern int	dm_respond_event __P((dm_sessid_t, dm_token_t, dm_response_t,
				      int, size_t, void *));
extern int	dm_send_msg __P((dm_sessid_t, dm_msgtype_t, size_t, void *));
extern int	dm_set_disp __P((dm_sessid_t, void *, size_t, dm_token_t,
				 dm_eventset_t *, u_int));
extern int	dm_set_dmattr __P((dm_sessid_t, void *, size_t, dm_token_t,
				   dm_attrname_t *, int, size_t, void *));
extern int	dm_set_eventlist __P((dm_sessid_t, void *, size_t, dm_token_t,
				      dm_eventset_t *, u_int));
extern int	dm_set_fileattr __P((dm_sessid_t, void *, size_t, dm_token_t,
				     u_int, dm_fileattr_t *));
extern int	dm_set_inherit __P((dm_sessid_t, void *, size_t, dm_token_t,
				    dm_attrname_t *, u_int));
extern int	dm_set_region __P((dm_sessid_t, void *, size_t, dm_token_t,
				   u_int, dm_region_t *, dm_boolean_t *));
extern int	dm_set_return_on_destroy __P((dm_sessid_t, void *, size_t,
					      dm_token_t,  dm_attrname_t *,
					      dm_boolean_t));
extern int	dm_symlink_by_handle __P((dm_sessid_t, void *, size_t,
					  dm_token_t, void *, size_t, char *,
					  char *));
extern int	dm_sync_by_handle __P((dm_sessid_t, void *, size_t,
				       dm_token_t));
extern int	dm_handle_to_fsid __P((void *, size_t, dm_fsid_t *));
extern int	dm_handle_to_igen __P((void *, size_t, dm_igen_t *));
extern int	dm_handle_to_ino __P((void *, size_t, dm_ino_t *));
extern int	dm_make_handle __P((dm_fsid_t, dm_ino_t, dm_igen_t, void **,
			       size_t *));
extern int	dm_make_fshandle __P((dm_fsid_t, void **, size_t *));

/*
 * Stubs for non-supported optional interfaces
 */

extern int	dm_upgrade_right __P((dm_sessid_t, void *, size_t, dm_token_t));
extern int	dm_downgrade_right __P((dm_sessid_t, void *, size_t,
					dm_token_t));
extern int	dm_pending __P((dm_sessid_t, dm_token_t, timestruc_t *));
extern int	dm_obj_ref_hold __P((dm_sessid_t, dm_token_t, void *, size_t));
extern int	dm_obj_ref_rele __P((dm_sessid_t, dm_token_t, void *, size_t));
extern int	dm_obj_ref_query __P((dm_sessid_t, dm_token_t, void *, size_t));

#ifdef __cplusplus
}
#endif

#endif	/* _DMAPI_H */
