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

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