git add -f bin/default/librpc/gen_ndr/packet-dcerpc-*
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / packet-dcerpc-nbt.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from /home/metze/devel/samba/4.0/master4-franky/librpc/idl/nbt.idl and /home/metze/devel/samba/4.0/master4-franky/librpc/idl/nbt.cnf.
4         
5         Pidl is a perl based IDL compiler for DCE/RPC idl files.
6         It is maintained by the Samba team, not the Wireshark team.
7         Instructions on how to download and install Pidl can be
8         found at http://wiki.wireshark.org/Pidl
9
10         $Id$
11 */
12
13
14 #include "config.h"
15 #ifdef _MSC_VER
16 #pragma warning(disable:4005)
17 #pragma warning(disable:4013)
18 #pragma warning(disable:4018)
19 #pragma warning(disable:4101)
20 #endif
21
22 #include <glib.h>
23 #include <string.h>
24 #include <epan/packet.h>
25
26 #include "packet-dcerpc.h"
27 #include "packet-dcerpc-nt.h"
28 #include "packet-windows-common.h"
29 #include "packet-dcerpc-nbt.h"
30
31 /* Ett declarations */
32 static gint ett_dcerpc_nbt = -1;
33 static gint ett_nbt_nbt_operation = -1;
34 static gint ett_nbt_nbt_name = -1;
35 static gint ett_nbt_nbt_name_question = -1;
36 static gint ett_nbt_nb_flags = -1;
37 static gint ett_nbt_nbt_rdata_address = -1;
38 static gint ett_nbt_nbt_rdata_netbios = -1;
39 static gint ett_nbt_nbt_statistics = -1;
40 static gint ett_nbt_nbt_status_name = -1;
41 static gint ett_nbt_nbt_rdata_status = -1;
42 static gint ett_nbt_nbt_rdata_data = -1;
43 static gint ett_nbt_nbt_rdata = -1;
44 static gint ett_nbt_nbt_res_rec = -1;
45 static gint ett_nbt_nbt_name_packet = -1;
46 static gint ett_nbt_dgram_flags = -1;
47 static gint ett_nbt_smb_trans_body = -1;
48 static gint ett_nbt_smb_body = -1;
49 static gint ett_nbt_dgram_smb_packet = -1;
50 static gint ett_nbt_dgram_message_body = -1;
51 static gint ett_nbt_dgram_message = -1;
52 static gint ett_nbt_dgram_data = -1;
53 static gint ett_nbt_nbt_dgram_packet = -1;
54 static gint ett_nbt_nbt_sockaddr = -1;
55 static gint ett_nbt_nbt_server_type = -1;
56 static gint ett_nbt_netlogon_nt_version_flags = -1;
57 static gint ett_nbt_NETLOGON_SAM_LOGON_REQUEST = -1;
58 static gint ett_nbt_NETLOGON_LOGON_REQUEST = -1;
59 static gint ett_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40 = -1;
60 static gint ett_nbt_NETLOGON_SAM_LOGON_RESPONSE = -1;
61 static gint ett_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX = -1;
62 static gint ett_nbt_nbt_netlogon_query_for_pdc = -1;
63 static gint ett_nbt_nbt_netlogon_response_from_pdc = -1;
64 static gint ett_nbt_nbt_netlogon_response2 = -1;
65 static gint ett_nbt_nbt_db_change_info = -1;
66 static gint ett_nbt_NETLOGON_DB_CHANGE = -1;
67 static gint ett_nbt_nbt_netlogon_request = -1;
68 static gint ett_nbt_nbt_netlogon_packet = -1;
69 static gint ett_nbt_svcctl_ServerType = -1;
70 static gint ett_nbt_nbt_browse_host_announcement = -1;
71 static gint ett_nbt_nbt_browse_announcement_request = -1;
72 static gint ett_nbt_nbt_browse_election_request = -1;
73 static gint ett_nbt_nbt_browse_backup_list_request = -1;
74 static gint ett_nbt_nbt_browse_backup_list_response = -1;
75 static gint ett_nbt_nbt_browse_become_backup = -1;
76 static gint ett_nbt_nbt_browse_domain_announcement = -1;
77 static gint ett_nbt_nbt_browse_master_announcement = -1;
78 static gint ett_nbt_nbt_browse_reset_state = -1;
79 static gint ett_nbt_nbt_browse_local_master_announcement = -1;
80 static gint ett_nbt_nbt_browse_payload = -1;
81 static gint ett_nbt_nbt_browse_packet = -1;
82
83
84 /* Header field declarations */
85 static gint hf_nbt_nb_flags_NBT_NM_OWNER_TYPE = -1;
86 static gint hf_nbt_smb_trans_body_data_count = -1;
87 static gint hf_nbt_nbt_db_change_info_db_index = -1;
88 static gint hf_nbt_dgram_message_offset = -1;
89 static gint hf_nbt_nbt_netlogon_query_for_pdc_lmnt_token = -1;
90 static gint hf_nbt_dgram_message_body = -1;
91 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr = -1;
92 static gint hf_nbt_nbt_name_packet_questions = -1;
93 static gint hf_nbt_nbt_name_packet_ancount = -1;
94 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_lmnt_token = -1;
95 static gint hf_nbt_smb_trans_body_opcode = -1;
96 static gint hf_nbt_nbt_statistics_number_no_resource_conditions = -1;
97 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_IP = -1;
98 static gint hf_nbt_nbt_rdata_data = -1;
99 static gint hf_nbt_nbt_rdata_status_statistics = -1;
100 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX_WITH_IP = -1;
101 static gint hf_nbt_nbt_sockaddr_sockaddr_family = -1;
102 static gint hf_nbt_nbt_name_question_question_type = -1;
103 static gint hf_nbt_dgram_smb_packet_reserved = -1;
104 static gint hf_nbt_nbt_res_rec_rr_type = -1;
105 static gint hf_nbt_nbt_statistics_number_of_collisions = -1;
106 static gint hf_nbt_nbt_name_name = -1;
107 static gint hf_nbt_nbt_res_rec_name = -1;
108 static gint hf_nbt_nbt_rdata_netbios_length = -1;
109 static gint hf_nbt_dgram_message_source_name = -1;
110 static gint hf_nbt_nbt_rdata_status = -1;
111 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_lm20_token = -1;
112 static gint hf_nbt_nbt_res_rec_rr_class = -1;
113 static gint hf_nbt_nbt_browse_local_master_announcement_Signature = -1;
114 static gint hf_nbt_dgram_smb_packet_smb_command = -1;
115 static gint hf_nbt_nbt_netlogon_packet_req = -1;
116 static gint hf_nbt_nbt_name_question_question_class = -1;
117 static gint hf_nbt_smb_trans_body_data = -1;
118 static gint hf_nbt_nbt_statistics_number_alignment_errors = -1;
119 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_name = -1;
120 static gint hf_nbt_nbt_browse_domain_announcement_Periodicity = -1;
121 static gint hf_nbt_nbt_netlogon_response_from_pdc_domain_name = -1;
122 static gint hf_nbt_nbt_rdata_status_num_names = -1;
123 static gint hf_nbt_nbt_browse_local_master_announcement_BroMinorVer = -1;
124 static gint hf_nbt_dgram_data_dest_name = -1;
125 static gint hf_nbt_dgram_message_body_smb = -1;
126 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_next_closest_site = -1;
127 static gint hf_nbt_nbt_netlogon_query_for_pdc_nt_version = -1;
128 static gint hf_nbt_nbt_db_change_info_serial = -1;
129 static gint hf_nbt_smb_trans_body_setup_count = -1;
130 static gint hf_nbt_nbt_browse_payload_host_annoucement = -1;
131 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_WITH_CLOSEST_SITE = -1;
132 static gint hf_nbt_nbt_browse_packet_payload = -1;
133 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sbz = -1;
134 static gint hf_nbt_nbt_dgram_packet_data = -1;
135 static gint hf_nbt_dgram_message_dgram_body_type = -1;
136 static gint hf_nbt_smb_trans_body_total_param_count = -1;
137 static gint hf_nbt_dgram_data_error = -1;
138 static gint hf_nbt_nbt_browse_backup_list_response_Token = -1;
139 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_user_name = -1;
140 static gint hf_nbt_nbt_netlogon_request_logon0 = -1;
141 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_dns_domain = -1;
142 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST__pad = -1;
143 static gint hf_nbt_dgram_smb_packet_flags = -1;
144 static gint hf_nbt_nbt_statistics_total_number_command_blocks = -1;
145 static gint hf_nbt_nbt_browse_local_master_announcement_UpdateCount = -1;
146 static gint hf_nbt_smb_trans_body_pad2 = -1;
147 static gint hf_nbt_nbt_rdata_status_length = -1;
148 static gint hf_nbt_NETLOGON_DB_CHANGE_unicode_domain = -1;
149 static gint hf_nbt_nbt_rdata_address_ipaddr = -1;
150 static gint hf_nbt_nbt_netlogon_request_uas = -1;
151 static gint hf_nbt_smb_trans_body_timeout = -1;
152 static gint hf_nbt_nbt_statistics_max_total_number_command_blocks = -1;
153 static gint hf_nbt_nbt_dgram_packet_flags = -1;
154 static gint hf_nbt_nbt_res_rec_rdata = -1;
155 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_lm20_token = -1;
156 static gint hf_nbt_nb_flags_NBT_NM_DEREGISTER = -1;
157 static gint hf_nbt_NETLOGON_DB_CHANGE_dbchange = -1;
158 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_command = -1;
159 static gint hf_nbt_nbt_server_type_NBT_SERVER_CLOSEST = -1;
160 static gint hf_nbt_dgram_smb_packet_pid = -1;
161 static gint hf_nbt_nbt_browse_host_announcement_BroMajorVer = -1;
162 static gint hf_nbt_nbt_name_scope = -1;
163 static gint hf_nbt_nbt_sockaddr_remaining = -1;
164 static gint hf_nbt_nbt_operation_NBT_FLAG_RECURSION_AVAIL = -1;
165 static gint hf_nbt_nbt_server_type_NBT_SERVER_DS = -1;
166 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_lm20_token = -1;
167 static gint hf_nbt_NETLOGON_DB_CHANGE_unicode_pdc_name = -1;
168 static gint hf_nbt_nbt_status_name_name = -1;
169 static gint hf_nbt_smb_trans_body_param_count = -1;
170 static gint hf_nbt_nbt_operation_NBT_FLAG_RECURSION_DESIRED = -1;
171 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_1 = -1;
172 static gint hf_nbt_nbt_statistics_number_pending_sessions = -1;
173 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_name = -1;
174 static gint hf_nbt_nbt_server_type_NBT_SERVER_IS_DEFAULT_NC = -1;
175 static gint hf_nbt_smb_trans_body_param_offset = -1;
176 static gint hf_nbt_smb_trans_body_max_param_count = -1;
177 static gint hf_nbt_nbt_browse_backup_list_request_Token = -1;
178 static gint hf_nbt_nbt_browse_local_master_announcement_BroMajorVer = -1;
179 static gint hf_nbt_nbt_server_type_NBT_SERVER_FOREST_ROOT = -1;
180 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_command = -1;
181 static gint hf_nbt_nbt_browse_backup_list_response_BackupServerList = -1;
182 static gint hf_nbt_nbt_browse_local_master_announcement_ServerType = -1;
183 static gint hf_nbt_dgram_message_dest_name = -1;
184 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_acct_control = -1;
185 static gint hf_nbt_nbt_browse_election_request_Reserved = -1;
186 static gint hf_nbt_nbt_browse_master_announcement_ServerName = -1;
187 static gint hf_nbt_nbt_browse_host_announcement_UpdateCount = -1;
188 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_user_name = -1;
189 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX = -1;
190 static gint hf_nbt_nbt_operation_NBT_RCODE = -1;
191 static gint hf_nbt_nbt_browse_election_request_ServerName = -1;
192 static gint hf_nbt_nbt_browse_election_request_UpTime = -1;
193 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_name = -1;
194 static gint hf_nbt_dgram_message_length = -1;
195 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_dns_name = -1;
196 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_server_type = -1;
197 static gint hf_nbt_nbt_browse_packet_opcode = -1;
198 static gint hf_nbt_nbt_name_packet_nsrecs = -1;
199 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_server_site = -1;
200 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5 = -1;
201 static gint hf_nbt_NETLOGON_LOGON_REQUEST_lm20_token = -1;
202 static gint hf_nbt_nb_flags_NBT_NM_PERMANENT = -1;
203 static gint hf_nbt_nbt_browse_host_announcement_Signature = -1;
204 static gint hf_nbt_NETLOGON_DB_CHANGE_serial_lo = -1;
205 static gint hf_nbt_nbt_browse_host_announcement_Periodicity = -1;
206 static gint hf_nbt_nbt_operation_NBT_FLAG_TRUNCATION = -1;
207 static gint hf_nbt_dgram_smb_packet_tid = -1;
208 static gint hf_nbt_nbt_browse_host_announcement_ServerName = -1;
209 static gint hf_nbt_nbt_server_type_NBT_SERVER_GOOD_TIMESERV = -1;
210 static gint hf_nbt_nbt_browse_election_request_Version = -1;
211 static gint hf_nbt_smb_trans_body_pad = -1;
212 static gint hf_nbt_nbt_browse_host_announcement_Comment = -1;
213 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_domain_name = -1;
214 static gint hf_nbt_NETLOGON_LOGON_REQUEST_computer_name = -1;
215 static gint hf_nbt_nbt_browse_host_announcement_ServerType = -1;
216 static gint hf_nbt_smb_trans_body_priority = -1;
217 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_request_count = -1;
218 static gint hf_nbt_nbt_statistics_session_data_packet_size = -1;
219 static gint hf_nbt_nbt_statistics_number_free_command_blocks = -1;
220 static gint hf_nbt_nbt_operation_NBT_OPCODE = -1;
221 static gint hf_nbt_nbt_browse_backup_list_request_ReqCount = -1;
222 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_AVOID_NT4EMUL = -1;
223 static gint hf_nbt_nbt_browse_host_announcement_OSMajor = -1;
224 static gint hf_nbt_nbt_dgram_packet_src_addr = -1;
225 static gint hf_nbt_dgram_smb_packet_mid = -1;
226 static gint hf_nbt_nbt_name_packet_answers = -1;
227 static gint hf_nbt_nbt_browse_domain_announcement_UpdateCount = -1;
228 static gint hf_nbt_nbt_browse_reset_state_Command = -1;
229 static gint hf_nbt_nbt_browse_become_backup_BrowserName = -1;
230 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_forest = -1;
231 static gint hf_nbt_nbt_rdata_netbios_addresses = -1;
232 static gint hf_nbt_nbt_browse_local_master_announcement_ServerName = -1;
233 static gint hf_nbt_nbt_browse_announcement_request_ResponseName = -1;
234 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_user_name = -1;
235 static gint hf_nbt_nbt_browse_payload_election_request = -1;
236 static gint hf_nbt_NETLOGON_DB_CHANGE_random = -1;
237 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_GC = -1;
238 static gint hf_nbt_nbt_browse_local_master_announcement_Comment = -1;
239 static gint hf_nbt_nbt_netlogon_packet_command = -1;
240 static gint hf_nbt_dgram_smb_packet_pad = -1;
241 static gint hf_nbt_nbt_netlogon_query_for_pdc__pad = -1;
242 static gint hf_nbt_smb_trans_body_max_setup_count = -1;
243 static gint hf_nbt_nbt_server_type_NBT_SERVER_TIMESERV = -1;
244 static gint hf_nbt_nbt_dgram_packet_msg_type = -1;
245 static gint hf_nbt_smb_trans_body_mailslot_name = -1;
246 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_domain_name = -1;
247 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_pdc_name = -1;
248 static gint hf_nbt_nbt_rdata_status_names = -1;
249 static gint hf_nbt_nbt_netlogon_request_logon = -1;
250 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_nt_version = -1;
251 static gint hf_nbt_NETLOGON_DB_CHANGE_db_count = -1;
252 static gint hf_nbt_nbt_browse_domain_announcement_ServerType = -1;
253 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_lmnt_token = -1;
254 static gint hf_nbt_nbt_statistics_max_number_pending_sessions = -1;
255 static gint hf_nbt_nbt_netlogon_request_pdc = -1;
256 static gint hf_nbt_nbt_netlogon_query_for_pdc_mailslot_name = -1;
257 static gint hf_nbt_nbt_browse_domain_announcement_MysteriousField = -1;
258 static gint hf_nbt_nbt_browse_host_announcement_BroMinorVer = -1;
259 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_nt_version = -1;
260 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_nt_version = -1;
261 static gint hf_nbt_nbt_netlogon_response2_lm20_token = -1;
262 static gint hf_nbt_dgram_data_msg = -1;
263 static gint hf_nbt_nbt_browse_election_request_Criteria = -1;
264 static gint hf_nbt_NETLOGON_LOGON_REQUEST_user_name = -1;
265 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_nt_version = -1;
266 static gint hf_nbt_nbt_operation_NBT_FLAG_AUTHORITATIVE = -1;
267 static gint hf_nbt_NETLOGON_LOGON_REQUEST_lmnt_token = -1;
268 static gint hf_nbt_smb_trans_body_reserved = -1;
269 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_uuid = -1;
270 static gint hf_nbt_nbt_statistics_number_retransmits = -1;
271 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_command = -1;
272 static gint hf_nbt_nbt_status_name_type = -1;
273 static gint hf_nbt_dgram_smb_packet_signature = -1;
274 static gint hf_nbt_nbt_netlogon_response2_pdc_name = -1;
275 static gint hf_nbt_nbt_browse_payload_local_master_announcement = -1;
276 static gint hf_nbt_nbt_browse_domain_announcement_OSMajor = -1;
277 static gint hf_nbt_nbt_browse_domain_announcement_Comment = -1;
278 static gint hf_nbt_nbt_statistics_number_send_aborts = -1;
279 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_user_name = -1;
280 static gint hf_nbt_smb_trans_body_data_offset = -1;
281 static gint hf_nbt_nbt_browse_domain_announcement_OSMinor = -1;
282 static gint hf_nbt_nbt_browse_domain_announcement_ServerName = -1;
283 static gint hf_nbt_nbt_browse_host_announcement_OSMinor = -1;
284 static gint hf_nbt_nbt_dgram_packet_src_port = -1;
285 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_PDC = -1;
286 static gint hf_nbt_NETLOGON_DB_CHANGE_sid_size = -1;
287 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid = -1;
288 static gint hf_nbt_nb_flags_NBT_NM_ACTIVE = -1;
289 static gint hf_nbt_smb_trans_body_byte_count = -1;
290 static gint hf_nbt_nbt_statistics_unit_id = -1;
291 static gint hf_nbt_nbt_name_packet_nscount = -1;
292 static gint hf_nbt_NETLOGON_DB_CHANGE_pdc_name = -1;
293 static gint hf_nbt_nbt_browse_payload_master_announcement = -1;
294 static gint hf_nbt_nbt_netlogon_response_from_pdc_command = -1;
295 static gint hf_nbt_dgram_smb_packet_body = -1;
296 static gint hf_nbt_nbt_name_packet_name_trn_id = -1;
297 static gint hf_nbt_nbt_browse_local_master_announcement_OSMinor = -1;
298 static gint hf_nbt_nbt_browse_payload_become_backup = -1;
299 static gint hf_nbt_NETLOGON_LOGON_REQUEST_mailslot_name = -1;
300 static gint hf_nbt_nbt_res_rec_ttl = -1;
301 static gint hf_nbt_nbt_server_type_NBT_SERVER_SELECT_SECRET_DOMAIN_6 = -1;
302 static gint hf_nbt_dgram_smb_packet_vuid = -1;
303 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_zero_uuid = -1;
304 static gint hf_nbt_nbt_sockaddr_pdc_ip = -1;
305 static gint hf_nbt_dgram_smb_packet_flags2 = -1;
306 static gint hf_nbt_opnum = -1;
307 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_lm20_token = -1;
308 static gint hf_nbt_nbt_rdata_data_length = -1;
309 static gint hf_nbt_NETLOGON_DB_CHANGE_pulse = -1;
310 static gint hf_nbt_nbt_statistics_jumpers = -1;
311 static gint hf_nbt_nbt_statistics_number_good_sends = -1;
312 static gint hf_nbt_dgram_flags_DGRAM_FLAG_NODE_TYPE = -1;
313 static gint hf_nbt_nbt_name_packet_qdcount = -1;
314 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_lmnt_token = -1;
315 static gint hf_nbt_nbt_browse_payload_domain_announcement = -1;
316 static gint hf_nbt_nbt_statistics_number_of_crcs = -1;
317 static gint hf_nbt_nbt_db_change_info_timestamp = -1;
318 static gint hf_nbt_smb_trans_body_total_data_count = -1;
319 static gint hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_LOCAL = -1;
320 static gint hf_nbt_dgram_smb_packet_err_code = -1;
321 static gint hf_nbt_decode_nbt_netlogon_packet_packet = -1;
322 static gint hf_nbt_nbt_name_question_name = -1;
323 static gint hf_nbt_nbt_server_type_NBT_SERVER_PDC = -1;
324 static gint hf_nbt_nbt_rdata_address_nb_flags = -1;
325 static gint hf_nbt_nbt_server_type_NBT_SERVER_HAS_DNS_NAME = -1;
326 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_client_site = -1;
327 static gint hf_nbt_NETLOGON_DB_CHANGE_domain = -1;
328 static gint hf_nbt_nbt_browse_payload_announcement_request = -1;
329 static gint hf_nbt_nbt_operation_NBT_FLAG_BROADCAST = -1;
330 static gint hf_nbt_nbt_netlogon_response_from_pdc_nt_version = -1;
331 static gint hf_nbt_dgram_smb_packet_pid_high = -1;
332 static gint hf_nbt_nbt_netlogon_response2_command = -1;
333 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_size = -1;
334 static gint hf_nbt_nbt_operation_NBT_FLAG_REPLY = -1;
335 static gint hf_nbt_nbt_server_type_NBT_SERVER_GC = -1;
336 static gint hf_nbt_nbt_netlogon_query_for_pdc_unicode_name = -1;
337 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid_size = -1;
338 static gint hf_nbt_nbt_server_type_NBT_SERVER_NDNC = -1;
339 static gint hf_nbt_nbt_server_type_NBT_SERVER_FULL_SECRET_DOMAIN_6 = -1;
340 static gint hf_nbt_nbt_netlogon_response_from_pdc_lmnt_token = -1;
341 static gint hf_nbt_NETLOGON_LOGON_REQUEST_request_count = -1;
342 static gint hf_nbt_smb_trans_body_wct = -1;
343 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_mailslot_name = -1;
344 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_domain_uuid = -1;
345 static gint hf_nbt_NETLOGON_DB_CHANGE_message_format_version = -1;
346 static gint hf_nbt_nbt_statistics_max_total_sessions_possible = -1;
347 static gint hf_nbt_nbt_name_packet_operation = -1;
348 static gint hf_nbt_nbt_statistics_version_number = -1;
349 static gint hf_nbt_nbt_dgram_packet_dgram_id = -1;
350 static gint hf_nbt_nbt_name_packet_padding = -1;
351 static gint hf_nbt_nbt_server_type_NBT_SERVER_LDAP = -1;
352 static gint hf_nbt_nbt_netlogon_query_for_pdc_lm20_token = -1;
353 static gint hf_nbt_nbt_netlogon_response_from_pdc_pdc_name = -1;
354 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_dns_name = -1;
355 static gint hf_nbt_nbt_browse_payload_reset_browser_state = -1;
356 static gint hf_nbt_nbt_name_packet_additional = -1;
357 static gint hf_nbt_nbt_name_packet_arcount = -1;
358 static gint hf_nbt_smb_trans_body_max_data_count = -1;
359 static gint hf_nbt_smb_trans_body_trans_flags = -1;
360 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_forest = -1;
361 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_dns_domain = -1;
362 static gint hf_nbt_nbt_browse_announcement_request_Unused = -1;
363 static gint hf_nbt_NETLOGON_DB_CHANGE_sid = -1;
364 static gint hf_nbt_nbt_server_type_NBT_SERVER_ADS_WEB_SERVICE = -1;
365 static gint hf_nbt_NETLOGON_DB_CHANGE_message_token = -1;
366 static gint hf_nbt_NETLOGON_DB_CHANGE_sid_ = -1;
367 static gint hf_nbt_nbt_browse_payload_backup_list_response = -1;
368 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_computer_name = -1;
369 static gint hf_nbt_nb_flags_NBT_NM_CONFLICT = -1;
370 static gint hf_nbt_nbt_rdata_netbios = -1;
371 static gint hf_nbt_nbt_statistics_period_of_statistics = -1;
372 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_ip = -1;
373 static gint hf_nbt_nbt_server_type_NBT_SERVER_WRITABLE = -1;
374 static gint hf_nbt_nbt_netlogon_query_for_pdc_computer_name = -1;
375 static gint hf_nbt_nbt_status_name_nb_flags = -1;
376 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_ = -1;
377 static gint hf_nbt_dgram_flags_DGRAM_FLAG_MORE = -1;
378 static gint hf_nbt_nbt_netlogon_response_from_pdc__pad = -1;
379 static gint hf_nbt_nbt_browse_local_master_announcement_OSMajor = -1;
380 static gint hf_nbt_nbt_rdata_data_data = -1;
381 static gint hf_nbt_NETLOGON_DB_CHANGE_timestamp = -1;
382 static gint hf_nbt_NETLOGON_DB_CHANGE__pad = -1;
383 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_server_type = -1;
384 static gint hf_nbt_nbt_browse_payload_backup_list_request = -1;
385 static gint hf_nbt_dgram_flags_DGRAM_FLAG_FIRST = -1;
386 static gint hf_nbt_smb_trans_body__class = -1;
387 static gint hf_nbt_nb_flags_NBT_NM_GROUP = -1;
388 static gint hf_nbt_nbt_statistics_test_result = -1;
389 static gint hf_nbt_nbt_netlogon_response_from_pdc_unicode_pdc_name = -1;
390 static gint hf_nbt_nbt_name_type = -1;
391 static gint hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid_ = -1;
392 static gint hf_nbt_nbt_server_type_NBT_SERVER_KDC = -1;
393 static gint hf_nbt_nbt_browse_local_master_announcement_Periodicity = -1;
394 static gint hf_nbt_dgram_smb_packet_err_class = -1;
395 static gint hf_nbt_nbt_statistics_number_good_receives = -1;
396 static gint hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_lmnt_token = -1;
397 static gint hf_nbt_nbt_browse_backup_list_response_BackupCount = -1;
398 static gint hf_nbt_smb_body_trans = -1;
399 static gint hf_nbt_nbt_netlogon_response_from_pdc_lm20_token = -1;
400
401 static gint proto_dcerpc_nbt = -1;
402 /* Version information */
403
404
405 static e_uuid_t uuid_dcerpc_nbt = {
406         0x6def41b6, 0x86e4, 0x4c32,
407         { 0x99, 0x7c, 0xed, 0x33, 0xaf, 0x7b, 0xcd, 0x8e }
408 };
409 static guint16 ver_dcerpc_nbt = 0;
410
411 static const true_false_string nbt_operation_NBT_RCODE_tfs = {
412    "NBT_RCODE is SET",
413    "NBT_RCODE is NOT SET",
414 };
415 static const true_false_string nbt_operation_NBT_FLAG_BROADCAST_tfs = {
416    "NBT_FLAG_BROADCAST is SET",
417    "NBT_FLAG_BROADCAST is NOT SET",
418 };
419 static const true_false_string nbt_operation_NBT_FLAG_RECURSION_AVAIL_tfs = {
420    "NBT_FLAG_RECURSION_AVAIL is SET",
421    "NBT_FLAG_RECURSION_AVAIL is NOT SET",
422 };
423 static const true_false_string nbt_operation_NBT_FLAG_RECURSION_DESIRED_tfs = {
424    "NBT_FLAG_RECURSION_DESIRED is SET",
425    "NBT_FLAG_RECURSION_DESIRED is NOT SET",
426 };
427 static const true_false_string nbt_operation_NBT_FLAG_TRUNCATION_tfs = {
428    "NBT_FLAG_TRUNCATION is SET",
429    "NBT_FLAG_TRUNCATION is NOT SET",
430 };
431 static const true_false_string nbt_operation_NBT_FLAG_AUTHORITATIVE_tfs = {
432    "NBT_FLAG_AUTHORITATIVE is SET",
433    "NBT_FLAG_AUTHORITATIVE is NOT SET",
434 };
435 static const true_false_string nbt_operation_NBT_OPCODE_tfs = {
436    "NBT_OPCODE is SET",
437    "NBT_OPCODE is NOT SET",
438 };
439 static const true_false_string nbt_operation_NBT_FLAG_REPLY_tfs = {
440    "NBT_FLAG_REPLY is SET",
441    "NBT_FLAG_REPLY is NOT SET",
442 };
443 const value_string nbt_nbt_opcode_vals[] = {
444         { NBT_OPCODE_QUERY, "NBT_OPCODE_QUERY" },
445         { NBT_OPCODE_REGISTER, "NBT_OPCODE_REGISTER" },
446         { NBT_OPCODE_RELEASE, "NBT_OPCODE_RELEASE" },
447         { NBT_OPCODE_WACK, "NBT_OPCODE_WACK" },
448         { NBT_OPCODE_REFRESH, "NBT_OPCODE_REFRESH" },
449         { NBT_OPCODE_REFRESH2, "NBT_OPCODE_REFRESH2" },
450         { NBT_OPCODE_MULTI_HOME_REG, "NBT_OPCODE_MULTI_HOME_REG" },
451 { 0, NULL }
452 };
453 const value_string nbt_nbt_rcode_vals[] = {
454         { NBT_RCODE_OK, "NBT_RCODE_OK" },
455         { NBT_RCODE_FMT, "NBT_RCODE_FMT" },
456         { NBT_RCODE_SVR, "NBT_RCODE_SVR" },
457         { NBT_RCODE_NAM, "NBT_RCODE_NAM" },
458         { NBT_RCODE_IMP, "NBT_RCODE_IMP" },
459         { NBT_RCODE_RFS, "NBT_RCODE_RFS" },
460         { NBT_RCODE_ACT, "NBT_RCODE_ACT" },
461         { NBT_RCODE_CFT, "NBT_RCODE_CFT" },
462 { 0, NULL }
463 };
464 const value_string nbt_nbt_name_type_vals[] = {
465         { NBT_NAME_CLIENT, "NBT_NAME_CLIENT" },
466         { NBT_NAME_MS, "NBT_NAME_MS" },
467         { NBT_NAME_USER, "NBT_NAME_USER" },
468         { NBT_NAME_SERVER, "NBT_NAME_SERVER" },
469         { NBT_NAME_PDC, "NBT_NAME_PDC" },
470         { NBT_NAME_LOGON, "NBT_NAME_LOGON" },
471         { NBT_NAME_MASTER, "NBT_NAME_MASTER" },
472         { NBT_NAME_BROWSER, "NBT_NAME_BROWSER" },
473 { 0, NULL }
474 };
475 static int nbt_dissect_element_name_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
476 static int nbt_dissect_element_name_scope(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
477 static int nbt_dissect_element_name_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
478 const value_string nbt_nbt_qclass_vals[] = {
479         { NBT_QCLASS_IP, "NBT_QCLASS_IP" },
480 { 0, NULL }
481 };
482 const value_string nbt_nbt_qtype_vals[] = {
483         { NBT_QTYPE_ADDRESS, "NBT_QTYPE_ADDRESS" },
484         { NBT_QTYPE_NAMESERVICE, "NBT_QTYPE_NAMESERVICE" },
485         { NBT_QTYPE_NULL, "NBT_QTYPE_NULL" },
486         { NBT_QTYPE_NETBIOS, "NBT_QTYPE_NETBIOS" },
487         { NBT_QTYPE_STATUS, "NBT_QTYPE_STATUS" },
488 { 0, NULL }
489 };
490 static int nbt_dissect_element_name_question_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
491 static int nbt_dissect_element_name_question_question_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
492 static int nbt_dissect_element_name_question_question_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
493 const value_string nbt_nbt_node_type_vals[] = {
494         { NBT_NODE_B, "NBT_NODE_B" },
495         { NBT_NODE_P, "NBT_NODE_P" },
496         { NBT_NODE_M, "NBT_NODE_M" },
497         { NBT_NODE_H, "NBT_NODE_H" },
498 { 0, NULL }
499 };
500 static const true_false_string nb_flags_NBT_NM_PERMANENT_tfs = {
501    "NBT_NM_PERMANENT is SET",
502    "NBT_NM_PERMANENT is NOT SET",
503 };
504 static const true_false_string nb_flags_NBT_NM_ACTIVE_tfs = {
505    "NBT_NM_ACTIVE is SET",
506    "NBT_NM_ACTIVE is NOT SET",
507 };
508 static const true_false_string nb_flags_NBT_NM_CONFLICT_tfs = {
509    "NBT_NM_CONFLICT is SET",
510    "NBT_NM_CONFLICT is NOT SET",
511 };
512 static const true_false_string nb_flags_NBT_NM_DEREGISTER_tfs = {
513    "NBT_NM_DEREGISTER is SET",
514    "NBT_NM_DEREGISTER is NOT SET",
515 };
516 static const true_false_string nb_flags_NBT_NM_OWNER_TYPE_tfs = {
517    "NBT_NM_OWNER_TYPE is SET",
518    "NBT_NM_OWNER_TYPE is NOT SET",
519 };
520 static const true_false_string nb_flags_NBT_NM_GROUP_tfs = {
521    "NBT_NM_GROUP is SET",
522    "NBT_NM_GROUP is NOT SET",
523 };
524 static int nbt_dissect_element_rdata_address_nb_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
525 static int nbt_dissect_element_rdata_address_ipaddr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
526 static int nbt_dissect_element_rdata_netbios_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
527 static int nbt_dissect_element_rdata_netbios_addresses(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
528 static int nbt_dissect_element_rdata_netbios_addresses_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
529 static int nbt_dissect_element_statistics_unit_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
530 static int nbt_dissect_element_statistics_unit_id_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
531 static int nbt_dissect_element_statistics_jumpers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
532 static int nbt_dissect_element_statistics_test_result(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
533 static int nbt_dissect_element_statistics_version_number(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
534 static int nbt_dissect_element_statistics_period_of_statistics(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
535 static int nbt_dissect_element_statistics_number_of_crcs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
536 static int nbt_dissect_element_statistics_number_alignment_errors(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
537 static int nbt_dissect_element_statistics_number_of_collisions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
538 static int nbt_dissect_element_statistics_number_send_aborts(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
539 static int nbt_dissect_element_statistics_number_good_sends(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
540 static int nbt_dissect_element_statistics_number_good_receives(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
541 static int nbt_dissect_element_statistics_number_retransmits(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
542 static int nbt_dissect_element_statistics_number_no_resource_conditions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
543 static int nbt_dissect_element_statistics_number_free_command_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
544 static int nbt_dissect_element_statistics_total_number_command_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
545 static int nbt_dissect_element_statistics_max_total_number_command_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
546 static int nbt_dissect_element_statistics_number_pending_sessions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
547 static int nbt_dissect_element_statistics_max_number_pending_sessions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
548 static int nbt_dissect_element_statistics_max_total_sessions_possible(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
549 static int nbt_dissect_element_statistics_session_data_packet_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
550 static int nbt_dissect_element_status_name_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
551 static int nbt_dissect_element_status_name_name_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
552 static int nbt_dissect_element_status_name_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
553 static int nbt_dissect_element_status_name_nb_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
554 static int nbt_dissect_element_rdata_status_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
555 static int nbt_dissect_element_rdata_status_num_names(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
556 static int nbt_dissect_element_rdata_status_names(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
557 static int nbt_dissect_element_rdata_status_names_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
558 static int nbt_dissect_element_rdata_status_statistics(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
559 static int nbt_dissect_element_rdata_data_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
560 static int nbt_dissect_element_rdata_data_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
561 static int nbt_dissect_element_rdata_data_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
562 static int nbt_dissect_element_rdata_netbios(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
563 static int nbt_dissect_element_rdata_status(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
564 static int nbt_dissect_element_rdata_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
565 static int nbt_dissect_element_res_rec_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
566 static int nbt_dissect_element_res_rec_rr_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type);
567 static int nbt_dissect_element_res_rec_rr_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
568 static int nbt_dissect_element_res_rec_ttl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
569 static int nbt_dissect_element_res_rec_rdata(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type);
570 static int nbt_dissect_element_name_packet_name_trn_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
571 static int nbt_dissect_element_name_packet_operation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
572 static int nbt_dissect_element_name_packet_qdcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
573 static int nbt_dissect_element_name_packet_ancount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
574 static int nbt_dissect_element_name_packet_nscount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
575 static int nbt_dissect_element_name_packet_arcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
576 static int nbt_dissect_element_name_packet_questions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
577 static int nbt_dissect_element_name_packet_questions_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
578 static int nbt_dissect_element_name_packet_answers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
579 static int nbt_dissect_element_name_packet_answers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
580 static int nbt_dissect_element_name_packet_nsrecs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
581 static int nbt_dissect_element_name_packet_nsrecs_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
582 static int nbt_dissect_element_name_packet_additional(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
583 static int nbt_dissect_element_name_packet_additional_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
584 static int nbt_dissect_element_name_packet_padding(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
585 const value_string nbt_dgram_msg_type_vals[] = {
586         { DGRAM_DIRECT_UNIQUE, "DGRAM_DIRECT_UNIQUE" },
587         { DGRAM_DIRECT_GROUP, "DGRAM_DIRECT_GROUP" },
588         { DGRAM_BCAST, "DGRAM_BCAST" },
589         { DGRAM_ERROR, "DGRAM_ERROR" },
590         { DGRAM_QUERY, "DGRAM_QUERY" },
591         { DGRAM_QUERY_POSITIVE, "DGRAM_QUERY_POSITIVE" },
592         { DGRAM_QUERY_NEGATIVE, "DGRAM_QUERY_NEGATIVE" },
593 { 0, NULL }
594 };
595 static const true_false_string dgram_flags_DGRAM_FLAG_MORE_tfs = {
596    "DGRAM_FLAG_MORE is SET",
597    "DGRAM_FLAG_MORE is NOT SET",
598 };
599 static const true_false_string dgram_flags_DGRAM_FLAG_FIRST_tfs = {
600    "DGRAM_FLAG_FIRST is SET",
601    "DGRAM_FLAG_FIRST is NOT SET",
602 };
603 static const true_false_string dgram_flags_DGRAM_FLAG_NODE_TYPE_tfs = {
604    "DGRAM_FLAG_NODE_TYPE is SET",
605    "DGRAM_FLAG_NODE_TYPE is NOT SET",
606 };
607 const value_string nbt_dgram_node_type_vals[] = {
608         { DGRAM_NODE_B, "DGRAM_NODE_B" },
609         { DGRAM_NODE_P, "DGRAM_NODE_P" },
610         { DGRAM_NODE_M, "DGRAM_NODE_M" },
611         { DGRAM_NODE_NBDD, "DGRAM_NODE_NBDD" },
612 { 0, NULL }
613 };
614 const value_string nbt_smb_command_vals[] = {
615         { SMB_TRANSACTION, "SMB_TRANSACTION" },
616 { 0, NULL }
617 };
618 static int nbt_dissect_element_smb_trans_body_wct(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
619 static int nbt_dissect_element_smb_trans_body_total_param_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
620 static int nbt_dissect_element_smb_trans_body_total_data_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
621 static int nbt_dissect_element_smb_trans_body_max_param_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
622 static int nbt_dissect_element_smb_trans_body_max_data_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
623 static int nbt_dissect_element_smb_trans_body_max_setup_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
624 static int nbt_dissect_element_smb_trans_body_pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
625 static int nbt_dissect_element_smb_trans_body_trans_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
626 static int nbt_dissect_element_smb_trans_body_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
627 static int nbt_dissect_element_smb_trans_body_reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
628 static int nbt_dissect_element_smb_trans_body_param_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
629 static int nbt_dissect_element_smb_trans_body_param_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
630 static int nbt_dissect_element_smb_trans_body_data_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
631 static int nbt_dissect_element_smb_trans_body_data_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
632 static int nbt_dissect_element_smb_trans_body_setup_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
633 static int nbt_dissect_element_smb_trans_body_pad2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
634 static int nbt_dissect_element_smb_trans_body_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
635 static int nbt_dissect_element_smb_trans_body_priority(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
636 static int nbt_dissect_element_smb_trans_body__class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
637 static int nbt_dissect_element_smb_trans_body_byte_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
638 static int nbt_dissect_element_smb_trans_body_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
639 static int nbt_dissect_element_smb_trans_body_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
640 static int nbt_dissect_element_smb_body_trans(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
641 static int nbt_dissect_element_dgram_smb_packet_smb_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *smb_command);
642 static int nbt_dissect_element_dgram_smb_packet_err_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
643 static int nbt_dissect_element_dgram_smb_packet_pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
644 static int nbt_dissect_element_dgram_smb_packet_err_code(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
645 static int nbt_dissect_element_dgram_smb_packet_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
646 static int nbt_dissect_element_dgram_smb_packet_flags2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
647 static int nbt_dissect_element_dgram_smb_packet_pid_high(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
648 static int nbt_dissect_element_dgram_smb_packet_signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
649 static int nbt_dissect_element_dgram_smb_packet_signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
650 static int nbt_dissect_element_dgram_smb_packet_reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
651 static int nbt_dissect_element_dgram_smb_packet_tid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
652 static int nbt_dissect_element_dgram_smb_packet_pid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
653 static int nbt_dissect_element_dgram_smb_packet_vuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
654 static int nbt_dissect_element_dgram_smb_packet_mid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
655 static int nbt_dissect_element_dgram_smb_packet_body(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *smb_command);
656 static int nbt_dissect_element_dgram_message_body_smb(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
657 static int nbt_dissect_element_dgram_message_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
658 static int nbt_dissect_element_dgram_message_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
659 static int nbt_dissect_element_dgram_message_source_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
660 static int nbt_dissect_element_dgram_message_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
661 static int nbt_dissect_element_dgram_message_dgram_body_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, g *dgram_body_type);
662 static int nbt_dissect_element_dgram_message_body(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, g *dgram_body_type);
663 const value_string nbt_dgram_err_code_vals[] = {
664         { DGRAM_ERROR_NAME_NOT_PRESENT, "DGRAM_ERROR_NAME_NOT_PRESENT" },
665         { DGRAM_ERROR_INVALID_SOURCE, "DGRAM_ERROR_INVALID_SOURCE" },
666         { DGRAM_ERROR_INVALID_DEST, "DGRAM_ERROR_INVALID_DEST" },
667 { 0, NULL }
668 };
669 static int nbt_dissect_element_dgram_data_msg(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
670 static int nbt_dissect_element_dgram_data_msg(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
671 static int nbt_dissect_element_dgram_data_msg(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
672 static int nbt_dissect_element_dgram_data_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
673 static int nbt_dissect_element_dgram_data_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
674 static int nbt_dissect_element_dgram_data_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
675 static int nbt_dissect_element_dgram_data_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
676 static int nbt_dissect_element_dgram_packet_msg_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *msg_type);
677 static int nbt_dissect_element_dgram_packet_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
678 static int nbt_dissect_element_dgram_packet_dgram_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
679 static int nbt_dissect_element_dgram_packet_src_addr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
680 static int nbt_dissect_element_dgram_packet_src_port(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
681 static int nbt_dissect_element_dgram_packet_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *msg_type);
682 static int nbt_dissect_element_sockaddr_sockaddr_family(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
683 static int nbt_dissect_element_sockaddr_pdc_ip(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
684 static int nbt_dissect_element_sockaddr_remaining(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
685 static const true_false_string nbt_server_type_NBT_SERVER_PDC_tfs = {
686    "NBT_SERVER_PDC is SET",
687    "NBT_SERVER_PDC is NOT SET",
688 };
689 static const true_false_string nbt_server_type_NBT_SERVER_GC_tfs = {
690    "NBT_SERVER_GC is SET",
691    "NBT_SERVER_GC is NOT SET",
692 };
693 static const true_false_string nbt_server_type_NBT_SERVER_LDAP_tfs = {
694    "NBT_SERVER_LDAP is SET",
695    "NBT_SERVER_LDAP is NOT SET",
696 };
697 static const true_false_string nbt_server_type_NBT_SERVER_DS_tfs = {
698    "NBT_SERVER_DS is SET",
699    "NBT_SERVER_DS is NOT SET",
700 };
701 static const true_false_string nbt_server_type_NBT_SERVER_KDC_tfs = {
702    "NBT_SERVER_KDC is SET",
703    "NBT_SERVER_KDC is NOT SET",
704 };
705 static const true_false_string nbt_server_type_NBT_SERVER_TIMESERV_tfs = {
706    "NBT_SERVER_TIMESERV is SET",
707    "NBT_SERVER_TIMESERV is NOT SET",
708 };
709 static const true_false_string nbt_server_type_NBT_SERVER_CLOSEST_tfs = {
710    "NBT_SERVER_CLOSEST is SET",
711    "NBT_SERVER_CLOSEST is NOT SET",
712 };
713 static const true_false_string nbt_server_type_NBT_SERVER_WRITABLE_tfs = {
714    "NBT_SERVER_WRITABLE is SET",
715    "NBT_SERVER_WRITABLE is NOT SET",
716 };
717 static const true_false_string nbt_server_type_NBT_SERVER_GOOD_TIMESERV_tfs = {
718    "NBT_SERVER_GOOD_TIMESERV is SET",
719    "NBT_SERVER_GOOD_TIMESERV is NOT SET",
720 };
721 static const true_false_string nbt_server_type_NBT_SERVER_NDNC_tfs = {
722    "NBT_SERVER_NDNC is SET",
723    "NBT_SERVER_NDNC is NOT SET",
724 };
725 static const true_false_string nbt_server_type_NBT_SERVER_SELECT_SECRET_DOMAIN_6_tfs = {
726    "NBT_SERVER_SELECT_SECRET_DOMAIN_6 is SET",
727    "NBT_SERVER_SELECT_SECRET_DOMAIN_6 is NOT SET",
728 };
729 static const true_false_string nbt_server_type_NBT_SERVER_FULL_SECRET_DOMAIN_6_tfs = {
730    "NBT_SERVER_FULL_SECRET_DOMAIN_6 is SET",
731    "NBT_SERVER_FULL_SECRET_DOMAIN_6 is NOT SET",
732 };
733 static const true_false_string nbt_server_type_NBT_SERVER_ADS_WEB_SERVICE_tfs = {
734    "NBT_SERVER_ADS_WEB_SERVICE is SET",
735    "NBT_SERVER_ADS_WEB_SERVICE is NOT SET",
736 };
737 static const true_false_string nbt_server_type_NBT_SERVER_HAS_DNS_NAME_tfs = {
738    "NBT_SERVER_HAS_DNS_NAME is SET",
739    "NBT_SERVER_HAS_DNS_NAME is NOT SET",
740 };
741 static const true_false_string nbt_server_type_NBT_SERVER_IS_DEFAULT_NC_tfs = {
742    "NBT_SERVER_IS_DEFAULT_NC is SET",
743    "NBT_SERVER_IS_DEFAULT_NC is NOT SET",
744 };
745 static const true_false_string nbt_server_type_NBT_SERVER_FOREST_ROOT_tfs = {
746    "NBT_SERVER_FOREST_ROOT is SET",
747    "NBT_SERVER_FOREST_ROOT is NOT SET",
748 };
749 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_1_tfs = {
750    "NETLOGON_NT_VERSION_1 is SET",
751    "NETLOGON_NT_VERSION_1 is NOT SET",
752 };
753 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_5_tfs = {
754    "NETLOGON_NT_VERSION_5 is SET",
755    "NETLOGON_NT_VERSION_5 is NOT SET",
756 };
757 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX_tfs = {
758    "NETLOGON_NT_VERSION_5EX is SET",
759    "NETLOGON_NT_VERSION_5EX is NOT SET",
760 };
761 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX_WITH_IP_tfs = {
762    "NETLOGON_NT_VERSION_5EX_WITH_IP is SET",
763    "NETLOGON_NT_VERSION_5EX_WITH_IP is NOT SET",
764 };
765 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_WITH_CLOSEST_SITE_tfs = {
766    "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE is SET",
767    "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE is NOT SET",
768 };
769 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_AVOID_NT4EMUL_tfs = {
770    "NETLOGON_NT_VERSION_AVOID_NT4EMUL is SET",
771    "NETLOGON_NT_VERSION_AVOID_NT4EMUL is NOT SET",
772 };
773 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_PDC_tfs = {
774    "NETLOGON_NT_VERSION_PDC is SET",
775    "NETLOGON_NT_VERSION_PDC is NOT SET",
776 };
777 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_IP_tfs = {
778    "NETLOGON_NT_VERSION_IP is SET",
779    "NETLOGON_NT_VERSION_IP is NOT SET",
780 };
781 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_LOCAL_tfs = {
782    "NETLOGON_NT_VERSION_LOCAL is SET",
783    "NETLOGON_NT_VERSION_LOCAL is NOT SET",
784 };
785 static const true_false_string netlogon_nt_version_flags_NETLOGON_NT_VERSION_GC_tfs = {
786    "NETLOGON_NT_VERSION_GC is SET",
787    "NETLOGON_NT_VERSION_GC is NOT SET",
788 };
789 const value_string nbt_netlogon_command_vals[] = {
790         { LOGON_REQUEST, "LOGON_REQUEST" },
791         { LOGON_RESPONSE2, "LOGON_RESPONSE2" },
792         { LOGON_PRIMARY_QUERY, "LOGON_PRIMARY_QUERY" },
793         { NETLOGON_ANNOUNCE_UAS, "NETLOGON_ANNOUNCE_UAS" },
794         { NETLOGON_RESPONSE_FROM_PDC, "NETLOGON_RESPONSE_FROM_PDC" },
795         { LOGON_SAM_LOGON_REQUEST, "LOGON_SAM_LOGON_REQUEST" },
796         { LOGON_SAM_LOGON_RESPONSE, "LOGON_SAM_LOGON_RESPONSE" },
797         { LOGON_SAM_LOGON_PAUSE_RESPONSE, "LOGON_SAM_LOGON_PAUSE_RESPONSE" },
798         { LOGON_SAM_LOGON_USER_UNKNOWN, "LOGON_SAM_LOGON_USER_UNKNOWN" },
799         { LOGON_SAM_LOGON_RESPONSE_EX, "LOGON_SAM_LOGON_RESPONSE_EX" },
800         { LOGON_SAM_LOGON_PAUSE_RESPONSE_EX, "LOGON_SAM_LOGON_PAUSE_RESPONSE_EX" },
801         { LOGON_SAM_LOGON_USER_UNKNOWN_EX, "LOGON_SAM_LOGON_USER_UNKNOWN_EX" },
802 { 0, NULL }
803 };
804 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_request_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
805 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
806 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
807 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
808 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_acct_control(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
809 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
810 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
811 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
812 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
813 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
814 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
815 static int nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
816 static int nbt_dissect_element_NETLOGON_LOGON_REQUEST_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
817 static int nbt_dissect_element_NETLOGON_LOGON_REQUEST_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
818 static int nbt_dissect_element_NETLOGON_LOGON_REQUEST_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
819 static int nbt_dissect_element_NETLOGON_LOGON_REQUEST_request_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
820 static int nbt_dissect_element_NETLOGON_LOGON_REQUEST_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
821 static int nbt_dissect_element_NETLOGON_LOGON_REQUEST_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
822 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
823 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
824 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
825 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
826 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
827 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
828 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
829 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
830 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
831 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
832 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
833 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_domain_uuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
834 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_zero_uuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
835 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_forest(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
836 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_dns_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
837 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_dns_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
838 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_ip(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
839 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_server_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
840 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
841 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
842 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
843 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
844 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sbz(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
845 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_server_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
846 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_uuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
847 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_forest(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
848 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_dns_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
849 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_dns_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
850 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
851 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
852 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
853 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_server_site(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
854 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_client_site(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
855 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
856 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
857 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
858 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_next_closest_site(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
859 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
860 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
861 static int nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
862 static int nbt_dissect_element_netlogon_query_for_pdc_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
863 static int nbt_dissect_element_netlogon_query_for_pdc_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
864 static int nbt_dissect_element_netlogon_query_for_pdc__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
865 static int nbt_dissect_element_netlogon_query_for_pdc_unicode_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
866 static int nbt_dissect_element_netlogon_query_for_pdc_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
867 static int nbt_dissect_element_netlogon_query_for_pdc_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
868 static int nbt_dissect_element_netlogon_query_for_pdc_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
869 static int nbt_dissect_element_netlogon_response_from_pdc_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
870 static int nbt_dissect_element_netlogon_response_from_pdc_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
871 static int nbt_dissect_element_netlogon_response_from_pdc__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
872 static int nbt_dissect_element_netlogon_response_from_pdc_unicode_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
873 static int nbt_dissect_element_netlogon_response_from_pdc_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
874 static int nbt_dissect_element_netlogon_response_from_pdc_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
875 static int nbt_dissect_element_netlogon_response_from_pdc_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
876 static int nbt_dissect_element_netlogon_response_from_pdc_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
877 static int nbt_dissect_element_netlogon_response2_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
878 static int nbt_dissect_element_netlogon_response2_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
879 static int nbt_dissect_element_netlogon_response2_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
880 static int nbt_dissect_element_db_change_info_db_index(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
881 static int nbt_dissect_element_db_change_info_serial(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
882 static int nbt_dissect_element_db_change_info_timestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
883 static int nbt_dissect_element_NETLOGON_DB_CHANGE_serial_lo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
884 static int nbt_dissect_element_NETLOGON_DB_CHANGE_timestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
885 static int nbt_dissect_element_NETLOGON_DB_CHANGE_pulse(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
886 static int nbt_dissect_element_NETLOGON_DB_CHANGE_random(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
887 static int nbt_dissect_element_NETLOGON_DB_CHANGE_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
888 static int nbt_dissect_element_NETLOGON_DB_CHANGE_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
889 static int nbt_dissect_element_NETLOGON_DB_CHANGE__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
890 static int nbt_dissect_element_NETLOGON_DB_CHANGE_unicode_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
891 static int nbt_dissect_element_NETLOGON_DB_CHANGE_unicode_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
892 static int nbt_dissect_element_NETLOGON_DB_CHANGE_db_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
893 static int nbt_dissect_element_NETLOGON_DB_CHANGE_dbchange(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
894 static int nbt_dissect_element_NETLOGON_DB_CHANGE_dbchange_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
895 static int nbt_dissect_element_NETLOGON_DB_CHANGE_sid_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
896 static int nbt_dissect_element_NETLOGON_DB_CHANGE_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
897 static int nbt_dissect_element_NETLOGON_DB_CHANGE_sid_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
898 static int nbt_dissect_element_NETLOGON_DB_CHANGE_message_format_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
899 static int nbt_dissect_element_NETLOGON_DB_CHANGE_message_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
900 static int nbt_dissect_element_netlogon_request_logon0(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
901 static int nbt_dissect_element_netlogon_request_logon(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
902 static int nbt_dissect_element_netlogon_request_pdc(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
903 static int nbt_dissect_element_netlogon_request_uas(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
904 static int nbt_dissect_element_netlogon_packet_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *command);
905 static int nbt_dissect_element_netlogon_packet_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *command);
906 const value_string nbt_nbt_browse_opcode_vals[] = {
907         { HostAnnouncement, "HostAnnouncement" },
908         { AnnouncementRequest, "AnnouncementRequest" },
909         { Election, "Election" },
910         { GetBackupListReq, "GetBackupListReq" },
911         { GetBackupListResp, "GetBackupListResp" },
912         { BecomeBackup, "BecomeBackup" },
913         { DomainAnnouncement, "DomainAnnouncement" },
914         { MasterAnnouncement, "MasterAnnouncement" },
915         { ResetBrowserState, "ResetBrowserState" },
916         { LocalMasterAnnouncement, "LocalMasterAnnouncement" },
917 { 0, NULL }
918 };
919 static int nbt_dissect_element_browse_host_announcement_UpdateCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
920 static int nbt_dissect_element_browse_host_announcement_Periodicity(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
921 static int nbt_dissect_element_browse_host_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
922 static int nbt_dissect_element_browse_host_announcement_ServerName_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
923 static int nbt_dissect_element_browse_host_announcement_OSMajor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
924 static int nbt_dissect_element_browse_host_announcement_OSMinor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
925 static int nbt_dissect_element_browse_host_announcement_ServerType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
926 static int nbt_dissect_element_browse_host_announcement_BroMajorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
927 static int nbt_dissect_element_browse_host_announcement_BroMinorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
928 static int nbt_dissect_element_browse_host_announcement_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
929 static int nbt_dissect_element_browse_host_announcement_Comment(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
930 static int nbt_dissect_element_browse_announcement_request_Unused(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
931 static int nbt_dissect_element_browse_announcement_request_ResponseName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
932 static int nbt_dissect_element_browse_election_request_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
933 static int nbt_dissect_element_browse_election_request_Criteria(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
934 static int nbt_dissect_element_browse_election_request_UpTime(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
935 static int nbt_dissect_element_browse_election_request_Reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
936 static int nbt_dissect_element_browse_election_request_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
937 static int nbt_dissect_element_browse_backup_list_request_ReqCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
938 static int nbt_dissect_element_browse_backup_list_request_Token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
939 static int nbt_dissect_element_browse_backup_list_response_BackupCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
940 static int nbt_dissect_element_browse_backup_list_response_Token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
941 static int nbt_dissect_element_browse_backup_list_response_BackupServerList(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
942 static int nbt_dissect_element_browse_backup_list_response_BackupServerList_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
943 static int nbt_dissect_element_browse_become_backup_BrowserName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
944 static int nbt_dissect_element_browse_domain_announcement_UpdateCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
945 static int nbt_dissect_element_browse_domain_announcement_Periodicity(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
946 static int nbt_dissect_element_browse_domain_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
947 static int nbt_dissect_element_browse_domain_announcement_ServerName_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
948 static int nbt_dissect_element_browse_domain_announcement_OSMajor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
949 static int nbt_dissect_element_browse_domain_announcement_OSMinor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
950 static int nbt_dissect_element_browse_domain_announcement_ServerType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
951 static int nbt_dissect_element_browse_domain_announcement_MysteriousField(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
952 static int nbt_dissect_element_browse_domain_announcement_Comment(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
953 static int nbt_dissect_element_browse_master_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
954 static int nbt_dissect_element_browse_reset_state_Command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
955 static int nbt_dissect_element_browse_local_master_announcement_UpdateCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
956 static int nbt_dissect_element_browse_local_master_announcement_Periodicity(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
957 static int nbt_dissect_element_browse_local_master_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
958 static int nbt_dissect_element_browse_local_master_announcement_ServerName_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
959 static int nbt_dissect_element_browse_local_master_announcement_OSMajor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
960 static int nbt_dissect_element_browse_local_master_announcement_OSMinor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
961 static int nbt_dissect_element_browse_local_master_announcement_ServerType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
962 static int nbt_dissect_element_browse_local_master_announcement_BroMajorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
963 static int nbt_dissect_element_browse_local_master_announcement_BroMinorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
964 static int nbt_dissect_element_browse_local_master_announcement_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
965 static int nbt_dissect_element_browse_local_master_announcement_Comment(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
966 static int nbt_dissect_element_browse_payload_host_annoucement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
967 static int nbt_dissect_element_browse_payload_announcement_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
968 static int nbt_dissect_element_browse_payload_election_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
969 static int nbt_dissect_element_browse_payload_backup_list_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
970 static int nbt_dissect_element_browse_payload_backup_list_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
971 static int nbt_dissect_element_browse_payload_become_backup(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
972 static int nbt_dissect_element_browse_payload_domain_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
973 static int nbt_dissect_element_browse_payload_master_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
974 static int nbt_dissect_element_browse_payload_reset_browser_state(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
975 static int nbt_dissect_element_browse_payload_local_master_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
976 static int nbt_dissect_element_browse_packet_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *opcode);
977 static int nbt_dissect_element_browse_packet_payload(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *opcode);
978 static int nbt_dissect_element_decode_nbt_netlogon_packet_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
979
980
981 /* IDL: bitmap { */
982 /* IDL:         NBT_RCODE =  0x000F , */
983 /* IDL:         NBT_FLAG_BROADCAST =  0x0010 , */
984 /* IDL:         NBT_FLAG_RECURSION_AVAIL =  0x0080 , */
985 /* IDL:         NBT_FLAG_RECURSION_DESIRED =  0x0100 , */
986 /* IDL:         NBT_FLAG_TRUNCATION =  0x0200 , */
987 /* IDL:         NBT_FLAG_AUTHORITATIVE =  0x0400 , */
988 /* IDL:         NBT_OPCODE =  0x7800 , */
989 /* IDL:         NBT_FLAG_REPLY =  0x8000 , */
990 /* IDL: } */
991
992 int
993 nbt_dissect_bitmap_operation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
994 {
995         proto_item *item = NULL;
996         proto_tree *tree = NULL;
997
998         guint16 flags;
999         ALIGN_TO_2_BYTES;
1000
1001         if (parent_tree) {
1002                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 2, DREP_ENC_INTEGER(drep));
1003                 tree = proto_item_add_subtree(item,ett_nbt_nbt_operation);
1004         }
1005
1006         offset = dissect_ndr_uint16(tvb, offset, pinfo, NULL, drep, -1, &flags);
1007         proto_item_append_text(item, ": ");
1008
1009         if (!flags)
1010                 proto_item_append_text(item, "(No values set)");
1011
1012         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_RCODE, tvb, offset-2, 2, flags);
1013         if (flags&( 0x000F )){
1014                 proto_item_append_text(item, "NBT_RCODE");
1015                 if (flags & (~( 0x000F )))
1016                         proto_item_append_text(item, ", ");
1017         }
1018         flags&=(~( 0x000F ));
1019
1020         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_FLAG_BROADCAST, tvb, offset-2, 2, flags);
1021         if (flags&( 0x0010 )){
1022                 proto_item_append_text(item, "NBT_FLAG_BROADCAST");
1023                 if (flags & (~( 0x0010 )))
1024                         proto_item_append_text(item, ", ");
1025         }
1026         flags&=(~( 0x0010 ));
1027
1028         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_FLAG_RECURSION_AVAIL, tvb, offset-2, 2, flags);
1029         if (flags&( 0x0080 )){
1030                 proto_item_append_text(item, "NBT_FLAG_RECURSION_AVAIL");
1031                 if (flags & (~( 0x0080 )))
1032                         proto_item_append_text(item, ", ");
1033         }
1034         flags&=(~( 0x0080 ));
1035
1036         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_FLAG_RECURSION_DESIRED, tvb, offset-2, 2, flags);
1037         if (flags&( 0x0100 )){
1038                 proto_item_append_text(item, "NBT_FLAG_RECURSION_DESIRED");
1039                 if (flags & (~( 0x0100 )))
1040                         proto_item_append_text(item, ", ");
1041         }
1042         flags&=(~( 0x0100 ));
1043
1044         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_FLAG_TRUNCATION, tvb, offset-2, 2, flags);
1045         if (flags&( 0x0200 )){
1046                 proto_item_append_text(item, "NBT_FLAG_TRUNCATION");
1047                 if (flags & (~( 0x0200 )))
1048                         proto_item_append_text(item, ", ");
1049         }
1050         flags&=(~( 0x0200 ));
1051
1052         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_FLAG_AUTHORITATIVE, tvb, offset-2, 2, flags);
1053         if (flags&( 0x0400 )){
1054                 proto_item_append_text(item, "NBT_FLAG_AUTHORITATIVE");
1055                 if (flags & (~( 0x0400 )))
1056                         proto_item_append_text(item, ", ");
1057         }
1058         flags&=(~( 0x0400 ));
1059
1060         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_OPCODE, tvb, offset-2, 2, flags);
1061         if (flags&( 0x7800 )){
1062                 proto_item_append_text(item, "NBT_OPCODE");
1063                 if (flags & (~( 0x7800 )))
1064                         proto_item_append_text(item, ", ");
1065         }
1066         flags&=(~( 0x7800 ));
1067
1068         proto_tree_add_boolean(tree, hf_nbt_nbt_operation_NBT_FLAG_REPLY, tvb, offset-2, 2, flags);
1069         if (flags&( 0x8000 )){
1070                 proto_item_append_text(item, "NBT_FLAG_REPLY");
1071                 if (flags & (~( 0x8000 )))
1072                         proto_item_append_text(item, ", ");
1073         }
1074         flags&=(~( 0x8000 ));
1075
1076         if (flags) {
1077                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
1078         }
1079
1080         return offset;
1081 }
1082
1083
1084 /* IDL: enum { */
1085 /* IDL:         NBT_OPCODE_QUERY=(0x0<<11), */
1086 /* IDL:         NBT_OPCODE_REGISTER=(0x5<<11), */
1087 /* IDL:         NBT_OPCODE_RELEASE=(0x6<<11), */
1088 /* IDL:         NBT_OPCODE_WACK=(0x7<<11), */
1089 /* IDL:         NBT_OPCODE_REFRESH=(0x8<<11), */
1090 /* IDL:         NBT_OPCODE_REFRESH2=(0x9<<11), */
1091 /* IDL:         NBT_OPCODE_MULTI_HOME_REG=(0xf<<11), */
1092 /* IDL: } */
1093
1094 int
1095 nbt_dissect_enum_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
1096 {
1097         guint1632 parameter=0;
1098         if(param){
1099                 parameter=(guint1632)*param;
1100         }
1101         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1102         if(param){
1103                 *param=(guint32)parameter;
1104         }
1105         return offset;
1106 }
1107
1108
1109 /* IDL: enum { */
1110 /* IDL:         NBT_RCODE_OK=0x0, */
1111 /* IDL:         NBT_RCODE_FMT=0x1, */
1112 /* IDL:         NBT_RCODE_SVR=0x2, */
1113 /* IDL:         NBT_RCODE_NAM=0x3, */
1114 /* IDL:         NBT_RCODE_IMP=0x4, */
1115 /* IDL:         NBT_RCODE_RFS=0x5, */
1116 /* IDL:         NBT_RCODE_ACT=0x6, */
1117 /* IDL:         NBT_RCODE_CFT=0x7, */
1118 /* IDL: } */
1119
1120 int
1121 nbt_dissect_enum_rcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
1122 {
1123         guint1632 parameter=0;
1124         if(param){
1125                 parameter=(guint1632)*param;
1126         }
1127         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1128         if(param){
1129                 *param=(guint32)parameter;
1130         }
1131         return offset;
1132 }
1133
1134
1135 /* IDL: enum { */
1136 /* IDL:         NBT_NAME_CLIENT=0x00, */
1137 /* IDL:         NBT_NAME_MS=0x01, */
1138 /* IDL:         NBT_NAME_USER=0x03, */
1139 /* IDL:         NBT_NAME_SERVER=0x20, */
1140 /* IDL:         NBT_NAME_PDC=0x1B, */
1141 /* IDL:         NBT_NAME_LOGON=0x1C, */
1142 /* IDL:         NBT_NAME_MASTER=0x1D, */
1143 /* IDL:         NBT_NAME_BROWSER=0x1E, */
1144 /* IDL: } */
1145
1146 int
1147 nbt_dissect_enum_name_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
1148 {
1149         guint8 parameter=0;
1150         if(param){
1151                 parameter=(guint8)*param;
1152         }
1153         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1154         if(param){
1155                 *param=(guint32)parameter;
1156         }
1157         return offset;
1158 }
1159
1160
1161 /* IDL: struct { */
1162 /* IDL:         string name; */
1163 /* IDL:         string scope; */
1164 /* IDL:         nbt_name_type type; */
1165 /* IDL: } */
1166
1167 static int
1168 nbt_dissect_element_name_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1169 {
1170
1171         return offset;
1172 }
1173
1174 static int
1175 nbt_dissect_element_name_scope(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1176 {
1177
1178         return offset;
1179 }
1180
1181 static int
1182 nbt_dissect_element_name_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1183 {
1184         offset = nbt_dissect_enum_name_type(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_type, 0);
1185
1186         return offset;
1187 }
1188
1189 int
1190 nbt_dissect_struct_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1191 {
1192         proto_item *item = NULL;
1193         proto_tree *tree = NULL;
1194         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1195         int old_offset;
1196
1197         ALIGN_TO_4_BYTES;
1198
1199         old_offset = offset;
1200
1201         if (parent_tree) {
1202                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1203                 tree = proto_item_add_subtree(item, ett_nbt_nbt_name);
1204         }
1205         
1206         offset = nbt_dissect_element_name_name(tvb, offset, pinfo, tree, drep);
1207
1208         offset = nbt_dissect_element_name_scope(tvb, offset, pinfo, tree, drep);
1209
1210         offset = nbt_dissect_element_name_type(tvb, offset, pinfo, tree, drep);
1211
1212
1213         proto_item_set_len(item, offset-old_offset);
1214
1215
1216         if (di->call_data->flags & DCERPC_IS_NDR64) {
1217                 ALIGN_TO_4_BYTES;
1218         }
1219
1220         return offset;
1221 }
1222
1223
1224 /* IDL: enum { */
1225 /* IDL:         NBT_QCLASS_IP=0x01, */
1226 /* IDL: } */
1227
1228 int
1229 nbt_dissect_enum_qclass(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
1230 {
1231         guint16 parameter=0;
1232         if(param){
1233                 parameter=(guint16)*param;
1234         }
1235         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1236         if(param){
1237                 *param=(guint32)parameter;
1238         }
1239         return offset;
1240 }
1241
1242
1243 /* IDL: enum { */
1244 /* IDL:         NBT_QTYPE_ADDRESS=0x0001, */
1245 /* IDL:         NBT_QTYPE_NAMESERVICE=0x0002, */
1246 /* IDL:         NBT_QTYPE_NULL=0x000A, */
1247 /* IDL:         NBT_QTYPE_NETBIOS=0x0020, */
1248 /* IDL:         NBT_QTYPE_STATUS=0x0021, */
1249 /* IDL: } */
1250
1251 int
1252 nbt_dissect_enum_qtype(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
1253 {
1254         guint16 parameter=0;
1255         if(param){
1256                 parameter=(guint16)*param;
1257         }
1258         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1259         if(param){
1260                 *param=(guint32)parameter;
1261         }
1262         return offset;
1263 }
1264
1265
1266 /* IDL: struct { */
1267 /* IDL:         nbt_name name; */
1268 /* IDL:         nbt_qtype question_type; */
1269 /* IDL:         nbt_qclass question_class; */
1270 /* IDL: } */
1271
1272 static int
1273 nbt_dissect_element_name_question_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1274 {
1275         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_name_question_name,0);
1276
1277         return offset;
1278 }
1279
1280 static int
1281 nbt_dissect_element_name_question_question_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1282 {
1283         offset = nbt_dissect_enum_qtype(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_question_question_type, 0);
1284
1285         return offset;
1286 }
1287
1288 static int
1289 nbt_dissect_element_name_question_question_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1290 {
1291         offset = nbt_dissect_enum_qclass(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_question_question_class, 0);
1292
1293         return offset;
1294 }
1295
1296 int
1297 nbt_dissect_struct_name_question(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1298 {
1299         proto_item *item = NULL;
1300         proto_tree *tree = NULL;
1301         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1302         int old_offset;
1303
1304         ALIGN_TO_4_BYTES;
1305
1306         old_offset = offset;
1307
1308         if (parent_tree) {
1309                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1310                 tree = proto_item_add_subtree(item, ett_nbt_nbt_name_question);
1311         }
1312         
1313         offset = nbt_dissect_element_name_question_name(tvb, offset, pinfo, tree, drep);
1314
1315         offset = nbt_dissect_element_name_question_question_type(tvb, offset, pinfo, tree, drep);
1316
1317         offset = nbt_dissect_element_name_question_question_class(tvb, offset, pinfo, tree, drep);
1318
1319
1320         proto_item_set_len(item, offset-old_offset);
1321
1322
1323         if (di->call_data->flags & DCERPC_IS_NDR64) {
1324                 ALIGN_TO_4_BYTES;
1325         }
1326
1327         return offset;
1328 }
1329
1330
1331 /* IDL: enum { */
1332 /* IDL:         NBT_NODE_B=0x0000, */
1333 /* IDL:         NBT_NODE_P=0x2000, */
1334 /* IDL:         NBT_NODE_M=0x4000, */
1335 /* IDL:         NBT_NODE_H=0x6000, */
1336 /* IDL: } */
1337
1338 int
1339 nbt_dissect_enum_node_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
1340 {
1341         guint1632 parameter=0;
1342         if(param){
1343                 parameter=(guint1632)*param;
1344         }
1345         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1346         if(param){
1347                 *param=(guint32)parameter;
1348         }
1349         return offset;
1350 }
1351
1352
1353 /* IDL: bitmap { */
1354 /* IDL:         NBT_NM_PERMANENT =  0x0200 , */
1355 /* IDL:         NBT_NM_ACTIVE =  0x0400 , */
1356 /* IDL:         NBT_NM_CONFLICT =  0x0800 , */
1357 /* IDL:         NBT_NM_DEREGISTER =  0x1000 , */
1358 /* IDL:         NBT_NM_OWNER_TYPE =  0x6000 , */
1359 /* IDL:         NBT_NM_GROUP =  0x8000 , */
1360 /* IDL: } */
1361
1362 int
1363 nbt_dissect_bitmap_nb_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1364 {
1365         proto_item *item = NULL;
1366         proto_tree *tree = NULL;
1367
1368         guint16 flags;
1369         ALIGN_TO_2_BYTES;
1370
1371         if (parent_tree) {
1372                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 2, DREP_ENC_INTEGER(drep));
1373                 tree = proto_item_add_subtree(item,ett_nbt_nb_flags);
1374         }
1375
1376         offset = dissect_ndr_uint16(tvb, offset, pinfo, NULL, drep, -1, &flags);
1377         proto_item_append_text(item, ": ");
1378
1379         if (!flags)
1380                 proto_item_append_text(item, "(No values set)");
1381
1382         proto_tree_add_boolean(tree, hf_nbt_nb_flags_NBT_NM_PERMANENT, tvb, offset-2, 2, flags);
1383         if (flags&( 0x0200 )){
1384                 proto_item_append_text(item, "NBT_NM_PERMANENT");
1385                 if (flags & (~( 0x0200 )))
1386                         proto_item_append_text(item, ", ");
1387         }
1388         flags&=(~( 0x0200 ));
1389
1390         proto_tree_add_boolean(tree, hf_nbt_nb_flags_NBT_NM_ACTIVE, tvb, offset-2, 2, flags);
1391         if (flags&( 0x0400 )){
1392                 proto_item_append_text(item, "NBT_NM_ACTIVE");
1393                 if (flags & (~( 0x0400 )))
1394                         proto_item_append_text(item, ", ");
1395         }
1396         flags&=(~( 0x0400 ));
1397
1398         proto_tree_add_boolean(tree, hf_nbt_nb_flags_NBT_NM_CONFLICT, tvb, offset-2, 2, flags);
1399         if (flags&( 0x0800 )){
1400                 proto_item_append_text(item, "NBT_NM_CONFLICT");
1401                 if (flags & (~( 0x0800 )))
1402                         proto_item_append_text(item, ", ");
1403         }
1404         flags&=(~( 0x0800 ));
1405
1406         proto_tree_add_boolean(tree, hf_nbt_nb_flags_NBT_NM_DEREGISTER, tvb, offset-2, 2, flags);
1407         if (flags&( 0x1000 )){
1408                 proto_item_append_text(item, "NBT_NM_DEREGISTER");
1409                 if (flags & (~( 0x1000 )))
1410                         proto_item_append_text(item, ", ");
1411         }
1412         flags&=(~( 0x1000 ));
1413
1414         proto_tree_add_boolean(tree, hf_nbt_nb_flags_NBT_NM_OWNER_TYPE, tvb, offset-2, 2, flags);
1415         if (flags&( 0x6000 )){
1416                 proto_item_append_text(item, "NBT_NM_OWNER_TYPE");
1417                 if (flags & (~( 0x6000 )))
1418                         proto_item_append_text(item, ", ");
1419         }
1420         flags&=(~( 0x6000 ));
1421
1422         proto_tree_add_boolean(tree, hf_nbt_nb_flags_NBT_NM_GROUP, tvb, offset-2, 2, flags);
1423         if (flags&( 0x8000 )){
1424                 proto_item_append_text(item, "NBT_NM_GROUP");
1425                 if (flags & (~( 0x8000 )))
1426                         proto_item_append_text(item, ", ");
1427         }
1428         flags&=(~( 0x8000 ));
1429
1430         if (flags) {
1431                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
1432         }
1433
1434         return offset;
1435 }
1436
1437
1438 /* IDL: struct { */
1439 /* IDL:         nb_flags nb_flags; */
1440 /* IDL:         ipv4address ipaddr; */
1441 /* IDL: } */
1442
1443 static int
1444 nbt_dissect_element_rdata_address_nb_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1445 {
1446         offset = nbt_dissect_bitmap_nb_flags(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_rdata_address_nb_flags, 0);
1447
1448         return offset;
1449 }
1450
1451 static int
1452 nbt_dissect_element_rdata_address_ipaddr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1453 {
1454         offset = nbt_dissect_struct_ipv4address(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_rdata_address_ipaddr,0);
1455
1456         return offset;
1457 }
1458
1459 int
1460 nbt_dissect_struct_rdata_address(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1461 {
1462         proto_item *item = NULL;
1463         proto_tree *tree = NULL;
1464         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1465         int old_offset;
1466
1467         ALIGN_TO_4_BYTES;
1468
1469         old_offset = offset;
1470
1471         if (parent_tree) {
1472                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1473                 tree = proto_item_add_subtree(item, ett_nbt_nbt_rdata_address);
1474         }
1475         
1476         offset = nbt_dissect_element_rdata_address_nb_flags(tvb, offset, pinfo, tree, drep);
1477
1478         offset = nbt_dissect_element_rdata_address_ipaddr(tvb, offset, pinfo, tree, drep);
1479
1480
1481         proto_item_set_len(item, offset-old_offset);
1482
1483
1484         if (di->call_data->flags & DCERPC_IS_NDR64) {
1485                 ALIGN_TO_4_BYTES;
1486         }
1487
1488         return offset;
1489 }
1490
1491
1492 /* IDL: struct { */
1493 /* IDL:         uint16 length; */
1494 /* IDL:         nbt_rdata_address addresses[length/6]; */
1495 /* IDL: } */
1496
1497 static int
1498 nbt_dissect_element_rdata_netbios_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1499 {
1500         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_rdata_netbios_length, 0);
1501
1502         return offset;
1503 }
1504
1505 static int
1506 nbt_dissect_element_rdata_netbios_addresses(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1507 {
1508
1509         return offset;
1510 }
1511
1512 static int
1513 nbt_dissect_element_rdata_netbios_addresses_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1514 {
1515         offset = nbt_dissect_struct_rdata_address(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_rdata_netbios_addresses,0);
1516
1517         return offset;
1518 }
1519
1520 int
1521 nbt_dissect_struct_rdata_netbios(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1522 {
1523         proto_item *item = NULL;
1524         proto_tree *tree = NULL;
1525         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1526         int old_offset;
1527
1528         ALIGN_TO_4_BYTES;
1529
1530         old_offset = offset;
1531
1532         if (parent_tree) {
1533                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1534                 tree = proto_item_add_subtree(item, ett_nbt_nbt_rdata_netbios);
1535         }
1536         
1537         offset = nbt_dissect_element_rdata_netbios_length(tvb, offset, pinfo, tree, drep);
1538
1539         offset = nbt_dissect_element_rdata_netbios_addresses(tvb, offset, pinfo, tree, drep);
1540
1541
1542         proto_item_set_len(item, offset-old_offset);
1543
1544
1545         if (di->call_data->flags & DCERPC_IS_NDR64) {
1546                 ALIGN_TO_4_BYTES;
1547         }
1548
1549         return offset;
1550 }
1551
1552
1553 /* IDL: struct { */
1554 /* IDL:         uint8 unit_id[6]; */
1555 /* IDL:         uint8 jumpers; */
1556 /* IDL:         uint8 test_result; */
1557 /* IDL:         uint16 version_number; */
1558 /* IDL:         uint16 period_of_statistics; */
1559 /* IDL:         uint16 number_of_crcs; */
1560 /* IDL:         uint16 number_alignment_errors; */
1561 /* IDL:         uint16 number_of_collisions; */
1562 /* IDL:         uint16 number_send_aborts; */
1563 /* IDL:         uint32 number_good_sends; */
1564 /* IDL:         uint32 number_good_receives; */
1565 /* IDL:         uint16 number_retransmits; */
1566 /* IDL:         uint16 number_no_resource_conditions; */
1567 /* IDL:         uint16 number_free_command_blocks; */
1568 /* IDL:         uint16 total_number_command_blocks; */
1569 /* IDL:         uint16 max_total_number_command_blocks; */
1570 /* IDL:         uint16 number_pending_sessions; */
1571 /* IDL:         uint16 max_number_pending_sessions; */
1572 /* IDL:         uint16 max_total_sessions_possible; */
1573 /* IDL:         uint16 session_data_packet_size; */
1574 /* IDL: } */
1575
1576 static int
1577 nbt_dissect_element_statistics_unit_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1578 {
1579         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1580         int conformant = di->conformant_run;
1581         if (!conformant) {
1582                 offset = nbt_dissect_element_statistics_unit_id_(tvb, offset, 6, pinfo, tree, drep);
1583         }
1584
1585         return offset;
1586 }
1587
1588 static int
1589 nbt_dissect_element_statistics_unit_id_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1590 {
1591         proto_tree_add_bytes(tree, hf_nbt_nbt_statistics_unit_id, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1592
1593         return offset;
1594 }
1595
1596 static int
1597 nbt_dissect_element_statistics_jumpers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1598 {
1599         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_jumpers, 0);
1600
1601         return offset;
1602 }
1603
1604 static int
1605 nbt_dissect_element_statistics_test_result(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1606 {
1607         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_test_result, 0);
1608
1609         return offset;
1610 }
1611
1612 static int
1613 nbt_dissect_element_statistics_version_number(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1614 {
1615         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_version_number, 0);
1616
1617         return offset;
1618 }
1619
1620 static int
1621 nbt_dissect_element_statistics_period_of_statistics(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1622 {
1623         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_period_of_statistics, 0);
1624
1625         return offset;
1626 }
1627
1628 static int
1629 nbt_dissect_element_statistics_number_of_crcs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1630 {
1631         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_of_crcs, 0);
1632
1633         return offset;
1634 }
1635
1636 static int
1637 nbt_dissect_element_statistics_number_alignment_errors(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1638 {
1639         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_alignment_errors, 0);
1640
1641         return offset;
1642 }
1643
1644 static int
1645 nbt_dissect_element_statistics_number_of_collisions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1646 {
1647         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_of_collisions, 0);
1648
1649         return offset;
1650 }
1651
1652 static int
1653 nbt_dissect_element_statistics_number_send_aborts(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1654 {
1655         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_send_aborts, 0);
1656
1657         return offset;
1658 }
1659
1660 static int
1661 nbt_dissect_element_statistics_number_good_sends(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1662 {
1663         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_good_sends, 0);
1664
1665         return offset;
1666 }
1667
1668 static int
1669 nbt_dissect_element_statistics_number_good_receives(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1670 {
1671         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_good_receives, 0);
1672
1673         return offset;
1674 }
1675
1676 static int
1677 nbt_dissect_element_statistics_number_retransmits(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1678 {
1679         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_retransmits, 0);
1680
1681         return offset;
1682 }
1683
1684 static int
1685 nbt_dissect_element_statistics_number_no_resource_conditions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1686 {
1687         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_no_resource_conditions, 0);
1688
1689         return offset;
1690 }
1691
1692 static int
1693 nbt_dissect_element_statistics_number_free_command_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1694 {
1695         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_free_command_blocks, 0);
1696
1697         return offset;
1698 }
1699
1700 static int
1701 nbt_dissect_element_statistics_total_number_command_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1702 {
1703         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_total_number_command_blocks, 0);
1704
1705         return offset;
1706 }
1707
1708 static int
1709 nbt_dissect_element_statistics_max_total_number_command_blocks(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1710 {
1711         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_max_total_number_command_blocks, 0);
1712
1713         return offset;
1714 }
1715
1716 static int
1717 nbt_dissect_element_statistics_number_pending_sessions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1718 {
1719         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_number_pending_sessions, 0);
1720
1721         return offset;
1722 }
1723
1724 static int
1725 nbt_dissect_element_statistics_max_number_pending_sessions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1726 {
1727         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_max_number_pending_sessions, 0);
1728
1729         return offset;
1730 }
1731
1732 static int
1733 nbt_dissect_element_statistics_max_total_sessions_possible(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1734 {
1735         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_max_total_sessions_possible, 0);
1736
1737         return offset;
1738 }
1739
1740 static int
1741 nbt_dissect_element_statistics_session_data_packet_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1742 {
1743         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_statistics_session_data_packet_size, 0);
1744
1745         return offset;
1746 }
1747
1748 int
1749 nbt_dissect_struct_statistics(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1750 {
1751         proto_item *item = NULL;
1752         proto_tree *tree = NULL;
1753         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1754         int old_offset;
1755
1756         ALIGN_TO_4_BYTES;
1757
1758         old_offset = offset;
1759
1760         if (parent_tree) {
1761                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1762                 tree = proto_item_add_subtree(item, ett_nbt_nbt_statistics);
1763         }
1764         
1765         offset = nbt_dissect_element_statistics_unit_id(tvb, offset, pinfo, tree, drep);
1766
1767         offset = nbt_dissect_element_statistics_jumpers(tvb, offset, pinfo, tree, drep);
1768
1769         offset = nbt_dissect_element_statistics_test_result(tvb, offset, pinfo, tree, drep);
1770
1771         offset = nbt_dissect_element_statistics_version_number(tvb, offset, pinfo, tree, drep);
1772
1773         offset = nbt_dissect_element_statistics_period_of_statistics(tvb, offset, pinfo, tree, drep);
1774
1775         offset = nbt_dissect_element_statistics_number_of_crcs(tvb, offset, pinfo, tree, drep);
1776
1777         offset = nbt_dissect_element_statistics_number_alignment_errors(tvb, offset, pinfo, tree, drep);
1778
1779         offset = nbt_dissect_element_statistics_number_of_collisions(tvb, offset, pinfo, tree, drep);
1780
1781         offset = nbt_dissect_element_statistics_number_send_aborts(tvb, offset, pinfo, tree, drep);
1782
1783         offset = nbt_dissect_element_statistics_number_good_sends(tvb, offset, pinfo, tree, drep);
1784
1785         offset = nbt_dissect_element_statistics_number_good_receives(tvb, offset, pinfo, tree, drep);
1786
1787         offset = nbt_dissect_element_statistics_number_retransmits(tvb, offset, pinfo, tree, drep);
1788
1789         offset = nbt_dissect_element_statistics_number_no_resource_conditions(tvb, offset, pinfo, tree, drep);
1790
1791         offset = nbt_dissect_element_statistics_number_free_command_blocks(tvb, offset, pinfo, tree, drep);
1792
1793         offset = nbt_dissect_element_statistics_total_number_command_blocks(tvb, offset, pinfo, tree, drep);
1794
1795         offset = nbt_dissect_element_statistics_max_total_number_command_blocks(tvb, offset, pinfo, tree, drep);
1796
1797         offset = nbt_dissect_element_statistics_number_pending_sessions(tvb, offset, pinfo, tree, drep);
1798
1799         offset = nbt_dissect_element_statistics_max_number_pending_sessions(tvb, offset, pinfo, tree, drep);
1800
1801         offset = nbt_dissect_element_statistics_max_total_sessions_possible(tvb, offset, pinfo, tree, drep);
1802
1803         offset = nbt_dissect_element_statistics_session_data_packet_size(tvb, offset, pinfo, tree, drep);
1804
1805
1806         proto_item_set_len(item, offset-old_offset);
1807
1808
1809         if (di->call_data->flags & DCERPC_IS_NDR64) {
1810                 ALIGN_TO_4_BYTES;
1811         }
1812
1813         return offset;
1814 }
1815
1816
1817 /* IDL: struct { */
1818 /* IDL:         [charset(DOS)] uint8 name[15]; */
1819 /* IDL:         nbt_name_type type; */
1820 /* IDL:         nb_flags nb_flags; */
1821 /* IDL: } */
1822
1823 static int
1824 nbt_dissect_element_status_name_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1825 {
1826         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1827         int conformant = di->conformant_run;
1828         if (!conformant) {
1829                 offset = nbt_dissect_element_status_name_name_(tvb, offset, 15, pinfo, tree, drep);
1830         }
1831
1832         return offset;
1833 }
1834
1835 static int
1836 nbt_dissect_element_status_name_name_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1837 {
1838         proto_tree_add_bytes(tree, hf_nbt_nbt_status_name_name, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1839
1840         return offset;
1841 }
1842
1843 static int
1844 nbt_dissect_element_status_name_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1845 {
1846         offset = nbt_dissect_enum_name_type(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_status_name_type, 0);
1847
1848         return offset;
1849 }
1850
1851 static int
1852 nbt_dissect_element_status_name_nb_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1853 {
1854         offset = nbt_dissect_bitmap_nb_flags(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_status_name_nb_flags, 0);
1855
1856         return offset;
1857 }
1858
1859 int
1860 nbt_dissect_struct_status_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1861 {
1862         proto_item *item = NULL;
1863         proto_tree *tree = NULL;
1864         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1865         int old_offset;
1866
1867         ALIGN_TO_2_BYTES;
1868
1869         old_offset = offset;
1870
1871         if (parent_tree) {
1872                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1873                 tree = proto_item_add_subtree(item, ett_nbt_nbt_status_name);
1874         }
1875         
1876         offset = nbt_dissect_element_status_name_name(tvb, offset, pinfo, tree, drep);
1877
1878         offset = nbt_dissect_element_status_name_type(tvb, offset, pinfo, tree, drep);
1879
1880         offset = nbt_dissect_element_status_name_nb_flags(tvb, offset, pinfo, tree, drep);
1881
1882
1883         proto_item_set_len(item, offset-old_offset);
1884
1885
1886         if (di->call_data->flags & DCERPC_IS_NDR64) {
1887                 ALIGN_TO_2_BYTES;
1888         }
1889
1890         return offset;
1891 }
1892
1893
1894 /* IDL: struct { */
1895 /* IDL:         [value(num_names*18+47)] uint16 length; */
1896 /* IDL:         uint8 num_names; */
1897 /* IDL:         nbt_status_name names[num_names]; */
1898 /* IDL:         nbt_statistics statistics; */
1899 /* IDL: } */
1900
1901 static int
1902 nbt_dissect_element_rdata_status_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1903 {
1904         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_rdata_status_length, 0);
1905
1906         return offset;
1907 }
1908
1909 static int
1910 nbt_dissect_element_rdata_status_num_names(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1911 {
1912         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_rdata_status_num_names, 0);
1913
1914         return offset;
1915 }
1916
1917 static int
1918 nbt_dissect_element_rdata_status_names(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1919 {
1920
1921         return offset;
1922 }
1923
1924 static int
1925 nbt_dissect_element_rdata_status_names_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1926 {
1927         offset = nbt_dissect_struct_status_name(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_rdata_status_names,0);
1928
1929         return offset;
1930 }
1931
1932 static int
1933 nbt_dissect_element_rdata_status_statistics(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1934 {
1935         offset = nbt_dissect_struct_statistics(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_rdata_status_statistics,0);
1936
1937         return offset;
1938 }
1939
1940 int
1941 nbt_dissect_struct_rdata_status(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1942 {
1943         proto_item *item = NULL;
1944         proto_tree *tree = NULL;
1945         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1946         int old_offset;
1947
1948         ALIGN_TO_4_BYTES;
1949
1950         old_offset = offset;
1951
1952         if (parent_tree) {
1953                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1954                 tree = proto_item_add_subtree(item, ett_nbt_nbt_rdata_status);
1955         }
1956         
1957         offset = nbt_dissect_element_rdata_status_length(tvb, offset, pinfo, tree, drep);
1958
1959         offset = nbt_dissect_element_rdata_status_num_names(tvb, offset, pinfo, tree, drep);
1960
1961         offset = nbt_dissect_element_rdata_status_names(tvb, offset, pinfo, tree, drep);
1962
1963         offset = nbt_dissect_element_rdata_status_statistics(tvb, offset, pinfo, tree, drep);
1964
1965
1966         proto_item_set_len(item, offset-old_offset);
1967
1968
1969         if (di->call_data->flags & DCERPC_IS_NDR64) {
1970                 ALIGN_TO_4_BYTES;
1971         }
1972
1973         return offset;
1974 }
1975
1976
1977 /* IDL: struct { */
1978 /* IDL:         uint16 length; */
1979 /* IDL:         uint8 data[length]; */
1980 /* IDL: } */
1981
1982 static int
1983 nbt_dissect_element_rdata_data_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1984 {
1985         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_rdata_data_length, 0);
1986
1987         return offset;
1988 }
1989
1990 static int
1991 nbt_dissect_element_rdata_data_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1992 {
1993
1994         return offset;
1995 }
1996
1997 static int
1998 nbt_dissect_element_rdata_data_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1999 {
2000         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_rdata_data_data, 0);
2001
2002         return offset;
2003 }
2004
2005 int
2006 nbt_dissect_struct_rdata_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2007 {
2008         proto_item *item = NULL;
2009         proto_tree *tree = NULL;
2010         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2011         int old_offset;
2012
2013         ALIGN_TO_2_BYTES;
2014
2015         old_offset = offset;
2016
2017         if (parent_tree) {
2018                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2019                 tree = proto_item_add_subtree(item, ett_nbt_nbt_rdata_data);
2020         }
2021         
2022         offset = nbt_dissect_element_rdata_data_length(tvb, offset, pinfo, tree, drep);
2023
2024         offset = nbt_dissect_element_rdata_data_data(tvb, offset, pinfo, tree, drep);
2025
2026
2027         proto_item_set_len(item, offset-old_offset);
2028
2029
2030         if (di->call_data->flags & DCERPC_IS_NDR64) {
2031                 ALIGN_TO_2_BYTES;
2032         }
2033
2034         return offset;
2035 }
2036
2037
2038 /* IDL: [nodiscriminant(1)] [public(1)] union { */
2039 /* IDL: [case(NBT_QTYPE_NETBIOS)] [case(NBT_QTYPE_NETBIOS)] nbt_rdata_netbios netbios; */
2040 /* IDL: [case(NBT_QTYPE_STATUS)] [case(NBT_QTYPE_STATUS)] nbt_rdata_status status; */
2041 /* IDL: [default] ; */
2042 /* IDL: } */
2043
2044 static int
2045 nbt_dissect_element_rdata_netbios(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2046 {
2047         offset = nbt_dissect_struct_rdata_netbios(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_rdata_netbios,0);
2048
2049         return offset;
2050 }
2051
2052 static int
2053 nbt_dissect_element_rdata_status(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2054 {
2055         offset = nbt_dissect_struct_rdata_status(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_rdata_status,0);
2056
2057         return offset;
2058 }
2059
2060 static int
2061 nbt_dissect_element_rdata_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2062 {
2063         offset = nbt_dissect_struct_rdata_data(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_rdata_data,0);
2064
2065         return offset;
2066 }
2067
2068 static int
2069 nbt_dissect_rdata(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2070 {
2071         proto_item *item = NULL;
2072         proto_tree *tree = NULL;
2073         int old_offset;
2074         guint32 level = param;
2075
2076         old_offset = offset;
2077         if (parent_tree) {
2078                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "nbt_rdata");
2079                 tree = proto_item_add_subtree(item, ett_nbt_nbt_rdata);
2080         }
2081
2082         switch(level) {
2083                 case NBT_QTYPE_NETBIOS:
2084                         offset = nbt_dissect_element_rdata_netbios(tvb, offset, pinfo, tree, drep);
2085                 break;
2086
2087                 case NBT_QTYPE_STATUS:
2088                         offset = nbt_dissect_element_rdata_status(tvb, offset, pinfo, tree, drep);
2089                 break;
2090
2091                 default:
2092                         offset = nbt_dissect_element_rdata_data(tvb, offset, pinfo, tree, drep);
2093                 break;
2094         }
2095         proto_item_set_len(item, offset-old_offset);
2096
2097
2098         return offset;
2099 }
2100
2101 /* IDL: struct { */
2102 /* IDL:         nbt_name name; */
2103 /* IDL:         nbt_qtype rr_type; */
2104 /* IDL:         nbt_qclass rr_class; */
2105 /* IDL:         uint32 ttl; */
2106 /* IDL:         [switch_is(rr_type)] nbt_rdata rdata; */
2107 /* IDL: } */
2108
2109 static int
2110 nbt_dissect_element_res_rec_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2111 {
2112         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_res_rec_name,0);
2113
2114         return offset;
2115 }
2116
2117 static int
2118 nbt_dissect_element_res_rec_rr_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type)
2119 {
2120         offset = nbt_dissect_enum_qtype(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_res_rec_rr_type, rr_type);
2121
2122         return offset;
2123 }
2124
2125 static int
2126 nbt_dissect_element_res_rec_rr_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2127 {
2128         offset = nbt_dissect_enum_qclass(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_res_rec_rr_class, 0);
2129
2130         return offset;
2131 }
2132
2133 static int
2134 nbt_dissect_element_res_rec_ttl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2135 {
2136         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_res_rec_ttl, 0);
2137
2138         return offset;
2139 }
2140
2141 static int
2142 nbt_dissect_element_res_rec_rdata(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type)
2143 {
2144         offset = nbt_dissect_rdata(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_res_rec_rdata, *rr_type);
2145
2146         return offset;
2147 }
2148
2149 int
2150 nbt_dissect_struct_res_rec(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2151 {
2152         guint16 rr_type;
2153         proto_item *item = NULL;
2154         proto_tree *tree = NULL;
2155         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2156         int old_offset;
2157
2158         ALIGN_TO_4_BYTES;
2159
2160         old_offset = offset;
2161
2162         if (parent_tree) {
2163                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2164                 tree = proto_item_add_subtree(item, ett_nbt_nbt_res_rec);
2165         }
2166         
2167         offset = nbt_dissect_element_res_rec_name(tvb, offset, pinfo, tree, drep);
2168
2169         offset = nbt_dissect_element_res_rec_rr_type(tvb, offset, pinfo, tree, drep, &rr_type);
2170
2171         offset = nbt_dissect_element_res_rec_rr_class(tvb, offset, pinfo, tree, drep);
2172
2173         offset = nbt_dissect_element_res_rec_ttl(tvb, offset, pinfo, tree, drep);
2174
2175         offset = nbt_dissect_element_res_rec_rdata(tvb, offset, pinfo, tree, drep, &rr_type);
2176
2177
2178         proto_item_set_len(item, offset-old_offset);
2179
2180
2181         if (di->call_data->flags & DCERPC_IS_NDR64) {
2182                 ALIGN_TO_4_BYTES;
2183         }
2184
2185         return offset;
2186 }
2187
2188
2189 /* IDL: struct { */
2190 /* IDL:         uint16 name_trn_id; */
2191 /* IDL:         nbt_operation operation; */
2192 /* IDL:         uint16 qdcount; */
2193 /* IDL:         uint16 ancount; */
2194 /* IDL:         uint16 nscount; */
2195 /* IDL:         uint16 arcount; */
2196 /* IDL:         nbt_name_question questions[qdcount]; */
2197 /* IDL:         nbt_res_rec answers[ancount]; */
2198 /* IDL:         nbt_res_rec nsrecs[nscount]; */
2199 /* IDL:         nbt_res_rec additional[arcount]; */
2200 /* IDL:         [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB padding; */
2201 /* IDL: } */
2202
2203 static int
2204 nbt_dissect_element_name_packet_name_trn_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2205 {
2206         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_packet_name_trn_id, 0);
2207
2208         return offset;
2209 }
2210
2211 static int
2212 nbt_dissect_element_name_packet_operation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2213 {
2214         offset = nbt_dissect_bitmap_operation(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_packet_operation, 0);
2215
2216         return offset;
2217 }
2218
2219 static int
2220 nbt_dissect_element_name_packet_qdcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2221 {
2222         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_packet_qdcount, 0);
2223
2224         return offset;
2225 }
2226
2227 static int
2228 nbt_dissect_element_name_packet_ancount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2229 {
2230         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_packet_ancount, 0);
2231
2232         return offset;
2233 }
2234
2235 static int
2236 nbt_dissect_element_name_packet_nscount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2237 {
2238         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_packet_nscount, 0);
2239
2240         return offset;
2241 }
2242
2243 static int
2244 nbt_dissect_element_name_packet_arcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2245 {
2246         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_packet_arcount, 0);
2247
2248         return offset;
2249 }
2250
2251 static int
2252 nbt_dissect_element_name_packet_questions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2253 {
2254
2255         return offset;
2256 }
2257
2258 static int
2259 nbt_dissect_element_name_packet_questions_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2260 {
2261         offset = nbt_dissect_struct_name_question(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_name_packet_questions,0);
2262
2263         return offset;
2264 }
2265
2266 static int
2267 nbt_dissect_element_name_packet_answers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2268 {
2269
2270         return offset;
2271 }
2272
2273 static int
2274 nbt_dissect_element_name_packet_answers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2275 {
2276         offset = nbt_dissect_struct_res_rec(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_name_packet_answers,0);
2277
2278         return offset;
2279 }
2280
2281 static int
2282 nbt_dissect_element_name_packet_nsrecs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2283 {
2284
2285         return offset;
2286 }
2287
2288 static int
2289 nbt_dissect_element_name_packet_nsrecs_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2290 {
2291         offset = nbt_dissect_struct_res_rec(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_name_packet_nsrecs,0);
2292
2293         return offset;
2294 }
2295
2296 static int
2297 nbt_dissect_element_name_packet_additional(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2298 {
2299
2300         return offset;
2301 }
2302
2303 static int
2304 nbt_dissect_element_name_packet_additional_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2305 {
2306         offset = nbt_dissect_struct_res_rec(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_name_packet_additional,0);
2307
2308         return offset;
2309 }
2310
2311 static int
2312 nbt_dissect_element_name_packet_padding(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2313 {
2314         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_name_packet_padding, 1);
2315
2316         return offset;
2317 }
2318
2319 int
2320 nbt_dissect_struct_name_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2321 {
2322         proto_item *item = NULL;
2323         proto_tree *tree = NULL;
2324         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2325         int old_offset;
2326
2327
2328         old_offset = offset;
2329
2330         if (parent_tree) {
2331                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2332                 tree = proto_item_add_subtree(item, ett_nbt_nbt_name_packet);
2333         }
2334         
2335         offset = nbt_dissect_element_name_packet_name_trn_id(tvb, offset, pinfo, tree, drep);
2336
2337         offset = nbt_dissect_element_name_packet_operation(tvb, offset, pinfo, tree, drep);
2338
2339         offset = nbt_dissect_element_name_packet_qdcount(tvb, offset, pinfo, tree, drep);
2340
2341         offset = nbt_dissect_element_name_packet_ancount(tvb, offset, pinfo, tree, drep);
2342
2343         offset = nbt_dissect_element_name_packet_nscount(tvb, offset, pinfo, tree, drep);
2344
2345         offset = nbt_dissect_element_name_packet_arcount(tvb, offset, pinfo, tree, drep);
2346
2347         offset = nbt_dissect_element_name_packet_questions(tvb, offset, pinfo, tree, drep);
2348
2349         offset = nbt_dissect_element_name_packet_answers(tvb, offset, pinfo, tree, drep);
2350
2351         offset = nbt_dissect_element_name_packet_nsrecs(tvb, offset, pinfo, tree, drep);
2352
2353         offset = nbt_dissect_element_name_packet_additional(tvb, offset, pinfo, tree, drep);
2354
2355         offset = nbt_dissect_element_name_packet_padding(tvb, offset, pinfo, tree, drep);
2356
2357
2358         proto_item_set_len(item, offset-old_offset);
2359
2360
2361         if (di->call_data->flags & DCERPC_IS_NDR64) {
2362                 ALIGN_TO_4_BYTES;
2363         }
2364
2365         return offset;
2366 }
2367
2368
2369 /* IDL: enum { */
2370 /* IDL:         DGRAM_DIRECT_UNIQUE=0x10, */
2371 /* IDL:         DGRAM_DIRECT_GROUP=0x11, */
2372 /* IDL:         DGRAM_BCAST=0x12, */
2373 /* IDL:         DGRAM_ERROR=0x13, */
2374 /* IDL:         DGRAM_QUERY=0x14, */
2375 /* IDL:         DGRAM_QUERY_POSITIVE=0x15, */
2376 /* IDL:         DGRAM_QUERY_NEGATIVE=0x16, */
2377 /* IDL: } */
2378
2379 int
2380 nbt_dissect_enum_dgram_msg_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
2381 {
2382         guint8 parameter=0;
2383         if(param){
2384                 parameter=(guint8)*param;
2385         }
2386         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
2387         if(param){
2388                 *param=(guint32)parameter;
2389         }
2390         return offset;
2391 }
2392
2393
2394 /* IDL: bitmap { */
2395 /* IDL:         DGRAM_FLAG_MORE =  0x01 , */
2396 /* IDL:         DGRAM_FLAG_FIRST =  0x02 , */
2397 /* IDL:         DGRAM_FLAG_NODE_TYPE =  0x0C , */
2398 /* IDL: } */
2399
2400 int
2401 nbt_dissect_bitmap_dgram_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2402 {
2403         proto_item *item = NULL;
2404         proto_tree *tree = NULL;
2405
2406         guint8 flags;
2407
2408         if (parent_tree) {
2409                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 1, DREP_ENC_INTEGER(drep));
2410                 tree = proto_item_add_subtree(item,ett_nbt_dgram_flags);
2411         }
2412
2413         offset = dissect_ndr_uint8(tvb, offset, pinfo, NULL, drep, -1, &flags);
2414         proto_item_append_text(item, ": ");
2415
2416         if (!flags)
2417                 proto_item_append_text(item, "(No values set)");
2418
2419         proto_tree_add_boolean(tree, hf_nbt_dgram_flags_DGRAM_FLAG_MORE, tvb, offset-1, 1, flags);
2420         if (flags&( 0x01 )){
2421                 proto_item_append_text(item, "DGRAM_FLAG_MORE");
2422                 if (flags & (~( 0x01 )))
2423                         proto_item_append_text(item, ", ");
2424         }
2425         flags&=(~( 0x01 ));
2426
2427         proto_tree_add_boolean(tree, hf_nbt_dgram_flags_DGRAM_FLAG_FIRST, tvb, offset-1, 1, flags);
2428         if (flags&( 0x02 )){
2429                 proto_item_append_text(item, "DGRAM_FLAG_FIRST");
2430                 if (flags & (~( 0x02 )))
2431                         proto_item_append_text(item, ", ");
2432         }
2433         flags&=(~( 0x02 ));
2434
2435         proto_tree_add_boolean(tree, hf_nbt_dgram_flags_DGRAM_FLAG_NODE_TYPE, tvb, offset-1, 1, flags);
2436         if (flags&( 0x0C )){
2437                 proto_item_append_text(item, "DGRAM_FLAG_NODE_TYPE");
2438                 if (flags & (~( 0x0C )))
2439                         proto_item_append_text(item, ", ");
2440         }
2441         flags&=(~( 0x0C ));
2442
2443         if (flags) {
2444                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
2445         }
2446
2447         return offset;
2448 }
2449
2450
2451 /* IDL: enum { */
2452 /* IDL:         DGRAM_NODE_B=0x00, */
2453 /* IDL:         DGRAM_NODE_P=0x04, */
2454 /* IDL:         DGRAM_NODE_M=0x08, */
2455 /* IDL:         DGRAM_NODE_NBDD=0x0C, */
2456 /* IDL: } */
2457
2458 int
2459 nbt_dissect_enum_dgram_node_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
2460 {
2461         guint8 parameter=0;
2462         if(param){
2463                 parameter=(guint8)*param;
2464         }
2465         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
2466         if(param){
2467                 *param=(guint32)parameter;
2468         }
2469         return offset;
2470 }
2471
2472
2473 /* IDL: enum { */
2474 /* IDL:         SMB_TRANSACTION=0x25, */
2475 /* IDL: } */
2476
2477 int
2478 nbt_dissect_enum_smb_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
2479 {
2480         guint8 parameter=0;
2481         if(param){
2482                 parameter=(guint8)*param;
2483         }
2484         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
2485         if(param){
2486                 *param=(guint32)parameter;
2487         }
2488         return offset;
2489 }
2490
2491
2492 /* IDL: struct { */
2493 /* IDL:         [value(17)] [range(17,17)] uint8 wct; */
2494 /* IDL:         uint16 total_param_count; */
2495 /* IDL:         uint16 total_data_count; */
2496 /* IDL:         uint16 max_param_count; */
2497 /* IDL:         uint16 max_data_count; */
2498 /* IDL:         uint8 max_setup_count; */
2499 /* IDL:         uint8 pad; */
2500 /* IDL:         uint16 trans_flags; */
2501 /* IDL:         uint32 timeout; */
2502 /* IDL:         uint16 reserved; */
2503 /* IDL:         uint16 param_count; */
2504 /* IDL:         uint16 param_offset; */
2505 /* IDL:         uint16 data_count; */
2506 /* IDL:         uint16 data_offset; */
2507 /* IDL:         [value(3)] [range(3,3)] uint8 setup_count; */
2508 /* IDL:         uint8 pad2; */
2509 /* IDL:         uint16 opcode; */
2510 /* IDL:         uint16 priority; */
2511 /* IDL:         uint16 _class; */
2512 /* IDL:         [value(strlen(mailslot_name)+1+data.length)] uint16 byte_count; */
2513 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string mailslot_name; */
2514 /* IDL:         [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB data; */
2515 /* IDL: } */
2516
2517 static int
2518 nbt_dissect_element_smb_trans_body_wct(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2519 {
2520         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_wct, 0);
2521
2522         return offset;
2523 }
2524
2525 static int
2526 nbt_dissect_element_smb_trans_body_total_param_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2527 {
2528         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_total_param_count, 0);
2529
2530         return offset;
2531 }
2532
2533 static int
2534 nbt_dissect_element_smb_trans_body_total_data_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2535 {
2536         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_total_data_count, 0);
2537
2538         return offset;
2539 }
2540
2541 static int
2542 nbt_dissect_element_smb_trans_body_max_param_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2543 {
2544         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_max_param_count, 0);
2545
2546         return offset;
2547 }
2548
2549 static int
2550 nbt_dissect_element_smb_trans_body_max_data_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2551 {
2552         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_max_data_count, 0);
2553
2554         return offset;
2555 }
2556
2557 static int
2558 nbt_dissect_element_smb_trans_body_max_setup_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2559 {
2560         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_max_setup_count, 0);
2561
2562         return offset;
2563 }
2564
2565 static int
2566 nbt_dissect_element_smb_trans_body_pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2567 {
2568         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_pad, 0);
2569
2570         return offset;
2571 }
2572
2573 static int
2574 nbt_dissect_element_smb_trans_body_trans_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2575 {
2576         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_trans_flags, 0);
2577
2578         return offset;
2579 }
2580
2581 static int
2582 nbt_dissect_element_smb_trans_body_timeout(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2583 {
2584         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_timeout, 0);
2585
2586         return offset;
2587 }
2588
2589 static int
2590 nbt_dissect_element_smb_trans_body_reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2591 {
2592         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_reserved, 0);
2593
2594         return offset;
2595 }
2596
2597 static int
2598 nbt_dissect_element_smb_trans_body_param_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2599 {
2600         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_param_count, 0);
2601
2602         return offset;
2603 }
2604
2605 static int
2606 nbt_dissect_element_smb_trans_body_param_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2607 {
2608         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_param_offset, 0);
2609
2610         return offset;
2611 }
2612
2613 static int
2614 nbt_dissect_element_smb_trans_body_data_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2615 {
2616         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_data_count, 0);
2617
2618         return offset;
2619 }
2620
2621 static int
2622 nbt_dissect_element_smb_trans_body_data_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2623 {
2624         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_data_offset, 0);
2625
2626         return offset;
2627 }
2628
2629 static int
2630 nbt_dissect_element_smb_trans_body_setup_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2631 {
2632         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_setup_count, 0);
2633
2634         return offset;
2635 }
2636
2637 static int
2638 nbt_dissect_element_smb_trans_body_pad2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2639 {
2640         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_pad2, 0);
2641
2642         return offset;
2643 }
2644
2645 static int
2646 nbt_dissect_element_smb_trans_body_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2647 {
2648         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_opcode, 0);
2649
2650         return offset;
2651 }
2652
2653 static int
2654 nbt_dissect_element_smb_trans_body_priority(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2655 {
2656         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_priority, 0);
2657
2658         return offset;
2659 }
2660
2661 static int
2662 nbt_dissect_element_smb_trans_body__class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2663 {
2664         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body__class, 0);
2665
2666         return offset;
2667 }
2668
2669 static int
2670 nbt_dissect_element_smb_trans_body_byte_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2671 {
2672         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_byte_count, 0);
2673
2674         return offset;
2675 }
2676
2677 static int
2678 nbt_dissect_element_smb_trans_body_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2679 {
2680         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_mailslot_name , 0);
2681
2682         return offset;
2683 }
2684
2685 static int
2686 nbt_dissect_element_smb_trans_body_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2687 {
2688         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_nbt_smb_trans_body_data, 1);
2689
2690         return offset;
2691 }
2692
2693 int
2694 nbt_dissect_struct_smb_trans_body(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2695 {
2696         proto_item *item = NULL;
2697         proto_tree *tree = NULL;
2698         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2699         int old_offset;
2700
2701         ALIGN_TO_4_BYTES;
2702
2703         old_offset = offset;
2704
2705         if (parent_tree) {
2706                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2707                 tree = proto_item_add_subtree(item, ett_nbt_smb_trans_body);
2708         }
2709         
2710         offset = nbt_dissect_element_smb_trans_body_wct(tvb, offset, pinfo, tree, drep);
2711
2712         offset = nbt_dissect_element_smb_trans_body_total_param_count(tvb, offset, pinfo, tree, drep);
2713
2714         offset = nbt_dissect_element_smb_trans_body_total_data_count(tvb, offset, pinfo, tree, drep);
2715
2716         offset = nbt_dissect_element_smb_trans_body_max_param_count(tvb, offset, pinfo, tree, drep);
2717
2718         offset = nbt_dissect_element_smb_trans_body_max_data_count(tvb, offset, pinfo, tree, drep);
2719
2720         offset = nbt_dissect_element_smb_trans_body_max_setup_count(tvb, offset, pinfo, tree, drep);
2721
2722         offset = nbt_dissect_element_smb_trans_body_pad(tvb, offset, pinfo, tree, drep);
2723
2724         offset = nbt_dissect_element_smb_trans_body_trans_flags(tvb, offset, pinfo, tree, drep);
2725
2726         offset = nbt_dissect_element_smb_trans_body_timeout(tvb, offset, pinfo, tree, drep);
2727
2728         offset = nbt_dissect_element_smb_trans_body_reserved(tvb, offset, pinfo, tree, drep);
2729
2730         offset = nbt_dissect_element_smb_trans_body_param_count(tvb, offset, pinfo, tree, drep);
2731
2732         offset = nbt_dissect_element_smb_trans_body_param_offset(tvb, offset, pinfo, tree, drep);
2733
2734         offset = nbt_dissect_element_smb_trans_body_data_count(tvb, offset, pinfo, tree, drep);
2735
2736         offset = nbt_dissect_element_smb_trans_body_data_offset(tvb, offset, pinfo, tree, drep);
2737
2738         offset = nbt_dissect_element_smb_trans_body_setup_count(tvb, offset, pinfo, tree, drep);
2739
2740         offset = nbt_dissect_element_smb_trans_body_pad2(tvb, offset, pinfo, tree, drep);
2741
2742         offset = nbt_dissect_element_smb_trans_body_opcode(tvb, offset, pinfo, tree, drep);
2743
2744         offset = nbt_dissect_element_smb_trans_body_priority(tvb, offset, pinfo, tree, drep);
2745
2746         offset = nbt_dissect_element_smb_trans_body__class(tvb, offset, pinfo, tree, drep);
2747
2748         offset = nbt_dissect_element_smb_trans_body_byte_count(tvb, offset, pinfo, tree, drep);
2749
2750         offset = nbt_dissect_element_smb_trans_body_mailslot_name(tvb, offset, pinfo, tree, drep);
2751
2752         offset = nbt_dissect_element_smb_trans_body_data(tvb, offset, pinfo, tree, drep);
2753
2754
2755         proto_item_set_len(item, offset-old_offset);
2756
2757
2758         if (di->call_data->flags & DCERPC_IS_NDR64) {
2759                 ALIGN_TO_4_BYTES;
2760         }
2761
2762         return offset;
2763 }
2764
2765
2766 /* IDL: [nodiscriminant(1)] union { */
2767 /* IDL: [case(SMB_TRANSACTION)] [case(SMB_TRANSACTION)] smb_trans_body trans; */
2768 /* IDL: } */
2769
2770 static int
2771 nbt_dissect_element_smb_body_trans(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2772 {
2773         offset = nbt_dissect_struct_smb_trans_body(tvb,offset,pinfo,tree,drep,hf_nbt_smb_body_trans,0);
2774
2775         return offset;
2776 }
2777
2778 static int
2779 nbt_dissect_smb_body(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2780 {
2781         proto_item *item = NULL;
2782         proto_tree *tree = NULL;
2783         int old_offset;
2784         guint32 level = param;
2785
2786         old_offset = offset;
2787         if (parent_tree) {
2788                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "smb_body");
2789                 tree = proto_item_add_subtree(item, ett_nbt_smb_body);
2790         }
2791
2792         switch(level) {
2793                 case SMB_TRANSACTION:
2794                         offset = nbt_dissect_element_smb_body_trans(tvb, offset, pinfo, tree, drep);
2795                 break;
2796         }
2797         proto_item_set_len(item, offset-old_offset);
2798
2799
2800         return offset;
2801 }
2802
2803 /* IDL: struct { */
2804 /* IDL:         smb_command smb_command; */
2805 /* IDL:         uint8 err_class; */
2806 /* IDL:         uint8 pad; */
2807 /* IDL:         uint16 err_code; */
2808 /* IDL:         uint8 flags; */
2809 /* IDL:         uint16 flags2; */
2810 /* IDL:         uint16 pid_high; */
2811 /* IDL:         uint8 signature[8]; */
2812 /* IDL:         uint16 reserved; */
2813 /* IDL:         uint16 tid; */
2814 /* IDL:         uint16 pid; */
2815 /* IDL:         uint16 vuid; */
2816 /* IDL:         uint16 mid; */
2817 /* IDL:         [switch_is(smb_command)] smb_body body; */
2818 /* IDL: } */
2819
2820 static int
2821 nbt_dissect_element_dgram_smb_packet_smb_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *smb_command)
2822 {
2823         offset = nbt_dissect_enum_smb_command(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_smb_command, smb_command);
2824
2825         return offset;
2826 }
2827
2828 static int
2829 nbt_dissect_element_dgram_smb_packet_err_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2830 {
2831         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_err_class, 0);
2832
2833         return offset;
2834 }
2835
2836 static int
2837 nbt_dissect_element_dgram_smb_packet_pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2838 {
2839         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_pad, 0);
2840
2841         return offset;
2842 }
2843
2844 static int
2845 nbt_dissect_element_dgram_smb_packet_err_code(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2846 {
2847         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_err_code, 0);
2848
2849         return offset;
2850 }
2851
2852 static int
2853 nbt_dissect_element_dgram_smb_packet_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2854 {
2855         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_flags, 0);
2856
2857         return offset;
2858 }
2859
2860 static int
2861 nbt_dissect_element_dgram_smb_packet_flags2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2862 {
2863         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_flags2, 0);
2864
2865         return offset;
2866 }
2867
2868 static int
2869 nbt_dissect_element_dgram_smb_packet_pid_high(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2870 {
2871         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_pid_high, 0);
2872
2873         return offset;
2874 }
2875
2876 static int
2877 nbt_dissect_element_dgram_smb_packet_signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2878 {
2879         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2880         int conformant = di->conformant_run;
2881         if (!conformant) {
2882                 offset = nbt_dissect_element_dgram_smb_packet_signature_(tvb, offset, 8, pinfo, tree, drep);
2883         }
2884
2885         return offset;
2886 }
2887
2888 static int
2889 nbt_dissect_element_dgram_smb_packet_signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2890 {
2891         proto_tree_add_bytes(tree, hf_nbt_dgram_smb_packet_signature, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2892
2893         return offset;
2894 }
2895
2896 static int
2897 nbt_dissect_element_dgram_smb_packet_reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2898 {
2899         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_reserved, 0);
2900
2901         return offset;
2902 }
2903
2904 static int
2905 nbt_dissect_element_dgram_smb_packet_tid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2906 {
2907         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_tid, 0);
2908
2909         return offset;
2910 }
2911
2912 static int
2913 nbt_dissect_element_dgram_smb_packet_pid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2914 {
2915         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_pid, 0);
2916
2917         return offset;
2918 }
2919
2920 static int
2921 nbt_dissect_element_dgram_smb_packet_vuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2922 {
2923         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_vuid, 0);
2924
2925         return offset;
2926 }
2927
2928 static int
2929 nbt_dissect_element_dgram_smb_packet_mid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2930 {
2931         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_mid, 0);
2932
2933         return offset;
2934 }
2935
2936 static int
2937 nbt_dissect_element_dgram_smb_packet_body(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *smb_command)
2938 {
2939         offset = nbt_dissect_smb_body(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_smb_packet_body, *smb_command);
2940
2941         return offset;
2942 }
2943
2944 int
2945 nbt_dissect_struct_dgram_smb_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2946 {
2947         guint8 smb_command;
2948         proto_item *item = NULL;
2949         proto_tree *tree = NULL;
2950         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2951         int old_offset;
2952
2953
2954         old_offset = offset;
2955
2956         if (parent_tree) {
2957                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2958                 tree = proto_item_add_subtree(item, ett_nbt_dgram_smb_packet);
2959         }
2960         
2961         offset = nbt_dissect_element_dgram_smb_packet_smb_command(tvb, offset, pinfo, tree, drep, &smb_command);
2962
2963         offset = nbt_dissect_element_dgram_smb_packet_err_class(tvb, offset, pinfo, tree, drep);
2964
2965         offset = nbt_dissect_element_dgram_smb_packet_pad(tvb, offset, pinfo, tree, drep);
2966
2967         offset = nbt_dissect_element_dgram_smb_packet_err_code(tvb, offset, pinfo, tree, drep);
2968
2969         offset = nbt_dissect_element_dgram_smb_packet_flags(tvb, offset, pinfo, tree, drep);
2970
2971         offset = nbt_dissect_element_dgram_smb_packet_flags2(tvb, offset, pinfo, tree, drep);
2972
2973         offset = nbt_dissect_element_dgram_smb_packet_pid_high(tvb, offset, pinfo, tree, drep);
2974
2975         offset = nbt_dissect_element_dgram_smb_packet_signature(tvb, offset, pinfo, tree, drep);
2976
2977         offset = nbt_dissect_element_dgram_smb_packet_reserved(tvb, offset, pinfo, tree, drep);
2978
2979         offset = nbt_dissect_element_dgram_smb_packet_tid(tvb, offset, pinfo, tree, drep);
2980
2981         offset = nbt_dissect_element_dgram_smb_packet_pid(tvb, offset, pinfo, tree, drep);
2982
2983         offset = nbt_dissect_element_dgram_smb_packet_vuid(tvb, offset, pinfo, tree, drep);
2984
2985         offset = nbt_dissect_element_dgram_smb_packet_mid(tvb, offset, pinfo, tree, drep);
2986
2987         offset = nbt_dissect_element_dgram_smb_packet_body(tvb, offset, pinfo, tree, drep, &smb_command);
2988
2989
2990         proto_item_set_len(item, offset-old_offset);
2991
2992
2993         if (di->call_data->flags & DCERPC_IS_NDR64) {
2994                 ALIGN_TO_4_BYTES;
2995         }
2996
2997         return offset;
2998 }
2999
3000
3001 /* IDL: [nodiscriminant(1)] union { */
3002 /* IDL: [case(DGRAM_SMB)] [case(DGRAM_SMB)] dgram_smb_packet smb; */
3003 /* IDL: } */
3004
3005 static int
3006 nbt_dissect_element_dgram_message_body_smb(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3007 {
3008         offset = nbt_dissect_struct_dgram_smb_packet(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_message_body_smb,0);
3009
3010         return offset;
3011 }
3012
3013 static int
3014 nbt_dissect_dgram_message_body(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3015 {
3016         proto_item *item = NULL;
3017         proto_tree *tree = NULL;
3018         int old_offset;
3019         guint32 level = param;
3020
3021         old_offset = offset;
3022         if (parent_tree) {
3023                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "dgram_message_body");
3024                 tree = proto_item_add_subtree(item, ett_nbt_dgram_message_body);
3025         }
3026
3027         switch(level) {
3028                 case DGRAM_SMB:
3029                         offset = nbt_dissect_element_dgram_message_body_smb(tvb, offset, pinfo, tree, drep);
3030                 break;
3031         }
3032         proto_item_set_len(item, offset-old_offset);
3033
3034
3035         return offset;
3036 }
3037
3038 /* IDL: struct { */
3039 /* IDL:         uint16 length; */
3040 /* IDL:         uint16 offset; */
3041 /* IDL:         nbt_name source_name; */
3042 /* IDL:         nbt_name dest_name; */
3043 /* IDL:         uint32 dgram_body_type; */
3044 /* IDL:         [switch_is(dgram_body_type)] dgram_message_body body; */
3045 /* IDL: } */
3046
3047 static int
3048 nbt_dissect_element_dgram_message_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3049 {
3050         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_message_length, 0);
3051
3052         return offset;
3053 }
3054
3055 static int
3056 nbt_dissect_element_dgram_message_offset(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3057 {
3058         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_message_offset, 0);
3059
3060         return offset;
3061 }
3062
3063 static int
3064 nbt_dissect_element_dgram_message_source_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3065 {
3066         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_message_source_name,0);
3067
3068         return offset;
3069 }
3070
3071 static int
3072 nbt_dissect_element_dgram_message_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3073 {
3074         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_message_dest_name,0);
3075
3076         return offset;
3077 }
3078
3079 static int
3080 nbt_dissect_element_dgram_message_dgram_body_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, g *dgram_body_type)
3081 {
3082         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_message_dgram_body_type, dgram_body_type);
3083
3084         return offset;
3085 }
3086
3087 static int
3088 nbt_dissect_element_dgram_message_body(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, g *dgram_body_type)
3089 {
3090         offset = nbt_dissect_dgram_message_body(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_message_body, *dgram_body_type);
3091
3092         return offset;
3093 }
3094
3095 int
3096 nbt_dissect_struct_dgram_message(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3097 {
3098         g dgram_body_type;
3099          body;
3100         proto_item *item = NULL;
3101         proto_tree *tree = NULL;
3102         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3103         int old_offset;
3104
3105         ALIGN_TO_4_BYTES;
3106
3107         old_offset = offset;
3108
3109         if (parent_tree) {
3110                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
3111                 tree = proto_item_add_subtree(item, ett_nbt_dgram_message);
3112         }
3113         
3114         offset = nbt_dissect_element_dgram_message_length(tvb, offset, pinfo, tree, drep);
3115
3116         offset = nbt_dissect_element_dgram_message_offset(tvb, offset, pinfo, tree, drep);
3117
3118         offset = nbt_dissect_element_dgram_message_source_name(tvb, offset, pinfo, tree, drep);
3119
3120         offset = nbt_dissect_element_dgram_message_dest_name(tvb, offset, pinfo, tree, drep);
3121
3122         offset = nbt_dissect_element_dgram_message_dgram_body_type(tvb, offset, pinfo, tree, drep, &dgram_body_type);
3123
3124         offset = nbt_dissect_element_dgram_message_body(tvb, offset, pinfo, tree, drep, &dgram_body_type);
3125
3126
3127         proto_item_set_len(item, offset-old_offset);
3128
3129
3130         if (di->call_data->flags & DCERPC_IS_NDR64) {
3131                 ALIGN_TO_4_BYTES;
3132         }
3133
3134         return offset;
3135 }
3136
3137
3138 /* IDL: enum { */
3139 /* IDL:         DGRAM_ERROR_NAME_NOT_PRESENT=0x82, */
3140 /* IDL:         DGRAM_ERROR_INVALID_SOURCE=0x83, */
3141 /* IDL:         DGRAM_ERROR_INVALID_DEST=0x84, */
3142 /* IDL: } */
3143
3144 int
3145 nbt_dissect_enum_dgram_err_code(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
3146 {
3147         guint8 parameter=0;
3148         if(param){
3149                 parameter=(guint8)*param;
3150         }
3151         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
3152         if(param){
3153                 *param=(guint32)parameter;
3154         }
3155         return offset;
3156 }
3157
3158
3159 /* IDL: [nodiscriminant(1)] union { */
3160 /* IDL: [case(DGRAM_DIRECT_UNIQUE)] [case(DGRAM_DIRECT_UNIQUE)] dgram_message msg; */
3161 /* IDL: [case(DGRAM_DIRECT_GROUP)] [case(DGRAM_DIRECT_GROUP)] dgram_message msg; */
3162 /* IDL: [case(DGRAM_BCAST)] [case(DGRAM_BCAST)] dgram_message msg; */
3163 /* IDL: [case(DGRAM_ERROR)] [case(DGRAM_ERROR)] dgram_err_code error; */
3164 /* IDL: [case(DGRAM_QUERY)] [case(DGRAM_QUERY)] nbt_name dest_name; */
3165 /* IDL: [case(DGRAM_QUERY_POSITIVE)] [case(DGRAM_QUERY_POSITIVE)] nbt_name dest_name; */
3166 /* IDL: [case(DGRAM_QUERY_NEGATIVE)] [case(DGRAM_QUERY_NEGATIVE)] nbt_name dest_name; */
3167 /* IDL: } */
3168
3169 static int
3170 nbt_dissect_element_dgram_data_msg(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3171 {
3172         offset = nbt_dissect_struct_dgram_message(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_data_msg,0);
3173
3174         return offset;
3175 }
3176
3177 static int
3178 nbt_dissect_element_dgram_data_msg(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3179 {
3180         offset = nbt_dissect_struct_dgram_message(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_data_msg,0);
3181
3182         return offset;
3183 }
3184
3185 static int
3186 nbt_dissect_element_dgram_data_msg(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3187 {
3188         offset = nbt_dissect_struct_dgram_message(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_data_msg,0);
3189
3190         return offset;
3191 }
3192
3193 static int
3194 nbt_dissect_element_dgram_data_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3195 {
3196         offset = nbt_dissect_enum_dgram_err_code(tvb, offset, pinfo, tree, drep, hf_nbt_dgram_data_error, 0);
3197
3198         return offset;
3199 }
3200
3201 static int
3202 nbt_dissect_element_dgram_data_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3203 {
3204         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_data_dest_name,0);
3205
3206         return offset;
3207 }
3208
3209 static int
3210 nbt_dissect_element_dgram_data_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3211 {
3212         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_data_dest_name,0);
3213
3214         return offset;
3215 }
3216
3217 static int
3218 nbt_dissect_element_dgram_data_dest_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3219 {
3220         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_dgram_data_dest_name,0);
3221
3222         return offset;
3223 }
3224
3225 static int
3226 nbt_dissect_dgram_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3227 {
3228         proto_item *item = NULL;
3229         proto_tree *tree = NULL;
3230         int old_offset;
3231         guint32 level = param;
3232
3233         old_offset = offset;
3234         if (parent_tree) {
3235                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "dgram_data");
3236                 tree = proto_item_add_subtree(item, ett_nbt_dgram_data);
3237         }
3238
3239         switch(level) {
3240                 case DGRAM_DIRECT_UNIQUE:
3241                         offset = nbt_dissect_element_dgram_data_msg(tvb, offset, pinfo, tree, drep);
3242                 break;
3243
3244                 case DGRAM_DIRECT_GROUP:
3245                         offset = nbt_dissect_element_dgram_data_msg(tvb, offset, pinfo, tree, drep);
3246                 break;
3247
3248                 case DGRAM_BCAST:
3249                         offset = nbt_dissect_element_dgram_data_msg(tvb, offset, pinfo, tree, drep);
3250                 break;
3251
3252                 case DGRAM_ERROR:
3253                         offset = nbt_dissect_element_dgram_data_error(tvb, offset, pinfo, tree, drep);
3254                 break;
3255
3256                 case DGRAM_QUERY:
3257                         offset = nbt_dissect_element_dgram_data_dest_name(tvb, offset, pinfo, tree, drep);
3258                 break;
3259
3260                 case DGRAM_QUERY_POSITIVE:
3261                         offset = nbt_dissect_element_dgram_data_dest_name(tvb, offset, pinfo, tree, drep);
3262                 break;
3263
3264                 case DGRAM_QUERY_NEGATIVE:
3265                         offset = nbt_dissect_element_dgram_data_dest_name(tvb, offset, pinfo, tree, drep);
3266                 break;
3267         }
3268         proto_item_set_len(item, offset-old_offset);
3269
3270
3271         return offset;
3272 }
3273
3274 /* IDL: struct { */
3275 /* IDL:         dgram_msg_type msg_type; */
3276 /* IDL:         dgram_flags flags; */
3277 /* IDL:         uint16 dgram_id; */
3278 /* IDL:         ipv4address src_addr; */
3279 /* IDL:         uint16 src_port; */
3280 /* IDL:         [switch_is(msg_type)] dgram_data data; */
3281 /* IDL: } */
3282
3283 static int
3284 nbt_dissect_element_dgram_packet_msg_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *msg_type)
3285 {
3286         offset = nbt_dissect_enum_dgram_msg_type(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_dgram_packet_msg_type, msg_type);
3287
3288         return offset;
3289 }
3290
3291 static int
3292 nbt_dissect_element_dgram_packet_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3293 {
3294         offset = nbt_dissect_bitmap_dgram_flags(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_dgram_packet_flags, 0);
3295
3296         return offset;
3297 }
3298
3299 static int
3300 nbt_dissect_element_dgram_packet_dgram_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3301 {
3302         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_dgram_packet_dgram_id, 0);
3303
3304         return offset;
3305 }
3306
3307 static int
3308 nbt_dissect_element_dgram_packet_src_addr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3309 {
3310         offset = nbt_dissect_struct_ipv4address(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_dgram_packet_src_addr,0);
3311
3312         return offset;
3313 }
3314
3315 static int
3316 nbt_dissect_element_dgram_packet_src_port(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3317 {
3318         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_dgram_packet_src_port, 0);
3319
3320         return offset;
3321 }
3322
3323 static int
3324 nbt_dissect_element_dgram_packet_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *msg_type)
3325 {
3326         offset = nbt_dissect_dgram_data(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_dgram_packet_data, *msg_type);
3327
3328         return offset;
3329 }
3330
3331 int
3332 nbt_dissect_struct_dgram_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3333 {
3334         guint8 msg_type;
3335         proto_item *item = NULL;
3336         proto_tree *tree = NULL;
3337         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3338         int old_offset;
3339
3340
3341         old_offset = offset;
3342
3343         if (parent_tree) {
3344                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
3345                 tree = proto_item_add_subtree(item, ett_nbt_nbt_dgram_packet);
3346         }
3347         
3348         offset = nbt_dissect_element_dgram_packet_msg_type(tvb, offset, pinfo, tree, drep, &msg_type);
3349
3350         offset = nbt_dissect_element_dgram_packet_flags(tvb, offset, pinfo, tree, drep);
3351
3352         offset = nbt_dissect_element_dgram_packet_dgram_id(tvb, offset, pinfo, tree, drep);
3353
3354         offset = nbt_dissect_element_dgram_packet_src_addr(tvb, offset, pinfo, tree, drep);
3355
3356         offset = nbt_dissect_element_dgram_packet_src_port(tvb, offset, pinfo, tree, drep);
3357
3358         offset = nbt_dissect_element_dgram_packet_data(tvb, offset, pinfo, tree, drep, &msg_type);
3359
3360
3361         proto_item_set_len(item, offset-old_offset);
3362
3363
3364         if (di->call_data->flags & DCERPC_IS_NDR64) {
3365                 ALIGN_TO_4_BYTES;
3366         }
3367
3368         return offset;
3369 }
3370
3371
3372 /* IDL: struct { */
3373 /* IDL:         uint32 sockaddr_family; */
3374 /* IDL:         [flag(LIBNDR_FLAG_BIGENDIAN)] ipv4address pdc_ip; */
3375 /* IDL:         [flag(LIBNDR_FLAG_REMAINING)] DATA_BLOB remaining; */
3376 /* IDL: } */
3377
3378 static int
3379 nbt_dissect_element_sockaddr_sockaddr_family(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3380 {
3381         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_sockaddr_sockaddr_family, 0);
3382
3383         return offset;
3384 }
3385
3386 static int
3387 nbt_dissect_element_sockaddr_pdc_ip(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3388 {
3389         offset = nbt_dissect_struct_ipv4address(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_sockaddr_pdc_ip,0);
3390
3391         return offset;
3392 }
3393
3394 static int
3395 nbt_dissect_element_sockaddr_remaining(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3396 {
3397         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_sockaddr_remaining, 1);
3398
3399         return offset;
3400 }
3401
3402 int
3403 nbt_dissect_struct_sockaddr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3404 {
3405         proto_item *item = NULL;
3406         proto_tree *tree = NULL;
3407         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3408         int old_offset;
3409
3410         ALIGN_TO_4_BYTES;
3411
3412         old_offset = offset;
3413
3414         if (parent_tree) {
3415                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
3416                 tree = proto_item_add_subtree(item, ett_nbt_nbt_sockaddr);
3417         }
3418         
3419         offset = nbt_dissect_element_sockaddr_sockaddr_family(tvb, offset, pinfo, tree, drep);
3420
3421         offset = nbt_dissect_element_sockaddr_pdc_ip(tvb, offset, pinfo, tree, drep);
3422
3423         offset = nbt_dissect_element_sockaddr_remaining(tvb, offset, pinfo, tree, drep);
3424
3425
3426         proto_item_set_len(item, offset-old_offset);
3427
3428
3429         if (di->call_data->flags & DCERPC_IS_NDR64) {
3430                 ALIGN_TO_4_BYTES;
3431         }
3432
3433         return offset;
3434 }
3435
3436
3437 /* IDL: bitmap { */
3438 /* IDL:         NBT_SERVER_PDC =  0x00000001 , */
3439 /* IDL:         NBT_SERVER_GC =  0x00000004 , */
3440 /* IDL:         NBT_SERVER_LDAP =  0x00000008 , */
3441 /* IDL:         NBT_SERVER_DS =  0x00000010 , */
3442 /* IDL:         NBT_SERVER_KDC =  0x00000020 , */
3443 /* IDL:         NBT_SERVER_TIMESERV =  0x00000040 , */
3444 /* IDL:         NBT_SERVER_CLOSEST =  0x00000080 , */
3445 /* IDL:         NBT_SERVER_WRITABLE =  0x00000100 , */
3446 /* IDL:         NBT_SERVER_GOOD_TIMESERV =  0x00000200 , */
3447 /* IDL:         NBT_SERVER_NDNC =  0x00000400 , */
3448 /* IDL:         NBT_SERVER_SELECT_SECRET_DOMAIN_6 =  0x00000800 , */
3449 /* IDL:         NBT_SERVER_FULL_SECRET_DOMAIN_6 =  0x00001000 , */
3450 /* IDL:         NBT_SERVER_ADS_WEB_SERVICE =  0x00002000 , */
3451 /* IDL:         NBT_SERVER_HAS_DNS_NAME =  0x20000000 , */
3452 /* IDL:         NBT_SERVER_IS_DEFAULT_NC =  0x40000000 , */
3453 /* IDL:         NBT_SERVER_FOREST_ROOT =  0x80000000 , */
3454 /* IDL: } */
3455
3456 int
3457 nbt_dissect_bitmap_server_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3458 {
3459         proto_item *item = NULL;
3460         proto_tree *tree = NULL;
3461
3462         guint32 flags;
3463         ALIGN_TO_4_BYTES;
3464
3465         if (parent_tree) {
3466                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, DREP_ENC_INTEGER(drep));
3467                 tree = proto_item_add_subtree(item,ett_nbt_nbt_server_type);
3468         }
3469
3470         offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);
3471         proto_item_append_text(item, ": ");
3472
3473         if (!flags)
3474                 proto_item_append_text(item, "(No values set)");
3475
3476         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_PDC, tvb, offset-4, 4, flags);
3477         if (flags&( 0x00000001 )){
3478                 proto_item_append_text(item, "NBT_SERVER_PDC");
3479                 if (flags & (~( 0x00000001 )))
3480                         proto_item_append_text(item, ", ");
3481         }
3482         flags&=(~( 0x00000001 ));
3483
3484         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_GC, tvb, offset-4, 4, flags);
3485         if (flags&( 0x00000004 )){
3486                 proto_item_append_text(item, "NBT_SERVER_GC");
3487                 if (flags & (~( 0x00000004 )))
3488                         proto_item_append_text(item, ", ");
3489         }
3490         flags&=(~( 0x00000004 ));
3491
3492         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_LDAP, tvb, offset-4, 4, flags);
3493         if (flags&( 0x00000008 )){
3494                 proto_item_append_text(item, "NBT_SERVER_LDAP");
3495                 if (flags & (~( 0x00000008 )))
3496                         proto_item_append_text(item, ", ");
3497         }
3498         flags&=(~( 0x00000008 ));
3499
3500         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_DS, tvb, offset-4, 4, flags);
3501         if (flags&( 0x00000010 )){
3502                 proto_item_append_text(item, "NBT_SERVER_DS");
3503                 if (flags & (~( 0x00000010 )))
3504                         proto_item_append_text(item, ", ");
3505         }
3506         flags&=(~( 0x00000010 ));
3507
3508         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_KDC, tvb, offset-4, 4, flags);
3509         if (flags&( 0x00000020 )){
3510                 proto_item_append_text(item, "NBT_SERVER_KDC");
3511                 if (flags & (~( 0x00000020 )))
3512                         proto_item_append_text(item, ", ");
3513         }
3514         flags&=(~( 0x00000020 ));
3515
3516         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_TIMESERV, tvb, offset-4, 4, flags);
3517         if (flags&( 0x00000040 )){
3518                 proto_item_append_text(item, "NBT_SERVER_TIMESERV");
3519                 if (flags & (~( 0x00000040 )))
3520                         proto_item_append_text(item, ", ");
3521         }
3522         flags&=(~( 0x00000040 ));
3523
3524         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_CLOSEST, tvb, offset-4, 4, flags);
3525         if (flags&( 0x00000080 )){
3526                 proto_item_append_text(item, "NBT_SERVER_CLOSEST");
3527                 if (flags & (~( 0x00000080 )))
3528                         proto_item_append_text(item, ", ");
3529         }
3530         flags&=(~( 0x00000080 ));
3531
3532         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_WRITABLE, tvb, offset-4, 4, flags);
3533         if (flags&( 0x00000100 )){
3534                 proto_item_append_text(item, "NBT_SERVER_WRITABLE");
3535                 if (flags & (~( 0x00000100 )))
3536                         proto_item_append_text(item, ", ");
3537         }
3538         flags&=(~( 0x00000100 ));
3539
3540         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_GOOD_TIMESERV, tvb, offset-4, 4, flags);
3541         if (flags&( 0x00000200 )){
3542                 proto_item_append_text(item, "NBT_SERVER_GOOD_TIMESERV");
3543                 if (flags & (~( 0x00000200 )))
3544                         proto_item_append_text(item, ", ");
3545         }
3546         flags&=(~( 0x00000200 ));
3547
3548         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_NDNC, tvb, offset-4, 4, flags);
3549         if (flags&( 0x00000400 )){
3550                 proto_item_append_text(item, "NBT_SERVER_NDNC");
3551                 if (flags & (~( 0x00000400 )))
3552                         proto_item_append_text(item, ", ");
3553         }
3554         flags&=(~( 0x00000400 ));
3555
3556         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_SELECT_SECRET_DOMAIN_6, tvb, offset-4, 4, flags);
3557         if (flags&( 0x00000800 )){
3558                 proto_item_append_text(item, "NBT_SERVER_SELECT_SECRET_DOMAIN_6");
3559                 if (flags & (~( 0x00000800 )))
3560                         proto_item_append_text(item, ", ");
3561         }
3562         flags&=(~( 0x00000800 ));
3563
3564         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_FULL_SECRET_DOMAIN_6, tvb, offset-4, 4, flags);
3565         if (flags&( 0x00001000 )){
3566                 proto_item_append_text(item, "NBT_SERVER_FULL_SECRET_DOMAIN_6");
3567                 if (flags & (~( 0x00001000 )))
3568                         proto_item_append_text(item, ", ");
3569         }
3570         flags&=(~( 0x00001000 ));
3571
3572         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_ADS_WEB_SERVICE, tvb, offset-4, 4, flags);
3573         if (flags&( 0x00002000 )){
3574                 proto_item_append_text(item, "NBT_SERVER_ADS_WEB_SERVICE");
3575                 if (flags & (~( 0x00002000 )))
3576                         proto_item_append_text(item, ", ");
3577         }
3578         flags&=(~( 0x00002000 ));
3579
3580         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_HAS_DNS_NAME, tvb, offset-4, 4, flags);
3581         if (flags&( 0x20000000 )){
3582                 proto_item_append_text(item, "NBT_SERVER_HAS_DNS_NAME");
3583                 if (flags & (~( 0x20000000 )))
3584                         proto_item_append_text(item, ", ");
3585         }
3586         flags&=(~( 0x20000000 ));
3587
3588         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_IS_DEFAULT_NC, tvb, offset-4, 4, flags);
3589         if (flags&( 0x40000000 )){
3590                 proto_item_append_text(item, "NBT_SERVER_IS_DEFAULT_NC");
3591                 if (flags & (~( 0x40000000 )))
3592                         proto_item_append_text(item, ", ");
3593         }
3594         flags&=(~( 0x40000000 ));
3595
3596         proto_tree_add_boolean(tree, hf_nbt_nbt_server_type_NBT_SERVER_FOREST_ROOT, tvb, offset-4, 4, flags);
3597         if (flags&( 0x80000000 )){
3598                 proto_item_append_text(item, "NBT_SERVER_FOREST_ROOT");
3599                 if (flags & (~( 0x80000000 )))
3600                         proto_item_append_text(item, ", ");
3601         }
3602         flags&=(~( 0x80000000 ));
3603
3604         if (flags) {
3605                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
3606         }
3607
3608         return offset;
3609 }
3610
3611
3612 /* IDL: bitmap { */
3613 /* IDL:         NETLOGON_NT_VERSION_1 =  0x00000001 , */
3614 /* IDL:         NETLOGON_NT_VERSION_5 =  0x00000002 , */
3615 /* IDL:         NETLOGON_NT_VERSION_5EX =  0x00000004 , */
3616 /* IDL:         NETLOGON_NT_VERSION_5EX_WITH_IP =  0x00000008 , */
3617 /* IDL:         NETLOGON_NT_VERSION_WITH_CLOSEST_SITE =  0x00000010 , */
3618 /* IDL:         NETLOGON_NT_VERSION_AVOID_NT4EMUL =  0x01000000 , */
3619 /* IDL:         NETLOGON_NT_VERSION_PDC =  0x10000000 , */
3620 /* IDL:         NETLOGON_NT_VERSION_IP =  0x20000000 , */
3621 /* IDL:         NETLOGON_NT_VERSION_LOCAL =  0x40000000 , */
3622 /* IDL:         NETLOGON_NT_VERSION_GC =  0x80000000 , */
3623 /* IDL: } */
3624
3625 int
3626 nbt_dissect_bitmap_netlogon_nt_version_flags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3627 {
3628         proto_item *item = NULL;
3629         proto_tree *tree = NULL;
3630
3631         guint32 flags;
3632         ALIGN_TO_4_BYTES;
3633
3634         if (parent_tree) {
3635                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, DREP_ENC_INTEGER(drep));
3636                 tree = proto_item_add_subtree(item,ett_nbt_netlogon_nt_version_flags);
3637         }
3638
3639         offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);
3640         proto_item_append_text(item, ": ");
3641
3642         if (!flags)
3643                 proto_item_append_text(item, "(No values set)");
3644
3645         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_1, tvb, offset-4, 4, flags);
3646         if (flags&( 0x00000001 )){
3647                 proto_item_append_text(item, "NETLOGON_NT_VERSION_1");
3648                 if (flags & (~( 0x00000001 )))
3649                         proto_item_append_text(item, ", ");
3650         }
3651         flags&=(~( 0x00000001 ));
3652
3653         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5, tvb, offset-4, 4, flags);
3654         if (flags&( 0x00000002 )){
3655                 proto_item_append_text(item, "NETLOGON_NT_VERSION_5");
3656                 if (flags & (~( 0x00000002 )))
3657                         proto_item_append_text(item, ", ");
3658         }
3659         flags&=(~( 0x00000002 ));
3660
3661         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX, tvb, offset-4, 4, flags);
3662         if (flags&( 0x00000004 )){
3663                 proto_item_append_text(item, "NETLOGON_NT_VERSION_5EX");
3664                 if (flags & (~( 0x00000004 )))
3665                         proto_item_append_text(item, ", ");
3666         }
3667         flags&=(~( 0x00000004 ));
3668
3669         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX_WITH_IP, tvb, offset-4, 4, flags);
3670         if (flags&( 0x00000008 )){
3671                 proto_item_append_text(item, "NETLOGON_NT_VERSION_5EX_WITH_IP");
3672                 if (flags & (~( 0x00000008 )))
3673                         proto_item_append_text(item, ", ");
3674         }
3675         flags&=(~( 0x00000008 ));
3676
3677         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_WITH_CLOSEST_SITE, tvb, offset-4, 4, flags);
3678         if (flags&( 0x00000010 )){
3679                 proto_item_append_text(item, "NETLOGON_NT_VERSION_WITH_CLOSEST_SITE");
3680                 if (flags & (~( 0x00000010 )))
3681                         proto_item_append_text(item, ", ");
3682         }
3683         flags&=(~( 0x00000010 ));
3684
3685         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_AVOID_NT4EMUL, tvb, offset-4, 4, flags);
3686         if (flags&( 0x01000000 )){
3687                 proto_item_append_text(item, "NETLOGON_NT_VERSION_AVOID_NT4EMUL");
3688                 if (flags & (~( 0x01000000 )))
3689                         proto_item_append_text(item, ", ");
3690         }
3691         flags&=(~( 0x01000000 ));
3692
3693         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_PDC, tvb, offset-4, 4, flags);
3694         if (flags&( 0x10000000 )){
3695                 proto_item_append_text(item, "NETLOGON_NT_VERSION_PDC");
3696                 if (flags & (~( 0x10000000 )))
3697                         proto_item_append_text(item, ", ");
3698         }
3699         flags&=(~( 0x10000000 ));
3700
3701         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_IP, tvb, offset-4, 4, flags);
3702         if (flags&( 0x20000000 )){
3703                 proto_item_append_text(item, "NETLOGON_NT_VERSION_IP");
3704                 if (flags & (~( 0x20000000 )))
3705                         proto_item_append_text(item, ", ");
3706         }
3707         flags&=(~( 0x20000000 ));
3708
3709         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_LOCAL, tvb, offset-4, 4, flags);
3710         if (flags&( 0x40000000 )){
3711                 proto_item_append_text(item, "NETLOGON_NT_VERSION_LOCAL");
3712                 if (flags & (~( 0x40000000 )))
3713                         proto_item_append_text(item, ", ");
3714         }
3715         flags&=(~( 0x40000000 ));
3716
3717         proto_tree_add_boolean(tree, hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_GC, tvb, offset-4, 4, flags);
3718         if (flags&( 0x80000000 )){
3719                 proto_item_append_text(item, "NETLOGON_NT_VERSION_GC");
3720                 if (flags & (~( 0x80000000 )))
3721                         proto_item_append_text(item, ", ");
3722         }
3723         flags&=(~( 0x80000000 ));
3724
3725         if (flags) {
3726                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
3727         }
3728
3729         return offset;
3730 }
3731
3732
3733 /* IDL: enum { */
3734 /* IDL:         LOGON_REQUEST=0, */
3735 /* IDL:         LOGON_RESPONSE2=6, */
3736 /* IDL:         LOGON_PRIMARY_QUERY=7, */
3737 /* IDL:         NETLOGON_ANNOUNCE_UAS=10, */
3738 /* IDL:         NETLOGON_RESPONSE_FROM_PDC=12, */
3739 /* IDL:         LOGON_SAM_LOGON_REQUEST=18, */
3740 /* IDL:         LOGON_SAM_LOGON_RESPONSE=19, */
3741 /* IDL:         LOGON_SAM_LOGON_PAUSE_RESPONSE=20, */
3742 /* IDL:         LOGON_SAM_LOGON_USER_UNKNOWN=21, */
3743 /* IDL:         LOGON_SAM_LOGON_RESPONSE_EX=23, */
3744 /* IDL:         LOGON_SAM_LOGON_PAUSE_RESPONSE_EX=24, */
3745 /* IDL:         LOGON_SAM_LOGON_USER_UNKNOWN_EX=25, */
3746 /* IDL: } */
3747
3748 int
3749 nbt_dissect_enum_netlogon_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
3750 {
3751         guint16 parameter=0;
3752         if(param){
3753                 parameter=(guint16)*param;
3754         }
3755         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
3756         if(param){
3757                 *param=(guint32)parameter;
3758         }
3759         return offset;
3760 }
3761
3762
3763 /* IDL: struct { */
3764 /* IDL:         uint16 request_count; */
3765 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string computer_name; */
3766 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string user_name; */
3767 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string mailslot_name; */
3768 /* IDL:         uint32 acct_control; */
3769 /* IDL:         [value(ndr_size_dom_sid0(&sid,ndr->flags))] uint32 sid_size; */
3770 /* IDL:         [flag(LIBNDR_FLAG_ALIGN4)] DATA_BLOB _pad; */
3771 /* IDL:         [subcontext_size(sid_size)] [subcontext(0)] dom_sid0 sid; */
3772 /* IDL:         netlogon_nt_version_flags nt_version; */
3773 /* IDL:         uint16 lmnt_token; */
3774 /* IDL:         uint16 lm20_token; */
3775 /* IDL: } */
3776
3777 static int
3778 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_request_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3779 {
3780         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_request_count, 0);
3781
3782         return offset;
3783 }
3784
3785 static int
3786 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3787 {
3788         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_computer_name , 0);
3789
3790         return offset;
3791 }
3792
3793 static int
3794 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3795 {
3796         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_user_name , 0);
3797
3798         return offset;
3799 }
3800
3801 static int
3802 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3803 {
3804         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_mailslot_name , 0);
3805
3806         return offset;
3807 }
3808
3809 static int
3810 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_acct_control(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3811 {
3812         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_acct_control, 0);
3813
3814         return offset;
3815 }
3816
3817 static int
3818 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3819 {
3820         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid_size, 0);
3821
3822         return offset;
3823 }
3824
3825 static int
3826 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3827 {
3828         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST__pad, 0);
3829
3830         return offset;
3831 }
3832
3833 static int
3834 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3835 {
3836         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
3837         guint0 size;
3838         int conformant = di->conformant_run;
3839         tvbuff_t *subtvb;
3840
3841         if (!conformant) {
3842                 guint32 saved_flags = di->call_data->flags;
3843                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid_, &size);
3844                 di->call_data->flags &= ~DCERPC_IS_NDR64;
3845                 subtvb = tvb_new_subset(tvb, offset, size, -1);
3846                 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid_(subtvb, 0, pinfo, tree, drep);
3847                 offset += size;
3848                 di->call_data->flags = saved_flags;
3849         }
3850
3851         return offset;
3852 }
3853
3854 static int
3855 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3856 {
3857         offset = nbt_dissect_struct_dom_sid0(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid,0);
3858
3859         return offset;
3860 }
3861
3862 static int
3863 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3864 {
3865         offset = nbt_dissect_bitmap_netlogon_nt_version_flags(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_nt_version, 0);
3866
3867         return offset;
3868 }
3869
3870 static int
3871 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3872 {
3873         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_lmnt_token, 0);
3874
3875         return offset;
3876 }
3877
3878 static int
3879 nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3880 {
3881         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_REQUEST_lm20_token, 0);
3882
3883         return offset;
3884 }
3885
3886 int
3887 nbt_dissect_struct_NETLOGON_SAM_LOGON_REQUEST(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3888 {
3889         proto_item *item = NULL;
3890         proto_tree *tree = NULL;
3891         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3892         int old_offset;
3893
3894         ALIGN_TO_4_BYTES;
3895
3896         old_offset = offset;
3897
3898         if (parent_tree) {
3899                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
3900                 tree = proto_item_add_subtree(item, ett_nbt_NETLOGON_SAM_LOGON_REQUEST);
3901         }
3902         
3903         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_request_count(tvb, offset, pinfo, tree, drep);
3904
3905         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_computer_name(tvb, offset, pinfo, tree, drep);
3906
3907         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_user_name(tvb, offset, pinfo, tree, drep);
3908
3909         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_mailslot_name(tvb, offset, pinfo, tree, drep);
3910
3911         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_acct_control(tvb, offset, pinfo, tree, drep);
3912
3913         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid_size(tvb, offset, pinfo, tree, drep);
3914
3915         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST__pad(tvb, offset, pinfo, tree, drep);
3916
3917         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_sid(tvb, offset, pinfo, tree, drep);
3918
3919         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_nt_version(tvb, offset, pinfo, tree, drep);
3920
3921         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_lmnt_token(tvb, offset, pinfo, tree, drep);
3922
3923         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_REQUEST_lm20_token(tvb, offset, pinfo, tree, drep);
3924
3925
3926         proto_item_set_len(item, offset-old_offset);
3927
3928
3929         if (di->call_data->flags & DCERPC_IS_NDR64) {
3930                 ALIGN_TO_4_BYTES;
3931         }
3932
3933         return offset;
3934 }
3935
3936
3937 /* IDL: struct { */
3938 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string computer_name; */
3939 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string user_name; */
3940 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string mailslot_name; */
3941 /* IDL:         uint8 request_count; */
3942 /* IDL:         uint16 lmnt_token; */
3943 /* IDL:         uint16 lm20_token; */
3944 /* IDL: } */
3945
3946 static int
3947 nbt_dissect_element_NETLOGON_LOGON_REQUEST_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3948 {
3949         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_LOGON_REQUEST_computer_name , 0);
3950
3951         return offset;
3952 }
3953
3954 static int
3955 nbt_dissect_element_NETLOGON_LOGON_REQUEST_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3956 {
3957         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_LOGON_REQUEST_user_name , 0);
3958
3959         return offset;
3960 }
3961
3962 static int
3963 nbt_dissect_element_NETLOGON_LOGON_REQUEST_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3964 {
3965         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_LOGON_REQUEST_mailslot_name , 0);
3966
3967         return offset;
3968 }
3969
3970 static int
3971 nbt_dissect_element_NETLOGON_LOGON_REQUEST_request_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3972 {
3973         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_LOGON_REQUEST_request_count, 0);
3974
3975         return offset;
3976 }
3977
3978 static int
3979 nbt_dissect_element_NETLOGON_LOGON_REQUEST_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3980 {
3981         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_LOGON_REQUEST_lmnt_token, 0);
3982
3983         return offset;
3984 }
3985
3986 static int
3987 nbt_dissect_element_NETLOGON_LOGON_REQUEST_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3988 {
3989         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_LOGON_REQUEST_lm20_token, 0);
3990
3991         return offset;
3992 }
3993
3994 int
3995 nbt_dissect_struct_NETLOGON_LOGON_REQUEST(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
3996 {
3997         proto_item *item = NULL;
3998         proto_tree *tree = NULL;
3999         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4000         int old_offset;
4001
4002         ALIGN_TO_4_BYTES;
4003
4004         old_offset = offset;
4005
4006         if (parent_tree) {
4007                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4008                 tree = proto_item_add_subtree(item, ett_nbt_NETLOGON_LOGON_REQUEST);
4009         }
4010         
4011         offset = nbt_dissect_element_NETLOGON_LOGON_REQUEST_computer_name(tvb, offset, pinfo, tree, drep);
4012
4013         offset = nbt_dissect_element_NETLOGON_LOGON_REQUEST_user_name(tvb, offset, pinfo, tree, drep);
4014
4015         offset = nbt_dissect_element_NETLOGON_LOGON_REQUEST_mailslot_name(tvb, offset, pinfo, tree, drep);
4016
4017         offset = nbt_dissect_element_NETLOGON_LOGON_REQUEST_request_count(tvb, offset, pinfo, tree, drep);
4018
4019         offset = nbt_dissect_element_NETLOGON_LOGON_REQUEST_lmnt_token(tvb, offset, pinfo, tree, drep);
4020
4021         offset = nbt_dissect_element_NETLOGON_LOGON_REQUEST_lm20_token(tvb, offset, pinfo, tree, drep);
4022
4023
4024         proto_item_set_len(item, offset-old_offset);
4025
4026
4027         if (di->call_data->flags & DCERPC_IS_NDR64) {
4028                 ALIGN_TO_4_BYTES;
4029         }
4030
4031         return offset;
4032 }
4033
4034
4035 /* IDL: struct { */
4036 /* IDL:         netlogon_command command; */
4037 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string pdc_name; */
4038 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string user_name; */
4039 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string domain_name; */
4040 /* IDL:         netlogon_nt_version_flags nt_version; */
4041 /* IDL:         uint16 lmnt_token; */
4042 /* IDL:         uint16 lm20_token; */
4043 /* IDL: } */
4044
4045 static int
4046 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4047 {
4048         offset = nbt_dissect_enum_netlogon_command(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_command, 0);
4049
4050         return offset;
4051 }
4052
4053 static int
4054 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4055 {
4056         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_pdc_name , 0);
4057
4058         return offset;
4059 }
4060
4061 static int
4062 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4063 {
4064         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_user_name , 0);
4065
4066         return offset;
4067 }
4068
4069 static int
4070 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4071 {
4072         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_domain_name , 0);
4073
4074         return offset;
4075 }
4076
4077 static int
4078 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4079 {
4080         offset = nbt_dissect_bitmap_netlogon_nt_version_flags(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_nt_version, 0);
4081
4082         return offset;
4083 }
4084
4085 static int
4086 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4087 {
4088         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_lmnt_token, 0);
4089
4090         return offset;
4091 }
4092
4093 static int
4094 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4095 {
4096         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_lm20_token, 0);
4097
4098         return offset;
4099 }
4100
4101 int
4102 nbt_dissect_struct_NETLOGON_SAM_LOGON_RESPONSE_NT40(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
4103 {
4104         proto_item *item = NULL;
4105         proto_tree *tree = NULL;
4106         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4107         int old_offset;
4108
4109
4110         old_offset = offset;
4111
4112         if (parent_tree) {
4113                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4114                 tree = proto_item_add_subtree(item, ett_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40);
4115         }
4116         
4117         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_command(tvb, offset, pinfo, tree, drep);
4118
4119         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_pdc_name(tvb, offset, pinfo, tree, drep);
4120
4121         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_user_name(tvb, offset, pinfo, tree, drep);
4122
4123         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_domain_name(tvb, offset, pinfo, tree, drep);
4124
4125         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_nt_version(tvb, offset, pinfo, tree, drep);
4126
4127         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_lmnt_token(tvb, offset, pinfo, tree, drep);
4128
4129         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_NT40_lm20_token(tvb, offset, pinfo, tree, drep);
4130
4131
4132         proto_item_set_len(item, offset-old_offset);
4133
4134
4135         if (di->call_data->flags & DCERPC_IS_NDR64) {
4136                 ALIGN_TO_4_BYTES;
4137         }
4138
4139         return offset;
4140 }
4141
4142
4143 /* IDL: struct { */
4144 /* IDL:         netlogon_command command; */
4145 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string pdc_name; */
4146 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string user_name; */
4147 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string domain_name; */
4148 /* IDL:         GUID domain_uuid; */
4149 /* IDL:         GUID zero_uuid; */
4150 /* IDL:         nbt_string forest; */
4151 /* IDL:         nbt_string dns_domain; */
4152 /* IDL:         nbt_string pdc_dns_name; */
4153 /* IDL:         ipv4address pdc_ip; */
4154 /* IDL:         nbt_server_type server_type; */
4155 /* IDL:         netlogon_nt_version_flags nt_version; */
4156 /* IDL:         uint16 lmnt_token; */
4157 /* IDL:         uint16 lm20_token; */
4158 /* IDL: } */
4159
4160 static int
4161 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4162 {
4163         offset = nbt_dissect_enum_netlogon_command(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_command, 0);
4164
4165         return offset;
4166 }
4167
4168 static int
4169 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4170 {
4171         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_name , 0);
4172
4173         return offset;
4174 }
4175
4176 static int
4177 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4178 {
4179         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_user_name , 0);
4180
4181         return offset;
4182 }
4183
4184 static int
4185 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4186 {
4187         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_domain_name , 0);
4188
4189         return offset;
4190 }
4191
4192 static int
4193 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_domain_uuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4194 {
4195         offset = dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_domain_uuid, NULL);
4196
4197         return offset;
4198 }
4199
4200 static int
4201 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_zero_uuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4202 {
4203         offset = dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_zero_uuid, NULL);
4204
4205         return offset;
4206 }
4207
4208 static int
4209 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_forest(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4210 {
4211         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_forest,0);
4212
4213         return offset;
4214 }
4215
4216 static int
4217 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_dns_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4218 {
4219         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_dns_domain,0);
4220
4221         return offset;
4222 }
4223
4224 static int
4225 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_dns_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4226 {
4227         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_dns_name,0);
4228
4229         return offset;
4230 }
4231
4232 static int
4233 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_ip(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4234 {
4235         offset = nbt_dissect_struct_ipv4address(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_ip,0);
4236
4237         return offset;
4238 }
4239
4240 static int
4241 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_server_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4242 {
4243         offset = nbt_dissect_bitmap_server_type(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_server_type, 0);
4244
4245         return offset;
4246 }
4247
4248 static int
4249 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4250 {
4251         offset = nbt_dissect_bitmap_netlogon_nt_version_flags(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_nt_version, 0);
4252
4253         return offset;
4254 }
4255
4256 static int
4257 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4258 {
4259         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_lmnt_token, 0);
4260
4261         return offset;
4262 }
4263
4264 static int
4265 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4266 {
4267         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_lm20_token, 0);
4268
4269         return offset;
4270 }
4271
4272 int
4273 nbt_dissect_struct_NETLOGON_SAM_LOGON_RESPONSE(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
4274 {
4275         proto_item *item = NULL;
4276         proto_tree *tree = NULL;
4277         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4278         int old_offset;
4279
4280
4281         old_offset = offset;
4282
4283         if (parent_tree) {
4284                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4285                 tree = proto_item_add_subtree(item, ett_nbt_NETLOGON_SAM_LOGON_RESPONSE);
4286         }
4287         
4288         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_command(tvb, offset, pinfo, tree, drep);
4289
4290         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_name(tvb, offset, pinfo, tree, drep);
4291
4292         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_user_name(tvb, offset, pinfo, tree, drep);
4293
4294         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_domain_name(tvb, offset, pinfo, tree, drep);
4295
4296         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_domain_uuid(tvb, offset, pinfo, tree, drep);
4297
4298         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_zero_uuid(tvb, offset, pinfo, tree, drep);
4299
4300         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_forest(tvb, offset, pinfo, tree, drep);
4301
4302         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_dns_domain(tvb, offset, pinfo, tree, drep);
4303
4304         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_dns_name(tvb, offset, pinfo, tree, drep);
4305
4306         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_pdc_ip(tvb, offset, pinfo, tree, drep);
4307
4308         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_server_type(tvb, offset, pinfo, tree, drep);
4309
4310         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_nt_version(tvb, offset, pinfo, tree, drep);
4311
4312         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_lmnt_token(tvb, offset, pinfo, tree, drep);
4313
4314         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_lm20_token(tvb, offset, pinfo, tree, drep);
4315
4316
4317         proto_item_set_len(item, offset-old_offset);
4318
4319
4320         if (di->call_data->flags & DCERPC_IS_NDR64) {
4321                 ALIGN_TO_4_BYTES;
4322         }
4323
4324         return offset;
4325 }
4326
4327
4328 /* IDL: struct { */
4329 /* IDL:         netlogon_command command; */
4330 /* IDL:         uint16 sbz; */
4331 /* IDL:         nbt_server_type server_type; */
4332 /* IDL:         GUID domain_uuid; */
4333 /* IDL:         nbt_string forest; */
4334 /* IDL:         nbt_string dns_domain; */
4335 /* IDL:         nbt_string pdc_dns_name; */
4336 /* IDL:         nbt_string domain_name; */
4337 /* IDL:         nbt_string pdc_name; */
4338 /* IDL:         nbt_string user_name; */
4339 /* IDL:         nbt_string server_site; */
4340 /* IDL:         nbt_string client_site; */
4341 /* IDL:         [value(ndr_size_nbt_sockaddr(&sockaddr,ndr->flags))] uint8 sockaddr_size; */
4342 /* IDL:         [subcontext_size(sockaddr_size)] [subcontext(0)] nbt_sockaddr sockaddr; */
4343 /* IDL:         nbt_string next_closest_site; */
4344 /* IDL:         netlogon_nt_version_flags nt_version; */
4345 /* IDL:         uint16 lmnt_token; */
4346 /* IDL:         uint16 lm20_token; */
4347 /* IDL: } */
4348
4349 static int
4350 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4351 {
4352         offset = nbt_dissect_enum_netlogon_command(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_command, 0);
4353
4354         return offset;
4355 }
4356
4357 static int
4358 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sbz(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4359 {
4360         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sbz, 0);
4361
4362         return offset;
4363 }
4364
4365 static int
4366 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_server_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4367 {
4368         offset = nbt_dissect_bitmap_server_type(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_server_type, 0);
4369
4370         return offset;
4371 }
4372
4373 static int
4374 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_uuid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4375 {
4376         offset = dissect_ndr_uuid_t(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_uuid, NULL);
4377
4378         return offset;
4379 }
4380
4381 static int
4382 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_forest(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4383 {
4384         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_forest,0);
4385
4386         return offset;
4387 }
4388
4389 static int
4390 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_dns_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4391 {
4392         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_dns_domain,0);
4393
4394         return offset;
4395 }
4396
4397 static int
4398 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_dns_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4399 {
4400         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_dns_name,0);
4401
4402         return offset;
4403 }
4404
4405 static int
4406 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4407 {
4408         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_name,0);
4409
4410         return offset;
4411 }
4412
4413 static int
4414 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4415 {
4416         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_name,0);
4417
4418         return offset;
4419 }
4420
4421 static int
4422 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_user_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4423 {
4424         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_user_name,0);
4425
4426         return offset;
4427 }
4428
4429 static int
4430 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_server_site(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4431 {
4432         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_server_site,0);
4433
4434         return offset;
4435 }
4436
4437 static int
4438 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_client_site(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4439 {
4440         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_client_site,0);
4441
4442         return offset;
4443 }
4444
4445 static int
4446 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4447 {
4448         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_size, 0);
4449
4450         return offset;
4451 }
4452
4453 static int
4454 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4455 {
4456         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
4457         guint0 size;
4458         int conformant = di->conformant_run;
4459         tvbuff_t *subtvb;
4460
4461         if (!conformant) {
4462                 guint32 saved_flags = di->call_data->flags;
4463                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_, &size);
4464                 di->call_data->flags &= ~DCERPC_IS_NDR64;
4465                 subtvb = tvb_new_subset(tvb, offset, size, -1);
4466                 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_(subtvb, 0, pinfo, tree, drep);
4467                 offset += size;
4468                 di->call_data->flags = saved_flags;
4469         }
4470
4471         return offset;
4472 }
4473
4474 static int
4475 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4476 {
4477         offset = nbt_dissect_struct_sockaddr(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr,0);
4478
4479         return offset;
4480 }
4481
4482 static int
4483 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_next_closest_site(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4484 {
4485         offset = nbt_dissect_struct_nbt_string(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_next_closest_site,0);
4486
4487         return offset;
4488 }
4489
4490 static int
4491 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4492 {
4493         offset = nbt_dissect_bitmap_netlogon_nt_version_flags(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_nt_version, 0);
4494
4495         return offset;
4496 }
4497
4498 static int
4499 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4500 {
4501         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_lmnt_token, 0);
4502
4503         return offset;
4504 }
4505
4506 static int
4507 nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4508 {
4509         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_lm20_token, 0);
4510
4511         return offset;
4512 }
4513
4514 int
4515 nbt_dissect_struct_NETLOGON_SAM_LOGON_RESPONSE_EX(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
4516 {
4517         proto_item *item = NULL;
4518         proto_tree *tree = NULL;
4519         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4520         int old_offset;
4521
4522
4523         old_offset = offset;
4524
4525         if (parent_tree) {
4526                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4527                 tree = proto_item_add_subtree(item, ett_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX);
4528         }
4529         
4530         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_command(tvb, offset, pinfo, tree, drep);
4531
4532         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sbz(tvb, offset, pinfo, tree, drep);
4533
4534         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_server_type(tvb, offset, pinfo, tree, drep);
4535
4536         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_uuid(tvb, offset, pinfo, tree, drep);
4537
4538         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_forest(tvb, offset, pinfo, tree, drep);
4539
4540         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_dns_domain(tvb, offset, pinfo, tree, drep);
4541
4542         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_dns_name(tvb, offset, pinfo, tree, drep);
4543
4544         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_name(tvb, offset, pinfo, tree, drep);
4545
4546         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_name(tvb, offset, pinfo, tree, drep);
4547
4548         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_user_name(tvb, offset, pinfo, tree, drep);
4549
4550         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_server_site(tvb, offset, pinfo, tree, drep);
4551
4552         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_client_site(tvb, offset, pinfo, tree, drep);
4553
4554         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_size(tvb, offset, pinfo, tree, drep);
4555
4556         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr(tvb, offset, pinfo, tree, drep);
4557
4558         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_next_closest_site(tvb, offset, pinfo, tree, drep);
4559
4560         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_nt_version(tvb, offset, pinfo, tree, drep);
4561
4562         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_lmnt_token(tvb, offset, pinfo, tree, drep);
4563
4564         offset = nbt_dissect_element_NETLOGON_SAM_LOGON_RESPONSE_EX_lm20_token(tvb, offset, pinfo, tree, drep);
4565
4566
4567         proto_item_set_len(item, offset-old_offset);
4568
4569
4570         if (di->call_data->flags & DCERPC_IS_NDR64) {
4571                 ALIGN_TO_4_BYTES;
4572         }
4573
4574         return offset;
4575 }
4576
4577
4578 /* IDL: struct { */
4579 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string computer_name; */
4580 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string mailslot_name; */
4581 /* IDL:         [flag(LIBNDR_FLAG_ALIGN2)] DATA_BLOB _pad; */
4582 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string unicode_name; */
4583 /* IDL:         netlogon_nt_version_flags nt_version; */
4584 /* IDL:         uint16 lmnt_token; */
4585 /* IDL:         uint16 lm20_token; */
4586 /* IDL: } */
4587
4588 static int
4589 nbt_dissect_element_netlogon_query_for_pdc_computer_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4590 {
4591         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_query_for_pdc_computer_name , 0);
4592
4593         return offset;
4594 }
4595
4596 static int
4597 nbt_dissect_element_netlogon_query_for_pdc_mailslot_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4598 {
4599         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_query_for_pdc_mailslot_name , 0);
4600
4601         return offset;
4602 }
4603
4604 static int
4605 nbt_dissect_element_netlogon_query_for_pdc__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4606 {
4607         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_query_for_pdc__pad, 0);
4608
4609         return offset;
4610 }
4611
4612 static int
4613 nbt_dissect_element_netlogon_query_for_pdc_unicode_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4614 {
4615         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_query_for_pdc_unicode_name , 0);
4616
4617         return offset;
4618 }
4619
4620 static int
4621 nbt_dissect_element_netlogon_query_for_pdc_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4622 {
4623         offset = nbt_dissect_bitmap_netlogon_nt_version_flags(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_query_for_pdc_nt_version, 0);
4624
4625         return offset;
4626 }
4627
4628 static int
4629 nbt_dissect_element_netlogon_query_for_pdc_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4630 {
4631         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_query_for_pdc_lmnt_token, 0);
4632
4633         return offset;
4634 }
4635
4636 static int
4637 nbt_dissect_element_netlogon_query_for_pdc_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4638 {
4639         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_query_for_pdc_lm20_token, 0);
4640
4641         return offset;
4642 }
4643
4644 int
4645 nbt_dissect_struct_netlogon_query_for_pdc(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
4646 {
4647         proto_item *item = NULL;
4648         proto_tree *tree = NULL;
4649         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4650         int old_offset;
4651
4652         ALIGN_TO_4_BYTES;
4653
4654         old_offset = offset;
4655
4656         if (parent_tree) {
4657                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4658                 tree = proto_item_add_subtree(item, ett_nbt_nbt_netlogon_query_for_pdc);
4659         }
4660         
4661         offset = nbt_dissect_element_netlogon_query_for_pdc_computer_name(tvb, offset, pinfo, tree, drep);
4662
4663         offset = nbt_dissect_element_netlogon_query_for_pdc_mailslot_name(tvb, offset, pinfo, tree, drep);
4664
4665         offset = nbt_dissect_element_netlogon_query_for_pdc__pad(tvb, offset, pinfo, tree, drep);
4666
4667         offset = nbt_dissect_element_netlogon_query_for_pdc_unicode_name(tvb, offset, pinfo, tree, drep);
4668
4669         offset = nbt_dissect_element_netlogon_query_for_pdc_nt_version(tvb, offset, pinfo, tree, drep);
4670
4671         offset = nbt_dissect_element_netlogon_query_for_pdc_lmnt_token(tvb, offset, pinfo, tree, drep);
4672
4673         offset = nbt_dissect_element_netlogon_query_for_pdc_lm20_token(tvb, offset, pinfo, tree, drep);
4674
4675
4676         proto_item_set_len(item, offset-old_offset);
4677
4678
4679         if (di->call_data->flags & DCERPC_IS_NDR64) {
4680                 ALIGN_TO_4_BYTES;
4681         }
4682
4683         return offset;
4684 }
4685
4686
4687 /* IDL: struct { */
4688 /* IDL:         netlogon_command command; */
4689 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string pdc_name; */
4690 /* IDL:         [flag(LIBNDR_FLAG_ALIGN2)] DATA_BLOB _pad; */
4691 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string unicode_pdc_name; */
4692 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string domain_name; */
4693 /* IDL:         netlogon_nt_version_flags nt_version; */
4694 /* IDL:         uint16 lmnt_token; */
4695 /* IDL:         uint16 lm20_token; */
4696 /* IDL: } */
4697
4698 static int
4699 nbt_dissect_element_netlogon_response_from_pdc_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4700 {
4701         offset = nbt_dissect_enum_netlogon_command(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc_command, 0);
4702
4703         return offset;
4704 }
4705
4706 static int
4707 nbt_dissect_element_netlogon_response_from_pdc_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4708 {
4709         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc_pdc_name , 0);
4710
4711         return offset;
4712 }
4713
4714 static int
4715 nbt_dissect_element_netlogon_response_from_pdc__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4716 {
4717         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc__pad, 0);
4718
4719         return offset;
4720 }
4721
4722 static int
4723 nbt_dissect_element_netlogon_response_from_pdc_unicode_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4724 {
4725         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc_unicode_pdc_name , 0);
4726
4727         return offset;
4728 }
4729
4730 static int
4731 nbt_dissect_element_netlogon_response_from_pdc_domain_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4732 {
4733         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc_domain_name , 0);
4734
4735         return offset;
4736 }
4737
4738 static int
4739 nbt_dissect_element_netlogon_response_from_pdc_nt_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4740 {
4741         offset = nbt_dissect_bitmap_netlogon_nt_version_flags(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc_nt_version, 0);
4742
4743         return offset;
4744 }
4745
4746 static int
4747 nbt_dissect_element_netlogon_response_from_pdc_lmnt_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4748 {
4749         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc_lmnt_token, 0);
4750
4751         return offset;
4752 }
4753
4754 static int
4755 nbt_dissect_element_netlogon_response_from_pdc_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4756 {
4757         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response_from_pdc_lm20_token, 0);
4758
4759         return offset;
4760 }
4761
4762 int
4763 nbt_dissect_struct_netlogon_response_from_pdc(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
4764 {
4765         proto_item *item = NULL;
4766         proto_tree *tree = NULL;
4767         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4768         int old_offset;
4769
4770         ALIGN_TO_4_BYTES;
4771
4772         old_offset = offset;
4773
4774         if (parent_tree) {
4775                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4776                 tree = proto_item_add_subtree(item, ett_nbt_nbt_netlogon_response_from_pdc);
4777         }
4778         
4779         offset = nbt_dissect_element_netlogon_response_from_pdc_command(tvb, offset, pinfo, tree, drep);
4780
4781         offset = nbt_dissect_element_netlogon_response_from_pdc_pdc_name(tvb, offset, pinfo, tree, drep);
4782
4783         offset = nbt_dissect_element_netlogon_response_from_pdc__pad(tvb, offset, pinfo, tree, drep);
4784
4785         offset = nbt_dissect_element_netlogon_response_from_pdc_unicode_pdc_name(tvb, offset, pinfo, tree, drep);
4786
4787         offset = nbt_dissect_element_netlogon_response_from_pdc_domain_name(tvb, offset, pinfo, tree, drep);
4788
4789         offset = nbt_dissect_element_netlogon_response_from_pdc_nt_version(tvb, offset, pinfo, tree, drep);
4790
4791         offset = nbt_dissect_element_netlogon_response_from_pdc_lmnt_token(tvb, offset, pinfo, tree, drep);
4792
4793         offset = nbt_dissect_element_netlogon_response_from_pdc_lm20_token(tvb, offset, pinfo, tree, drep);
4794
4795
4796         proto_item_set_len(item, offset-old_offset);
4797
4798
4799         if (di->call_data->flags & DCERPC_IS_NDR64) {
4800                 ALIGN_TO_4_BYTES;
4801         }
4802
4803         return offset;
4804 }
4805
4806
4807 /* IDL: struct { */
4808 /* IDL:         netlogon_command command; */
4809 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string pdc_name; */
4810 /* IDL:         uint16 lm20_token; */
4811 /* IDL: } */
4812
4813 static int
4814 nbt_dissect_element_netlogon_response2_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4815 {
4816         offset = nbt_dissect_enum_netlogon_command(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response2_command, 0);
4817
4818         return offset;
4819 }
4820
4821 static int
4822 nbt_dissect_element_netlogon_response2_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4823 {
4824         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response2_pdc_name , 0);
4825
4826         return offset;
4827 }
4828
4829 static int
4830 nbt_dissect_element_netlogon_response2_lm20_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4831 {
4832         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_response2_lm20_token, 0);
4833
4834         return offset;
4835 }
4836
4837 int
4838 nbt_dissect_struct_netlogon_response2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
4839 {
4840         proto_item *item = NULL;
4841         proto_tree *tree = NULL;
4842         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4843         int old_offset;
4844
4845
4846         old_offset = offset;
4847
4848         if (parent_tree) {
4849                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4850                 tree = proto_item_add_subtree(item, ett_nbt_nbt_netlogon_response2);
4851         }
4852         
4853         offset = nbt_dissect_element_netlogon_response2_command(tvb, offset, pinfo, tree, drep);
4854
4855         offset = nbt_dissect_element_netlogon_response2_pdc_name(tvb, offset, pinfo, tree, drep);
4856
4857         offset = nbt_dissect_element_netlogon_response2_lm20_token(tvb, offset, pinfo, tree, drep);
4858
4859
4860         proto_item_set_len(item, offset-old_offset);
4861
4862
4863         if (di->call_data->flags & DCERPC_IS_NDR64) {
4864                 ALIGN_TO_4_BYTES;
4865         }
4866
4867         return offset;
4868 }
4869
4870
4871 /* IDL: struct { */
4872 /* IDL:         netr_SamDatabaseID db_index; */
4873 /* IDL:         hyper serial; */
4874 /* IDL:         NTTIME timestamp; */
4875 /* IDL: } */
4876
4877 static int
4878 nbt_dissect_element_db_change_info_db_index(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4879 {
4880         offset = nbt_dissect_struct_netr_SamDatabaseID(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_db_change_info_db_index,0);
4881
4882         return offset;
4883 }
4884
4885 static int
4886 nbt_dissect_element_db_change_info_serial(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4887 {
4888         offset = dissect_ndr_uint64(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_db_change_info_serial, NULL);
4889
4890         return offset;
4891 }
4892
4893 static int
4894 nbt_dissect_element_db_change_info_timestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4895 {
4896         offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_db_change_info_timestamp);
4897
4898         return offset;
4899 }
4900
4901 int
4902 nbt_dissect_struct_db_change_info(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
4903 {
4904         proto_item *item = NULL;
4905         proto_tree *tree = NULL;
4906         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
4907         int old_offset;
4908
4909         ALIGN_TO_8_BYTES;
4910
4911         old_offset = offset;
4912
4913         if (parent_tree) {
4914                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
4915                 tree = proto_item_add_subtree(item, ett_nbt_nbt_db_change_info);
4916         }
4917         
4918         offset = nbt_dissect_element_db_change_info_db_index(tvb, offset, pinfo, tree, drep);
4919
4920         offset = nbt_dissect_element_db_change_info_serial(tvb, offset, pinfo, tree, drep);
4921
4922         offset = nbt_dissect_element_db_change_info_timestamp(tvb, offset, pinfo, tree, drep);
4923
4924
4925         proto_item_set_len(item, offset-old_offset);
4926
4927
4928         if (di->call_data->flags & DCERPC_IS_NDR64) {
4929                 ALIGN_TO_8_BYTES;
4930         }
4931
4932         return offset;
4933 }
4934
4935
4936 /* IDL: struct { */
4937 /* IDL:         uint32 serial_lo; */
4938 /* IDL:         time_t timestamp; */
4939 /* IDL:         uint32 pulse; */
4940 /* IDL:         uint32 random; */
4941 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string pdc_name; */
4942 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string domain; */
4943 /* IDL:         [flag(LIBNDR_FLAG_ALIGN2)] DATA_BLOB _pad; */
4944 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string unicode_pdc_name; */
4945 /* IDL:         [flag(LIBNDR_FLAG_STR_NULLTERM|LIBNDR_FLAG_ALIGN2)] string unicode_domain; */
4946 /* IDL:         uint32 db_count; */
4947 /* IDL:         nbt_db_change_info dbchange[db_count]; */
4948 /* IDL:         [value(ndr_size_dom_sid0(&sid,ndr->flags))] uint32 sid_size; */
4949 /* IDL:         [subcontext_size(sid_size)] [subcontext(0)] dom_sid0 sid; */
4950 /* IDL:         uint32 message_format_version; */
4951 /* IDL:         uint32 message_token; */
4952 /* IDL: } */
4953
4954 static int
4955 nbt_dissect_element_NETLOGON_DB_CHANGE_serial_lo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4956 {
4957         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_serial_lo, 0);
4958
4959         return offset;
4960 }
4961
4962 static int
4963 nbt_dissect_element_NETLOGON_DB_CHANGE_timestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4964 {
4965         offset = dissect_ndr_time_t(tvb, offset, pinfo,tree, drep, hf_nbt_NETLOGON_DB_CHANGE_timestamp, NULL);
4966
4967         return offset;
4968 }
4969
4970 static int
4971 nbt_dissect_element_NETLOGON_DB_CHANGE_pulse(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4972 {
4973         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_pulse, 0);
4974
4975         return offset;
4976 }
4977
4978 static int
4979 nbt_dissect_element_NETLOGON_DB_CHANGE_random(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4980 {
4981         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_random, 0);
4982
4983         return offset;
4984 }
4985
4986 static int
4987 nbt_dissect_element_NETLOGON_DB_CHANGE_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4988 {
4989         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_pdc_name , 0);
4990
4991         return offset;
4992 }
4993
4994 static int
4995 nbt_dissect_element_NETLOGON_DB_CHANGE_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
4996 {
4997         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_domain , 0);
4998
4999         return offset;
5000 }
5001
5002 static int
5003 nbt_dissect_element_NETLOGON_DB_CHANGE__pad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5004 {
5005         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE__pad, 0);
5006
5007         return offset;
5008 }
5009
5010 static int
5011 nbt_dissect_element_NETLOGON_DB_CHANGE_unicode_pdc_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5012 {
5013         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_unicode_pdc_name , 0);
5014
5015         return offset;
5016 }
5017
5018 static int
5019 nbt_dissect_element_NETLOGON_DB_CHANGE_unicode_domain(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5020 {
5021         offset = dissect_null_term_wstring(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_unicode_domain , 0);
5022
5023         return offset;
5024 }
5025
5026 static int
5027 nbt_dissect_element_NETLOGON_DB_CHANGE_db_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5028 {
5029         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_db_count, 0);
5030
5031         return offset;
5032 }
5033
5034 static int
5035 nbt_dissect_element_NETLOGON_DB_CHANGE_dbchange(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5036 {
5037
5038         return offset;
5039 }
5040
5041 static int
5042 nbt_dissect_element_NETLOGON_DB_CHANGE_dbchange_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5043 {
5044         offset = nbt_dissect_struct_db_change_info(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_DB_CHANGE_dbchange,0);
5045
5046         return offset;
5047 }
5048
5049 static int
5050 nbt_dissect_element_NETLOGON_DB_CHANGE_sid_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5051 {
5052         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_sid_size, 0);
5053
5054         return offset;
5055 }
5056
5057 static int
5058 nbt_dissect_element_NETLOGON_DB_CHANGE_sid(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5059 {
5060         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
5061         guint0 size;
5062         int conformant = di->conformant_run;
5063         tvbuff_t *subtvb;
5064
5065         if (!conformant) {
5066                 guint32 saved_flags = di->call_data->flags;
5067                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_sid_, &size);
5068                 di->call_data->flags &= ~DCERPC_IS_NDR64;
5069                 subtvb = tvb_new_subset(tvb, offset, size, -1);
5070                 nbt_dissect_element_NETLOGON_DB_CHANGE_sid_(subtvb, 0, pinfo, tree, drep);
5071                 offset += size;
5072                 di->call_data->flags = saved_flags;
5073         }
5074
5075         return offset;
5076 }
5077
5078 static int
5079 nbt_dissect_element_NETLOGON_DB_CHANGE_sid_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5080 {
5081         offset = nbt_dissect_struct_dom_sid0(tvb,offset,pinfo,tree,drep,hf_nbt_NETLOGON_DB_CHANGE_sid,0);
5082
5083         return offset;
5084 }
5085
5086 static int
5087 nbt_dissect_element_NETLOGON_DB_CHANGE_message_format_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5088 {
5089         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_message_format_version, 0);
5090
5091         return offset;
5092 }
5093
5094 static int
5095 nbt_dissect_element_NETLOGON_DB_CHANGE_message_token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5096 {
5097         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_NETLOGON_DB_CHANGE_message_token, 0);
5098
5099         return offset;
5100 }
5101
5102 int
5103 nbt_dissect_struct_NETLOGON_DB_CHANGE(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5104 {
5105         proto_item *item = NULL;
5106         proto_tree *tree = NULL;
5107         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5108         int old_offset;
5109
5110         ALIGN_TO_8_BYTES;
5111
5112         old_offset = offset;
5113
5114         if (parent_tree) {
5115                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5116                 tree = proto_item_add_subtree(item, ett_nbt_NETLOGON_DB_CHANGE);
5117         }
5118         
5119         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_serial_lo(tvb, offset, pinfo, tree, drep);
5120
5121         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_timestamp(tvb, offset, pinfo, tree, drep);
5122
5123         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_pulse(tvb, offset, pinfo, tree, drep);
5124
5125         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_random(tvb, offset, pinfo, tree, drep);
5126
5127         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_pdc_name(tvb, offset, pinfo, tree, drep);
5128
5129         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_domain(tvb, offset, pinfo, tree, drep);
5130
5131         offset = nbt_dissect_element_NETLOGON_DB_CHANGE__pad(tvb, offset, pinfo, tree, drep);
5132
5133         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_unicode_pdc_name(tvb, offset, pinfo, tree, drep);
5134
5135         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_unicode_domain(tvb, offset, pinfo, tree, drep);
5136
5137         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_db_count(tvb, offset, pinfo, tree, drep);
5138
5139         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_dbchange(tvb, offset, pinfo, tree, drep);
5140
5141         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_sid_size(tvb, offset, pinfo, tree, drep);
5142
5143         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_sid(tvb, offset, pinfo, tree, drep);
5144
5145         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_message_format_version(tvb, offset, pinfo, tree, drep);
5146
5147         offset = nbt_dissect_element_NETLOGON_DB_CHANGE_message_token(tvb, offset, pinfo, tree, drep);
5148
5149
5150         proto_item_set_len(item, offset-old_offset);
5151
5152
5153         if (di->call_data->flags & DCERPC_IS_NDR64) {
5154                 ALIGN_TO_8_BYTES;
5155         }
5156
5157         return offset;
5158 }
5159
5160
5161 /* IDL: [nodiscriminant(1)] union { */
5162 /* IDL: [case(LOGON_REQUEST)] [case(LOGON_REQUEST)] NETLOGON_LOGON_REQUEST logon0; */
5163 /* IDL: [case(LOGON_SAM_LOGON_REQUEST)] [case(LOGON_SAM_LOGON_REQUEST)] NETLOGON_SAM_LOGON_REQUEST logon; */
5164 /* IDL: [case(LOGON_PRIMARY_QUERY)] [case(LOGON_PRIMARY_QUERY)] nbt_netlogon_query_for_pdc pdc; */
5165 /* IDL: [case(NETLOGON_ANNOUNCE_UAS)] [case(NETLOGON_ANNOUNCE_UAS)] NETLOGON_DB_CHANGE uas; */
5166 /* IDL: } */
5167
5168 static int
5169 nbt_dissect_element_netlogon_request_logon0(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5170 {
5171         offset = nbt_dissect_struct_NETLOGON_LOGON_REQUEST(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_netlogon_request_logon0,0);
5172
5173         return offset;
5174 }
5175
5176 static int
5177 nbt_dissect_element_netlogon_request_logon(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5178 {
5179         offset = nbt_dissect_struct_NETLOGON_SAM_LOGON_REQUEST(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_netlogon_request_logon,0);
5180
5181         return offset;
5182 }
5183
5184 static int
5185 nbt_dissect_element_netlogon_request_pdc(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5186 {
5187         offset = nbt_dissect_struct_netlogon_query_for_pdc(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_netlogon_request_pdc,0);
5188
5189         return offset;
5190 }
5191
5192 static int
5193 nbt_dissect_element_netlogon_request_uas(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5194 {
5195         offset = nbt_dissect_struct_NETLOGON_DB_CHANGE(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_netlogon_request_uas,0);
5196
5197         return offset;
5198 }
5199
5200 static int
5201 nbt_dissect_netlogon_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5202 {
5203         proto_item *item = NULL;
5204         proto_tree *tree = NULL;
5205         int old_offset;
5206         guint32 level = param;
5207
5208         old_offset = offset;
5209         if (parent_tree) {
5210                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "nbt_netlogon_request");
5211                 tree = proto_item_add_subtree(item, ett_nbt_nbt_netlogon_request);
5212         }
5213
5214         switch(level) {
5215                 case LOGON_REQUEST:
5216                         offset = nbt_dissect_element_netlogon_request_logon0(tvb, offset, pinfo, tree, drep);
5217                 break;
5218
5219                 case LOGON_SAM_LOGON_REQUEST:
5220                         offset = nbt_dissect_element_netlogon_request_logon(tvb, offset, pinfo, tree, drep);
5221                 break;
5222
5223                 case LOGON_PRIMARY_QUERY:
5224                         offset = nbt_dissect_element_netlogon_request_pdc(tvb, offset, pinfo, tree, drep);
5225                 break;
5226
5227                 case NETLOGON_ANNOUNCE_UAS:
5228                         offset = nbt_dissect_element_netlogon_request_uas(tvb, offset, pinfo, tree, drep);
5229                 break;
5230         }
5231         proto_item_set_len(item, offset-old_offset);
5232
5233
5234         return offset;
5235 }
5236
5237 /* IDL: struct { */
5238 /* IDL:         netlogon_command command; */
5239 /* IDL:         [switch_is(command)] nbt_netlogon_request req; */
5240 /* IDL: } */
5241
5242 static int
5243 nbt_dissect_element_netlogon_packet_command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *command)
5244 {
5245         offset = nbt_dissect_enum_netlogon_command(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_packet_command, command);
5246
5247         return offset;
5248 }
5249
5250 static int
5251 nbt_dissect_element_netlogon_packet_req(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *command)
5252 {
5253         offset = nbt_dissect_netlogon_request(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_netlogon_packet_req, *command);
5254
5255         return offset;
5256 }
5257
5258 int
5259 nbt_dissect_struct_netlogon_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5260 {
5261         guint16 command;
5262         proto_item *item = NULL;
5263         proto_tree *tree = NULL;
5264         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5265         int old_offset;
5266
5267
5268         old_offset = offset;
5269
5270         if (parent_tree) {
5271                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5272                 tree = proto_item_add_subtree(item, ett_nbt_nbt_netlogon_packet);
5273         }
5274         
5275         offset = nbt_dissect_element_netlogon_packet_command(tvb, offset, pinfo, tree, drep, &command);
5276
5277         offset = nbt_dissect_element_netlogon_packet_req(tvb, offset, pinfo, tree, drep, &command);
5278
5279
5280         proto_item_set_len(item, offset-old_offset);
5281
5282
5283         if (di->call_data->flags & DCERPC_IS_NDR64) {
5284                 ALIGN_TO_8_BYTES;
5285         }
5286
5287         return offset;
5288 }
5289
5290
5291 /* IDL: bitmap { */
5292 /* IDL: } */
5293
5294 int
5295 nbt_dissect_bitmap_svcctl_ServerType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5296 {
5297         proto_item *item = NULL;
5298         proto_tree *tree = NULL;
5299
5300         guint32 flags;
5301         ALIGN_TO_4_BYTES;
5302
5303         if (parent_tree) {
5304                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, DREP_ENC_INTEGER(drep));
5305                 tree = proto_item_add_subtree(item,ett_nbt_svcctl_ServerType);
5306         }
5307
5308         offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);
5309         proto_item_append_text(item, ": ");
5310
5311         if (!flags)
5312                 proto_item_append_text(item, "(No values set)");
5313
5314         if (flags) {
5315                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
5316         }
5317
5318         return offset;
5319 }
5320
5321
5322 /* IDL: enum { */
5323 /* IDL:         HostAnnouncement=1, */
5324 /* IDL:         AnnouncementRequest=2, */
5325 /* IDL:         Election=8, */
5326 /* IDL:         GetBackupListReq=9, */
5327 /* IDL:         GetBackupListResp=10, */
5328 /* IDL:         BecomeBackup=11, */
5329 /* IDL:         DomainAnnouncement=12, */
5330 /* IDL:         MasterAnnouncement=13, */
5331 /* IDL:         ResetBrowserState=14, */
5332 /* IDL:         LocalMasterAnnouncement=15, */
5333 /* IDL: } */
5334
5335 int
5336 nbt_dissect_enum_browse_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
5337 {
5338         guint8 parameter=0;
5339         if(param){
5340                 parameter=(guint8)*param;
5341         }
5342         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
5343         if(param){
5344                 *param=(guint32)parameter;
5345         }
5346         return offset;
5347 }
5348
5349
5350 /* IDL: struct { */
5351 /* IDL:         uint8 UpdateCount; */
5352 /* IDL:         uint32 Periodicity; */
5353 /* IDL:         [charset(DOS)] uint8 ServerName[16]; */
5354 /* IDL:         uint8 OSMajor; */
5355 /* IDL:         uint8 OSMinor; */
5356 /* IDL:         svcctl_ServerType ServerType; */
5357 /* IDL:         uint8 BroMajorVer; */
5358 /* IDL:         uint8 BroMinorVer; */
5359 /* IDL:         uint16 Signature; */
5360 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string Comment; */
5361 /* IDL: } */
5362
5363 static int
5364 nbt_dissect_element_browse_host_announcement_UpdateCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5365 {
5366         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_UpdateCount, 0);
5367
5368         return offset;
5369 }
5370
5371 static int
5372 nbt_dissect_element_browse_host_announcement_Periodicity(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5373 {
5374         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_Periodicity, 0);
5375
5376         return offset;
5377 }
5378
5379 static int
5380 nbt_dissect_element_browse_host_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5381 {
5382         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
5383         int conformant = di->conformant_run;
5384         if (!conformant) {
5385                 offset = nbt_dissect_element_browse_host_announcement_ServerName_(tvb, offset, 16, pinfo, tree, drep);
5386         }
5387
5388         return offset;
5389 }
5390
5391 static int
5392 nbt_dissect_element_browse_host_announcement_ServerName_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5393 {
5394         proto_tree_add_bytes(tree, hf_nbt_nbt_browse_host_announcement_ServerName, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
5395
5396         return offset;
5397 }
5398
5399 static int
5400 nbt_dissect_element_browse_host_announcement_OSMajor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5401 {
5402         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_OSMajor, 0);
5403
5404         return offset;
5405 }
5406
5407 static int
5408 nbt_dissect_element_browse_host_announcement_OSMinor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5409 {
5410         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_OSMinor, 0);
5411
5412         return offset;
5413 }
5414
5415 static int
5416 nbt_dissect_element_browse_host_announcement_ServerType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5417 {
5418         offset = nbt_dissect_bitmap_svcctl_ServerType(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_ServerType, 0);
5419
5420         return offset;
5421 }
5422
5423 static int
5424 nbt_dissect_element_browse_host_announcement_BroMajorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5425 {
5426         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_BroMajorVer, 0);
5427
5428         return offset;
5429 }
5430
5431 static int
5432 nbt_dissect_element_browse_host_announcement_BroMinorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5433 {
5434         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_BroMinorVer, 0);
5435
5436         return offset;
5437 }
5438
5439 static int
5440 nbt_dissect_element_browse_host_announcement_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5441 {
5442         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_Signature, 0);
5443
5444         return offset;
5445 }
5446
5447 static int
5448 nbt_dissect_element_browse_host_announcement_Comment(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5449 {
5450         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_host_announcement_Comment , 0);
5451
5452         return offset;
5453 }
5454
5455 int
5456 nbt_dissect_struct_browse_host_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5457 {
5458         proto_item *item = NULL;
5459         proto_tree *tree = NULL;
5460         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5461         int old_offset;
5462
5463         ALIGN_TO_4_BYTES;
5464
5465         old_offset = offset;
5466
5467         if (parent_tree) {
5468                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5469                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_host_announcement);
5470         }
5471         
5472         offset = nbt_dissect_element_browse_host_announcement_UpdateCount(tvb, offset, pinfo, tree, drep);
5473
5474         offset = nbt_dissect_element_browse_host_announcement_Periodicity(tvb, offset, pinfo, tree, drep);
5475
5476         offset = nbt_dissect_element_browse_host_announcement_ServerName(tvb, offset, pinfo, tree, drep);
5477
5478         offset = nbt_dissect_element_browse_host_announcement_OSMajor(tvb, offset, pinfo, tree, drep);
5479
5480         offset = nbt_dissect_element_browse_host_announcement_OSMinor(tvb, offset, pinfo, tree, drep);
5481
5482         offset = nbt_dissect_element_browse_host_announcement_ServerType(tvb, offset, pinfo, tree, drep);
5483
5484         offset = nbt_dissect_element_browse_host_announcement_BroMajorVer(tvb, offset, pinfo, tree, drep);
5485
5486         offset = nbt_dissect_element_browse_host_announcement_BroMinorVer(tvb, offset, pinfo, tree, drep);
5487
5488         offset = nbt_dissect_element_browse_host_announcement_Signature(tvb, offset, pinfo, tree, drep);
5489
5490         offset = nbt_dissect_element_browse_host_announcement_Comment(tvb, offset, pinfo, tree, drep);
5491
5492
5493         proto_item_set_len(item, offset-old_offset);
5494
5495
5496         if (di->call_data->flags & DCERPC_IS_NDR64) {
5497                 ALIGN_TO_4_BYTES;
5498         }
5499
5500         return offset;
5501 }
5502
5503
5504 /* IDL: struct { */
5505 /* IDL:         uint8 Unused; */
5506 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string ResponseName; */
5507 /* IDL: } */
5508
5509 static int
5510 nbt_dissect_element_browse_announcement_request_Unused(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5511 {
5512         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_announcement_request_Unused, 0);
5513
5514         return offset;
5515 }
5516
5517 static int
5518 nbt_dissect_element_browse_announcement_request_ResponseName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5519 {
5520         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_announcement_request_ResponseName , 0);
5521
5522         return offset;
5523 }
5524
5525 int
5526 nbt_dissect_struct_browse_announcement_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5527 {
5528         proto_item *item = NULL;
5529         proto_tree *tree = NULL;
5530         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5531         int old_offset;
5532
5533         ALIGN_TO_4_BYTES;
5534
5535         old_offset = offset;
5536
5537         if (parent_tree) {
5538                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5539                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_announcement_request);
5540         }
5541         
5542         offset = nbt_dissect_element_browse_announcement_request_Unused(tvb, offset, pinfo, tree, drep);
5543
5544         offset = nbt_dissect_element_browse_announcement_request_ResponseName(tvb, offset, pinfo, tree, drep);
5545
5546
5547         proto_item_set_len(item, offset-old_offset);
5548
5549
5550         if (di->call_data->flags & DCERPC_IS_NDR64) {
5551                 ALIGN_TO_4_BYTES;
5552         }
5553
5554         return offset;
5555 }
5556
5557
5558 /* IDL: struct { */
5559 /* IDL:         uint8 Version; */
5560 /* IDL:         uint32 Criteria; */
5561 /* IDL:         uint32 UpTime; */
5562 /* IDL:         uint32 Reserved; */
5563 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string ServerName; */
5564 /* IDL: } */
5565
5566 static int
5567 nbt_dissect_element_browse_election_request_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5568 {
5569         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_election_request_Version, 0);
5570
5571         return offset;
5572 }
5573
5574 static int
5575 nbt_dissect_element_browse_election_request_Criteria(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5576 {
5577         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_election_request_Criteria, 0);
5578
5579         return offset;
5580 }
5581
5582 static int
5583 nbt_dissect_element_browse_election_request_UpTime(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5584 {
5585         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_election_request_UpTime, 0);
5586
5587         return offset;
5588 }
5589
5590 static int
5591 nbt_dissect_element_browse_election_request_Reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5592 {
5593         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_election_request_Reserved, 0);
5594
5595         return offset;
5596 }
5597
5598 static int
5599 nbt_dissect_element_browse_election_request_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5600 {
5601         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_election_request_ServerName , 0);
5602
5603         return offset;
5604 }
5605
5606 int
5607 nbt_dissect_struct_browse_election_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5608 {
5609         proto_item *item = NULL;
5610         proto_tree *tree = NULL;
5611         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5612         int old_offset;
5613
5614         ALIGN_TO_4_BYTES;
5615
5616         old_offset = offset;
5617
5618         if (parent_tree) {
5619                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5620                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_election_request);
5621         }
5622         
5623         offset = nbt_dissect_element_browse_election_request_Version(tvb, offset, pinfo, tree, drep);
5624
5625         offset = nbt_dissect_element_browse_election_request_Criteria(tvb, offset, pinfo, tree, drep);
5626
5627         offset = nbt_dissect_element_browse_election_request_UpTime(tvb, offset, pinfo, tree, drep);
5628
5629         offset = nbt_dissect_element_browse_election_request_Reserved(tvb, offset, pinfo, tree, drep);
5630
5631         offset = nbt_dissect_element_browse_election_request_ServerName(tvb, offset, pinfo, tree, drep);
5632
5633
5634         proto_item_set_len(item, offset-old_offset);
5635
5636
5637         if (di->call_data->flags & DCERPC_IS_NDR64) {
5638                 ALIGN_TO_4_BYTES;
5639         }
5640
5641         return offset;
5642 }
5643
5644
5645 /* IDL: struct { */
5646 /* IDL:         uint8 ReqCount; */
5647 /* IDL:         uint32 Token; */
5648 /* IDL: } */
5649
5650 static int
5651 nbt_dissect_element_browse_backup_list_request_ReqCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5652 {
5653         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_backup_list_request_ReqCount, 0);
5654
5655         return offset;
5656 }
5657
5658 static int
5659 nbt_dissect_element_browse_backup_list_request_Token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5660 {
5661         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_backup_list_request_Token, 0);
5662
5663         return offset;
5664 }
5665
5666 int
5667 nbt_dissect_struct_browse_backup_list_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5668 {
5669         proto_item *item = NULL;
5670         proto_tree *tree = NULL;
5671         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5672         int old_offset;
5673
5674         ALIGN_TO_4_BYTES;
5675
5676         old_offset = offset;
5677
5678         if (parent_tree) {
5679                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5680                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_backup_list_request);
5681         }
5682         
5683         offset = nbt_dissect_element_browse_backup_list_request_ReqCount(tvb, offset, pinfo, tree, drep);
5684
5685         offset = nbt_dissect_element_browse_backup_list_request_Token(tvb, offset, pinfo, tree, drep);
5686
5687
5688         proto_item_set_len(item, offset-old_offset);
5689
5690
5691         if (di->call_data->flags & DCERPC_IS_NDR64) {
5692                 ALIGN_TO_4_BYTES;
5693         }
5694
5695         return offset;
5696 }
5697
5698
5699 /* IDL: struct { */
5700 /* IDL:         uint8 BackupCount; */
5701 /* IDL:         uint32 Token; */
5702 /* IDL:         nbt_name BackupServerList[BackupCount]; */
5703 /* IDL: } */
5704
5705 static int
5706 nbt_dissect_element_browse_backup_list_response_BackupCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5707 {
5708         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_backup_list_response_BackupCount, 0);
5709
5710         return offset;
5711 }
5712
5713 static int
5714 nbt_dissect_element_browse_backup_list_response_Token(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5715 {
5716         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_backup_list_response_Token, 0);
5717
5718         return offset;
5719 }
5720
5721 static int
5722 nbt_dissect_element_browse_backup_list_response_BackupServerList(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5723 {
5724
5725         return offset;
5726 }
5727
5728 static int
5729 nbt_dissect_element_browse_backup_list_response_BackupServerList_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5730 {
5731         offset = nbt_dissect_struct_name(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_backup_list_response_BackupServerList,0);
5732
5733         return offset;
5734 }
5735
5736 int
5737 nbt_dissect_struct_browse_backup_list_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5738 {
5739         proto_item *item = NULL;
5740         proto_tree *tree = NULL;
5741         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5742         int old_offset;
5743
5744         ALIGN_TO_4_BYTES;
5745
5746         old_offset = offset;
5747
5748         if (parent_tree) {
5749                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5750                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_backup_list_response);
5751         }
5752         
5753         offset = nbt_dissect_element_browse_backup_list_response_BackupCount(tvb, offset, pinfo, tree, drep);
5754
5755         offset = nbt_dissect_element_browse_backup_list_response_Token(tvb, offset, pinfo, tree, drep);
5756
5757         offset = nbt_dissect_element_browse_backup_list_response_BackupServerList(tvb, offset, pinfo, tree, drep);
5758
5759
5760         proto_item_set_len(item, offset-old_offset);
5761
5762
5763         if (di->call_data->flags & DCERPC_IS_NDR64) {
5764                 ALIGN_TO_4_BYTES;
5765         }
5766
5767         return offset;
5768 }
5769
5770
5771 /* IDL: struct { */
5772 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string BrowserName; */
5773 /* IDL: } */
5774
5775 static int
5776 nbt_dissect_element_browse_become_backup_BrowserName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5777 {
5778         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_become_backup_BrowserName , 0);
5779
5780         return offset;
5781 }
5782
5783 int
5784 nbt_dissect_struct_browse_become_backup(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5785 {
5786         proto_item *item = NULL;
5787         proto_tree *tree = NULL;
5788         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5789         int old_offset;
5790
5791         ALIGN_TO_4_BYTES;
5792
5793         old_offset = offset;
5794
5795         if (parent_tree) {
5796                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5797                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_become_backup);
5798         }
5799         
5800         offset = nbt_dissect_element_browse_become_backup_BrowserName(tvb, offset, pinfo, tree, drep);
5801
5802
5803         proto_item_set_len(item, offset-old_offset);
5804
5805
5806         if (di->call_data->flags & DCERPC_IS_NDR64) {
5807                 ALIGN_TO_4_BYTES;
5808         }
5809
5810         return offset;
5811 }
5812
5813
5814 /* IDL: struct { */
5815 /* IDL:         uint8 UpdateCount; */
5816 /* IDL:         uint32 Periodicity; */
5817 /* IDL:         [charset(DOS)] uint8 ServerName[16]; */
5818 /* IDL:         uint8 OSMajor; */
5819 /* IDL:         uint8 OSMinor; */
5820 /* IDL:         svcctl_ServerType ServerType; */
5821 /* IDL:         uint32 MysteriousField; */
5822 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string Comment; */
5823 /* IDL: } */
5824
5825 static int
5826 nbt_dissect_element_browse_domain_announcement_UpdateCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5827 {
5828         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_domain_announcement_UpdateCount, 0);
5829
5830         return offset;
5831 }
5832
5833 static int
5834 nbt_dissect_element_browse_domain_announcement_Periodicity(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5835 {
5836         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_domain_announcement_Periodicity, 0);
5837
5838         return offset;
5839 }
5840
5841 static int
5842 nbt_dissect_element_browse_domain_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5843 {
5844         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
5845         int conformant = di->conformant_run;
5846         if (!conformant) {
5847                 offset = nbt_dissect_element_browse_domain_announcement_ServerName_(tvb, offset, 16, pinfo, tree, drep);
5848         }
5849
5850         return offset;
5851 }
5852
5853 static int
5854 nbt_dissect_element_browse_domain_announcement_ServerName_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5855 {
5856         proto_tree_add_bytes(tree, hf_nbt_nbt_browse_domain_announcement_ServerName, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
5857
5858         return offset;
5859 }
5860
5861 static int
5862 nbt_dissect_element_browse_domain_announcement_OSMajor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5863 {
5864         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_domain_announcement_OSMajor, 0);
5865
5866         return offset;
5867 }
5868
5869 static int
5870 nbt_dissect_element_browse_domain_announcement_OSMinor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5871 {
5872         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_domain_announcement_OSMinor, 0);
5873
5874         return offset;
5875 }
5876
5877 static int
5878 nbt_dissect_element_browse_domain_announcement_ServerType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5879 {
5880         offset = nbt_dissect_bitmap_svcctl_ServerType(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_domain_announcement_ServerType, 0);
5881
5882         return offset;
5883 }
5884
5885 static int
5886 nbt_dissect_element_browse_domain_announcement_MysteriousField(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5887 {
5888         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_domain_announcement_MysteriousField, 0);
5889
5890         return offset;
5891 }
5892
5893 static int
5894 nbt_dissect_element_browse_domain_announcement_Comment(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5895 {
5896         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_domain_announcement_Comment , 0);
5897
5898         return offset;
5899 }
5900
5901 int
5902 nbt_dissect_struct_browse_domain_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5903 {
5904         proto_item *item = NULL;
5905         proto_tree *tree = NULL;
5906         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5907         int old_offset;
5908
5909         ALIGN_TO_4_BYTES;
5910
5911         old_offset = offset;
5912
5913         if (parent_tree) {
5914                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5915                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_domain_announcement);
5916         }
5917         
5918         offset = nbt_dissect_element_browse_domain_announcement_UpdateCount(tvb, offset, pinfo, tree, drep);
5919
5920         offset = nbt_dissect_element_browse_domain_announcement_Periodicity(tvb, offset, pinfo, tree, drep);
5921
5922         offset = nbt_dissect_element_browse_domain_announcement_ServerName(tvb, offset, pinfo, tree, drep);
5923
5924         offset = nbt_dissect_element_browse_domain_announcement_OSMajor(tvb, offset, pinfo, tree, drep);
5925
5926         offset = nbt_dissect_element_browse_domain_announcement_OSMinor(tvb, offset, pinfo, tree, drep);
5927
5928         offset = nbt_dissect_element_browse_domain_announcement_ServerType(tvb, offset, pinfo, tree, drep);
5929
5930         offset = nbt_dissect_element_browse_domain_announcement_MysteriousField(tvb, offset, pinfo, tree, drep);
5931
5932         offset = nbt_dissect_element_browse_domain_announcement_Comment(tvb, offset, pinfo, tree, drep);
5933
5934
5935         proto_item_set_len(item, offset-old_offset);
5936
5937
5938         if (di->call_data->flags & DCERPC_IS_NDR64) {
5939                 ALIGN_TO_4_BYTES;
5940         }
5941
5942         return offset;
5943 }
5944
5945
5946 /* IDL: struct { */
5947 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string ServerName; */
5948 /* IDL: } */
5949
5950 static int
5951 nbt_dissect_element_browse_master_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5952 {
5953         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_master_announcement_ServerName , 0);
5954
5955         return offset;
5956 }
5957
5958 int
5959 nbt_dissect_struct_browse_master_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
5960 {
5961         proto_item *item = NULL;
5962         proto_tree *tree = NULL;
5963         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
5964         int old_offset;
5965
5966         ALIGN_TO_4_BYTES;
5967
5968         old_offset = offset;
5969
5970         if (parent_tree) {
5971                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
5972                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_master_announcement);
5973         }
5974         
5975         offset = nbt_dissect_element_browse_master_announcement_ServerName(tvb, offset, pinfo, tree, drep);
5976
5977
5978         proto_item_set_len(item, offset-old_offset);
5979
5980
5981         if (di->call_data->flags & DCERPC_IS_NDR64) {
5982                 ALIGN_TO_4_BYTES;
5983         }
5984
5985         return offset;
5986 }
5987
5988
5989 /* IDL: struct { */
5990 /* IDL:         uint8 Command; */
5991 /* IDL: } */
5992
5993 static int
5994 nbt_dissect_element_browse_reset_state_Command(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
5995 {
5996         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_reset_state_Command, 0);
5997
5998         return offset;
5999 }
6000
6001 int
6002 nbt_dissect_struct_browse_reset_state(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
6003 {
6004         proto_item *item = NULL;
6005         proto_tree *tree = NULL;
6006         int old_offset;
6007
6008
6009         old_offset = offset;
6010
6011         if (parent_tree) {
6012                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
6013                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_reset_state);
6014         }
6015         
6016         offset = nbt_dissect_element_browse_reset_state_Command(tvb, offset, pinfo, tree, drep);
6017
6018
6019         proto_item_set_len(item, offset-old_offset);
6020
6021
6022         return offset;
6023 }
6024
6025
6026 /* IDL: struct { */
6027 /* IDL:         uint8 UpdateCount; */
6028 /* IDL:         uint32 Periodicity; */
6029 /* IDL:         [charset(DOS)] uint8 ServerName[16]; */
6030 /* IDL:         uint8 OSMajor; */
6031 /* IDL:         uint8 OSMinor; */
6032 /* IDL:         svcctl_ServerType ServerType; */
6033 /* IDL:         uint8 BroMajorVer; */
6034 /* IDL:         uint8 BroMinorVer; */
6035 /* IDL:         uint16 Signature; */
6036 /* IDL:         [flag(LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM)] string Comment; */
6037 /* IDL: } */
6038
6039 static int
6040 nbt_dissect_element_browse_local_master_announcement_UpdateCount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6041 {
6042         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_UpdateCount, 0);
6043
6044         return offset;
6045 }
6046
6047 static int
6048 nbt_dissect_element_browse_local_master_announcement_Periodicity(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6049 {
6050         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_Periodicity, 0);
6051
6052         return offset;
6053 }
6054
6055 static int
6056 nbt_dissect_element_browse_local_master_announcement_ServerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6057 {
6058         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
6059         int conformant = di->conformant_run;
6060         if (!conformant) {
6061                 offset = nbt_dissect_element_browse_local_master_announcement_ServerName_(tvb, offset, 16, pinfo, tree, drep);
6062         }
6063
6064         return offset;
6065 }
6066
6067 static int
6068 nbt_dissect_element_browse_local_master_announcement_ServerName_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6069 {
6070         proto_tree_add_bytes(tree, hf_nbt_nbt_browse_local_master_announcement_ServerName, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
6071
6072         return offset;
6073 }
6074
6075 static int
6076 nbt_dissect_element_browse_local_master_announcement_OSMajor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6077 {
6078         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_OSMajor, 0);
6079
6080         return offset;
6081 }
6082
6083 static int
6084 nbt_dissect_element_browse_local_master_announcement_OSMinor(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6085 {
6086         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_OSMinor, 0);
6087
6088         return offset;
6089 }
6090
6091 static int
6092 nbt_dissect_element_browse_local_master_announcement_ServerType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6093 {
6094         offset = nbt_dissect_bitmap_svcctl_ServerType(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_ServerType, 0);
6095
6096         return offset;
6097 }
6098
6099 static int
6100 nbt_dissect_element_browse_local_master_announcement_BroMajorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6101 {
6102         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_BroMajorVer, 0);
6103
6104         return offset;
6105 }
6106
6107 static int
6108 nbt_dissect_element_browse_local_master_announcement_BroMinorVer(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6109 {
6110         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_BroMinorVer, 0);
6111
6112         return offset;
6113 }
6114
6115 static int
6116 nbt_dissect_element_browse_local_master_announcement_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6117 {
6118         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_Signature, 0);
6119
6120         return offset;
6121 }
6122
6123 static int
6124 nbt_dissect_element_browse_local_master_announcement_Comment(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6125 {
6126         offset = dissect_null_term_string(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_local_master_announcement_Comment , 0);
6127
6128         return offset;
6129 }
6130
6131 int
6132 nbt_dissect_struct_browse_local_master_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
6133 {
6134         proto_item *item = NULL;
6135         proto_tree *tree = NULL;
6136         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
6137         int old_offset;
6138
6139         ALIGN_TO_4_BYTES;
6140
6141         old_offset = offset;
6142
6143         if (parent_tree) {
6144                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
6145                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_local_master_announcement);
6146         }
6147         
6148         offset = nbt_dissect_element_browse_local_master_announcement_UpdateCount(tvb, offset, pinfo, tree, drep);
6149
6150         offset = nbt_dissect_element_browse_local_master_announcement_Periodicity(tvb, offset, pinfo, tree, drep);
6151
6152         offset = nbt_dissect_element_browse_local_master_announcement_ServerName(tvb, offset, pinfo, tree, drep);
6153
6154         offset = nbt_dissect_element_browse_local_master_announcement_OSMajor(tvb, offset, pinfo, tree, drep);
6155
6156         offset = nbt_dissect_element_browse_local_master_announcement_OSMinor(tvb, offset, pinfo, tree, drep);
6157
6158         offset = nbt_dissect_element_browse_local_master_announcement_ServerType(tvb, offset, pinfo, tree, drep);
6159
6160         offset = nbt_dissect_element_browse_local_master_announcement_BroMajorVer(tvb, offset, pinfo, tree, drep);
6161
6162         offset = nbt_dissect_element_browse_local_master_announcement_BroMinorVer(tvb, offset, pinfo, tree, drep);
6163
6164         offset = nbt_dissect_element_browse_local_master_announcement_Signature(tvb, offset, pinfo, tree, drep);
6165
6166         offset = nbt_dissect_element_browse_local_master_announcement_Comment(tvb, offset, pinfo, tree, drep);
6167
6168
6169         proto_item_set_len(item, offset-old_offset);
6170
6171
6172         if (di->call_data->flags & DCERPC_IS_NDR64) {
6173                 ALIGN_TO_4_BYTES;
6174         }
6175
6176         return offset;
6177 }
6178
6179
6180 /* IDL: [nodiscriminant(1)] union { */
6181 /* IDL: [case(HostAnnouncement)] [case(HostAnnouncement)] nbt_browse_host_announcement host_annoucement; */
6182 /* IDL: [case(AnnouncementRequest)] [case(AnnouncementRequest)] nbt_browse_announcement_request announcement_request; */
6183 /* IDL: [case(Election)] [case(Election)] nbt_browse_election_request election_request; */
6184 /* IDL: [case(GetBackupListReq)] [case(GetBackupListReq)] nbt_browse_backup_list_request backup_list_request; */
6185 /* IDL: [case(GetBackupListResp)] [case(GetBackupListResp)] nbt_browse_backup_list_response backup_list_response; */
6186 /* IDL: [case(BecomeBackup)] [case(BecomeBackup)] nbt_browse_become_backup become_backup; */
6187 /* IDL: [case(DomainAnnouncement)] [case(DomainAnnouncement)] nbt_browse_domain_announcement domain_announcement; */
6188 /* IDL: [case(MasterAnnouncement)] [case(MasterAnnouncement)] nbt_browse_master_announcement master_announcement; */
6189 /* IDL: [case(ResetBrowserState)] [case(ResetBrowserState)] nbt_browse_reset_state reset_browser_state; */
6190 /* IDL: [case(LocalMasterAnnouncement)] [case(LocalMasterAnnouncement)] nbt_browse_local_master_announcement local_master_announcement; */
6191 /* IDL: } */
6192
6193 static int
6194 nbt_dissect_element_browse_payload_host_annoucement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6195 {
6196         offset = nbt_dissect_struct_browse_host_announcement(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_host_annoucement,0);
6197
6198         return offset;
6199 }
6200
6201 static int
6202 nbt_dissect_element_browse_payload_announcement_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6203 {
6204         offset = nbt_dissect_struct_browse_announcement_request(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_announcement_request,0);
6205
6206         return offset;
6207 }
6208
6209 static int
6210 nbt_dissect_element_browse_payload_election_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6211 {
6212         offset = nbt_dissect_struct_browse_election_request(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_election_request,0);
6213
6214         return offset;
6215 }
6216
6217 static int
6218 nbt_dissect_element_browse_payload_backup_list_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6219 {
6220         offset = nbt_dissect_struct_browse_backup_list_request(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_backup_list_request,0);
6221
6222         return offset;
6223 }
6224
6225 static int
6226 nbt_dissect_element_browse_payload_backup_list_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6227 {
6228         offset = nbt_dissect_struct_browse_backup_list_response(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_backup_list_response,0);
6229
6230         return offset;
6231 }
6232
6233 static int
6234 nbt_dissect_element_browse_payload_become_backup(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6235 {
6236         offset = nbt_dissect_struct_browse_become_backup(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_become_backup,0);
6237
6238         return offset;
6239 }
6240
6241 static int
6242 nbt_dissect_element_browse_payload_domain_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6243 {
6244         offset = nbt_dissect_struct_browse_domain_announcement(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_domain_announcement,0);
6245
6246         return offset;
6247 }
6248
6249 static int
6250 nbt_dissect_element_browse_payload_master_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6251 {
6252         offset = nbt_dissect_struct_browse_master_announcement(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_master_announcement,0);
6253
6254         return offset;
6255 }
6256
6257 static int
6258 nbt_dissect_element_browse_payload_reset_browser_state(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6259 {
6260         offset = nbt_dissect_struct_browse_reset_state(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_reset_browser_state,0);
6261
6262         return offset;
6263 }
6264
6265 static int
6266 nbt_dissect_element_browse_payload_local_master_announcement(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6267 {
6268         offset = nbt_dissect_struct_browse_local_master_announcement(tvb,offset,pinfo,tree,drep,hf_nbt_nbt_browse_payload_local_master_announcement,0);
6269
6270         return offset;
6271 }
6272
6273 static int
6274 nbt_dissect_browse_payload(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
6275 {
6276         proto_item *item = NULL;
6277         proto_tree *tree = NULL;
6278         int old_offset;
6279         guint32 level = param;
6280
6281         old_offset = offset;
6282         if (parent_tree) {
6283                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "nbt_browse_payload");
6284                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_payload);
6285         }
6286
6287         switch(level) {
6288                 case HostAnnouncement:
6289                         offset = nbt_dissect_element_browse_payload_host_annoucement(tvb, offset, pinfo, tree, drep);
6290                 break;
6291
6292                 case AnnouncementRequest:
6293                         offset = nbt_dissect_element_browse_payload_announcement_request(tvb, offset, pinfo, tree, drep);
6294                 break;
6295
6296                 case Election:
6297                         offset = nbt_dissect_element_browse_payload_election_request(tvb, offset, pinfo, tree, drep);
6298                 break;
6299
6300                 case GetBackupListReq:
6301                         offset = nbt_dissect_element_browse_payload_backup_list_request(tvb, offset, pinfo, tree, drep);
6302                 break;
6303
6304                 case GetBackupListResp:
6305                         offset = nbt_dissect_element_browse_payload_backup_list_response(tvb, offset, pinfo, tree, drep);
6306                 break;
6307
6308                 case BecomeBackup:
6309                         offset = nbt_dissect_element_browse_payload_become_backup(tvb, offset, pinfo, tree, drep);
6310                 break;
6311
6312                 case DomainAnnouncement:
6313                         offset = nbt_dissect_element_browse_payload_domain_announcement(tvb, offset, pinfo, tree, drep);
6314                 break;
6315
6316                 case MasterAnnouncement:
6317                         offset = nbt_dissect_element_browse_payload_master_announcement(tvb, offset, pinfo, tree, drep);
6318                 break;
6319
6320                 case ResetBrowserState:
6321                         offset = nbt_dissect_element_browse_payload_reset_browser_state(tvb, offset, pinfo, tree, drep);
6322                 break;
6323
6324                 case LocalMasterAnnouncement:
6325                         offset = nbt_dissect_element_browse_payload_local_master_announcement(tvb, offset, pinfo, tree, drep);
6326                 break;
6327         }
6328         proto_item_set_len(item, offset-old_offset);
6329
6330
6331         return offset;
6332 }
6333
6334 /* IDL: struct { */
6335 /* IDL:         nbt_browse_opcode opcode; */
6336 /* IDL:         [switch_is(opcode)] nbt_browse_payload payload; */
6337 /* IDL: } */
6338
6339 static int
6340 nbt_dissect_element_browse_packet_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *opcode)
6341 {
6342         offset = nbt_dissect_enum_browse_opcode(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_packet_opcode, opcode);
6343
6344         return offset;
6345 }
6346
6347 static int
6348 nbt_dissect_element_browse_packet_payload(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint8 *opcode)
6349 {
6350         offset = nbt_dissect_browse_payload(tvb, offset, pinfo, tree, drep, hf_nbt_nbt_browse_packet_payload, *opcode);
6351
6352         return offset;
6353 }
6354
6355 int
6356 nbt_dissect_struct_browse_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
6357 {
6358         guint8 opcode;
6359         proto_item *item = NULL;
6360         proto_tree *tree = NULL;
6361         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
6362         int old_offset;
6363
6364
6365         old_offset = offset;
6366
6367         if (parent_tree) {
6368                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
6369                 tree = proto_item_add_subtree(item, ett_nbt_nbt_browse_packet);
6370         }
6371         
6372         offset = nbt_dissect_element_browse_packet_opcode(tvb, offset, pinfo, tree, drep, &opcode);
6373
6374         offset = nbt_dissect_element_browse_packet_payload(tvb, offset, pinfo, tree, drep, &opcode);
6375
6376
6377         proto_item_set_len(item, offset-old_offset);
6378
6379
6380         if (di->call_data->flags & DCERPC_IS_NDR64) {
6381                 ALIGN_TO_4_BYTES;
6382         }
6383
6384         return offset;
6385 }
6386
6387 static int
6388 nbt_dissect_element_decode_nbt_netlogon_packet_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6389 {
6390         offset = nbt_dissect_struct_netlogon_packet(tvb,offset,pinfo,tree,drep,hf_nbt_decode_nbt_netlogon_packet_packet,0);
6391
6392         return offset;
6393 }
6394
6395 /* IDL: void decode_nbt_netlogon_packet( */
6396 /* IDL: [in] nbt_netlogon_packet packet */
6397 /* IDL: ); */
6398
6399 static int
6400 nbt_dissect_decode_nbt_netlogon_packet_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6401 {
6402         pinfo->dcerpc_procedure_name="decode_nbt_netlogon_packet";
6403         return offset;
6404 }
6405
6406 static int
6407 nbt_dissect_decode_nbt_netlogon_packet_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
6408 {
6409         pinfo->dcerpc_procedure_name="decode_nbt_netlogon_packet";
6410         offset = nbt_dissect_element_decode_nbt_netlogon_packet_packet(tvb, offset, pinfo, tree, drep);
6411         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
6412         return offset;
6413 }
6414
6415
6416 static dcerpc_sub_dissector nbt_dissectors[] = {
6417         { 0, "decode_nbt_netlogon_packet",
6418            nbt_dissect_decode_nbt_netlogon_packet_request, nbt_dissect_decode_nbt_netlogon_packet_response},
6419         { 0, NULL, NULL, NULL }
6420 };
6421
6422 void proto_register_dcerpc_nbt(void)
6423 {
6424         static hf_register_info hf[] = {
6425         { &hf_nbt_nb_flags_NBT_NM_OWNER_TYPE,
6426           { "Nbt Nm Owner Type", "nbt.nb_flags.NBT_NM_OWNER_TYPE", FT_BOOLEAN, 16, TFS(&nb_flags_NBT_NM_OWNER_TYPE_tfs), ( 0x6000 ), NULL, HFILL }},
6427         { &hf_nbt_smb_trans_body_data_count,
6428           { "Data Count", "nbt.smb_trans_body.data_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6429         { &hf_nbt_nbt_db_change_info_db_index,
6430           { "Db Index", "nbt.nbt_db_change_info.db_index", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6431         { &hf_nbt_dgram_message_offset,
6432           { "Offset", "nbt.dgram_message.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6433         { &hf_nbt_nbt_netlogon_query_for_pdc_lmnt_token,
6434           { "Lmnt Token", "nbt.nbt_netlogon_query_for_pdc.lmnt_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6435         { &hf_nbt_dgram_message_body,
6436           { "Body", "nbt.dgram_message.body", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6437         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr,
6438           { "Sockaddr", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.sockaddr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6439         { &hf_nbt_nbt_name_packet_questions,
6440           { "Questions", "nbt.nbt_name_packet.questions", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6441         { &hf_nbt_nbt_name_packet_ancount,
6442           { "Ancount", "nbt.nbt_name_packet.ancount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6443         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_lmnt_token,
6444           { "Lmnt Token", "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40.lmnt_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6445         { &hf_nbt_smb_trans_body_opcode,
6446           { "Opcode", "nbt.smb_trans_body.opcode", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6447         { &hf_nbt_nbt_statistics_number_no_resource_conditions,
6448           { "Number No Resource Conditions", "nbt.nbt_statistics.number_no_resource_conditions", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6449         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_IP,
6450           { "Netlogon Nt Version Ip", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_IP", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_IP_tfs), ( 0x20000000 ), NULL, HFILL }},
6451         { &hf_nbt_nbt_rdata_data,
6452           { "Data", "nbt.nbt_rdata.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6453         { &hf_nbt_nbt_rdata_status_statistics,
6454           { "Statistics", "nbt.nbt_rdata_status.statistics", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6455         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX_WITH_IP,
6456           { "Netlogon Nt Version 5ex With Ip", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_5EX_WITH_IP", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX_WITH_IP_tfs), ( 0x00000008 ), NULL, HFILL }},
6457         { &hf_nbt_nbt_sockaddr_sockaddr_family,
6458           { "Sockaddr Family", "nbt.nbt_sockaddr.sockaddr_family", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6459         { &hf_nbt_nbt_name_question_question_type,
6460           { "Question Type", "nbt.nbt_name_question.question_type", FT_UINT16, BASE_DEC, VALS(nbt_nbt_qtype_vals), 0, NULL, HFILL }},
6461         { &hf_nbt_dgram_smb_packet_reserved,
6462           { "Reserved", "nbt.dgram_smb_packet.reserved", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6463         { &hf_nbt_nbt_res_rec_rr_type,
6464           { "Rr Type", "nbt.nbt_res_rec.rr_type", FT_UINT16, BASE_DEC, VALS(nbt_nbt_qtype_vals), 0, NULL, HFILL }},
6465         { &hf_nbt_nbt_statistics_number_of_collisions,
6466           { "Number Of Collisions", "nbt.nbt_statistics.number_of_collisions", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6467         { &hf_nbt_nbt_name_name,
6468           { "Name", "nbt.nbt_name.name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6469         { &hf_nbt_nbt_res_rec_name,
6470           { "Name", "nbt.nbt_res_rec.name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6471         { &hf_nbt_nbt_rdata_netbios_length,
6472           { "Length", "nbt.nbt_rdata_netbios.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6473         { &hf_nbt_dgram_message_source_name,
6474           { "Source Name", "nbt.dgram_message.source_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6475         { &hf_nbt_nbt_rdata_status,
6476           { "Status", "nbt.nbt_rdata.status", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6477         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_lm20_token,
6478           { "Lm20 Token", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6479         { &hf_nbt_nbt_res_rec_rr_class,
6480           { "Rr Class", "nbt.nbt_res_rec.rr_class", FT_UINT16, BASE_DEC, VALS(nbt_nbt_qclass_vals), 0, NULL, HFILL }},
6481         { &hf_nbt_nbt_browse_local_master_announcement_Signature,
6482           { "Signature", "nbt.nbt_browse_local_master_announcement.Signature", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6483         { &hf_nbt_dgram_smb_packet_smb_command,
6484           { "Smb Command", "nbt.dgram_smb_packet.smb_command", FT_UINT8, BASE_DEC, VALS(nbt_smb_command_vals), 0, NULL, HFILL }},
6485         { &hf_nbt_nbt_netlogon_packet_req,
6486           { "Req", "nbt.nbt_netlogon_packet.req", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6487         { &hf_nbt_nbt_name_question_question_class,
6488           { "Question Class", "nbt.nbt_name_question.question_class", FT_UINT16, BASE_DEC, VALS(nbt_nbt_qclass_vals), 0, NULL, HFILL }},
6489         { &hf_nbt_smb_trans_body_data,
6490           { "Data", "nbt.smb_trans_body.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6491         { &hf_nbt_nbt_statistics_number_alignment_errors,
6492           { "Number Alignment Errors", "nbt.nbt_statistics.number_alignment_errors", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6493         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_name,
6494           { "Domain Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.domain_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6495         { &hf_nbt_nbt_browse_domain_announcement_Periodicity,
6496           { "Periodicity", "nbt.nbt_browse_domain_announcement.Periodicity", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6497         { &hf_nbt_nbt_netlogon_response_from_pdc_domain_name,
6498           { "Domain Name", "nbt.nbt_netlogon_response_from_pdc.domain_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6499         { &hf_nbt_nbt_rdata_status_num_names,
6500           { "Num Names", "nbt.nbt_rdata_status.num_names", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6501         { &hf_nbt_nbt_browse_local_master_announcement_BroMinorVer,
6502           { "Brominorver", "nbt.nbt_browse_local_master_announcement.BroMinorVer", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6503         { &hf_nbt_dgram_data_dest_name,
6504           { "Dest Name", "nbt.dgram_data.dest_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6505         { &hf_nbt_dgram_message_body_smb,
6506           { "Smb", "nbt.dgram_message_body.smb", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6507         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_next_closest_site,
6508           { "Next Closest Site", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.next_closest_site", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6509         { &hf_nbt_nbt_netlogon_query_for_pdc_nt_version,
6510           { "Nt Version", "nbt.nbt_netlogon_query_for_pdc.nt_version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6511         { &hf_nbt_nbt_db_change_info_serial,
6512           { "Serial", "nbt.nbt_db_change_info.serial", FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }},
6513         { &hf_nbt_smb_trans_body_setup_count,
6514           { "Setup Count", "nbt.smb_trans_body.setup_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6515         { &hf_nbt_nbt_browse_payload_host_annoucement,
6516           { "Host Annoucement", "nbt.nbt_browse_payload.host_annoucement", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6517         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_WITH_CLOSEST_SITE,
6518           { "Netlogon Nt Version With Closest Site", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_WITH_CLOSEST_SITE", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_WITH_CLOSEST_SITE_tfs), ( 0x00000010 ), NULL, HFILL }},
6519         { &hf_nbt_nbt_browse_packet_payload,
6520           { "Payload", "nbt.nbt_browse_packet.payload", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6521         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sbz,
6522           { "Sbz", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.sbz", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6523         { &hf_nbt_nbt_dgram_packet_data,
6524           { "Data", "nbt.nbt_dgram_packet.data", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6525         { &hf_nbt_dgram_message_dgram_body_type,
6526           { "Dgram Body Type", "nbt.dgram_message.dgram_body_type", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6527         { &hf_nbt_smb_trans_body_total_param_count,
6528           { "Total Param Count", "nbt.smb_trans_body.total_param_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6529         { &hf_nbt_dgram_data_error,
6530           { "Error", "nbt.dgram_data.error", FT_UINT8, BASE_DEC, VALS(nbt_dgram_err_code_vals), 0, NULL, HFILL }},
6531         { &hf_nbt_nbt_browse_backup_list_response_Token,
6532           { "Token", "nbt.nbt_browse_backup_list_response.Token", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6533         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_user_name,
6534           { "User Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.user_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6535         { &hf_nbt_nbt_netlogon_request_logon0,
6536           { "Logon0", "nbt.nbt_netlogon_request.logon0", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6537         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_dns_domain,
6538           { "Dns Domain", "nbt.NETLOGON_SAM_LOGON_RESPONSE.dns_domain", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6539         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST__pad,
6540           { " Pad", "nbt.NETLOGON_SAM_LOGON_REQUEST._pad", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6541         { &hf_nbt_dgram_smb_packet_flags,
6542           { "Flags", "nbt.dgram_smb_packet.flags", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6543         { &hf_nbt_nbt_statistics_total_number_command_blocks,
6544           { "Total Number Command Blocks", "nbt.nbt_statistics.total_number_command_blocks", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6545         { &hf_nbt_nbt_browse_local_master_announcement_UpdateCount,
6546           { "Updatecount", "nbt.nbt_browse_local_master_announcement.UpdateCount", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6547         { &hf_nbt_smb_trans_body_pad2,
6548           { "Pad2", "nbt.smb_trans_body.pad2", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6549         { &hf_nbt_nbt_rdata_status_length,
6550           { "Length", "nbt.nbt_rdata_status.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6551         { &hf_nbt_NETLOGON_DB_CHANGE_unicode_domain,
6552           { "Unicode Domain", "nbt.NETLOGON_DB_CHANGE.unicode_domain", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6553         { &hf_nbt_nbt_rdata_address_ipaddr,
6554           { "Ipaddr", "nbt.nbt_rdata_address.ipaddr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6555         { &hf_nbt_nbt_netlogon_request_uas,
6556           { "Uas", "nbt.nbt_netlogon_request.uas", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6557         { &hf_nbt_smb_trans_body_timeout,
6558           { "Timeout", "nbt.smb_trans_body.timeout", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6559         { &hf_nbt_nbt_statistics_max_total_number_command_blocks,
6560           { "Max Total Number Command Blocks", "nbt.nbt_statistics.max_total_number_command_blocks", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6561         { &hf_nbt_nbt_dgram_packet_flags,
6562           { "Flags", "nbt.nbt_dgram_packet.flags", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
6563         { &hf_nbt_nbt_res_rec_rdata,
6564           { "Rdata", "nbt.nbt_res_rec.rdata", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6565         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_lm20_token,
6566           { "Lm20 Token", "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6567         { &hf_nbt_nb_flags_NBT_NM_DEREGISTER,
6568           { "Nbt Nm Deregister", "nbt.nb_flags.NBT_NM_DEREGISTER", FT_BOOLEAN, 16, TFS(&nb_flags_NBT_NM_DEREGISTER_tfs), ( 0x1000 ), NULL, HFILL }},
6569         { &hf_nbt_NETLOGON_DB_CHANGE_dbchange,
6570           { "Dbchange", "nbt.NETLOGON_DB_CHANGE.dbchange", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6571         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_command,
6572           { "Command", "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40.command", FT_UINT16, BASE_DEC, VALS(nbt_netlogon_command_vals), 0, NULL, HFILL }},
6573         { &hf_nbt_nbt_server_type_NBT_SERVER_CLOSEST,
6574           { "Nbt Server Closest", "nbt.nbt_server_type.NBT_SERVER_CLOSEST", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_CLOSEST_tfs), ( 0x00000080 ), NULL, HFILL }},
6575         { &hf_nbt_dgram_smb_packet_pid,
6576           { "Pid", "nbt.dgram_smb_packet.pid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6577         { &hf_nbt_nbt_browse_host_announcement_BroMajorVer,
6578           { "Bromajorver", "nbt.nbt_browse_host_announcement.BroMajorVer", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6579         { &hf_nbt_nbt_name_scope,
6580           { "Scope", "nbt.nbt_name.scope", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6581         { &hf_nbt_nbt_sockaddr_remaining,
6582           { "Remaining", "nbt.nbt_sockaddr.remaining", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6583         { &hf_nbt_nbt_operation_NBT_FLAG_RECURSION_AVAIL,
6584           { "Nbt Flag Recursion Avail", "nbt.nbt_operation.NBT_FLAG_RECURSION_AVAIL", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_FLAG_RECURSION_AVAIL_tfs), ( 0x0080 ), NULL, HFILL }},
6585         { &hf_nbt_nbt_server_type_NBT_SERVER_DS,
6586           { "Nbt Server Ds", "nbt.nbt_server_type.NBT_SERVER_DS", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_DS_tfs), ( 0x00000010 ), NULL, HFILL }},
6587         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_lm20_token,
6588           { "Lm20 Token", "nbt.NETLOGON_SAM_LOGON_REQUEST.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6589         { &hf_nbt_NETLOGON_DB_CHANGE_unicode_pdc_name,
6590           { "Unicode Pdc Name", "nbt.NETLOGON_DB_CHANGE.unicode_pdc_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6591         { &hf_nbt_nbt_status_name_name,
6592           { "Name", "nbt.nbt_status_name.name", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
6593         { &hf_nbt_smb_trans_body_param_count,
6594           { "Param Count", "nbt.smb_trans_body.param_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6595         { &hf_nbt_nbt_operation_NBT_FLAG_RECURSION_DESIRED,
6596           { "Nbt Flag Recursion Desired", "nbt.nbt_operation.NBT_FLAG_RECURSION_DESIRED", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_FLAG_RECURSION_DESIRED_tfs), ( 0x0100 ), NULL, HFILL }},
6597         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_1,
6598           { "Netlogon Nt Version 1", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_1", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_1_tfs), ( 0x00000001 ), NULL, HFILL }},
6599         { &hf_nbt_nbt_statistics_number_pending_sessions,
6600           { "Number Pending Sessions", "nbt.nbt_statistics.number_pending_sessions", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6601         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_name,
6602           { "Pdc Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.pdc_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6603         { &hf_nbt_nbt_server_type_NBT_SERVER_IS_DEFAULT_NC,
6604           { "Nbt Server Is Default Nc", "nbt.nbt_server_type.NBT_SERVER_IS_DEFAULT_NC", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_IS_DEFAULT_NC_tfs), ( 0x40000000 ), NULL, HFILL }},
6605         { &hf_nbt_smb_trans_body_param_offset,
6606           { "Param Offset", "nbt.smb_trans_body.param_offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6607         { &hf_nbt_smb_trans_body_max_param_count,
6608           { "Max Param Count", "nbt.smb_trans_body.max_param_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6609         { &hf_nbt_nbt_browse_backup_list_request_Token,
6610           { "Token", "nbt.nbt_browse_backup_list_request.Token", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6611         { &hf_nbt_nbt_browse_local_master_announcement_BroMajorVer,
6612           { "Bromajorver", "nbt.nbt_browse_local_master_announcement.BroMajorVer", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6613         { &hf_nbt_nbt_server_type_NBT_SERVER_FOREST_ROOT,
6614           { "Nbt Server Forest Root", "nbt.nbt_server_type.NBT_SERVER_FOREST_ROOT", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_FOREST_ROOT_tfs), ( 0x80000000 ), NULL, HFILL }},
6615         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_command,
6616           { "Command", "nbt.NETLOGON_SAM_LOGON_RESPONSE.command", FT_UINT16, BASE_DEC, VALS(nbt_netlogon_command_vals), 0, NULL, HFILL }},
6617         { &hf_nbt_nbt_browse_backup_list_response_BackupServerList,
6618           { "Backupserverlist", "nbt.nbt_browse_backup_list_response.BackupServerList", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6619         { &hf_nbt_nbt_browse_local_master_announcement_ServerType,
6620           { "Servertype", "nbt.nbt_browse_local_master_announcement.ServerType", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6621         { &hf_nbt_dgram_message_dest_name,
6622           { "Dest Name", "nbt.dgram_message.dest_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6623         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_acct_control,
6624           { "Acct Control", "nbt.NETLOGON_SAM_LOGON_REQUEST.acct_control", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6625         { &hf_nbt_nbt_browse_election_request_Reserved,
6626           { "Reserved", "nbt.nbt_browse_election_request.Reserved", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6627         { &hf_nbt_nbt_browse_master_announcement_ServerName,
6628           { "Servername", "nbt.nbt_browse_master_announcement.ServerName", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6629         { &hf_nbt_nbt_browse_host_announcement_UpdateCount,
6630           { "Updatecount", "nbt.nbt_browse_host_announcement.UpdateCount", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6631         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_user_name,
6632           { "User Name", "nbt.NETLOGON_SAM_LOGON_REQUEST.user_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6633         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX,
6634           { "Netlogon Nt Version 5ex", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_5EX", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_5EX_tfs), ( 0x00000004 ), NULL, HFILL }},
6635         { &hf_nbt_nbt_operation_NBT_RCODE,
6636           { "Nbt Rcode", "nbt.nbt_operation.NBT_RCODE", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_RCODE_tfs), ( 0x000F ), NULL, HFILL }},
6637         { &hf_nbt_nbt_browse_election_request_ServerName,
6638           { "Servername", "nbt.nbt_browse_election_request.ServerName", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6639         { &hf_nbt_nbt_browse_election_request_UpTime,
6640           { "Uptime", "nbt.nbt_browse_election_request.UpTime", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6641         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_name,
6642           { "Pdc Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE.pdc_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6643         { &hf_nbt_dgram_message_length,
6644           { "Length", "nbt.dgram_message.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6645         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_pdc_dns_name,
6646           { "Pdc Dns Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.pdc_dns_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6647         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_server_type,
6648           { "Server Type", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.server_type", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6649         { &hf_nbt_nbt_browse_packet_opcode,
6650           { "Opcode", "nbt.nbt_browse_packet.opcode", FT_UINT8, BASE_DEC, VALS(nbt_nbt_browse_opcode_vals), 0, NULL, HFILL }},
6651         { &hf_nbt_nbt_name_packet_nsrecs,
6652           { "Nsrecs", "nbt.nbt_name_packet.nsrecs", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6653         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_server_site,
6654           { "Server Site", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.server_site", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6655         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_5,
6656           { "Netlogon Nt Version 5", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_5", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_5_tfs), ( 0x00000002 ), NULL, HFILL }},
6657         { &hf_nbt_NETLOGON_LOGON_REQUEST_lm20_token,
6658           { "Lm20 Token", "nbt.NETLOGON_LOGON_REQUEST.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6659         { &hf_nbt_nb_flags_NBT_NM_PERMANENT,
6660           { "Nbt Nm Permanent", "nbt.nb_flags.NBT_NM_PERMANENT", FT_BOOLEAN, 16, TFS(&nb_flags_NBT_NM_PERMANENT_tfs), ( 0x0200 ), NULL, HFILL }},
6661         { &hf_nbt_nbt_browse_host_announcement_Signature,
6662           { "Signature", "nbt.nbt_browse_host_announcement.Signature", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6663         { &hf_nbt_NETLOGON_DB_CHANGE_serial_lo,
6664           { "Serial Lo", "nbt.NETLOGON_DB_CHANGE.serial_lo", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6665         { &hf_nbt_nbt_browse_host_announcement_Periodicity,
6666           { "Periodicity", "nbt.nbt_browse_host_announcement.Periodicity", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6667         { &hf_nbt_nbt_operation_NBT_FLAG_TRUNCATION,
6668           { "Nbt Flag Truncation", "nbt.nbt_operation.NBT_FLAG_TRUNCATION", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_FLAG_TRUNCATION_tfs), ( 0x0200 ), NULL, HFILL }},
6669         { &hf_nbt_dgram_smb_packet_tid,
6670           { "Tid", "nbt.dgram_smb_packet.tid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6671         { &hf_nbt_nbt_browse_host_announcement_ServerName,
6672           { "Servername", "nbt.nbt_browse_host_announcement.ServerName", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
6673         { &hf_nbt_nbt_server_type_NBT_SERVER_GOOD_TIMESERV,
6674           { "Nbt Server Good Timeserv", "nbt.nbt_server_type.NBT_SERVER_GOOD_TIMESERV", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_GOOD_TIMESERV_tfs), ( 0x00000200 ), NULL, HFILL }},
6675         { &hf_nbt_nbt_browse_election_request_Version,
6676           { "Version", "nbt.nbt_browse_election_request.Version", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6677         { &hf_nbt_smb_trans_body_pad,
6678           { "Pad", "nbt.smb_trans_body.pad", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6679         { &hf_nbt_nbt_browse_host_announcement_Comment,
6680           { "Comment", "nbt.nbt_browse_host_announcement.Comment", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6681         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_domain_name,
6682           { "Domain Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40.domain_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6683         { &hf_nbt_NETLOGON_LOGON_REQUEST_computer_name,
6684           { "Computer Name", "nbt.NETLOGON_LOGON_REQUEST.computer_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6685         { &hf_nbt_nbt_browse_host_announcement_ServerType,
6686           { "Servertype", "nbt.nbt_browse_host_announcement.ServerType", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6687         { &hf_nbt_smb_trans_body_priority,
6688           { "Priority", "nbt.smb_trans_body.priority", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6689         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_request_count,
6690           { "Request Count", "nbt.NETLOGON_SAM_LOGON_REQUEST.request_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6691         { &hf_nbt_nbt_statistics_session_data_packet_size,
6692           { "Session Data Packet Size", "nbt.nbt_statistics.session_data_packet_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6693         { &hf_nbt_nbt_statistics_number_free_command_blocks,
6694           { "Number Free Command Blocks", "nbt.nbt_statistics.number_free_command_blocks", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6695         { &hf_nbt_nbt_operation_NBT_OPCODE,
6696           { "Nbt Opcode", "nbt.nbt_operation.NBT_OPCODE", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_OPCODE_tfs), ( 0x7800 ), NULL, HFILL }},
6697         { &hf_nbt_nbt_browse_backup_list_request_ReqCount,
6698           { "Reqcount", "nbt.nbt_browse_backup_list_request.ReqCount", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6699         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_AVOID_NT4EMUL,
6700           { "Netlogon Nt Version Avoid Nt4emul", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_AVOID_NT4EMUL", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_AVOID_NT4EMUL_tfs), ( 0x01000000 ), NULL, HFILL }},
6701         { &hf_nbt_nbt_browse_host_announcement_OSMajor,
6702           { "Osmajor", "nbt.nbt_browse_host_announcement.OSMajor", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6703         { &hf_nbt_nbt_dgram_packet_src_addr,
6704           { "Src Addr", "nbt.nbt_dgram_packet.src_addr", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6705         { &hf_nbt_dgram_smb_packet_mid,
6706           { "Mid", "nbt.dgram_smb_packet.mid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6707         { &hf_nbt_nbt_name_packet_answers,
6708           { "Answers", "nbt.nbt_name_packet.answers", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6709         { &hf_nbt_nbt_browse_domain_announcement_UpdateCount,
6710           { "Updatecount", "nbt.nbt_browse_domain_announcement.UpdateCount", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6711         { &hf_nbt_nbt_browse_reset_state_Command,
6712           { "Command", "nbt.nbt_browse_reset_state.Command", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6713         { &hf_nbt_nbt_browse_become_backup_BrowserName,
6714           { "Browsername", "nbt.nbt_browse_become_backup.BrowserName", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6715         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_forest,
6716           { "Forest", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.forest", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6717         { &hf_nbt_nbt_rdata_netbios_addresses,
6718           { "Addresses", "nbt.nbt_rdata_netbios.addresses", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6719         { &hf_nbt_nbt_browse_local_master_announcement_ServerName,
6720           { "Servername", "nbt.nbt_browse_local_master_announcement.ServerName", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
6721         { &hf_nbt_nbt_browse_announcement_request_ResponseName,
6722           { "Responsename", "nbt.nbt_browse_announcement_request.ResponseName", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6723         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_user_name,
6724           { "User Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40.user_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6725         { &hf_nbt_nbt_browse_payload_election_request,
6726           { "Election Request", "nbt.nbt_browse_payload.election_request", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6727         { &hf_nbt_NETLOGON_DB_CHANGE_random,
6728           { "Random", "nbt.NETLOGON_DB_CHANGE.random", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6729         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_GC,
6730           { "Netlogon Nt Version Gc", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_GC", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_GC_tfs), ( 0x80000000 ), NULL, HFILL }},
6731         { &hf_nbt_nbt_browse_local_master_announcement_Comment,
6732           { "Comment", "nbt.nbt_browse_local_master_announcement.Comment", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6733         { &hf_nbt_nbt_netlogon_packet_command,
6734           { "Command", "nbt.nbt_netlogon_packet.command", FT_UINT16, BASE_DEC, VALS(nbt_netlogon_command_vals), 0, NULL, HFILL }},
6735         { &hf_nbt_dgram_smb_packet_pad,
6736           { "Pad", "nbt.dgram_smb_packet.pad", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6737         { &hf_nbt_nbt_netlogon_query_for_pdc__pad,
6738           { " Pad", "nbt.nbt_netlogon_query_for_pdc._pad", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6739         { &hf_nbt_smb_trans_body_max_setup_count,
6740           { "Max Setup Count", "nbt.smb_trans_body.max_setup_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6741         { &hf_nbt_nbt_server_type_NBT_SERVER_TIMESERV,
6742           { "Nbt Server Timeserv", "nbt.nbt_server_type.NBT_SERVER_TIMESERV", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_TIMESERV_tfs), ( 0x00000040 ), NULL, HFILL }},
6743         { &hf_nbt_nbt_dgram_packet_msg_type,
6744           { "Msg Type", "nbt.nbt_dgram_packet.msg_type", FT_UINT8, BASE_DEC, VALS(nbt_dgram_msg_type_vals), 0, NULL, HFILL }},
6745         { &hf_nbt_smb_trans_body_mailslot_name,
6746           { "Mailslot Name", "nbt.smb_trans_body.mailslot_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6747         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_domain_name,
6748           { "Domain Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE.domain_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6749         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_pdc_name,
6750           { "Pdc Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40.pdc_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6751         { &hf_nbt_nbt_rdata_status_names,
6752           { "Names", "nbt.nbt_rdata_status.names", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6753         { &hf_nbt_nbt_netlogon_request_logon,
6754           { "Logon", "nbt.nbt_netlogon_request.logon", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6755         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_nt_version,
6756           { "Nt Version", "nbt.NETLOGON_SAM_LOGON_RESPONSE.nt_version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6757         { &hf_nbt_NETLOGON_DB_CHANGE_db_count,
6758           { "Db Count", "nbt.NETLOGON_DB_CHANGE.db_count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6759         { &hf_nbt_nbt_browse_domain_announcement_ServerType,
6760           { "Servertype", "nbt.nbt_browse_domain_announcement.ServerType", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6761         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_lmnt_token,
6762           { "Lmnt Token", "nbt.NETLOGON_SAM_LOGON_REQUEST.lmnt_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6763         { &hf_nbt_nbt_statistics_max_number_pending_sessions,
6764           { "Max Number Pending Sessions", "nbt.nbt_statistics.max_number_pending_sessions", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6765         { &hf_nbt_nbt_netlogon_request_pdc,
6766           { "Pdc", "nbt.nbt_netlogon_request.pdc", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6767         { &hf_nbt_nbt_netlogon_query_for_pdc_mailslot_name,
6768           { "Mailslot Name", "nbt.nbt_netlogon_query_for_pdc.mailslot_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6769         { &hf_nbt_nbt_browse_domain_announcement_MysteriousField,
6770           { "Mysteriousfield", "nbt.nbt_browse_domain_announcement.MysteriousField", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6771         { &hf_nbt_nbt_browse_host_announcement_BroMinorVer,
6772           { "Brominorver", "nbt.nbt_browse_host_announcement.BroMinorVer", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6773         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_nt_version,
6774           { "Nt Version", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.nt_version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6775         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40_nt_version,
6776           { "Nt Version", "nbt.NETLOGON_SAM_LOGON_RESPONSE_NT40.nt_version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6777         { &hf_nbt_nbt_netlogon_response2_lm20_token,
6778           { "Lm20 Token", "nbt.nbt_netlogon_response2.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6779         { &hf_nbt_dgram_data_msg,
6780           { "Msg", "nbt.dgram_data.msg", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6781         { &hf_nbt_nbt_browse_election_request_Criteria,
6782           { "Criteria", "nbt.nbt_browse_election_request.Criteria", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6783         { &hf_nbt_NETLOGON_LOGON_REQUEST_user_name,
6784           { "User Name", "nbt.NETLOGON_LOGON_REQUEST.user_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6785         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_nt_version,
6786           { "Nt Version", "nbt.NETLOGON_SAM_LOGON_REQUEST.nt_version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6787         { &hf_nbt_nbt_operation_NBT_FLAG_AUTHORITATIVE,
6788           { "Nbt Flag Authoritative", "nbt.nbt_operation.NBT_FLAG_AUTHORITATIVE", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_FLAG_AUTHORITATIVE_tfs), ( 0x0400 ), NULL, HFILL }},
6789         { &hf_nbt_NETLOGON_LOGON_REQUEST_lmnt_token,
6790           { "Lmnt Token", "nbt.NETLOGON_LOGON_REQUEST.lmnt_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6791         { &hf_nbt_smb_trans_body_reserved,
6792           { "Reserved", "nbt.smb_trans_body.reserved", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6793         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_domain_uuid,
6794           { "Domain Uuid", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.domain_uuid", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }},
6795         { &hf_nbt_nbt_statistics_number_retransmits,
6796           { "Number Retransmits", "nbt.nbt_statistics.number_retransmits", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6797         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_command,
6798           { "Command", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.command", FT_UINT16, BASE_DEC, VALS(nbt_netlogon_command_vals), 0, NULL, HFILL }},
6799         { &hf_nbt_nbt_status_name_type,
6800           { "Type", "nbt.nbt_status_name.type", FT_UINT8, BASE_DEC, VALS(nbt_nbt_name_type_vals), 0, NULL, HFILL }},
6801         { &hf_nbt_dgram_smb_packet_signature,
6802           { "Signature", "nbt.dgram_smb_packet.signature", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
6803         { &hf_nbt_nbt_netlogon_response2_pdc_name,
6804           { "Pdc Name", "nbt.nbt_netlogon_response2.pdc_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6805         { &hf_nbt_nbt_browse_payload_local_master_announcement,
6806           { "Local Master Announcement", "nbt.nbt_browse_payload.local_master_announcement", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6807         { &hf_nbt_nbt_browse_domain_announcement_OSMajor,
6808           { "Osmajor", "nbt.nbt_browse_domain_announcement.OSMajor", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6809         { &hf_nbt_nbt_browse_domain_announcement_Comment,
6810           { "Comment", "nbt.nbt_browse_domain_announcement.Comment", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6811         { &hf_nbt_nbt_statistics_number_send_aborts,
6812           { "Number Send Aborts", "nbt.nbt_statistics.number_send_aborts", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6813         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_user_name,
6814           { "User Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE.user_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6815         { &hf_nbt_smb_trans_body_data_offset,
6816           { "Data Offset", "nbt.smb_trans_body.data_offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6817         { &hf_nbt_nbt_browse_domain_announcement_OSMinor,
6818           { "Osminor", "nbt.nbt_browse_domain_announcement.OSMinor", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6819         { &hf_nbt_nbt_browse_domain_announcement_ServerName,
6820           { "Servername", "nbt.nbt_browse_domain_announcement.ServerName", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
6821         { &hf_nbt_nbt_browse_host_announcement_OSMinor,
6822           { "Osminor", "nbt.nbt_browse_host_announcement.OSMinor", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6823         { &hf_nbt_nbt_dgram_packet_src_port,
6824           { "Src Port", "nbt.nbt_dgram_packet.src_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6825         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_PDC,
6826           { "Netlogon Nt Version Pdc", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_PDC", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_PDC_tfs), ( 0x10000000 ), NULL, HFILL }},
6827         { &hf_nbt_NETLOGON_DB_CHANGE_sid_size,
6828           { "Sid Size", "nbt.NETLOGON_DB_CHANGE.sid_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6829         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid,
6830           { "Sid", "nbt.NETLOGON_SAM_LOGON_REQUEST.sid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6831         { &hf_nbt_nb_flags_NBT_NM_ACTIVE,
6832           { "Nbt Nm Active", "nbt.nb_flags.NBT_NM_ACTIVE", FT_BOOLEAN, 16, TFS(&nb_flags_NBT_NM_ACTIVE_tfs), ( 0x0400 ), NULL, HFILL }},
6833         { &hf_nbt_smb_trans_body_byte_count,
6834           { "Byte Count", "nbt.smb_trans_body.byte_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6835         { &hf_nbt_nbt_statistics_unit_id,
6836           { "Unit Id", "nbt.nbt_statistics.unit_id", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
6837         { &hf_nbt_nbt_name_packet_nscount,
6838           { "Nscount", "nbt.nbt_name_packet.nscount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6839         { &hf_nbt_NETLOGON_DB_CHANGE_pdc_name,
6840           { "Pdc Name", "nbt.NETLOGON_DB_CHANGE.pdc_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6841         { &hf_nbt_nbt_browse_payload_master_announcement,
6842           { "Master Announcement", "nbt.nbt_browse_payload.master_announcement", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6843         { &hf_nbt_nbt_netlogon_response_from_pdc_command,
6844           { "Command", "nbt.nbt_netlogon_response_from_pdc.command", FT_UINT16, BASE_DEC, VALS(nbt_netlogon_command_vals), 0, NULL, HFILL }},
6845         { &hf_nbt_dgram_smb_packet_body,
6846           { "Body", "nbt.dgram_smb_packet.body", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6847         { &hf_nbt_nbt_name_packet_name_trn_id,
6848           { "Name Trn Id", "nbt.nbt_name_packet.name_trn_id", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6849         { &hf_nbt_nbt_browse_local_master_announcement_OSMinor,
6850           { "Osminor", "nbt.nbt_browse_local_master_announcement.OSMinor", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6851         { &hf_nbt_nbt_browse_payload_become_backup,
6852           { "Become Backup", "nbt.nbt_browse_payload.become_backup", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6853         { &hf_nbt_NETLOGON_LOGON_REQUEST_mailslot_name,
6854           { "Mailslot Name", "nbt.NETLOGON_LOGON_REQUEST.mailslot_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6855         { &hf_nbt_nbt_res_rec_ttl,
6856           { "Ttl", "nbt.nbt_res_rec.ttl", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6857         { &hf_nbt_nbt_server_type_NBT_SERVER_SELECT_SECRET_DOMAIN_6,
6858           { "Nbt Server Select Secret Domain 6", "nbt.nbt_server_type.NBT_SERVER_SELECT_SECRET_DOMAIN_6", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_SELECT_SECRET_DOMAIN_6_tfs), ( 0x00000800 ), NULL, HFILL }},
6859         { &hf_nbt_dgram_smb_packet_vuid,
6860           { "Vuid", "nbt.dgram_smb_packet.vuid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6861         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_zero_uuid,
6862           { "Zero Uuid", "nbt.NETLOGON_SAM_LOGON_RESPONSE.zero_uuid", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }},
6863         { &hf_nbt_nbt_sockaddr_pdc_ip,
6864           { "Pdc Ip", "nbt.nbt_sockaddr.pdc_ip", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6865         { &hf_nbt_dgram_smb_packet_flags2,
6866           { "Flags2", "nbt.dgram_smb_packet.flags2", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6867         { &hf_nbt_opnum,
6868           { "Operation", "nbt.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6869         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_lm20_token,
6870           { "Lm20 Token", "nbt.NETLOGON_SAM_LOGON_RESPONSE.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6871         { &hf_nbt_nbt_rdata_data_length,
6872           { "Length", "nbt.nbt_rdata_data.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6873         { &hf_nbt_NETLOGON_DB_CHANGE_pulse,
6874           { "Pulse", "nbt.NETLOGON_DB_CHANGE.pulse", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6875         { &hf_nbt_nbt_statistics_jumpers,
6876           { "Jumpers", "nbt.nbt_statistics.jumpers", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6877         { &hf_nbt_nbt_statistics_number_good_sends,
6878           { "Number Good Sends", "nbt.nbt_statistics.number_good_sends", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6879         { &hf_nbt_dgram_flags_DGRAM_FLAG_NODE_TYPE,
6880           { "Dgram Flag Node Type", "nbt.dgram_flags.DGRAM_FLAG_NODE_TYPE", FT_BOOLEAN, 8, TFS(&dgram_flags_DGRAM_FLAG_NODE_TYPE_tfs), ( 0x0C ), NULL, HFILL }},
6881         { &hf_nbt_nbt_name_packet_qdcount,
6882           { "Qdcount", "nbt.nbt_name_packet.qdcount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6883         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_lmnt_token,
6884           { "Lmnt Token", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.lmnt_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6885         { &hf_nbt_nbt_browse_payload_domain_announcement,
6886           { "Domain Announcement", "nbt.nbt_browse_payload.domain_announcement", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6887         { &hf_nbt_nbt_statistics_number_of_crcs,
6888           { "Number Of Crcs", "nbt.nbt_statistics.number_of_crcs", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6889         { &hf_nbt_nbt_db_change_info_timestamp,
6890           { "Timestamp", "nbt.nbt_db_change_info.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
6891         { &hf_nbt_smb_trans_body_total_data_count,
6892           { "Total Data Count", "nbt.smb_trans_body.total_data_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6893         { &hf_nbt_netlogon_nt_version_flags_NETLOGON_NT_VERSION_LOCAL,
6894           { "Netlogon Nt Version Local", "nbt.netlogon_nt_version_flags.NETLOGON_NT_VERSION_LOCAL", FT_BOOLEAN, 32, TFS(&netlogon_nt_version_flags_NETLOGON_NT_VERSION_LOCAL_tfs), ( 0x40000000 ), NULL, HFILL }},
6895         { &hf_nbt_dgram_smb_packet_err_code,
6896           { "Err Code", "nbt.dgram_smb_packet.err_code", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6897         { &hf_nbt_decode_nbt_netlogon_packet_packet,
6898           { "Packet", "nbt.decode_nbt_netlogon_packet.packet", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6899         { &hf_nbt_nbt_name_question_name,
6900           { "Name", "nbt.nbt_name_question.name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6901         { &hf_nbt_nbt_server_type_NBT_SERVER_PDC,
6902           { "Nbt Server Pdc", "nbt.nbt_server_type.NBT_SERVER_PDC", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_PDC_tfs), ( 0x00000001 ), NULL, HFILL }},
6903         { &hf_nbt_nbt_rdata_address_nb_flags,
6904           { "Nb Flags", "nbt.nbt_rdata_address.nb_flags", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
6905         { &hf_nbt_nbt_server_type_NBT_SERVER_HAS_DNS_NAME,
6906           { "Nbt Server Has Dns Name", "nbt.nbt_server_type.NBT_SERVER_HAS_DNS_NAME", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_HAS_DNS_NAME_tfs), ( 0x20000000 ), NULL, HFILL }},
6907         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_client_site,
6908           { "Client Site", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.client_site", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6909         { &hf_nbt_NETLOGON_DB_CHANGE_domain,
6910           { "Domain", "nbt.NETLOGON_DB_CHANGE.domain", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6911         { &hf_nbt_nbt_browse_payload_announcement_request,
6912           { "Announcement Request", "nbt.nbt_browse_payload.announcement_request", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6913         { &hf_nbt_nbt_operation_NBT_FLAG_BROADCAST,
6914           { "Nbt Flag Broadcast", "nbt.nbt_operation.NBT_FLAG_BROADCAST", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_FLAG_BROADCAST_tfs), ( 0x0010 ), NULL, HFILL }},
6915         { &hf_nbt_nbt_netlogon_response_from_pdc_nt_version,
6916           { "Nt Version", "nbt.nbt_netlogon_response_from_pdc.nt_version", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
6917         { &hf_nbt_dgram_smb_packet_pid_high,
6918           { "Pid High", "nbt.dgram_smb_packet.pid_high", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6919         { &hf_nbt_nbt_netlogon_response2_command,
6920           { "Command", "nbt.nbt_netlogon_response2.command", FT_UINT16, BASE_DEC, VALS(nbt_netlogon_command_vals), 0, NULL, HFILL }},
6921         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_size,
6922           { "Sockaddr Size", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.sockaddr_size", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6923         { &hf_nbt_nbt_operation_NBT_FLAG_REPLY,
6924           { "Nbt Flag Reply", "nbt.nbt_operation.NBT_FLAG_REPLY", FT_BOOLEAN, 16, TFS(&nbt_operation_NBT_FLAG_REPLY_tfs), ( 0x8000 ), NULL, HFILL }},
6925         { &hf_nbt_nbt_server_type_NBT_SERVER_GC,
6926           { "Nbt Server Gc", "nbt.nbt_server_type.NBT_SERVER_GC", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_GC_tfs), ( 0x00000004 ), NULL, HFILL }},
6927         { &hf_nbt_nbt_netlogon_query_for_pdc_unicode_name,
6928           { "Unicode Name", "nbt.nbt_netlogon_query_for_pdc.unicode_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6929         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid_size,
6930           { "Sid Size", "nbt.NETLOGON_SAM_LOGON_REQUEST.sid_size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6931         { &hf_nbt_nbt_server_type_NBT_SERVER_NDNC,
6932           { "Nbt Server Ndnc", "nbt.nbt_server_type.NBT_SERVER_NDNC", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_NDNC_tfs), ( 0x00000400 ), NULL, HFILL }},
6933         { &hf_nbt_nbt_server_type_NBT_SERVER_FULL_SECRET_DOMAIN_6,
6934           { "Nbt Server Full Secret Domain 6", "nbt.nbt_server_type.NBT_SERVER_FULL_SECRET_DOMAIN_6", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_FULL_SECRET_DOMAIN_6_tfs), ( 0x00001000 ), NULL, HFILL }},
6935         { &hf_nbt_nbt_netlogon_response_from_pdc_lmnt_token,
6936           { "Lmnt Token", "nbt.nbt_netlogon_response_from_pdc.lmnt_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6937         { &hf_nbt_NETLOGON_LOGON_REQUEST_request_count,
6938           { "Request Count", "nbt.NETLOGON_LOGON_REQUEST.request_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6939         { &hf_nbt_smb_trans_body_wct,
6940           { "Wct", "nbt.smb_trans_body.wct", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6941         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_mailslot_name,
6942           { "Mailslot Name", "nbt.NETLOGON_SAM_LOGON_REQUEST.mailslot_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6943         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_domain_uuid,
6944           { "Domain Uuid", "nbt.NETLOGON_SAM_LOGON_RESPONSE.domain_uuid", FT_GUID, BASE_NONE, NULL, 0, NULL, HFILL }},
6945         { &hf_nbt_NETLOGON_DB_CHANGE_message_format_version,
6946           { "Message Format Version", "nbt.NETLOGON_DB_CHANGE.message_format_version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6947         { &hf_nbt_nbt_statistics_max_total_sessions_possible,
6948           { "Max Total Sessions Possible", "nbt.nbt_statistics.max_total_sessions_possible", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6949         { &hf_nbt_nbt_name_packet_operation,
6950           { "Operation", "nbt.nbt_name_packet.operation", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
6951         { &hf_nbt_nbt_statistics_version_number,
6952           { "Version Number", "nbt.nbt_statistics.version_number", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6953         { &hf_nbt_nbt_dgram_packet_dgram_id,
6954           { "Dgram Id", "nbt.nbt_dgram_packet.dgram_id", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6955         { &hf_nbt_nbt_name_packet_padding,
6956           { "Padding", "nbt.nbt_name_packet.padding", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6957         { &hf_nbt_nbt_server_type_NBT_SERVER_LDAP,
6958           { "Nbt Server Ldap", "nbt.nbt_server_type.NBT_SERVER_LDAP", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_LDAP_tfs), ( 0x00000008 ), NULL, HFILL }},
6959         { &hf_nbt_nbt_netlogon_query_for_pdc_lm20_token,
6960           { "Lm20 Token", "nbt.nbt_netlogon_query_for_pdc.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6961         { &hf_nbt_nbt_netlogon_response_from_pdc_pdc_name,
6962           { "Pdc Name", "nbt.nbt_netlogon_response_from_pdc.pdc_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6963         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_dns_name,
6964           { "Pdc Dns Name", "nbt.NETLOGON_SAM_LOGON_RESPONSE.pdc_dns_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6965         { &hf_nbt_nbt_browse_payload_reset_browser_state,
6966           { "Reset Browser State", "nbt.nbt_browse_payload.reset_browser_state", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6967         { &hf_nbt_nbt_name_packet_additional,
6968           { "Additional", "nbt.nbt_name_packet.additional", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6969         { &hf_nbt_nbt_name_packet_arcount,
6970           { "Arcount", "nbt.nbt_name_packet.arcount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6971         { &hf_nbt_smb_trans_body_max_data_count,
6972           { "Max Data Count", "nbt.smb_trans_body.max_data_count", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6973         { &hf_nbt_smb_trans_body_trans_flags,
6974           { "Trans Flags", "nbt.smb_trans_body.trans_flags", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6975         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_forest,
6976           { "Forest", "nbt.NETLOGON_SAM_LOGON_RESPONSE.forest", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6977         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_dns_domain,
6978           { "Dns Domain", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.dns_domain", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6979         { &hf_nbt_nbt_browse_announcement_request_Unused,
6980           { "Unused", "nbt.nbt_browse_announcement_request.Unused", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
6981         { &hf_nbt_NETLOGON_DB_CHANGE_sid,
6982           { "Sid", "nbt.NETLOGON_DB_CHANGE.sid", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6983         { &hf_nbt_nbt_server_type_NBT_SERVER_ADS_WEB_SERVICE,
6984           { "Nbt Server Ads Web Service", "nbt.nbt_server_type.NBT_SERVER_ADS_WEB_SERVICE", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_ADS_WEB_SERVICE_tfs), ( 0x00002000 ), NULL, HFILL }},
6985         { &hf_nbt_NETLOGON_DB_CHANGE_message_token,
6986           { "Message Token", "nbt.NETLOGON_DB_CHANGE.message_token", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
6987         { &hf_nbt_NETLOGON_DB_CHANGE_sid_,
6988           { "Subcontext length", "nbt.NETLOGON_DB_CHANGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
6989         { &hf_nbt_nbt_browse_payload_backup_list_response,
6990           { "Backup List Response", "nbt.nbt_browse_payload.backup_list_response", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6991         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_computer_name,
6992           { "Computer Name", "nbt.NETLOGON_SAM_LOGON_REQUEST.computer_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
6993         { &hf_nbt_nb_flags_NBT_NM_CONFLICT,
6994           { "Nbt Nm Conflict", "nbt.nb_flags.NBT_NM_CONFLICT", FT_BOOLEAN, 16, TFS(&nb_flags_NBT_NM_CONFLICT_tfs), ( 0x0800 ), NULL, HFILL }},
6995         { &hf_nbt_nbt_rdata_netbios,
6996           { "Netbios", "nbt.nbt_rdata.netbios", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
6997         { &hf_nbt_nbt_statistics_period_of_statistics,
6998           { "Period Of Statistics", "nbt.nbt_statistics.period_of_statistics", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
6999         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_pdc_ip,
7000           { "Pdc Ip", "nbt.NETLOGON_SAM_LOGON_RESPONSE.pdc_ip", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7001         { &hf_nbt_nbt_server_type_NBT_SERVER_WRITABLE,
7002           { "Nbt Server Writable", "nbt.nbt_server_type.NBT_SERVER_WRITABLE", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_WRITABLE_tfs), ( 0x00000100 ), NULL, HFILL }},
7003         { &hf_nbt_nbt_netlogon_query_for_pdc_computer_name,
7004           { "Computer Name", "nbt.nbt_netlogon_query_for_pdc.computer_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
7005         { &hf_nbt_nbt_status_name_nb_flags,
7006           { "Nb Flags", "nbt.nbt_status_name.nb_flags", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
7007         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX_sockaddr_,
7008           { "Subcontext length", "nbt.NETLOGON_SAM_LOGON_RESPONSE_EX.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
7009         { &hf_nbt_dgram_flags_DGRAM_FLAG_MORE,
7010           { "Dgram Flag More", "nbt.dgram_flags.DGRAM_FLAG_MORE", FT_BOOLEAN, 8, TFS(&dgram_flags_DGRAM_FLAG_MORE_tfs), ( 0x01 ), NULL, HFILL }},
7011         { &hf_nbt_nbt_netlogon_response_from_pdc__pad,
7012           { " Pad", "nbt.nbt_netlogon_response_from_pdc._pad", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7013         { &hf_nbt_nbt_browse_local_master_announcement_OSMajor,
7014           { "Osmajor", "nbt.nbt_browse_local_master_announcement.OSMajor", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
7015         { &hf_nbt_nbt_rdata_data_data,
7016           { "Data", "nbt.nbt_rdata_data.data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
7017         { &hf_nbt_NETLOGON_DB_CHANGE_timestamp,
7018           { "Timestamp", "nbt.NETLOGON_DB_CHANGE.timestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
7019         { &hf_nbt_NETLOGON_DB_CHANGE__pad,
7020           { " Pad", "nbt.NETLOGON_DB_CHANGE._pad", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7021         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_server_type,
7022           { "Server Type", "nbt.NETLOGON_SAM_LOGON_RESPONSE.server_type", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
7023         { &hf_nbt_nbt_browse_payload_backup_list_request,
7024           { "Backup List Request", "nbt.nbt_browse_payload.backup_list_request", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7025         { &hf_nbt_dgram_flags_DGRAM_FLAG_FIRST,
7026           { "Dgram Flag First", "nbt.dgram_flags.DGRAM_FLAG_FIRST", FT_BOOLEAN, 8, TFS(&dgram_flags_DGRAM_FLAG_FIRST_tfs), ( 0x02 ), NULL, HFILL }},
7027         { &hf_nbt_smb_trans_body__class,
7028           { " Class", "nbt.smb_trans_body._class", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7029         { &hf_nbt_nb_flags_NBT_NM_GROUP,
7030           { "Nbt Nm Group", "nbt.nb_flags.NBT_NM_GROUP", FT_BOOLEAN, 16, TFS(&nb_flags_NBT_NM_GROUP_tfs), ( 0x8000 ), NULL, HFILL }},
7031         { &hf_nbt_nbt_statistics_test_result,
7032           { "Test Result", "nbt.nbt_statistics.test_result", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
7033         { &hf_nbt_nbt_netlogon_response_from_pdc_unicode_pdc_name,
7034           { "Unicode Pdc Name", "nbt.nbt_netlogon_response_from_pdc.unicode_pdc_name", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
7035         { &hf_nbt_nbt_name_type,
7036           { "Type", "nbt.nbt_name.type", FT_UINT8, BASE_DEC, VALS(nbt_nbt_name_type_vals), 0, NULL, HFILL }},
7037         { &hf_nbt_NETLOGON_SAM_LOGON_REQUEST_sid_,
7038           { "Subcontext length", "nbt.NETLOGON_SAM_LOGON_REQUEST.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
7039         { &hf_nbt_nbt_server_type_NBT_SERVER_KDC,
7040           { "Nbt Server Kdc", "nbt.nbt_server_type.NBT_SERVER_KDC", FT_BOOLEAN, 32, TFS(&nbt_server_type_NBT_SERVER_KDC_tfs), ( 0x00000020 ), NULL, HFILL }},
7041         { &hf_nbt_nbt_browse_local_master_announcement_Periodicity,
7042           { "Periodicity", "nbt.nbt_browse_local_master_announcement.Periodicity", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7043         { &hf_nbt_dgram_smb_packet_err_class,
7044           { "Err Class", "nbt.dgram_smb_packet.err_class", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
7045         { &hf_nbt_nbt_statistics_number_good_receives,
7046           { "Number Good Receives", "nbt.nbt_statistics.number_good_receives", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
7047         { &hf_nbt_NETLOGON_SAM_LOGON_RESPONSE_lmnt_token,
7048           { "Lmnt Token", "nbt.NETLOGON_SAM_LOGON_RESPONSE.lmnt_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7049         { &hf_nbt_nbt_browse_backup_list_response_BackupCount,
7050           { "Backupcount", "nbt.nbt_browse_backup_list_response.BackupCount", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
7051         { &hf_nbt_smb_body_trans,
7052           { "Trans", "nbt.smb_body.trans", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
7053         { &hf_nbt_nbt_netlogon_response_from_pdc_lm20_token,
7054           { "Lm20 Token", "nbt.nbt_netlogon_response_from_pdc.lm20_token", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
7055         };
7056
7057
7058         static gint *ett[] = {
7059                 &ett_dcerpc_nbt,
7060                 &ett_nbt_nbt_operation,
7061                 &ett_nbt_nbt_name,
7062                 &ett_nbt_nbt_name_question,
7063                 &ett_nbt_nb_flags,
7064                 &ett_nbt_nbt_rdata_address,
7065                 &ett_nbt_nbt_rdata_netbios,
7066                 &ett_nbt_nbt_statistics,
7067                 &ett_nbt_nbt_status_name,
7068                 &ett_nbt_nbt_rdata_status,
7069                 &ett_nbt_nbt_rdata_data,
7070                 &ett_nbt_nbt_rdata,
7071                 &ett_nbt_nbt_res_rec,
7072                 &ett_nbt_nbt_name_packet,
7073                 &ett_nbt_dgram_flags,
7074                 &ett_nbt_smb_trans_body,
7075                 &ett_nbt_smb_body,
7076                 &ett_nbt_dgram_smb_packet,
7077                 &ett_nbt_dgram_message_body,
7078                 &ett_nbt_dgram_message,
7079                 &ett_nbt_dgram_data,
7080                 &ett_nbt_nbt_dgram_packet,
7081                 &ett_nbt_nbt_sockaddr,
7082                 &ett_nbt_nbt_server_type,
7083                 &ett_nbt_netlogon_nt_version_flags,
7084                 &ett_nbt_NETLOGON_SAM_LOGON_REQUEST,
7085                 &ett_nbt_NETLOGON_LOGON_REQUEST,
7086                 &ett_nbt_NETLOGON_SAM_LOGON_RESPONSE_NT40,
7087                 &ett_nbt_NETLOGON_SAM_LOGON_RESPONSE,
7088                 &ett_nbt_NETLOGON_SAM_LOGON_RESPONSE_EX,
7089                 &ett_nbt_nbt_netlogon_query_for_pdc,
7090                 &ett_nbt_nbt_netlogon_response_from_pdc,
7091                 &ett_nbt_nbt_netlogon_response2,
7092                 &ett_nbt_nbt_db_change_info,
7093                 &ett_nbt_NETLOGON_DB_CHANGE,
7094                 &ett_nbt_nbt_netlogon_request,
7095                 &ett_nbt_nbt_netlogon_packet,
7096                 &ett_nbt_svcctl_ServerType,
7097                 &ett_nbt_nbt_browse_host_announcement,
7098                 &ett_nbt_nbt_browse_announcement_request,
7099                 &ett_nbt_nbt_browse_election_request,
7100                 &ett_nbt_nbt_browse_backup_list_request,
7101                 &ett_nbt_nbt_browse_backup_list_response,
7102                 &ett_nbt_nbt_browse_become_backup,
7103                 &ett_nbt_nbt_browse_domain_announcement,
7104                 &ett_nbt_nbt_browse_master_announcement,
7105                 &ett_nbt_nbt_browse_reset_state,
7106                 &ett_nbt_nbt_browse_local_master_announcement,
7107                 &ett_nbt_nbt_browse_payload,
7108                 &ett_nbt_nbt_browse_packet,
7109         };
7110
7111         proto_dcerpc_nbt = proto_register_protocol("NBT messages", "NBT", "nbt");
7112         proto_register_field_array(proto_dcerpc_nbt, hf, array_length (hf));
7113         proto_register_subtree_array(ett, array_length(ett));
7114 }
7115
7116 void proto_reg_handoff_dcerpc_nbt(void)
7117 {
7118         dcerpc_init_uuid(proto_dcerpc_nbt, ett_dcerpc_nbt,
7119                 &uuid_dcerpc_nbt, ver_dcerpc_nbt,
7120                 nbt_dissectors, hf_nbt_opnum);
7121 }