Unit Nb

Classes

Functions

Netbios -
NetbiosCmd - Exposed functions

---------------------------------} { execute a Windows Netbios Call } {---------------------------------

Types

PAction_Header
PAdpStat
PFind_Name_Buffer
PFind_Name_Header
PLana_Enum
PNameInfo
PNCB
PSession_Buffer
PSession_Header
TAction_Header
TAdpStat
TFind_Name_Buffer
TFind_Name_Header
TLANA_ENUM
TMacAddress
TNameInfo
TNBName
TNCB
TNCBPostProc
TSession_Buffer
TSession_Header

Constants

ALL_TRANSPORTS
CALL_PENDING
DEREGISTERED
DUPLICATE
DUPLICATE_DEREG
GROUP_NAME
HANGUP_COMPLETE
HANGUP_PENDING
LISTEN_OUTSTANDING
MAXLANAS
MS_NBF
NAME_FLAGS_MASK
NBNAMESIZE
NCB_ACTION
NCB_ADDGRPNAME
NCB_ADDNAME
NCB_ADPSTAT
NCB_ASYNC
NCB_CALL
NCB_CANCEL
NCB_CHAINSEND
NCB_CHAINSENDNA
NCB_DELNAME
NCB_DGRECV
NCB_DGREVCBC
NCB_DGSEND
NCB_DGSENDBC
NCB_ENUM
NCB_FINDNAME
NCB_HANGUP
NCB_LANSTALERT
NCB_LISTEN
NCB_RECV
NCB_RECVANY
NCB_RESET
NCB_SEND
NCB_SENDNA
NCB_SSTAT
NCB_TRACE
NCB_UNLINK
NRC_ACTSES
NRC_BADDR
NRC_BRIDGE
NRC_BUFLEN
NRC_CANCEL
NRC_CANOCCR
NRC_CMDCAN
NRC_CMDTMO
NRC_DUPENV
NRC_DUPNAME
NRC_ENVNOTDEF
NRC_GOODRET
NRC_IFBUSY
NRC_ILLCMD
NRC_ILLNN
NRC_INCOMP
NRC_INUSE
NRC_INVADDRESS
NRC_INVDDID
NRC_LOCKFAIL
NRC_LOCTFUL
NRC_MAXAPPS
NRC_NAMCONF
NRC_NAMERR
NRC_NAMTFUL
NRC_NOCALL
NRC_NORES
NRC_NORESOURCES
NRC_NOSAPS
NRC_NOWILD
NRC_OPENERR
NRC_OSRESNOTAV
NRC_PENDING
NRC_REMTFUL
NRC_SABORT
NRC_SCLOSED
NRC_SNUMOUT
NRC_SYSTEM
NRC_TOOMANY
REGISTERED
REGISTERING
SESSION_ABORTED
SESSION_ESTABLISHED
UNIQUE_NAME

Variables


Functions


function Netbios(P: PNCB): Char;


function NetbiosCmd(var NCB: TNCB): Word;

Exposed functions

---------------------------------} { execute a Windows Netbios Call } {---------------------------------


Types


PAction_Header = ^TAction_Header
Structure provided with NCBACTION. The purpose of NCBACTION is to provide transport specific extensions to netbios.
PAdpStat = ^TAdpStat
Netbios adapter status
PFind_Name_Buffer = ^TFind_Name_Buffer

PFind_Name_Header = ^TFind_Name_Header
Structure returned to the NCB command NCBFINDNAME is FIND_NAME_HEADER followed by an array of FIND_NAME_BUFFER structures.
PLana_Enum = ^TLana_Enum
Structure returned to the NCB command NCBENUM. On a system containing lana's 0, 2 and 3, a structure with length =3, lana[0]=0, lana[1]=2 and lana[2]=3 will be returned.
PNameInfo = ^TNameInfo
Netbios Name Info record
PNCB = ^TNCB

PSession_Buffer = ^TSession_Buffer
session buffer
PSession_Header = ^TSession_Header
Structure returned to the NCB command NCBSSTAT is SESSION_HEADER followed by an array of SESSION_BUFFER structures. If the NCB_NAME starts with an asterisk then an array of these structures is returned containing the status for all names. { session header
TAction_Header = record
transport_id : LongInt;
action_code : Word;
reserved : Word;
end;

TAdpStat = record
ID : TMacAddress;
VMajor : byte;
Resvd0 : byte;
AdpType : byte;
VMinor : byte;
RptTime : word;
RcvCRC : word;
RcvOth : word;
TxmCol : word;
TxmOth : word;
TxmOK : LongInt;
RcvOK : LongInt;
TxmRetr : word;
NoRcvBuf : word;
T1_tmo : word;
Ti_tmo : word;
Resvd1 : LongInt;
Free_Ncbs : word;
Cfg_Ncbs : word;
max_Ncbs : word;
NoTxmBuf : word;
MaxDGSize : word;
Pend_Ses : word;
Cfg_Ses : word;
Max_Ses : word;
Max_SPSz : word;
nNames : word;
Names : array[0..15] of TnameInfo;
end;

TFind_Name_Buffer = record
length : byte;
access_control : byte;
frame_control : byte;
destination_addr : TMacAddress;
source_addr : TMacAddress;
routing_info : array[0..17] of byte;
end;

TFind_Name_Header = record
node_count : word;
reserved : byte;
unique_group : byte;
end;

TLANA_ENUM = record
length : byte;
lana : array[0..(MAXLANAS - 1)] of byte;
end;

TMacAddress = array[0..5] of byte;
MAC address
TNameInfo = record
Name : TNBName;
NameNum : byte;
NameSt : byte;
end;

TNBName = array[0..(NBNAMESIZE - 1)] of byte;
Netbios Name
TNCB = record
Command : byte;
RetCode : byte;
LSN : byte;
Num : byte;
Buf : ^byte;
Length : word;
CallName : TNBName;
Name : TNBName;
RTO : byte;
STO : byte;
PostPrc : TNCBPostProc;
Lana_Num : byte;
Cmd_Cplt : byte;
Reserved : array[0..9] of byte;
Event : THandle;
end;

TNCBPostProc = procedure(P: PNCB)
Netbios Control Block } {$IFDEF WIN32
TSession_Buffer = record
lsn : byte;
state : byte;
local_name : TNBName;
remote_name : TNBName;
rcvs_outstanding : byte;
sends_outstanding : byte;
end;

TSession_Header = record
sess_name : byte;
num_sess : byte;
rcv_dg_outstanding : byte;
rcv_any_outstanding : byte;
end;

Constants

ALL_TRANSPORTS = 'M'#$00#$00#$00

asynchronous command is not yet finished } { Values for transport_id

CALL_PENDING = $02

DEREGISTERED = $05

DUPLICATE = $06

DUPLICATE_DEREG = $07

GROUP_NAME = $80

HANGUP_COMPLETE = $05

HANGUP_PENDING = $04

LISTEN_OUTSTANDING = $01

Values for state

MAXLANAS = 254

max number of network adapters } { remeber it's BIG Blue, right ?

MS_NBF = 'MNBF'

NAME_FLAGS_MASK = $87

values for name_flags bits.

NBNAMESIZE = 16

size of a netbios name

NCB_ACTION = $77

lan status alert

NCB_ADDGRPNAME = $36

cancel NCB request

NCB_ADDNAME = $30

receive broadcast datagram

NCB_ADPSTAT = $33

reset adapter

NCB_ASYNC = $80

NCB Command codes

NCB_CALL = $10

asynch command bit to be or-ed into command

NCB_CANCEL = $35

session status

NCB_CHAINSEND = $17

receive data on any session

NCB_CHAINSENDNA = $72

send, don't wait for ACK

NCB_DELNAME = $31

add unique name to local table

NCB_DGRECV = $21

send a datagram

NCB_DGREVCBC = $23

send broadcast datagram

NCB_DGSEND = $20

chain send data

NCB_DGSENDBC = $22

receive datagram

NCB_ENUM = $37

add group name to local table

NCB_FINDNAME = $78

enable extensions

NCB_HANGUP = $12

wait for a call

NCB_LANSTALERT = $73

chain send, but don't wait for ACK

NCB_LISTEN = $11

open a session

NCB_RECV = $15

send data

NCB_RECVANY = $16

receive data

NCB_RESET = $32

delete name from local table

NCB_SEND = $14

end session

NCB_SENDNA = $71

unlink remote boot code

NCB_SSTAT = $34

adapter status

NCB_TRACE = $79

search for name on the network

NCB_UNLINK = $70

enum adapters

NRC_ACTSES = $0f

name table full

NRC_BADDR = $07

message incomplete, issue another command

NRC_BRIDGE = $23

too many commands outstanding, retry later

NRC_BUFLEN = $01

good return also returned when ASYNCH request accepted

NRC_CANCEL = $26

command completed while cancel occurring

NRC_CANOCCR = $24

ncb_lana_num field invalid

NRC_CMDCAN = $0b

session closed

NRC_CMDTMO = $05

illegal command

NRC_DUPENV = $30

command not valid to cancel

NRC_DUPNAME = $0d

command cancelled

NRC_ENVNOTDEF = $34

name defined by anther local process

NRC_GOODRET = $00

activate / stop tracing } { NCB return codes

NRC_IFBUSY = $21

name conflict detected

NRC_ILLCMD = $03

illegal buffer length

NRC_ILLNN = $13

remote session table full

NRC_INCOMP = $06

command timed out

NRC_INUSE = $16

cannot put * in NCB_NAME

NRC_INVADDRESS = $39

requested resources are not available

NRC_INVDDID = $3B

invalid ncb address or length > segment

NRC_LOCKFAIL = $3C

invalid NCB DDID

NRC_LOCTFUL = $11

no deletions, name has active sessions

NRC_MAXAPPS = $36

required OS resources exhausted

NRC_NAMCONF = $19

session ended abnormally

NRC_NAMERR = $17

name in use on remote adapter

NRC_NAMTFUL = $0e

duplicate name

NRC_NOCALL = $14

illegal name number

NRC_NORES = $09

session number out of range

NRC_NORESOURCES = $38

no saps available for netbios

NRC_NOSAPS = $37

max number of applications exceeded

NRC_NOWILD = $15

no callname

NRC_OPENERR = $3f

lock of user area failed

NRC_OSRESNOTAV = $35

environment undefined. RESET required

NRC_PENDING = $ff

system error

NRC_REMTFUL = $12

local session table full

NRC_SABORT = $18

name deleted

NRC_SCLOSED = $0a

no resource available

NRC_SNUMOUT = $08

illegal buffer address

NRC_SYSTEM = $40

NETBIOS not loaded

NRC_TOOMANY = $22

interface busy, IRET before retrying

REGISTERED = $04

REGISTERING = $00

SESSION_ABORTED = $06

SESSION_ESTABLISHED = $03

UNIQUE_NAME = $00


Variables