| 1 | #ifndef _NB30_H | 
 
 
 
 
 | 2 | #define _NB30_H | 
 
 
 
 
 | 3 | #if __GNUC__ >=3 | 
 
 
 
 
 | 4 | #pragma GCC system_header | 
 
 
 
 
 | 5 | #endif | 
 
 
 
 
 | 6 |  | 
 
 
 
 
 | 7 | #ifdef __cplusplus | 
 
 
 
 
 | 8 | extern "C" { | 
 
 
 
 
 | 9 | #endif | 
 
 
 
 
 | 10 | #define NCBNAMSZ 16 | 
 
 
 
 
 | 11 | #define MAX_LANA 254 | 
 
 
 
 
 | 12 | #define NAME_FLAGS_MASK 0x87 | 
 
 
 
 
 | 13 | #define GROUP_NAME 0x80 | 
 
 
 
 
 | 14 | #define UNIQUE_NAME 0x00 | 
 
 
 
 
 | 15 | #define REGISTERING 0x00 | 
 
 
 
 
 | 16 | #define REGISTERED 0x04 | 
 
 
 
 
 | 17 | #define DEREGISTERED 0x05 | 
 
 
 
 
 | 18 | #define DUPLICATE 0x06 | 
 
 
 
 
 | 19 | #define DUPLICATE_DEREG 0x07 | 
 
 
 
 
 | 20 | #define LISTEN_OUTSTANDING 0x01 | 
 
 
 
 
 | 21 | #define CALL_PENDING 0x02 | 
 
 
 
 
 | 22 | #define SESSION_ESTABLISHED 0x03 | 
 
 
 
 
 | 23 | #define HANGUP_PENDING 0x04 | 
 
 
 
 
 | 24 | #define HANGUP_COMPLETE 0x05 | 
 
 
 
 
 | 25 | #define SESSION_ABORTED 0x06 | 
 
 
 
 
 | 26 | #define ALL_TRANSPORTS "M\0\0\0" | 
 
 
 
 
 | 27 | #define MS_NBF "MNBF" | 
 
 
 
 
 | 28 | #define NCBCALL 0x10 | 
 
 
 
 
 | 29 | #define NCBLISTEN 0x11 | 
 
 
 
 
 | 30 | #define NCBHANGUP 0x12 | 
 
 
 
 
 | 31 | #define NCBSEND 0x14 | 
 
 
 
 
 | 32 | #define NCBRECV 0x15 | 
 
 
 
 
 | 33 | #define NCBRECVANY 0x16 | 
 
 
 
 
 | 34 | #define NCBCHAINSEND 0x17 | 
 
 
 
 
 | 35 | #define NCBDGSEND 0x20 | 
 
 
 
 
 | 36 | #define NCBDGRECV 0x21 | 
 
 
 
 
 | 37 | #define NCBDGSENDBC 0x22 | 
 
 
 
 
 | 38 | #define NCBDGRECVBC 0x23 | 
 
 
 
 
 | 39 | #define NCBADDNAME 0x30 | 
 
 
 
 
 | 40 | #define NCBDELNAME 0x31 | 
 
 
 
 
 | 41 | #define NCBRESET 0x32 | 
 
 
 
 
 | 42 | #define NCBASTAT 0x33 | 
 
 
 
 
 | 43 | #define NCBSSTAT 0x34 | 
 
 
 
 
 | 44 | #define NCBCANCEL 0x35 | 
 
 
 
 
 | 45 | #define NCBADDGRNAME 0x36 | 
 
 
 
 
 | 46 | #define NCBENUM 0x37 | 
 
 
 
 
 | 47 | #define NCBUNLINK 0x70 | 
 
 
 
 
 | 48 | #define NCBSENDNA 0x71 | 
 
 
 
 
 | 49 | #define NCBCHAINSENDNA 0x72 | 
 
 
 
 
 | 50 | #define NCBLANSTALERT 0x73 | 
 
 
 
 
 | 51 | #define NCBACTION 0x77 | 
 
 
 
 
 | 52 | #define NCBFINDNAME 0x78 | 
 
 
 
 
 | 53 | #define NCBTRACE 0x79 | 
 
 
 
 
 | 54 | #define ASYNCH 0x80 | 
 
 
 
 
 | 55 | #define NRC_GOODRET 0x00 | 
 
 
 
 
 | 56 | #define NRC_BUFLEN 0x01 | 
 
 
 
 
 | 57 | #define NRC_ILLCMD 0x03 | 
 
 
 
 
 | 58 | #define NRC_CMDTMO 0x05 | 
 
 
 
 
 | 59 | #define NRC_INCOMP 0x06 | 
 
 
 
 
 | 60 | #define NRC_BADDR 0x07 | 
 
 
 
 
 | 61 | #define NRC_SNUMOUT 0x08 | 
 
 
 
 
 | 62 | #define NRC_NORES 0x09 | 
 
 
 
 
 | 63 | #define NRC_SCLOSED 0x0a | 
 
 
 
 
 | 64 | #define NRC_CMDCAN 0x0b | 
 
 
 
 
 | 65 | #define NRC_DUPNAME 0x0d | 
 
 
 
 
 | 66 | #define NRC_NAMTFUL 0x0e | 
 
 
 
 
 | 67 | #define NRC_ACTSES 0x0f | 
 
 
 
 
 | 68 | #define NRC_LOCTFUL 0x11 | 
 
 
 
 
 | 69 | #define NRC_REMTFUL 0x12 | 
 
 
 
 
 | 70 | #define NRC_ILLNN 0x13 | 
 
 
 
 
 | 71 | #define NRC_NOCALL 0x14 | 
 
 
 
 
 | 72 | #define NRC_NOWILD 0x15 | 
 
 
 
 
 | 73 | #define NRC_INUSE 0x16 | 
 
 
 
 
 | 74 | #define NRC_NAMERR 0x17 | 
 
 
 
 
 | 75 | #define NRC_SABORT 0x18 | 
 
 
 
 
 | 76 | #define NRC_NAMCONF 0x19 | 
 
 
 
 
 | 77 | #define NRC_IFBUSY 0x21 | 
 
 
 
 
 | 78 | #define NRC_TOOMANY 0x22 | 
 
 
 
 
 | 79 | #define NRC_BRIDGE 0x23 | 
 
 
 
 
 | 80 | #define NRC_CANOCCR 0x24 | 
 
 
 
 
 | 81 | #define NRC_CANCEL 0x26 | 
 
 
 
 
 | 82 | #define NRC_DUPENV 0x30 | 
 
 
 
 
 | 83 | #define NRC_ENVNOTDEF 0x34 | 
 
 
 
 
 | 84 | #define NRC_OSRESNOTAV 0x35 | 
 
 
 
 
 | 85 | #define NRC_MAXAPPS 0x36 | 
 
 
 
 
 | 86 | #define NRC_NOSAPS 0x37 | 
 
 
 
 
 | 87 | #define NRC_NORESOURCES 0x38 | 
 
 
 
 
 | 88 | #define NRC_INVADDRESS 0x39 | 
 
 
 
 
 | 89 | #define NRC_INVDDID 0x3B | 
 
 
 
 
 | 90 | #define NRC_LOCKFAIL 0x3C | 
 
 
 
 
 | 91 | #define NRC_OPENERR 0x3f | 
 
 
 
 
 | 92 | #define NRC_SYSTEM 0x40 | 
 
 
 
 
 | 93 | #define NRC_PENDING 0xff | 
 
 
 
 
 | 94 | #define NCB_POST void CALLBACK | 
 
 
 
 
 | 95 | typedef struct _ACTION_HEADER { | 
 
 
 
 
 | 96 | ULONG transport_id; | 
 
 
 
 
 | 97 | USHORT action_code; | 
 
 
 
 
 | 98 | USHORT reserved; | 
 
 
 
 
 | 99 | } ACTION_HEADER,*PACTION_HEADER; | 
 
 
 
 
 | 100 | typedef struct _ADAPTER_STATUS { | 
 
 
 
 
 | 101 | UCHAR adapter_address[6]; | 
 
 
 
 
 | 102 | UCHAR rev_major; | 
 
 
 
 
 | 103 | UCHAR reserved0; | 
 
 
 
 
 | 104 | UCHAR adapter_type; | 
 
 
 
 
 | 105 | UCHAR rev_minor; | 
 
 
 
 
 | 106 | WORD duration; | 
 
 
 
 
 | 107 | WORD frmr_recv; | 
 
 
 
 
 | 108 | WORD frmr_xmit; | 
 
 
 
 
 | 109 | WORD iframe_recv_err; | 
 
 
 
 
 | 110 | WORD xmit_aborts; | 
 
 
 
 
 | 111 | DWORD xmit_success; | 
 
 
 
 
 | 112 | DWORD recv_success; | 
 
 
 
 
 | 113 | WORD iframe_xmit_err; | 
 
 
 
 
 | 114 | WORD recv_buff_unavail; | 
 
 
 
 
 | 115 | WORD t1_timeouts; | 
 
 
 
 
 | 116 | WORD ti_timeouts; | 
 
 
 
 
 | 117 | DWORD reserved1; | 
 
 
 
 
 | 118 | WORD free_ncbs; | 
 
 
 
 
 | 119 | WORD max_cfg_ncbs; | 
 
 
 
 
 | 120 | WORD max_ncbs; | 
 
 
 
 
 | 121 | WORD xmit_buf_unavail; | 
 
 
 
 
 | 122 | WORD max_dgram_size; | 
 
 
 
 
 | 123 | WORD pending_sess; | 
 
 
 
 
 | 124 | WORD max_cfg_sess; | 
 
 
 
 
 | 125 | WORD max_sess; | 
 
 
 
 
 | 126 | WORD max_sess_pkt_size; | 
 
 
 
 
 | 127 | WORD name_count; | 
 
 
 
 
 | 128 | } ADAPTER_STATUS,*PADAPTER_STATUS; | 
 
 
 
 
 | 129 | typedef struct _FIND_NAME_BUFFER { | 
 
 
 
 
 | 130 | UCHAR length; | 
 
 
 
 
 | 131 | UCHAR access_control; | 
 
 
 
 
 | 132 | UCHAR frame_control; | 
 
 
 
 
 | 133 | UCHAR destination_addr[6]; | 
 
 
 
 
 | 134 | UCHAR source_addr[6]; | 
 
 
 
 
 | 135 | UCHAR routing_info[18]; | 
 
 
 
 
 | 136 | } FIND_NAME_BUFFER,*PFIND_NAME_BUFFER; | 
 
 
 
 
 | 137 | typedef struct _FIND_NAME_HEADER { | 
 
 
 
 
 | 138 | WORD node_count; | 
 
 
 
 
 | 139 | UCHAR reserved; | 
 
 
 
 
 | 140 | UCHAR unique_group; | 
 
 
 
 
 | 141 | } FIND_NAME_HEADER,*PFIND_NAME_HEADER; | 
 
 
 
 
 | 142 | typedef struct _LANA_ENUM { | 
 
 
 
 
 | 143 | UCHAR length; | 
 
 
 
 
 | 144 | UCHAR lana[MAX_LANA+1]; | 
 
 
 
 
 | 145 | } LANA_ENUM,*PLANA_ENUM; | 
 
 
 
 
 | 146 | typedef struct _NAME_BUFFER { | 
 
 
 
 
 | 147 | UCHAR name[NCBNAMSZ]; | 
 
 
 
 
 | 148 | UCHAR name_num; | 
 
 
 
 
 | 149 | UCHAR name_flags; | 
 
 
 
 
 | 150 | } NAME_BUFFER,*PNAME_BUFFER; | 
 
 
 
 
 | 151 | typedef struct _NCB { | 
 
 
 
 
 | 152 | UCHAR ncb_command; | 
 
 
 
 
 | 153 | UCHAR ncb_retcode; | 
 
 
 
 
 | 154 | UCHAR ncb_lsn; | 
 
 
 
 
 | 155 | UCHAR ncb_num; | 
 
 
 
 
 | 156 | PUCHAR ncb_buffer; | 
 
 
 
 
 | 157 | WORD ncb_length; | 
 
 
 
 
 | 158 | UCHAR ncb_callname[NCBNAMSZ]; | 
 
 
 
 
 | 159 | UCHAR ncb_name[NCBNAMSZ]; | 
 
 
 
 
 | 160 | UCHAR ncb_rto; | 
 
 
 
 
 | 161 | UCHAR ncb_sto; | 
 
 
 
 
 | 162 | void (CALLBACK *ncb_post)(struct _NCB*); | 
 
 
 
 
 | 163 | UCHAR ncb_lana_num; | 
 
 
 
 
 | 164 | UCHAR ncb_cmd_cplt; | 
 
 
 
 
 | 165 | UCHAR ncb_reserve[10]; | 
 
 
 
 
 | 166 | HANDLE ncb_event; | 
 
 
 
 
 | 167 | } NCB,*PNCB; | 
 
 
 
 
 | 168 | typedef struct _SESSION_BUFFER { | 
 
 
 
 
 | 169 | UCHAR lsn; | 
 
 
 
 
 | 170 | UCHAR state; | 
 
 
 
 
 | 171 | UCHAR local_name[NCBNAMSZ]; | 
 
 
 
 
 | 172 | UCHAR remote_name[NCBNAMSZ]; | 
 
 
 
 
 | 173 | UCHAR rcvs_outstanding; | 
 
 
 
 
 | 174 | UCHAR sends_outstanding; | 
 
 
 
 
 | 175 | } SESSION_BUFFER,*PSESSION_BUFFER; | 
 
 
 
 
 | 176 | typedef struct _SESSION_HEADER { | 
 
 
 
 
 | 177 | UCHAR sess_name; | 
 
 
 
 
 | 178 | UCHAR num_sess; | 
 
 
 
 
 | 179 | UCHAR rcv_dg_outstanding; | 
 
 
 
 
 | 180 | UCHAR rcv_any_outstanding; | 
 
 
 
 
 | 181 | } SESSION_HEADER,*PSESSION_HEADER; | 
 
 
 
 
 | 182 | UCHAR WINAPI Netbios(PNCB); | 
 
 
 
 
 | 183 | #ifdef __cplusplus | 
 
 
 
 
 | 184 | } | 
 
 
 
 
 | 185 | #endif | 
 
 
 
 
 | 186 | #endif |