home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / NMPIPE.ZIP / NMPIPE.H < prev    next >
Text File  |  1992-03-07  |  2KB  |  48 lines

  1. #define INCL_DOS
  2. #define INCL_DOSERRORS
  3. #define INCL_DOSSEMAPHORES
  4. #define INCL_DOSMISC
  5. #include <os2.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <malloc.h>
  9. #include <process.h>
  10. #include <string.h>
  11. //#include <netcons.h>
  12. //#include <access.h>      Uncomment if using lan apis to get workstation name
  13. //#include <wksta.h>
  14.  
  15. #define StackSize 4096
  16. #define PipeName "\\PIPE\\LANMON.DAT"
  17. #define SemName  "\\SEM32\\LANMON.SEM"
  18. #define Here ""
  19.  
  20. struct irec {
  21.        char computername[16];    // was CNLEN+1
  22.        ULONG counter;            /* collection counter  */
  23.        ULONG base;               /* collection base     */
  24.        ULONG Interval;           /* collection interval */
  25.        ULONG  current;           /* The change in counter value this time   */
  26.        ULONG  last ;             /* The counter value at last check         */
  27.        ULONG  last_msecs;        /* The millisecond value at our last check */
  28.        ULONG  current_msecs;     /* The millisec. value now.                */
  29.        ULONG  base_msecs;        /* The millisec. value during calibration  */
  30.        ULONG  delta_msec;        /* The number of millisecs between checks  */
  31.        HPIPE  ClientHandle;      // handle of pipe for this client, set by server
  32. //     struct stat_workstation_0 workstats; // lan api for requester stats
  33. //     struct stat_server_0  serverstats;   // lan api for server stats
  34.        } inforec;
  35.  
  36. typedef struct irec *PIREC;
  37.  
  38. #define Server_ReadSize sizeof(inforec)
  39. #define Server_WriteSize sizeof(inforec.Interval)
  40.  
  41. #define Client_ReadSize Server_WriteSize
  42. #define Client_WriteSize Server_ReadSize
  43. // wait for pipe available
  44. #define WaitForPipe 5000L
  45. #define PipeMsgHdr sizeof(USHORT)
  46. // initial calibration cycle time
  47. #define CalibrateTime   2000L
  48.