/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#ifndef _METAMHD_H_RPCGEN
#define	_METAMHD_H_RPCGEN

#include <rpc/rpc.h>
#ifndef _KERNEL
#ifdef _REENTRANT
#include <synch.h>
#endif	/* _REENTRANT */
#ifdef _REENTRANT
#include <thread.h>
#endif	/* _REENTRANT */
#endif /* !_KERNEL */

#ifdef __cplusplus
extern "C" {
#endif

/*
 * Copyright (c) 1989-1996, 2000 by Sun Microsystems, Inc.
 * All rights reserved.
 */

#pragma ident	"@(#)metamhd.x	2.1	00/06/22 SMI"

#include <mhdx.h>

/*
 * error info
 */
#define	MHD_E_MAJORITY	-1	/* couldn't get majority reservation */
#define	MHD_E_RESERVED	-2	/* drive is reserved */

struct mhd_error_t {
	int errnum;
	char *name;
};
typedef struct mhd_error_t mhd_error_t;

/*
 * null error constant
 */
#define	MHD_NULL_ERROR	{ 0, NULL }

/*
 * External reference to constant null error struct. (decl. in metamhd_xdr.c)
 */
extern	const	mhd_error_t		mhd_null_error;

/*
 * drivename type
 */

typedef char *mhd_drivename_t;

/*
 * set definition
 */

struct mhd_set_t {
	char *setname;
	struct {
		u_int drives_len;
		mhd_drivename_t *drives_val;
	} drives;
};
typedef struct mhd_set_t mhd_set_t;

/*
 * common options
 */

typedef u_int mhd_opts_t;

#define	MHD_PARTIAL_SET	0x01	/* partial set definition */
#define	MHD_SERIAL	0x02	/* process disks serially */

/*
 * take ownership
 */

enum mhd_ff_mode_t {
	MHD_FF_NONE = 0,
	MHD_FF_DRIVER = 1,
	MHD_FF_DEBUG = 2,
	MHD_FF_HALT = 3,
	MHD_FF_PANIC = 4
};
typedef enum mhd_ff_mode_t mhd_ff_mode_t;

struct mhd_tkown_args_t {
	mhd_set_t set;
	mhd_mhiargs_t timeouts;
	mhd_ff_mode_t ff_mode;
	mhd_opts_t options;
};
typedef struct mhd_tkown_args_t mhd_tkown_args_t;

/*
 * release ownership
 */

struct mhd_relown_args_t {
	mhd_set_t set;
	mhd_opts_t options;
};
typedef struct mhd_relown_args_t mhd_relown_args_t;

/*
 * inquire status
 */

struct mhd_status_args_t {
	mhd_set_t set;
	mhd_opts_t options;
};
typedef struct mhd_status_args_t mhd_status_args_t;

struct mhd_drive_status_t {
	mhd_drivename_t drive;
	int errnum;
};
typedef struct mhd_drive_status_t mhd_drive_status_t;

struct mhd_status_res_t {
	mhd_error_t status;
	struct {
		u_int results_len;
		mhd_drive_status_t *results_val;
	} results;
};
typedef struct mhd_status_res_t mhd_status_res_t;
/*
 * get local drives
 */

struct mhd_list_args_t {
	char *path;
	mhd_did_flags_t flags;
};
typedef struct mhd_list_args_t mhd_list_args_t;

struct mhd_list_res_t {
	mhd_error_t status;
	mhd_drive_info_list_t results;
};
typedef struct mhd_list_res_t mhd_list_res_t;

/*
 * authorization info
 */
#define	METAMHD_GID 14

/*
 * services available
 */

#define	METAMHD	100230
#define	METAMHD_VERSION	1

#if defined(__STDC__) || defined(__cplusplus)
#define	mhd_tkown	1
extern  enum clnt_stat mhd_tkown_1(mhd_tkown_args_t *, mhd_error_t *, CLIENT *);
extern  bool_t mhd_tkown_1_svc(mhd_tkown_args_t *, mhd_error_t *, struct svc_req *);
#define	mhd_relown	2
extern  enum clnt_stat mhd_relown_1(mhd_relown_args_t *, mhd_error_t *, CLIENT *);
extern  bool_t mhd_relown_1_svc(mhd_relown_args_t *, mhd_error_t *, struct svc_req *);
#define	mhd_status	3
extern  enum clnt_stat mhd_status_1(mhd_status_args_t *, mhd_status_res_t *, CLIENT *);
extern  bool_t mhd_status_1_svc(mhd_status_args_t *, mhd_status_res_t *, struct svc_req *);
#define	mhd_list	4
extern  enum clnt_stat mhd_list_1(mhd_list_args_t *, mhd_list_res_t *, CLIENT *);
extern  bool_t mhd_list_1_svc(mhd_list_args_t *, mhd_list_res_t *, struct svc_req *);
extern int metamhd_1_freeresult(SVCXPRT *, xdrproc_t, caddr_t);

#else /* K&R C */
#define	mhd_tkown	1
extern  enum clnt_stat mhd_tkown_1();
extern  bool_t mhd_tkown_1_svc();
#define	mhd_relown	2
extern  enum clnt_stat mhd_relown_1();
extern  bool_t mhd_relown_1_svc();
#define	mhd_status	3
extern  enum clnt_stat mhd_status_1();
extern  bool_t mhd_status_1_svc();
#define	mhd_list	4
extern  enum clnt_stat mhd_list_1();
extern  bool_t mhd_list_1_svc();
extern int metamhd_1_freeresult();
#endif /* K&R C */

/* the xdr functions */

#if defined(__STDC__) || defined(__cplusplus)
extern  bool_t xdr_mhd_error_t(XDR *, mhd_error_t*);
extern  bool_t xdr_mhd_drivename_t(XDR *, mhd_drivename_t*);
extern  bool_t xdr_mhd_set_t(XDR *, mhd_set_t*);
extern  bool_t xdr_mhd_opts_t(XDR *, mhd_opts_t*);
extern  bool_t xdr_mhd_ff_mode_t(XDR *, mhd_ff_mode_t*);
extern  bool_t xdr_mhd_tkown_args_t(XDR *, mhd_tkown_args_t*);
extern  bool_t xdr_mhd_relown_args_t(XDR *, mhd_relown_args_t*);
extern  bool_t xdr_mhd_status_args_t(XDR *, mhd_status_args_t*);
extern  bool_t xdr_mhd_drive_status_t(XDR *, mhd_drive_status_t*);
extern  bool_t xdr_mhd_status_res_t(XDR *, mhd_status_res_t*);
extern  bool_t xdr_mhd_list_args_t(XDR *, mhd_list_args_t*);
extern  bool_t xdr_mhd_list_res_t(XDR *, mhd_list_res_t*);

#else /* K&R C */
extern bool_t xdr_mhd_error_t();
extern bool_t xdr_mhd_drivename_t();
extern bool_t xdr_mhd_set_t();
extern bool_t xdr_mhd_opts_t();
extern bool_t xdr_mhd_ff_mode_t();
extern bool_t xdr_mhd_tkown_args_t();
extern bool_t xdr_mhd_relown_args_t();
extern bool_t xdr_mhd_status_args_t();
extern bool_t xdr_mhd_drive_status_t();
extern bool_t xdr_mhd_status_res_t();
extern bool_t xdr_mhd_list_args_t();
extern bool_t xdr_mhd_list_res_t();

#endif /* K&R C */

#ifdef __cplusplus
}
#endif

#endif /* !_METAMHD_H_RPCGEN */
