home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lansystk.zip / INCLUDE / LANSERV / CHARDEV.H < prev    next >
C/C++ Source or Header  |  1998-05-08  |  14KB  |  348 lines

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*              IBM OS/2(tm) Local Area Network (LAN) Server              */
  4. /*                            Version 4.0                                 */
  5. /*                   (C) Copyright IBM Corp. 1988, 1994                   */
  6. /*                  Licensed Materials - Property of IBM                  */
  7. /*                            52G8468, 52G8475                            */
  8. /*                                                                        */
  9. /**************************************************************************/
  10. /********************************************************************/
  11.  
  12. /********************************************************************
  13.  *                                                                  * 
  14.  *  About this file ...  CHARDEV.H                                  *
  15.  *                                                                  * 
  16.  *  This file contains information about the NetCharDev             *
  17.  *  and NetHandle class APIs.                                       *
  18.  *                                                                  * 
  19.  *      Function prototypes.                                        *
  20.  *                                                                  * 
  21.  *      Data structure templates.                                   *
  22.  *                                                                  * 
  23.  *      Definition of special values.                               *
  24.  *                                                                  *
  25.  *                                                                  *
  26.  *  NOTE:  You must include NETCONS.H before this file, since this  *
  27.  *         file depends on values defined in NETCONS.H.             *
  28.  *                                                                  * 
  29.  *         This file is always included by LAN.H.                   *
  30.  *                                                                  * 
  31.  ********************************************************************/
  32.  
  33.  
  34. #ifdef ANY_32_BIT
  35. #pragma pack(1)
  36. #endif
  37.  
  38.  
  39.  
  40. /****************************************************************
  41.  *                                *
  42.  *          Character Device Class                    *
  43.  *                                *
  44.  ****************************************************************/
  45.  
  46. #if (defined( INCL_NETCHARDEV ) || !defined( LAN_INCLUDED )) \
  47.     && !defined( NETCHARDEV_INCLUDED )
  48.  
  49. #define NETCHARDEV_INCLUDED
  50.  
  51.  
  52. /****************************************************************
  53.  *                                                              *
  54.  *              Function prototypes - CHARDEV                   *
  55.  *                                                              *
  56.  ****************************************************************/
  57.  
  58. extern API_FUNCTION
  59.   NetCharDevControl ( const unsigned char LSFAR * pszServer,
  60.                       const unsigned char LSFAR * pszDevName,
  61.                       short                       sOpCode );
  62.  
  63. extern API_FUNCTION
  64.   NetCharDevEnum ( const unsigned char LSFAR *     pszServer,
  65.                    short                           sLevel,
  66.                    unsigned char LSFAR *           pbBuffer,
  67.                    unsigned short                  cbBuffer,
  68.                    unsigned short LSFAR *          pcEntriesRead,
  69.                    unsigned short LSFAR *          pcTotalAvail );
  70.  
  71. extern API_FUNCTION
  72.   NetCharDevGetInfo ( const unsigned char LSFAR *     pszServer,
  73.                       const unsigned char LSFAR *     pszDevName,
  74.                       short                           sLevel,
  75.                       unsigned char LSFAR *           pbBuffer,
  76.                       unsigned short                  cbBuffer,
  77.                       unsigned short LSFAR *          pcbTotalAvail );
  78.  
  79. extern API_FUNCTION
  80.   NetCharDevQEnum ( const unsigned char LSFAR *     pszServer,
  81.                     const unsigned char LSFAR *     pszUserName,
  82.                     short                           sLevel,
  83.                     unsigned char LSFAR *           pbBuffer,
  84.                     unsigned short                  cbBuffer,
  85.                     unsigned short LSFAR *          pcEntriesRead,
  86.                     unsigned short LSFAR *          pcTotalAvail );
  87.  
  88. extern API_FUNCTION
  89.   NetCharDevQGetInfo ( const unsigned char LSFAR *     pszServer,
  90.                        const unsigned char LSFAR *     pszQueueName,
  91.                        const unsigned char LSFAR *     pszUserName,
  92.                        short                           sLevel,
  93.                        unsigned char LSFAR *           pbBuffer,
  94.                        unsigned short                  cbBuffer,
  95.                        unsigned short LSFAR *          pcbTotalAvail );
  96.  
  97. extern API_FUNCTION
  98.   NetCharDevQSetInfo ( const unsigned char LSFAR * pszServer,
  99.                        const unsigned char LSFAR * pszQueueName,
  100.                        short                       sLevel,
  101.                        const unsigned char LSFAR * pbBuffer,
  102.                        unsigned short              cbBuffer,
  103.                        short                       sParmNum );
  104.  
  105. extern API_FUNCTION
  106.   NetCharDevQPurge ( const unsigned char LSFAR * pszServer,
  107.                      const unsigned char LSFAR * pszQueueName );
  108.  
  109. extern API_FUNCTION
  110.   NetCharDevQPurgeSelf ( const unsigned char LSFAR * pszServer,
  111.                          const unsigned char LSFAR * pszQueueName,
  112.                          const unsigned char LSFAR * pszComputerName );
  113.  
  114. /****************************************************************
  115.  *                                *
  116.  *          Data structure templates - CHARDEV        *
  117.  *                                *
  118.  ****************************************************************/
  119.  
  120. struct chardev_info_0 {
  121.     unsigned char       ch0_dev[DEVLEN+1];  /* device name                */
  122. };    /* chardev_info_0 */
  123.  
  124. struct chardev_info_1 {
  125.     unsigned char  ch1_dev[DEVLEN+1]; /* device name                */
  126.     unsigned char  ch1_pad1;          /* pad to a word boundary            */
  127.     unsigned short ch1_status;        /* status                             */
  128.                       /*   bit 0 reserved            */
  129.                                       /*   bit 1 on = opened                */
  130.                       /*   bit 1 off = idle            */
  131.                       /*   bit 2 on = error            */
  132.                       /*   bit 2 off = no error         */
  133.     unsigned char  ch1_username[UNLEN+1]; /* name of device's current user  */
  134.     unsigned char  ch1_pad2;          /* pad to a word boundary            */
  135.     unsigned long  ch1_time;          /* time current user attached         */
  136. }; /* chardev_info_1 */
  137.  
  138.  
  139. struct chardevQ_info_0 {
  140.     unsigned char       cq0_dev[NNLEN+1];   /* queue name (network name)        */
  141. }; /* chardevQ_info_0 */
  142.  
  143. struct chardevQ_info_1 {
  144.     unsigned char               cq1_dev[NNLEN+1];  /* queue name (network name)     */
  145.     unsigned char               cq1_pad;           /* pad to a word boundary      */
  146.     unsigned short              cq1_priority;      /* priority (1 - 9)             */
  147.     unsigned char LSFAR * LSPTR cq1_devs;          /* names of devices assigned to queue */
  148.     unsigned short              cq1_numusers;      /* # of users waiting in queue        */
  149.     unsigned short              cq1_numahead;      /* # of users in queue ahead of this  */
  150.                                                    /*     user. -1 is returned if the    */
  151.                                                    /*     user is not in the queue.      */
  152. }; /* chardevQ_info_1 */
  153.  
  154.  
  155. /* -------------------- Begin F2359 --------------------- */
  156.  
  157. #ifdef PURE_32
  158. /****************************************************************
  159.  *                                                              *
  160.  *              Function prototypes - CHARDEV                   *
  161.  *                                                              *
  162.  ****************************************************************/
  163.  
  164. extern API32_FUNCTION
  165. Net32CharDevControl ( const unsigned char * pszServer,
  166.                       const unsigned char * pszDevName,
  167.                       unsigned long         ulOpCode );   /*was signed short*/
  168.  
  169. extern API32_FUNCTION
  170. Net32CharDevEnum ( const unsigned char * pszServer,
  171.                    unsigned long         ulLevel,         /*was signed short*/
  172.                    unsigned char       * pbBuffer,
  173.                    unsigned long         ulBuffer,        /*was USHORT*/
  174.                    unsigned long       * pulEntriesRead,  /*was USHORT*/
  175.                    unsigned long       * pulTotalAvail ); /*was USHORT*/
  176.  
  177. extern API32_FUNCTION
  178. Net32CharDevGetInfo ( const unsigned char * pszServer,
  179.                       const unsigned char * pszDevName,
  180.                       unsigned long         ulLevel,        /*was signed short*/
  181.                       unsigned char       * pbBuffer,
  182.                       unsigned long         ulBuffer,        /*was USHORT*/
  183.                       unsigned long       * pulTotalAvail ); /*was USHORT*/
  184.  
  185. extern API32_FUNCTION
  186. Net32CharDevQEnum ( const unsigned char * pszServer,
  187.                     const unsigned char * pszUserName,
  188.                     unsigned long         ulLevel,          /*was signed short*/
  189.                     unsigned char       * pbBuffer,
  190.                     unsigned long         ulBuffer,          /*was USHORT*/
  191.                     unsigned long       * pulEntriesRead,    /*was USHORT*/
  192.                     unsigned long       * pulTotalAvail );   /*was USHORT*/
  193.  
  194. extern API32_FUNCTION
  195. Net32CharDevQGetInfo ( const unsigned char * pszServer,
  196.                        const unsigned char * pszQueueName,
  197.                        const unsigned char * pszUserName,
  198.                        unsigned long         ulLevel,       /*was signed short*/
  199.                        unsigned char       * pbBuffer,
  200.                        unsigned long         ulBuffer,       /*was USHORT*/
  201.                        unsigned long       * pulTotalAvail); /*was USHORT*/
  202.  
  203. extern API32_FUNCTION
  204. Net32CharDevQSetInfo ( const unsigned char * pszServer,
  205.                        const unsigned char * pszQueueName,
  206.                        unsigned long         ulLevel,     /*was signed short*/
  207.                        const unsigned char * pbBuffer,
  208.                        unsigned long         ulBuffer,    /*was USHORT*/
  209.                        unsigned long         ulParmNum ); /*was signed short*/
  210.  
  211. extern API32_FUNCTION
  212. Net32CharDevQPurge ( const unsigned char * pszServer,
  213.                      const unsigned char * pszQueueName );
  214.  
  215. extern API32_FUNCTION
  216. Net32CharDevQPurgeSelf ( const unsigned char * pszServer,
  217.                          const unsigned char * pszQueueName,
  218.                          const unsigned char * pszComputerName );
  219. #endif /* PURE_32 */
  220.  
  221. /* --------------------  End  F2359 --------------------- */
  222.  
  223.   
  224. /****************************************************************
  225.  *                                *
  226.  *          Special values and constants - CHARDEV        *
  227.  *                                *
  228.  ****************************************************************/
  229.  
  230. /*
  231.  *    Bits for chardev_info_1 field ch1_status.
  232.  */
  233.  
  234. #define CHARDEV_STAT_OPENED        0x02
  235. #define CHARDEV_STAT_ERROR        0x04
  236.  
  237. /*
  238.  *    Opcodes for NetCharDevControl
  239.  */
  240.  
  241. #define CHARDEV_CLOSE            0
  242.  
  243. /*
  244.  *    Values for parmnum parameter to NetCharDevQSetInfo.
  245.  */
  246.  
  247. #define CHARDEVQ_PRIORITY_PARMNUM    2
  248. #define CHARDEVQ_DEVICES_PARMNUM    3
  249.  
  250.  
  251. /*
  252.  *    Minimum, maximum, and recommended default for priority.
  253.  */
  254.  
  255. #define CHARDEVQ_MAX_PRIORITY        1
  256. #define CHARDEVQ_MIN_PRIORITY        9
  257. #define CHARDEVQ_DEF_PRIORITY        5
  258.  
  259. /*
  260.  *    Value indicating no requests in the queue.
  261.  */
  262.  
  263. #define CHARDEVQ_NO_REQUESTS        -1
  264.  
  265.  
  266. #endif /* NETCHARDEV_INCLUDED */
  267.  
  268. /****************************************************************
  269.  *                                *
  270.  *          Handle Class                    *
  271.  *                                *
  272.  ****************************************************************/
  273.  
  274. #if (defined( INCL_NETHANDLE ) || !defined( LAN_INCLUDED )) \
  275.     && !defined( NETHANDLE_INCLUDED )
  276.  
  277. #define NETHANDLE_INCLUDED
  278.  
  279.  
  280. /****************************************************************
  281.  *                                                              *
  282.  *              Function prototypes - HANDLE                    *
  283.  *                                                              *
  284.  ****************************************************************/
  285.  
  286. extern API_FUNCTION
  287.   NetHandleGetInfo ( unsigned short         hHandle,
  288.                      short                  sLevel,
  289.                      unsigned char LSFAR *           pbBuffer,
  290.                      unsigned short         cbBuffer,
  291.                      unsigned short LSFAR * pcbTotalAvail );
  292.  
  293. extern API_FUNCTION
  294.   NetHandleSetInfo ( unsigned short hHandle,
  295.                      short          sLevel,
  296.                      unsigned char LSFAR *   pbBuffer,
  297.                      unsigned short cbBuffer,
  298.                      unsigned short sParmNum );
  299.  
  300.  
  301. /****************************************************************
  302.  *                                *
  303.  *          Data structure templates - HANDLE        *
  304.  *                                *
  305.  ****************************************************************/
  306.  
  307. struct handle_info_1 {
  308.     unsigned long    hdli1_chartime;    /* time in msec to wait before send */
  309.     unsigned short    hdli1_charcount; /* max size of send buffer */
  310. }; /* handle_info_1 */
  311.  
  312. struct handle_info_2 {
  313.       unsigned char LSFAR * LSPTR hdli2_username;  /* owner of name-pipe handle */
  314. }; /* handle_info_2 */
  315.  
  316.  
  317. /****************************************************************
  318.  *                                *
  319.  *          Special values and constants - HANDLE        *
  320.  *                                *
  321.  ****************************************************************/
  322.  
  323.  
  324. /*
  325.  *    Handle Get Info Levels
  326.  */
  327.  
  328. #define HANDLE_INFO_LEVEL_1        1
  329. #define    HANDLE_INFO_LEVEL_2        2
  330.  
  331.  
  332. /*
  333.  *    Handle Set Info    parm numbers
  334.  */
  335.  
  336. #define    HANDLE_SET_CHAR_TIME        1
  337. #define    HANDLE_SET_CHAR_COUNT        2
  338.  
  339.  
  340. #endif /* NETHANDLE_INCLUDED */
  341.  
  342.  
  343.  
  344. #ifdef ANY_32_BIT
  345. #pragma pack()
  346. #endif
  347.  
  348.