home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / netbios.h < prev    next >
C/C++ Source or Header  |  1999-04-29  |  8KB  |  192 lines

  1. /**************************************************************************/
  2. /*                                                                        */
  3. /*              IBM OS/2(tm) Local Area Network (LAN) Server              */
  4. /*                            Version 5.03                                */
  5. /*                   (C) Copyright IBM Corp. 1988, 1998                   */
  6. /*                  Licensed Materials - Property of IBM                  */
  7. /*                                                                        */
  8. /**************************************************************************/
  9. /********************************************************************/
  10.  
  11. /********************************************************************
  12.  *                                                                  *
  13.  *  About this file ...  NETBIOS.H                                  *
  14.  *                                                                  *
  15.  *  This file contains information about the NetBios APIs.          *
  16.  *                                                                  *
  17.  *      Function prototypes.                                        *
  18.  *                                                                  *
  19.  *      Data structure templates.                                   *
  20.  *                                                                  *
  21.  *      Definition of special values.                               *
  22.  *                                                                  *
  23.  *                                                                  *
  24.  *  NOTE:  You must include NETCONS.H before this file, since this  *
  25.  *         file depends on values defined in NETCONS.H.             *
  26.  *                                                                  *
  27.  ********************************************************************/
  28.  
  29.  
  30.  
  31. #ifndef NETBIOS_INCLUDED
  32.  
  33. #define NETBIOS_INCLUDED
  34.  
  35. #ifdef  ANY_32_BIT
  36. #pragma pack(1)
  37. #endif
  38.  
  39.  
  40. /****************************************************************
  41.  *                                                              *
  42.  *               Function prototypes - NetBios                  *
  43.  *                                                              *
  44.  ****************************************************************/
  45.  
  46.  
  47. extern API_FUNCTION
  48.   NetBiosOpen ( unsigned char LSFAR *  pszDevName,
  49.                 unsigned char LSFAR *  pszReserved,
  50.                 unsigned short         usOpenOpt,
  51.                 unsigned short LSFAR * phDevName );
  52.  
  53. extern API_FUNCTION
  54.   NetBiosClose ( unsigned short hDevName,
  55.                  unsigned short usReserved );
  56.  
  57. extern API_FUNCTION
  58.   NetBiosEnum ( const unsigned char LSFAR * pszServer,
  59.                 short                       sLevel,
  60.                 unsigned char LSFAR       * pbBuffer,
  61.                 unsigned short              cbBuffer,
  62.                 unsigned short LSFAR      * pcEntriesRead,
  63.                 unsigned short LSFAR      * pcTotalAvail );
  64.  
  65. extern API_FUNCTION
  66.   NetBiosGetInfo ( const unsigned char LSFAR *  pszServer,
  67.                    const unsigned char LSFAR *  pszNetBiosName,
  68.                    short                        sLevel,
  69.                    unsigned char LSFAR       *  pbBuffer,
  70.                    unsigned short               cbBuffer,
  71.                    unsigned short LSFAR       * pcbTotalAvail );
  72.  
  73. extern API_FUNCTION
  74.   NetBiosSubmit ( unsigned short     hDevName,
  75.                   unsigned short     usNcbOpt,
  76.                   struct ncb LSFAR * pNCB );
  77.  
  78.  
  79.  
  80. /****************************************************************
  81.  *                                                              *
  82.  *              Data structure templates                        *
  83.  *                                                              *
  84.  ****************************************************************/
  85.  
  86.  
  87. struct netbios_info_0 {
  88.     unsigned char  nb0_net_name[NETBIOS_NAME_LEN+1];
  89. };      /* netbios_info_0 */
  90.  
  91. struct netbios_info_1 {
  92.     unsigned char  nb1_net_name[NETBIOS_NAME_LEN+1];
  93.     unsigned char  nb1_driver_name[DEVLEN+1];/* OS/2 device driver name        */
  94.     unsigned char  nb1_lana_num;             /* LAN adapter number of this net */
  95.     unsigned char  nb1_pad_1;
  96.     unsigned short nb1_driver_type;
  97.     unsigned short nb1_net_status;
  98.     unsigned long  nb1_net_bandwidth;     /* Network bandwidth, bits/second */
  99.     unsigned short nb1_max_sess;          /* Max number of sessions         */
  100.     unsigned short nb1_max_ncbs;          /* Max number of outstanding NCBs */
  101.     unsigned short nb1_max_names;         /* Max number of names            */
  102. };      /* netbios_info_1 */
  103.  
  104.  
  105.  
  106. #ifdef PURE_32
  107. /****************************************************************
  108.  *                                                              *
  109.  *               Function prototypes - NetBios                  *
  110.  *                                                              *
  111.  ****************************************************************/
  112.  
  113. extern API32_FUNCTION
  114. NetBios32Open ( unsigned char  * pszDevName,
  115.                 unsigned char  * pszReserved,
  116.                 unsigned long    ulOpenOpt,       /* was USHORT*/
  117.                 unsigned long  * phDevName );     /* was PUSHORT*/
  118.  
  119. extern API32_FUNCTION
  120. NetBios32Close ( unsigned long  hDevName,         /* was USHORT*/
  121.                  unsigned long  ulReserved );     /* was USHORT*/
  122.  
  123. extern API32_FUNCTION
  124. NetBios32Enum ( const unsigned char    * pszServer,
  125.                 unsigned long    ulLevel,          /* was signed short*/
  126.                 unsigned char  * pbBuffer,
  127.                 unsigned long    ulBuffer,         /* was USHORT*/
  128.                 unsigned long  * pulEntriesRead,   /* was PUSHORT*/
  129.                 unsigned long  * pulTotalAvail );  /* was PUSHORT*/
  130.  
  131. extern API32_FUNCTION
  132. NetBios32GetInfo ( const unsigned char    * pszServer,
  133.                    const unsigned char    * pszNetBiosName,
  134.                    unsigned long    ulLevel,          /* was signed short*/
  135.                    unsigned char  * pbBuffer,
  136.                    unsigned long    ulBuffer,         /* was USHORT*/
  137.                    unsigned long  * pulTotalAvail );  /* was PUSHORT*/
  138.  
  139. extern API32_FUNCTION
  140. NetBios32Submit ( unsigned long    hDevName,          /* was USHORT*/
  141.                   unsigned long    ulNcbOpt,          /* was USHORT*/
  142.                   struct ncb     * pNCB );
  143. #endif /* PURE_32 */
  144.  
  145.  
  146. /****************************************************************
  147.  *                                                              *
  148.  *              Special values and constants                    *
  149.  *                                                              *
  150.  ****************************************************************/
  151.  
  152.  
  153. /*
  154.  *      Driver types (nb1_driver_type).
  155.  */
  156.  
  157. #define NB_TYPE_NCB     1
  158. #define NB_TYPE_MCB     2
  159.  
  160. /*
  161.  *      Bits defined in nb1_net_status.
  162.  */
  163.  
  164. #define NB_LAN_FLAGS_MASK       0x3FFF  /* Mask for LAN Flags */
  165. #define NB_LAN_MANAGED          0x0001  /* LAN is managed by redirector */
  166. #define NB_LAN_LOOPBACK         0x0002  /* LAN is a loopback driver */
  167. #define NB_LAN_SENDNOACK        0x0004  /* LAN allows SendNoAck NCBs */
  168. #define NB_LAN_LMEXT            0x0008  /* LAN supports LAN Manager extended NCBs */
  169. #define NB_LAN_INTNCB           0x0010  /* LAN allows NCB submission at */
  170.                                         /* interrupt time (from NCBDone) */
  171. #define NB_LAN_NORESET          0x0040  /*  @p01a  */
  172.  
  173. #define NB_OPEN_MODE_MASK       0xC000  /* Mask for NetBios Open Modes */
  174. #define NB_OPEN_REGULAR         0x4000  /* NetBios opened in Regular mode */
  175. #define NB_OPEN_PRIVILEGED      0x8000  /* NetBios opened in Privileged mode */
  176. #define NB_OPEN_EXCLUSIVE       0xC000  /* NetBios opened in Exclusive mode */
  177.  
  178. /*
  179.  *      Open modes for NetBiosOpen.
  180.  */
  181.  
  182. #define NB_REGULAR      1
  183. #define NB_PRIVILEGED   2
  184. #define NB_EXCLUSIVE    3
  185.  
  186.  
  187. #ifdef ANY_32_BIT
  188. #pragma pack()
  189. #endif
  190.  
  191. #endif /* NETBIOS_INCLUDED */
  192.