rmtaccess.h 1.55 KB
/*
 * Copyright (C) 1996-1998 by the Board of Trustees
 *    of Leland Stanford Junior University.
 * 
 * This file is part of the SimOS distribution. 
 * See LICENSE file for terms of the license. 
 *
 */

/*
 * rmtaccess.h --
 *
 *  Interface to the remote  access server.
 *
 *  This file is shared by SimOS and the remote access server!!!!
 *
 */

#ifndef _RMTACCESS_H
#define	_RMTACCESS_H



#define RMTACCESS_MAGIC 0xC01

typedef enum {SIMRMT_OPEN = 1, SIMRMT_ACCESS = 2, SIMRMT_DISKINIT = 3} Rmtaccess_op;

typedef struct RmtAccessStartRequest {
   int  magic;     /* Better be RMTACCESS_MAGIC */
   Rmtaccess_op cmd;
   int  arglen;   
} RmtAccessStartRequest;

typedef struct DiskFileInfo {
   char filename[128];
   off_t fileSize;
   time_t modifyTime;
   int fd;
} DiskFileInfo;
   
/*
 * Remote access to the checkpoint disk
 */

#define NETDISK_MAX_REQUEST_SIZE	(4*1024*1024)
#define	NETDISK_MAX_DISKS	(SIM_DISK_DEV_MAX_UNIT*SIM_DISK_DEV_MAX_CTRL)

#define BitsPerByte 8

typedef enum {NETDISK_PROBE, NETDISK_READ, NETDISK_WRITE, 
              NETDISK_ATTACH } DiskOp;

typedef struct NetDiskHdr {
  DiskOp op;
  int  node;          /* Node number */
  int  ctrl;	        /* Controller number */
  int  unit;          /* Unit number */
  int64 sectorNum;     /* Disk sector number. */
  int64  sizeInBytes;   /* Requests size. */
  int  reqnum;	/* Sequence number */ 
  int64  retVal;	/* Return value */
  double aligner;
} NetDiskHdr;

#ifdef RMTACCESS
extern void CPUError(char* string, ...);
extern void CPUWarning( char *text,...);
#endif

#endif /* _RMTACCESS_H */