home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / netio113.zip / netbios.h < prev    next >
C/C++ Source or Header  |  1997-08-09  |  4KB  |  132 lines

  1. /* netbios.h
  2.  * NetBIOS access library
  3.  *
  4.  * Author:  Kai Uwe Rommel <rommel@ars.de>
  5.  * Created: Tue Apr 02 1996
  6.  */
  7.  
  8. /* $Id: netbios.h,v 1.3 1997/08/09 16:38:55 rommel Exp rommel $ */
  9.  
  10. /*
  11.  * $Log: netbios.h,v $
  12.  * Revision 1.3  1997/08/09 16:38:55  rommel
  13.  * code simplification for different OS support
  14.  *
  15.  * Revision 1.2  1997/08/09 16:01:48  rommel
  16.  * added Win32 support
  17.  *
  18.  * Revision 1.1  1997/08/09 15:07:58  rommel
  19.  * Initial revision
  20.  * 
  21.  */
  22.  
  23. #ifndef _NETBIOS_H
  24. #define _NETBIOS_H
  25.  
  26. typedef unsigned char byte;
  27. typedef unsigned short int word;
  28. typedef unsigned long int dword;
  29.  
  30. #ifdef WIN32
  31.  
  32. #define NCB __NCB
  33. #define PNCB __PNCB
  34. #include <windows.h>
  35. #undef NCB
  36. #undef PNCB
  37.  
  38. union ncb_types;
  39. typedef HANDLE semaphore;
  40. typedef unsigned char *address;
  41. typedef union ncb_types NCB, *PNCB;
  42.  
  43. #else /* !WIN32 */
  44.  
  45. #ifndef OS2DEF_INCLUDED
  46. #include <os2def.h>
  47. #endif
  48.  
  49. union ncb_types;
  50. typedef unsigned long semaphore;
  51.  
  52. #ifdef __32BIT__
  53. typedef unsigned char * _Seg16 address;
  54. typedef union ncb_types NCB, *PNCB, * _Seg16 PNCB16;
  55. #else
  56. typedef unsigned char far * address;
  57. typedef union ncb_types NCB, *PNCB, _far * PNCB16;
  58. #endif
  59.  
  60. #endif /* WIN32 */
  61.  
  62. #include "netb_1_c.h"               /* NCB defines      */
  63. #include "netb_2_c.h"               /* NCB structures   */
  64.  
  65. union ncb_types
  66. {
  67.   struct fncb
  68.   {
  69.     struct network_control_block bncb;
  70.     semaphore ncb_semaphore;
  71.   }
  72.   basic_ncb;
  73.   struct ncb_chain_send send;
  74.   struct ncb_reset reset;
  75. };
  76. #define NCBSIZE sizeof(union ncb_types)
  77.  
  78. #define NETBIOS 0
  79. #define NETBEUI 1
  80. extern BOOL NetBIOS_API;
  81.  
  82. USHORT NetBIOS_Avail(VOID);
  83.        
  84. USHORT NCBConfig(PNCB Ncb, USHORT lana, 
  85.          PUSHORT sessions, PUSHORT commands, PUSHORT names);
  86. USHORT NCBReset(PNCB Ncb, USHORT lana, 
  87.         USHORT sessions, USHORT commands, USHORT names);
  88. USHORT NCBClose(PNCB Ncb, USHORT lana);
  89.        
  90. USHORT NCBAddGroupName(PNCB Ncb, USHORT lana, PBYTE name);
  91. USHORT NCBAddName(PNCB Ncb, USHORT lana, PBYTE name);
  92. USHORT NCBDeleteName(PNCB Ncb, USHORT lana, PBYTE lclname);
  93.        
  94. USHORT NCBCall(PNCB Ncb, USHORT lana, PBYTE lclname, PBYTE rmtname, 
  95.            USHORT recv_timeout, USHORT send_timeout, BOOL wait);
  96. USHORT NCBListen(PNCB Ncb, USHORT lana, PBYTE lclname, PBYTE rmtname, 
  97.          USHORT recv_timeout, USHORT send_timeout, BOOL wait);
  98.  
  99. USHORT NCBWait(PNCB Ncb, ULONG timeout);
  100.  
  101. USHORT NCBHangup(PNCB Ncb, USHORT lana, USHORT lsn);
  102. USHORT NCBCancel(PNCB Ncb, USHORT lana, PNCB NcbToCancel);
  103.        
  104. USHORT NCBSend(PNCB Ncb, USHORT lana, USHORT lsn, 
  105.            PBYTE message, USHORT length, BOOL wait);
  106. USHORT NCBSendBroadcast(PNCB Ncb, USHORT lana, USHORT lsn, 
  107.             PBYTE message, USHORT length, BOOL wait);
  108. USHORT NCBSendDatagram(PNCB Ncb, USHORT lana, USHORT lsn, 
  109.                PBYTE rmtname, PBYTE message, USHORT length, BOOL wait);
  110. USHORT NCBSendNoAck(PNCB Ncb, USHORT lana, USHORT lsn, 
  111.             PBYTE message, USHORT length, BOOL wait);
  112.        
  113. USHORT NCBChainSend(PNCB Ncb, USHORT lana, USHORT lsn, 
  114.             PBYTE message, USHORT length, 
  115.             PBYTE Buffer2, USHORT Length2, BOOL wait);
  116. USHORT NCBChainSendNoAck(PNCB Ncb, USHORT lana, USHORT lsn, 
  117.              PBYTE message, USHORT length, 
  118.              PBYTE Buffer2, USHORT Length2, BOOL wait);
  119.  
  120. USHORT NCBReceive(PNCB Ncb, USHORT lana, USHORT lsn, 
  121.           PBYTE buffer, USHORT length, BOOL wait);
  122. USHORT NCBReceiveAny(PNCB Ncb, USHORT lana, USHORT lsn, 
  123.              PBYTE buffer, USHORT length, BOOL wait);
  124. USHORT NCBReceiveBroadcast(PNCB Ncb, USHORT lana, USHORT lsn, 
  125.                PBYTE buffer, USHORT length, BOOL wait);
  126. USHORT NCBReceiveDatagram(PNCB Ncb, USHORT lana, USHORT lsn, 
  127.               PBYTE buffer, USHORT length, BOOL wait);
  128.  
  129. #endif /* _NETBIOS_H */
  130.  
  131. /* end of netbios.h */
  132.