“网络基本输入/输出系统”(Network Basic Input/Output System, NetBIOS)是一种标准的应用程序编程接口( A P I),1 9 8 3年由S y t e k公司专为I B M开发成功。N e t B I O S为网络通信定义了一种编程接口,但却没有详细定义物理性的“帧”如何在网上传输。
LANA编号 (LAN adapter, LANA)
每个L A N A编号对应于网卡及传输协议的唯一组合。例如,假定某工作站安装了两张网卡,以及两种具有N e t B I O S能力的传输协议(如T C P / I P和N e t B E U I),那么总共就有四个L A N A编号。下面是一种对应关系的例子:
0 . T C P / I P—网卡1
1 . N e t B E U I—网卡1
2 . T C P / I P—网卡2
3 . N e t B E U I—网卡2
在Wi n 3 2环境中,针对每个可用的L A N A编号,每个进程都会为其维持一张N e t B I O S名字表
NetBIOS编程基础
typedef struct _NCB
{
UCHAR ncb_command; /* command code */
UCHAR ncb_retcode; /* return code */
UCHAR ncb_lsn; /* local session number */
UCHAR ncb_num; /* number of our network name */
PUCHAR ncb_buffer; /* address of message buffer */
WORD ncb_length; /* size of message buffer */
UCHAR ncb_callname[NCBNAMSZ]; /* blank-padded name of remote */
UCHAR ncb_name[NCBNAMSZ]; /* our blank-padded netname */
UCHAR ncb_rto; /* rcv timeout/retry count */
UCHAR ncb_sto; /* send timeout/sys timeout */
void (CALLBACK *ncb_post)( struct _NCB * ); /* POST routine address */
UCHAR ncb_lana_num; /* lana (adapter) number */
UCHAR ncb_cmd_cplt; /* 0xff => commmand pending */
#ifdef _WIN64
UCHAR ncb_reserve[18]; /* reserved, used by BIOS */
#else
UCHAR ncb_reserve[10]; /* reserved, used by BIOS */
#endif
HANDLE ncb_event; /* HANDLE to Win32 event which */
/* will be set to the signalled */
/* state when an ASYNCH command */
/* completes */
} NCB, *PNCB;
通过 Netbois() 函数实现各个命令的实现, ncb_command 参数带有命令标志
Netbois 主要用户域网中的传输,共享方面的传输
OSI (open system interconnect)
附带: windows 测试工具:DebugDiag