rdc_ioctl.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _RDC_IOCTL_H
#define _RDC_IOCTL_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef DS_DDICT
#endif
#ifdef _SunOS_5_6
#endif
typedef struct _rdc_ioctl_s {
long arg0;
long arg1;
long arg2;
long arg3;
long arg4;
long magic;
long pad[1];
} _rdc_ioctl_t;
#ifdef _SYSCALL32
typedef struct _rdc_ioctl32_s {
#endif /* _SYSCALL32 */
/*
* Ioctl command numbers
*/
/*
* Generic rdc ioctl arguments structure.
* Individual ioctl's will use 0-n of these arguments.
*
* Each rdc ioctl is described first by the command number
* e.g. #define RDC_CONFIG _RDCI_(0)
*
* Followed by a description of each argument (if any).
* Each argument is on a single line.
*
*/
#define RDC_CONFIG _RDCI_(0)
/*
* rdc_config_t *user_configuration;
*/
/*
* rdc_svc_args_t *daemon_configuration;
*/
/*
* rdc_status_t *rdc_status;
*/
/*
* rdc_version_t *rdc_version;
*/
/*
* char *rdc_host;
*/
/*
* char *rdc_master;
* char *rdc_group;
*/
/*
* struct svcpool_args *
*/
/*
* int id
*/
/*
* int id
*/
#ifdef DEBUG
#endif
#define MAX_RDC_HOST_SIZE 64
/*
* Change this when the ioctl structure changes
*/
#define RDC_MAGIC 0xf00d0001
typedef struct rdc_addr {
char intf[MAX_RDC_HOST_SIZE];
char file[NSC_MAXPATH];
char bitmap[NSC_MAXPATH];
} rdc_addr_t;
#ifdef _SYSCALL32
struct rdc_addr32 {
char intf[MAX_RDC_HOST_SIZE];
char file[NSC_MAXPATH];
char bitmap[NSC_MAXPATH];
};
#endif /* _SYSCALL32 */
/*
* User level rdc set structure - must be a multiple of 64bits long.
*/
typedef struct rdc_set {
struct knetconfig *netconfig;
long align1;
double alignfix;
int flags; /* See RDC flags below */
int sync_flags; /* See RDC flags below */
int bmap_flags; /* See RDC flags below */
int mflags; /* RDC 1-to-many flags */
int index; /* 0 .. rdc_max_sets - 1 */
int bits_set; /* Bits set in bitmap */
int autosync; /* Autosync on (1) or off (0) */
int syshostid; /* for cluster integration */
int asyncthr; /* # of async threads */
int setid; /* unique set id for this set */
} rdc_set_t;
#ifdef _SYSCALL32
struct rdc_set32 {
struct rdc_addr32 primary;
struct rdc_addr32 secondary;
double alignfix;
};
#endif /* _SYSCALL32 */
/*
* Parameter structure to pass to RDC_CONFIG
*/
typedef struct rdc_config {
int command; /* RDC_CMD_XXX */
int options; /* RDC_OPT_XXX */
} rdc_config_t;
#ifdef _SYSCALL32
struct rdc_config32 {
};
#endif /* _SYSCALL32 */
#define RDC_BITMAPSET 0x01
#define RDC_BITMAPOR 0x02
typedef struct rdc_bitmap_op {
char sechost[MAX_RDC_HOST_SIZE];
char secfile[NSC_MAXPATH];
unsigned long addr; /* address of bitmap in userland */
#ifdef _SYSCALL32
typedef struct rdc_bitmap_op32 {
char sechost[MAX_RDC_HOST_SIZE];
char secfile[NSC_MAXPATH];
#endif /* _SYSCALL32 */
#ifdef DEBUG
/*
* structure to initiate an asynchronous send to the secondary,
* so we can test the queuing code.
*/
typedef struct rdc_async6 {
char sechost[MAX_RDC_HOST_SIZE];
char secfile[NSC_MAXPATH];
int pos; /* Position in file */
int len;
int seq;
int pat; /* fill data with this */
int idx; /* server returned index */
int spos; /* sub task start block */
int slen; /* sub task length */
int endind; /* set when last block in multi request */
} rdc_async6_t;
/*
* structure to initiate a read on the secondary, so we can test the
* maxfba break up code.
*/
typedef struct rdc_readgen {
char sechost[MAX_RDC_HOST_SIZE];
char secfile[NSC_MAXPATH];
int len;
int pos;
int idx;
int flag;
int rpcversion;
void *data; /* where to place the data from the read */
#ifdef _SYSCALL32
typedef struct rdc_readgen32 {
char sechost[MAX_RDC_HOST_SIZE];
char secfile[NSC_MAXPATH];
int len;
int pos;
int idx;
int flag;
int rpcversion;
#endif
#endif
/*
* Config ioctl commands
*/
/*
* Config ioctl options
*/
/*
* RDC flags
*/
/*
* Passed out by the kernel (status)
*/
#ifndef RDC_QNOBLOCK
#define RDC_QNOBLOCK 0x10000
#endif
#define RDC_SYNC_START 0
#define RDC_SYNC_DONE 1
#define RDC_RSYNC_START 2
#ifdef _KERNEL
/*
* urdc->flags vs urdc->mflags usage:
*
* All flags are valid in urdc->flags, in which case the condition
* holds for the specific urdc.
*
* The flags in RDC_MFLAGS can also be in urdc->mflags, in which case
* connected to this urdc.
*/
/*
* Mask of volume flags that are valid in urdc->mflags
*/
/*
* Mask of volume flags that are maintained in sync_flags not flags,
* and protected by rdc_many_lock rather than the group lock.
* This allows code that is operating on one set to change the flags
* of another set.
*/
/*
* Mask of volume flags that are maintained in bmap_flags not flags,
* and protected by the bmapmutex rather than the group lock.
*/
#define RDC_BFLAGS RDC_BMP_FAILED
#endif /* _KERNEL */
typedef struct rdc_status {
int maxsets; /* Max # of sets allowed today */
} rdc_status_t;
#ifdef _SYSCALL32
struct rdc_status32 {
};
#endif /* _SYSCALL32 */
typedef struct rdc_svc_args {
int fd; /* Connection endpoint */
int nthr; /* Number of server threads */
#ifdef _SYSCALL32
struct rdc_svc_args32 {
char netid[128];
};
#endif /* _SYSCALL32 */
typedef struct rdc_version {
int major; /* Major release number */
int minor; /* Minor release number */
int micro; /* Micro release number */
int baseline; /* Baseline revison number */
#ifdef _SYSCALL32
typedef struct rdc_version32 {
#endif
#if !defined(_KERNEL)
extern int rdc_ioctl(long, long, long, long, long, long, spcs_s_info_t);
extern int rdc_ioctl_simple(long, void *);
#endif /* ! _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _RDC_IOCTL_H */