home *** CD-ROM | disk | FTP | other *** search
/ Troubleshooting Netware Systems / CSTRIAL0196.BIN / attach / pcc / v08n03 / netwrk.exe / DOSRIFS.ZIP / RIFSSRC.ZIP / IFS.H < prev    next >
C/C++ Source or Header  |  1994-10-08  |  5KB  |  191 lines

  1. #ifndef ifs_h
  2. #define ifs_h
  3.  
  4. #define IFSBAUD 19200
  5.  
  6. /* typedef enum { FALSE, TRUE } BOOL; */
  7.  
  8. #define NETWORK    (1U << 15)
  9. #define PHYSICAL   (1U << 14)
  10. #define JOIN       (1U << 13)
  11. #define SUBST      (1U << 12)
  12.  
  13. #define BYTE  unsigned char
  14. #define WORD  unsigned
  15. #define DWORD unsigned long
  16.  
  17. typedef struct {
  18.   BYTE    cwd[67];
  19.   WORD    flags;
  20.   void   *DBP;
  21.   DWORD   redirifs;
  22.   WORD    junk1;
  23.   WORD    bs;       /* pos of root backslash (normally 2) */
  24. } CDS;
  25.  
  26. typedef struct {
  27.   BYTE  srchattr;     /* attribute to search for    */
  28.   BYTE  drive;        /* drive number (0..31)??     */
  29.   BYTE  fcbname[11];  /* name in FCB format         */
  30.   BYTE  unused[8];    /* used by DOS (not us!)      */
  31.   BYTE  mtchattr;     /* attribute of file          */
  32.   WORD  ftime;        /* DOS packed time file       */
  33.   WORD  fdate;        /* DOS packed date of file    */
  34.   DWORD fsize;        /* size of file               */
  35.   BYTE  mtchname[13]; /* ASCIIZ name of file found  */
  36. } DTA;
  37.  
  38. typedef struct {
  39.   BYTE  drive;        /* drive letter?     */
  40.   BYTE  srchtmpl[11]; /* search template   */
  41.   BYTE  srchattr;     /* search attribute  */
  42.   WORD  direntry;     /* directory entry # */
  43.   WORD  par_clstr;    /* ???               */
  44.   BYTE  unused[4];    /* garbage bytes     */
  45. } SDB;
  46.  
  47. typedef struct {
  48.   char  fname[11];
  49.   BYTE  attr;
  50.   char  junk[10];
  51.   WORD  ftime;
  52.   WORD  fdate;
  53.   WORD  cluster;
  54.   DWORD size;
  55. } DIR;
  56.  
  57. typedef struct {
  58.   WORD  handlect,
  59.         open_mode;
  60.   BYTE  attr;
  61.   WORD  dev_info;
  62.   void *devdrv_ptr;
  63.   WORD  start_clstr,    /* not used by me */
  64.         ftime,
  65.         fdate;
  66.   DWORD fsize,
  67.         fpos;
  68.   WORD  rel_lastclu,    /* not used by me */
  69.         abs_lastclu,    /* not used by me */
  70.         dir_sector;     /* not used by me */
  71.   BYTE  dir_entryno;    /* not used by me */
  72.   BYTE  fcb_name[11];
  73. } SFT;
  74.  
  75. typedef struct tagSYS_FTAB {
  76.   struct tagSYS_FTAB *next;
  77.   WORD num_files;
  78.   BYTE files[];
  79. } SYS_FTAB;
  80.  
  81. typedef struct {
  82.   BYTE type;
  83.   WORD owner;
  84.   WORD size;
  85.   BYTE stuff[11];
  86. } MCB;
  87.  
  88. typedef struct {
  89.   WORD mcode;
  90.   WORD mem_top;
  91.   BYTE junk1;
  92.   BYTE longcall[5];
  93.   DWORD int22;
  94.   DWORD int23;
  95.   DWORD int24;
  96.   WORD  parent;
  97.   BYTE  handles[20];
  98.   WORD  env;
  99.   DWORD stack;
  100.   WORD  handlesize;
  101.   DWORD handlepos;
  102. } PSP;
  103.  
  104. /*
  105.   length includes length of header block
  106. */
  107. typedef struct {
  108.   BYTE  packetID[2];  /* ................................... */
  109.   WORD  length;       /* total number of bytes in this block */
  110.   WORD  notlength;    /* ~ length (used for checking)        */
  111.   WORD  cmd;          /* command to execute / result         */
  112.   WORD  sender_id;    /* machine ID of block sender          */
  113.   WORD  address_id;   /* machine ID of intended reciever     */
  114.   WORD  process_id;   /* ID of sending process (for closeall)*/
  115.   DWORD crc32;        /* crc-32 of entire block              */
  116.   BYTE  data[];       /* misc. data                          */
  117. } XMITBUF;
  118.  
  119. /*
  120.   known commands
  121.   note:
  122.     open / create --> (map to) extopen
  123. */
  124. enum {
  125.   IFS_RMDIR,
  126.   IFS_MKDIR,
  127.   IFS_CHDIR,
  128.   IFS_CLOSEFILE,
  129.   IFS_COMMITFILE,
  130.   IFS_READFILE,
  131.   IFS_WRITEFILE,
  132.   IFS_LOCKFILE,
  133.   IFS_UNLOCKFILE,
  134.   IFS_GETSPACE,
  135.   IFS_SETATTR,
  136.   IFS_GETATTR,
  137.   IFS_RENAMEFILE,
  138.   IFS_DELETEFILE,
  139.   IFS_OPENFILE,
  140.   IFS_CREATEFILE,
  141.   IFS_FINDFIRST,
  142.   IFS_FINDNEXT,
  143.   IFS_CLOSEALL,
  144.   IFS_EXTOPEN,
  145.   IFS_PORTOUT,
  146.   IFS_ENDOFLIST
  147. };
  148.  
  149. typedef struct {
  150.   DWORD lenfail;  /* number of length mismatch failures */
  151.   DWORD crcfail;  /* number of CRC mismatch failures    */
  152.   DWORD valid;    /* number of valid bytes recieved     */
  153.   DWORD timeout;  /* number of timeouts                 */
  154.   DWORD totalrcvd;/* number of bytes received           */
  155.   DWORD totalsent;/* number of bytes sent               */
  156.   WORD  stackused;/* number of bytes of local stack used*/
  157.   DWORD inserver; /* number of calls to server          */
  158.   unsigned char *openhandle; /* pointer to open files handles   */
  159.   unsigned *openpsp;    /* pointer to open files psp       */
  160. } IFS_STAT;
  161.  
  162. /*
  163.   this is how the registers are accessed on entry
  164. */
  165. typedef struct {
  166.   WORD bp,
  167.        es,
  168.        ds,
  169.        di,
  170.        si,
  171.        dx,
  172.        cx,
  173.        bx,
  174.        ax,
  175.        ip,
  176.        cs,
  177.        flags,
  178.        wparam;      /* extra parameter word */
  179. } INTREGS;
  180.  
  181. /*
  182.   most programs do block reads/writes in multiples of 512, 1024, 2048, etc.
  183.   so this minimizes the number of partial block sent.
  184.   the extra 8 bytes are for header info.
  185.   the actual block size is BLOCKSIZE + sizeof(XMITBUF)
  186. */
  187. #define BLOCKSIZE 1032
  188. #define MAXOPEN 20
  189.  
  190. #endif
  191.