// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 > or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT >, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
//! This module contains the definitions for portable NetBIOS 3.0 support.
use shared::minwindef::{DWORD, PUCHAR, UCHAR, ULONG, USHORT, WORD};
use um::winnt::HANDLE;
pub const NCBNAMSZ: usize =
16 ;
pub const MAX_LANA: usize =
254 ;
FN !{stdcall PFPOST(
*
mut NCB,
) -> ()}
#[ cfg(target_pointer_width =
"64" )]
STRUCT !{
struct NCB {
ncb_command: UCHAR,
ncb_retcode: UCHAR,
ncb_lsn: UCHAR,
ncb_num: UCHAR,
ncb_buffer: PUCHAR,
ncb_length: WORD,
ncb_callname: [UCHAR; NCBNAMSZ],
ncb_name: [UCHAR; NCBNAMSZ],
ncb_rto: UCHAR,
ncb_sto: UCHAR,
ncb_post: PFPOST,
ncb_lana_num: UCHAR,
ncb_cmd_cplt: UCHAR,
ncb_reserve: [UCHAR;
18 ],
ncb_event: HANDLE,
}}
#[ cfg(target_pointer_width =
"32" )]
STRUCT !{
struct NCB {
ncb_command: UCHAR,
ncb_retcode: UCHAR,
ncb_lsn: UCHAR,
ncb_num: UCHAR,
ncb_buffer: PUCHAR,
ncb_length: WORD,
ncb_callname: [UCHAR; NCBNAMSZ],
ncb_name: [UCHAR; NCBNAMSZ],
ncb_rto: UCHAR,
ncb_sto: UCHAR,
ncb_post: PFPOST,
ncb_lana_num: UCHAR,
ncb_cmd_cplt: UCHAR,
ncb_reserve: [UCHAR;
10 ],
ncb_event: HANDLE,
}}
pub type PNCB = *
mut NCB;
STRUCT !{
struct ADAPTER_STATUS {
adapter_address: [UCHAR;
6 ],
rev_major: UCHAR,
reserved0: UCHAR,
adapter_type: UCHAR,
rev_minor: UCHAR,
duration: WORD,
frmr_recv: WORD,
frmr_xmit: WORD,
iframe_recv_err: WORD,
xmit_aborts: WORD,
xmit_success: DWORD,
recv_success: DWORD,
iframe_xmit_err: WORD,
recv_buff_unavail: WORD,
t1_timeouts: WORD,
ti_timeouts: WORD,
reserved1: DWORD,
free_ncbs: WORD,
max_cfg_ncbs: WORD,
max_ncbs: WORD,
xmit_buf_unavail: WORD,
max_dgram_size: WORD,
pending_sess: WORD,
max_cfg_sess: WORD,
max_sess: WORD,
max_sess_pkt_size: WORD,
name_count: WORD,
}}
pub type PADAPTER_STATUS = *
mut ADAPTER_STATUS;
STRUCT !{
struct NAME_BUFFER {
name: [UCHAR; NCBNAMSZ],
name_num: UCHAR,
name_flags: UCHAR,
}}
pub type PNAME_BUFFER = *
mut NAME_BUFFER;
pub const NAME_FLAGS_MASK: UCHAR =
0 x87;
pub const GROUP_NAME: UCHAR =
0 x80;
pub const UNIQUE_NAME: UCHAR =
0 x00;
pub const REGISTERING: UCHAR =
0 x00;
pub const REGISTERED: UCHAR =
0 x04;
pub const DEREGISTERED: UCHAR =
0 x05;
pub const DUPLICATE: UCHAR =
0 x06;
pub const DUPLICATE_DEREG: UCHAR =
0 x07;
STRUCT !{
struct SESSION_HEADER {
sess_name: UCHAR,
num_sess: UCHAR,
rcv_dg_outstanding: UCHAR,
rcv_any_outstanding: UCHAR,
}}
pub type PSESSION_HEADER = *
mut SESSION_HEADER;
STRUCT !{
struct SESSION_BUFFER {
lsn: UCHAR,
state: UCHAR,
local_name: [UCHAR; NCBNAMSZ],
remote_name: [UCHAR; NCBNAMSZ],
rcvs_outstanding: UCHAR,
sends_outstanding: UCHAR,
}}
pub type PSESSION_BUFFER = *
mut SESSION_BUFFER;
pub const LISTEN_OUTSTANDING: UCHAR =
0 x01;
pub const CALL_PENDING: UCHAR =
0 x02;
pub const SESSION_ESTABLISHED: UCHAR =
0 x03;
pub const HANGUP_PENDING: UCHAR =
0 x04;
pub const HANGUP_COMPLETE: UCHAR =
0 x05;
pub const SESSION_ABORTED: UCHAR =
0 x06;
STRUCT !{
struct LANA_ENUM {
length: UCHAR,
lana: [UCHAR; MAX_LANA +
1 ],
}}
pub type PLANA_ENUM = *
mut LANA_ENUM;
STRUCT !{
struct FIND_NAME_HEADER {
node_count: WORD,
reserved: UCHAR,
unique_group: UCHAR,
}}
pub type PFIND_NAME_HEADER = *
mut FIND_NAME_HEADER;
STRUCT !{
struct FIND_NAME_BUFFER {
length: UCHAR,
access_control: UCHAR,
frame_control: UCHAR,
destination_addr: [UCHAR;
6 ],
source_addr: [UCHAR;
6 ],
routing_info: [UCHAR;
18 ],
}}
pub type PFIND_NAME_BUFFER = *
mut FIND_NAME_BUFFER;
STRUCT !{
struct ACTION_HEADER {
transport_id: ULONG,
action_code: USHORT,
reserved: USHORT,
}}
pub type PACTION_HEADER = *
mut ACTION_HEADER;
pub const ALL_TRANSPORTS: ULONG =
0 x0000004d;
pub const MS_NBF: ULONG =
0 x46424e4d;
pub const NCBCALL: UCHAR =
0 x10;
pub const NCBLISTEN: UCHAR =
0 x11;
pub const NCBHANGUP: UCHAR =
0 x12;
pub const NCBSEND: UCHAR =
0 x14;
pub const NCBRECV: UCHAR =
0 x15;
pub const NCBRECVANY: UCHAR =
0 x16;
pub const NCBCHAINSEND: UCHAR =
0 x17;
pub const NCBDGSEND: UCHAR =
0 x20;
pub const NCBDGRECV: UCHAR =
0 x21;
pub const NCBDGSENDBC: UCHAR =
0 x22;
pub const NCBADDNAME: UCHAR =
0 x30;
pub const NCBDELNAME: UCHAR =
0 x31;
pub const NCBRESET: UCHAR =
0 x32;
pub const NCBASTAT: UCHAR =
0 x33;
pub const NCBSSTAT: UCHAR =
0 x34;
pub const NCBCANCEL: UCHAR =
0 x35;
pub const NCBADDGRNAME: UCHAR =
0 x36;
pub const NCBENUM: UCHAR =
0 x37;
pub const NCBUNLINK: UCHAR =
0 x70;
pub const NCBSENDNA: UCHAR =
0 x71;
pub const NCBCHAINSENDNA: UCHAR =
0 x72;
pub const NCBLANSTALERT: UCHAR =
0 x73;
pub const NCBACTION: UCHAR =
0 x77;
pub const NCBFINDNAME: UCHAR =
0 x78;
pub const NCBTRACE: UCHAR =
0 x79;
pub const ASYNCH: UCHAR =
0 x80;
pub const NRC_GOODRET: UCHAR =
0 x00;
pub const NRC_BUFLEN: UCHAR =
0 x01;
pub const NRC_ILLCMD: UCHAR =
0 x03;
pub const NRC_CMDTMO: UCHAR =
0 x05;
pub const NRC_INCOMP: UCHAR =
0 x06;
pub const NRC_BADDR: UCHAR =
0 x07;
pub const NRC_SNUMOUT: UCHAR =
0 x08;
pub const NRC_NORES: UCHAR =
0 x09;
pub const NRC_SCLOSED: UCHAR =
0 x0a;
pub const NRC_CMDCAN: UCHAR =
0 x0b;
pub const NRC_DUPNAME: UCHAR =
0 x0d;
pub const NRC_NAMTFUL: UCHAR =
0 x0e;
pub const NRC_ACTSES: UCHAR =
0 x0f;
pub const NRC_LOCTFUL: UCHAR =
0 x11;
pub const NRC_REMTFUL: UCHAR =
0 x12;
pub const NRC_ILLNN: UCHAR =
0 x13;
pub const NRC_NOCALL: UCHAR =
0 x14;
pub const NRC_NOWILD: UCHAR =
0 x15;
pub const NRC_INUSE: UCHAR =
0 x16;
pub const NRC_NAMERR: UCHAR =
0 x17;
pub const NRC_SABORT: UCHAR =
0 x18;
pub const NRC_NAMCONF: UCHAR =
0 x19;
pub const NRC_IFBUSY: UCHAR =
0 x21;
pub const NRC_TOOMANY: UCHAR =
0 x22;
pub const NRC_BRIDGE: UCHAR =
0 x23;
pub const NRC_CANOCCR: UCHAR =
0 x24;
pub const NRC_CANCEL: UCHAR =
0 x26;
pub const NRC_DUPENV: UCHAR =
0 x30;
pub const NRC_ENVNOTDEF: UCHAR =
0 x34;
pub const NRC_OSRESNOTAV: UCHAR =
0 x35;
pub const NRC_MAXAPPS: UCHAR =
0 x36;
pub const NRC_NOSAPS: UCHAR =
0 x37;
pub const NRC_NORESOURCES: UCHAR =
0 x38;
pub const NRC_INVADDRESS: UCHAR =
0 x39;
pub const NRC_INVDDID: UCHAR =
0 x3B;
pub const NRC_LOCKFAIL: UCHAR =
0 x3C;
pub const NRC_OPENERR: UCHAR =
0 x3f;
pub const NRC_SYSTEM: UCHAR =
0 x40;
pub const NRC_PENDING: UCHAR =
0 xff;
extern "system" {
pub fn Netbios(
pncb: PNCB,
) -> UCHAR;
}
Messung V0.5 in Prozent C=98 H=100 G=98
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-06-22)
¤
*© Formatika GbR, Deutschland