home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / NETBIOS.H < prev    next >
C/C++ Source or Header  |  1997-09-05  |  8KB  |  190 lines

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