870N/A/*
870N/A * Copyright (C) 2001 Mike McCormack
870N/A *
870N/A * This library is free software; you can redistribute it and/or
870N/A * modify it under the terms of the GNU Lesser General Public
870N/A * License as published by the Free Software Foundation; either
870N/A * version 2.1 of the License, or (at your option) any later version.
870N/A *
870N/A * This library is distributed in the hope that it will be useful,
870N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
870N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
870N/A * Lesser General Public License for more details.
870N/A *
870N/A * You should have received a copy of the GNU Lesser General Public
870N/A * License along with this library; if not, write to the Free Software
870N/A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
870N/A */
870N/A
870N/A/*
870N/A * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
870N/A * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
870N/A * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
870N/A * a choice of LGPL license versions is made available with the language indicating
870N/A * that LGPLv2 or any later version may be used, or where a choice of which version
870N/A * of the LGPL is applied is otherwise unspecified.
870N/A */
870N/A
870N/A#ifndef NCB_INCLUDED
870N/A#define NCB_INCLUDED
870N/A
870N/A#ifdef __cplusplus
870N/Aextern "C" {
870N/A#endif
870N/A
870N/A#define NCBNAMSZ 16
870N/A#define MAX_LANA 0xfe
870N/A
870N/A#define NCBCALL 0x10
870N/A#define NCBLISTEN 0x11
870N/A#define NCBHANGUP 0x12
870N/A#define NCBSEND 0x14
870N/A#define NCBRECV 0x15
870N/A#define NCBRECVANY 0x16
870N/A#define NCBCHAINSEND 0x17
870N/A#define NCBDGSEND 0x20
870N/A#define NCBDGRECV 0x21
870N/A#define NCBDGSENDBC 0x22
870N/A#define NCBDGRECVBC 0x23
870N/A#define NCBADDNAME 0x30
870N/A#define NCBDELNAME 0x31
870N/A#define NCBRESET 0x32
870N/A#define NCBASTAT 0x33
870N/A#define NCBSSTAT 0x34
870N/A#define NCBCANCEL 0x35
870N/A#define NCBADDGRNAME 0x36
870N/A#define NCBENUM 0x37
870N/A#define NCBUNLINK 0x70
870N/A#define NCBSENDNA 0x71
870N/A#define NCBCHAINSENDNA 0x72
870N/A#define NCBLANSTALERT 0x73
870N/A#define NCBACTION 0x77
870N/A#define NCBFINDNAME 0x78
870N/A#define NCBTRACE 0x79
870N/A
870N/A#define ASYNCH 0x80
870N/A
870N/Atypedef struct _NCB
870N/A{
870N/A UCHAR ncb_command;
870N/A UCHAR ncb_retcode;
870N/A UCHAR ncb_lsn;
870N/A UCHAR ncb_num;
870N/A PUCHAR ncb_buffer;
870N/A WORD ncb_length;
870N/A UCHAR ncb_callname[NCBNAMSZ];
870N/A UCHAR ncb_name[NCBNAMSZ];
870N/A UCHAR ncb_rto;
870N/A UCHAR ncb_sto;
870N/A VOID (CALLBACK *ncb_post)(struct _NCB *);
870N/A UCHAR ncb_lana_num;
870N/A UCHAR ncb_cmd_cplt;
870N/A#ifdef _WIN64
870N/A UCHAR ncb_reserve[18];
870N/A#else
870N/A UCHAR ncb_reserve[10];
870N/A#endif
870N/A HANDLE ncb_event;
870N/A} NCB, *PNCB;
870N/A
870N/Atypedef struct _ADAPTER_STATUS
870N/A{
870N/A UCHAR adapter_address[6];
870N/A UCHAR rev_major;
870N/A UCHAR reserved0;
870N/A UCHAR adapter_type;
870N/A UCHAR rev_minor;
870N/A WORD duration;
870N/A WORD frmr_recv;
870N/A WORD frmr_xmit;
870N/A WORD iframe_recv_error;
870N/A WORD xmit_aborts;
870N/A DWORD xmit_success;
870N/A DWORD recv_success;
870N/A WORD iframe_xmit_error;
870N/A WORD recv_buffer_unavail;
870N/A WORD t1_timeouts;
870N/A WORD ti_timeouts;
870N/A DWORD reserved1;
870N/A WORD free_ncbs;
870N/A WORD max_cfg_ncbs;
870N/A WORD max_ncbs;
870N/A WORD xmit_buf_unavail;
870N/A WORD max_dgram_size;
870N/A WORD pending_sess;
870N/A WORD max_cfg_sess;
870N/A WORD max_sess;
870N/A WORD max_sess_pkt_size;
870N/A WORD name_count;
} ADAPTER_STATUS, *PADAPTER_STATUS;
typedef struct _NAME_BUFFER
{
UCHAR name[NCBNAMSZ];
UCHAR name_num;
UCHAR name_flags;
} NAME_BUFFER, *PNAME_BUFFER;
#define NAME_FLAGS_MASK 0x87
#define GROUP_NAME 0x80
#define UNIQUE_NAME 0x00
#define REGISTERING 0x00
#define REGISTERED 0x04
#define DEREGISTERED 0x05
#define DUPLICATE 0x06
#define DUPLICATE_DEREG 0x07
typedef struct _LANA_ENUM
{
UCHAR length;
UCHAR lana[MAX_LANA+1];
} LANA_ENUM, *PLANA_ENUM;
typedef struct _FIND_NAME_HEADER
{
WORD node_count;
UCHAR reserved;
UCHAR unique_group;
} FIND_NAME_HEADER, *PFIND_NAME_HEADER;
typedef struct _FIND_NAME_BUFFER
{
UCHAR length;
UCHAR access_control;
UCHAR frame_control;
UCHAR destination_addr[6];
UCHAR source_addr[6];
UCHAR routing_info[6];
} FIND_NAME_BUFFER, *PFIND_NAME_BUFFER;
typedef struct _SESSION_HEADER {
UCHAR sess_name;
UCHAR num_sess;
UCHAR rcv_dg_outstanding;
UCHAR rcv_any_outstanding;
} SESSION_HEADER, *PSESSION_HEADER;
typedef struct _SESSION_BUFFER {
UCHAR lsn;
UCHAR state;
UCHAR local_name[NCBNAMSZ];
UCHAR remote_name[NCBNAMSZ];
UCHAR rcvs_outstanding;
UCHAR sends_outstanding;
} SESSION_BUFFER, *PSESSION_BUFFER;
#define LISTEN_OUTSTANDING 0x01
#define CALL_PENDING 0x02
#define SESSION_ESTABLISHED 0x03
#define HANGUP_PENDING 0x04
#define HANGUP_COMPLETE 0x05
#define SESSION_ABORTED 0x06
#define ALL_TRANSPORTS "M\0\0\0"
#define NRC_GOODRET 0x00
#define NRC_BUFLEN 0x01
#define NRC_ILLCMD 0x03
#define NRC_CMDTMO 0x05
#define NRC_INCOMP 0x06
#define NRC_BADDR 0x07
#define NRC_SNUMOUT 0x08
#define NRC_NORES 0x09
#define NRC_SCLOSED 0x0a
#define NRC_CMDCAN 0x0b
#define NRC_DUPNAME 0x0d
#define NRC_NAMTFUL 0x0e
#define NRC_ACTSES 0x0f
#define NRC_LOCTFUL 0x11
#define NRC_REMTFUL 0x12
#define NRC_ILLNN 0x13
#define NRC_NOCALL 0x14
#define NRC_NOWILD 0x15
#define NRC_INUSE 0x16
#define NRC_NAMERR 0x17
#define NRC_SABORT 0x18
#define NRC_NAMCONF 0x19
#define NRC_IFBUSY 0x21
#define NRC_TOOMANY 0x22
#define NRC_BRIDGE 0x23
#define NRC_CANOCCR 0x24
#define NRC_CANCEL 0x26
#define NRC_DUPENV 0x30
#define NRC_ENVNOTDEF 0x34
#define NRC_OSRESNOTAV 0x35
#define NRC_MAXAPPS 0x36
#define NRC_NOSAPS 0x37
#define NRC_NORESOURCES 0x38
#define NRC_INVADDRESS 0x39
#define NRC_INVDDID 0x3b
#define NRC_LOCKFAIL 0x3c
#define NRC_OPENERROR 0x3f
#define NRC_SYSTEM 0x40
#define NRC_PENDING 0xff
UCHAR WINAPI Netbios(PNCB pncb);
#ifdef __cplusplus
}
#endif
#endif /* NCB_INCLUDED */