home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_02 / 2n02046a < prev    next >
Text File  |  1990-12-30  |  3KB  |  91 lines

  1.  
  2. #define  RECEIVE_TIMEOUT    0    /* no timeout */
  3. #define  SEND_TIMEOUT       0 
  4.  
  5. /* flags included for clarity */ 
  6. #define  CLIENT    0 
  7. #define  SERVER    1 
  8. #define  FIRST     0 
  9. #define  NEXT      1 
  10.  
  11. /* NetBIOS commands */ 
  12. #define  NCB_ADD_GROUP_NAME                  0x36 
  13. #define  NCB_ADD_NAME                        0x30 
  14. #define  NCB_CALL                            0x10 
  15. #define  NCB_CANCEL                          0x35 
  16. #define  NCB_CHAIN_SEND                      0x17 
  17. #define  NCB_CHAIN_SEND_NO_ACK               0x72 
  18. #define  NCB_DELETE_NAME                     0x31 
  19. #define  NCB_FIND_NAME                       0x78 
  20. #define  NCB_HANG_UP                         0x12 
  21. #define  NCB_LAN_STATUS_ALERT                0xF3 
  22. #define  NCB_LISTEN                          0x11 
  23. #define  NCB_RECEIVE                         0x15 
  24. #define  NCB_RECEIVE_ANY                     0x16 
  25. #define  NCB_RECEIVE_BROADCAST_DATAGRAM      0x23 
  26. #define  NCB_RECEIVE_DATAGRAM                0x21 
  27. #define  NCB_RESET                           0x32 
  28. #define  NCB_SEND                            0x14 
  29. #define  NCB_SEND_BROADCAST_DATAGRAM         0x22 
  30. #define  NCB_SEND_DATAGRAM                   0x20 
  31. #define  NCB_SEND_NO_ACK                     0x71 
  32. #define  NCB_SESSION_STATUS                  0x34 
  33. #define  NCB_STATUS                          0x33 
  34. #define  NCB_TRACE                           0x79 
  35. #define  NCB_UNLINK                          0x70 
  36.  
  37. /* NetBIOS command flags */ 
  38. #define  WAIT             0x00 
  39. #define  NO_WAIT          0x80 
  40.  
  41. /* NetBIOS return values */ 
  42. #define  NO_NETBIOS       0x00 
  43. #define  INVALID_NAME     0xFF 
  44.  
  45. struct  net_control_block 
  46. char    command; 
  47. char    retcode; 
  48. char    lsn;       /* logical session number */ 
  49. char    number;    /* application name table entry */ 
  50. char    *buffer; 
  51. unsigned int    length;   /* buffer length */ 
  52. char    r_name[16]; 
  53. char    l_name[16]; 
  54. char    rto;       /* receive time out */ 
  55. char    sto;       /* send time out */ 
  56. void    *post;     /* post routine location */ 
  57. char    adapter;   /* adapter number */ 
  58. char    complete; 
  59. char    reserved[14]; 
  60. }; 
  61.  
  62. struct   session_status 
  63. char      number;            /* name table entry */ 
  64. char      number_of_sessions; 
  65. char      outstanding_receive_datagram; 
  66. struct 
  67.       char     session_number; 
  68.       char     state; 
  69.       char     l_name[16]; 
  70.       char     r_name[16]; 
  71.       char     outstanding_receive; 
  72.       char     outstanding_send; 
  73. } session; 
  74. }; 
  75.  
  76. /* function prototypes */ 
  77. void init_ncb(struct net_control_block *ncb); 
  78. void int_netbios(struct net_control_block *ncb); 
  79. unsigned int init_netbios(char *name); 
  80. unsigned int shutdown_netbios(char *name); 
  81. int dg_write(unsigned int number, char *destination, 
  82.              char *buffer, int length); 
  83. int dg_read(unsigned int number, char *from, 
  84.             char *buffer, int length); 
  85. int max_dg(); 
  86.  
  87.  
  88.