4 IDL structures for NBT operations
6 NBT is not traditionally encoded using IDL/NDR. This is a bit of an
7 experiment, and I may well switch us back to a more traditional
8 encoding if it doesn't work out
13 const int NBT_NAME_SERVICE_PORT = 137;
14 const int NBT_DGRAM_SERVICE_PORT = 138;
16 typedef [bitmap16bit] bitmap {
18 NBT_FLAG_BROADCAST = 0x0010,
19 NBT_FLAG_RECURSION_AVAIL = 0x0080,
20 NBT_FLAG_RECURSION_DESIRED = 0x0100,
21 NBT_FLAG_TRUNCATION = 0x0200,
22 NBT_FLAG_AUTHORITIVE = 0x0400,
24 NBT_FLAG_REPLY = 0x8000
27 /* the opcodes are in the operation field, masked with
29 const int NBT_OPCODE_QUERY = (0<<11);
30 const int NBT_OPCODE_REGISTER = (5<<11);
31 const int NBT_OPCODE_RELEASE = (6<<11);
32 const int NBT_OPCODE_WACK = (7<<11);
33 const int NBT_OPCODE_REFRESH = (8<<11);
46 /* we support any 8bit name type, but by defining the common
47 ones here we get better debug displays */
48 typedef [enum8bit] enum {
49 NBT_NAME_CLIENT = 0x00,
52 NBT_NAME_SERVER = 0x20,
54 NBT_NAME_LOGON = 0x1C,
55 NBT_NAME_MASTER = 0x1D,
56 NBT_NAME_BROWSER = 0x1E
59 /* the ndr parser for nbt_name is separately defined in
61 typedef [nopull,nopush] struct {
67 typedef [enum16bit] enum {
71 typedef [enum16bit] enum {
72 NBT_QTYPE_ADDRESS = 0x0001,
73 NBT_QTYPE_NAMESERVICE = 0x0002,
74 NBT_QTYPE_NULL = 0x000A,
75 NBT_QTYPE_NETBIOS = 0x0020,
76 NBT_QTYPE_STATUS = 0x0021
81 nbt_qtype question_type;
82 nbt_qclass question_class;
85 /* these are the possible values of the NBT_NM_OWNER_TYPE
94 typedef [bitmap16bit] bitmap {
95 NBT_NM_PERMANENT = 0x0200,
96 NBT_NM_ACTIVE = 0x0400,
97 NBT_NM_CONFLICT = 0x0800,
98 NBT_NM_DEREGISTER = 0x1000,
99 NBT_NM_OWNER_TYPE = 0x6000,
100 NBT_NM_GROUP = 0x8000
113 uint16 version_number;
114 uint16 period_of_statistics;
115 uint16 number_of_crcs;
116 uint16 number_alignment_errors;
117 uint16 number_of_collisions;
118 uint16 number_send_aborts;
119 uint32 number_good_sends;
120 uint32 number_good_receives;
121 uint16 number_retransmits;
122 uint16 number_no_resource_conditions;
123 uint16 number_free_command_blocks;
124 uint16 total_number_command_blocks;
125 uint16 max_total_number_command_blocks;
126 uint16 number_pending_sessions;
127 uint16 max_number_pending_sessions;
128 uint16 max_total_sessions_possible;
129 uint16 session_data_packet_size;
140 nbt_status_name names[num_names];
141 nbt_statistics statistics;
145 nbt_operation operation;
148 typedef [nodiscriminant] union {
149 [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios;
150 [case(NBT_QTYPE_STATUS)] nbt_rdata_status status;
151 [case(NBT_QTYPE_NULL)] nbt_rdata_wack wack;
154 typedef [flag(LIBNDR_PRINT_ARRAY_HEX)] struct {
159 [subcontext(2),switch_is(rr_type)] nbt_rdata rdata;
162 typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
164 nbt_operation operation;
169 nbt_name_question questions[qdcount];
170 nbt_res_rec answers[ancount];
171 nbt_res_rec nsrecs[nscount];
172 nbt_res_rec additional[arcount];
173 [flag(NDR_REMAINING)] DATA_BLOB padding;