git add -f bin/default/librpc/gen_ndr/packet-dcerpc-*
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / packet-dcerpc-ntlmssp.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from /home/metze/devel/samba/4.0/master4-franky/librpc/idl/ntlmssp.idl and /home/metze/devel/samba/4.0/master4-franky/librpc/idl/ntlmssp.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-ntlmssp.h"
30
31 /* Ett declarations */
32 static gint ett_dcerpc_ntlmssp = -1;
33 static gint ett_ntlmssp_NEGOTIATE = -1;
34 static gint ett_ntlmssp_ntlmssp_VERSION = -1;
35 static gint ett_ntlmssp_ntlmssp_Version = -1;
36 static gint ett_ntlmssp_NEGOTIATE_MESSAGE = -1;
37 static gint ett_ntlmssp_Restriction_Encoding = -1;
38 static gint ett_ntlmssp_ntlmssp_AvFlags = -1;
39 static gint ett_ntlmssp_ntlmssp_AvValue = -1;
40 static gint ett_ntlmssp_AV_PAIR = -1;
41 static gint ett_ntlmssp_AV_PAIR_LIST = -1;
42 static gint ett_ntlmssp_CHALLENGE_MESSAGE = -1;
43 static gint ett_ntlmssp_LM_RESPONSE = -1;
44 static gint ett_ntlmssp_LMv2_RESPONSE = -1;
45 static gint ett_ntlmssp_ntlmssp_LM_RESPONSE = -1;
46 static gint ett_ntlmssp_NTLM_RESPONSE = -1;
47 static gint ett_ntlmssp_NTLMv2_CLIENT_CHALLENGE = -1;
48 static gint ett_ntlmssp_NTLMv2_RESPONSE = -1;
49 static gint ett_ntlmssp_ntlmssp_NTLM_RESPONSE = -1;
50 static gint ett_ntlmssp_MIC = -1;
51 static gint ett_ntlmssp_AUTHENTICATE_MESSAGE = -1;
52 static gint ett_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE = -1;
53 static gint ett_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2 = -1;
54
55
56 /* Header field declarations */
57 static gint hf_ntlmssp_decode_NTLMv2_RESPONSE_response = -1;
58 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameInfoMaxLen = -1;
59 static gint hf_ntlmssp_ntlmssp_VERSION_Reserved = -1;
60 static gint hf_ntlmssp_ntlmssp_AvValue_AvNbComputerName = -1;
61 static gint hf_ntlmssp_CHALLENGE_MESSAGE_Reserved = -1;
62 static gint hf_ntlmssp_ntlmssp_AvValue_AvTimestamp = -1;
63 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM = -1;
64 static gint hf_ntlmssp_Restriction_Encoding_MachineId = -1;
65 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_WorkstationLen = -1;
66 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NTLM = -1;
67 static gint hf_ntlmssp_ntlmssp_AvValue_ChannelBindings = -1;
68 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_Signature = -1;
69 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_SEAL = -1;
70 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_KEY_EXCH = -1;
71 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved1 = -1;
72 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_AvPairs = -1;
73 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_DomainName_ = -1;
74 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_WorkstationMaxLen = -1;
75 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_IDENTIFY = -1;
76 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfoLen = -1;
77 static gint hf_ntlmssp_LMv2_RESPONSE_ChallengeFromClient = -1;
78 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponse_ = -1;
79 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponse = -1;
80 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED = -1;
81 static gint hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_Checksum = -1;
82 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_Version = -1;
83 static gint hf_ntlmssp_LM_RESPONSE_Response = -1;
84 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_DomainNameLen = -1;
85 static gint hf_ntlmssp_NTLMv2_RESPONSE_Response = -1;
86 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NETWARE = -1;
87 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_RespType = -1;
88 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_UserNameMaxLen = -1;
89 static gint hf_ntlmssp_ntlmssp_Version_version = -1;
90 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameLen = -1;
91 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_DomainNameMaxLen = -1;
92 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_56 = -1;
93 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyMaxLen = -1;
94 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_MessageType = -1;
95 static gint hf_ntlmssp_ntlmssp_AvValue_AvNbDomainName = -1;
96 static gint hf_ntlmssp_ntlmssp_AvFlags_NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE = -1;
97 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_VERSION = -1;
98 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetName_ = -1;
99 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_REQUEST_TARGET = -1;
100 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_Workstation_ = -1;
101 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainNameMaxLen = -1;
102 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_DOMAIN = -1;
103 static gint hf_ntlmssp_decode_CHALLENGE_MESSAGE_challenge = -1;
104 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_UserName_ = -1;
105 static gint hf_ntlmssp_ntlmssp_LM_RESPONSE_v1 = -1;
106 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetName = -1;
107 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved2 = -1;
108 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL = -1;
109 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_MessageType = -1;
110 static gint hf_ntlmssp_ntlmssp_NTLM_RESPONSE_v2 = -1;
111 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_WorkstationLen = -1;
112 static gint hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_Version = -1;
113 static gint hf_ntlmssp_AV_PAIR_AvLen = -1;
114 static gint hf_ntlmssp_decode_NTLMv2_CLIENT_CHALLENGE_challenge = -1;
115 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainName_ = -1;
116 static gint hf_ntlmssp_LMv2_RESPONSE_Response = -1;
117 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_WorkstationMaxLen = -1;
118 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponseMaxLen = -1;
119 static gint hf_ntlmssp_AV_PAIR_AvId = -1;
120 static gint hf_ntlmssp_ntlmssp_AvValue_blob = -1;
121 static gint hf_ntlmssp_CHALLENGE_MESSAGE_ServerChallenge = -1;
122 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NT_ONLY = -1;
123 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_SIGN = -1;
124 static gint hf_ntlmssp_AV_PAIR_LIST_pair = -1;
125 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponseLen = -1;
126 static gint hf_ntlmssp_NTLM_RESPONSE_Response = -1;
127 static gint hf_ntlmssp_AV_PAIR_LIST_count = -1;
128 static gint hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum = -1;
129 static gint hf_ntlmssp_CHALLENGE_MESSAGE_Version = -1;
130 static gint hf_ntlmssp_Restriction_Encoding_SubjectIntegrityLevel = -1;
131 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponse = -1;
132 static gint hf_ntlmssp_decode_NEGOTIATE_MESSAGE_negotiate = -1;
133 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_UserName = -1;
134 static gint hf_ntlmssp_ntlmssp_AvValue_AvFlags = -1;
135 static gint hf_ntlmssp_CHALLENGE_MESSAGE_Signature = -1;
136 static gint hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Version = -1;
137 static gint hf_ntlmssp_Restriction_Encoding_Z4 = -1;
138 static gint hf_ntlmssp_ntlmssp_AvValue_AvDnsTreeName = -1;
139 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey = -1;
140 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponseLen = -1;
141 static gint hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_SeqNum = -1;
142 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_REQUEST_NON_NT_SESSION_KEY = -1;
143 static gint hf_ntlmssp_ntlmssp_VERSION_NTLMRevisionCurrent = -1;
144 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_TARGET_INFO = -1;
145 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponseMaxLen = -1;
146 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainNameLen = -1;
147 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_Signature = -1;
148 static gint hf_ntlmssp_ntlmssp_AvValue_AvRestrictions = -1;
149 static gint hf_ntlmssp_MIC_MIC = -1;
150 static gint hf_ntlmssp_AV_PAIR_Value_ = -1;
151 static gint hf_ntlmssp_Restriction_Encoding_Size = -1;
152 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_AvPairs_ = -1;
153 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_HiRespType = -1;
154 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient = -1;
155 static gint hf_ntlmssp_ntlmssp_AvFlags_NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT = -1;
156 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_ANONYMOUS = -1;
157 static gint hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_RandomPad = -1;
158 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_NegotiateFlags = -1;
159 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_SHARE = -1;
160 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_Workstation_ = -1;
161 static gint hf_ntlmssp_ntlmssp_NTLM_RESPONSE_v1 = -1;
162 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_Version = -1;
163 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_LM_KEY = -1;
164 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_UNICODE = -1;
165 static gint hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_SeqNum = -1;
166 static gint hf_ntlmssp_decode_AUTHENTICATE_MESSAGE_authenticate = -1;
167 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfo = -1;
168 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfo_ = -1;
169 static gint hf_ntlmssp_opnum = -1;
170 static gint hf_ntlmssp_ntlmssp_VERSION_ProductBuild = -1;
171 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_DATAGRAM = -1;
172 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainName = -1;
173 static gint hf_ntlmssp_ntlmssp_AvValue_AvDnsComputerName = -1;
174 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_128 = -1;
175 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved3 = -1;
176 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_NegotiateFlags = -1;
177 static gint hf_ntlmssp_NTLMv2_RESPONSE_Challenge = -1;
178 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey_ = -1;
179 static gint hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameMaxLen = -1;
180 static gint hf_ntlmssp_ntlmssp_VERSION_ProductMinorVersion = -1;
181 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_Workstation = -1;
182 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY = -1;
183 static gint hf_ntlmssp_CHALLENGE_MESSAGE_NegotiateFlags = -1;
184 static gint hf_ntlmssp_ntlmssp_AvValue_AvTargetName = -1;
185 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_SERVER = -1;
186 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED = -1;
187 static gint hf_ntlmssp_CHALLENGE_MESSAGE_MessageType = -1;
188 static gint hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_ALWAYS_SIGN = -1;
189 static gint hf_ntlmssp_AV_PAIR_Value = -1;
190 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_UserNameLen = -1;
191 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponse_ = -1;
192 static gint hf_ntlmssp_Restriction_Encoding_IntegrityLevel = -1;
193 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyLen = -1;
194 static gint hf_ntlmssp_NEGOTIATE_MESSAGE_DomainName = -1;
195 static gint hf_ntlmssp_ntlmssp_VERSION_ProductMajorVersion = -1;
196 static gint hf_ntlmssp_AUTHENTICATE_MESSAGE_Workstation = -1;
197 static gint hf_ntlmssp_ntlmssp_AvValue_AvDnsDomainName = -1;
198 static gint hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_TimeStamp = -1;
199
200 static gint proto_dcerpc_ntlmssp = -1;
201 /* Version information */
202
203
204 static e_uuid_t uuid_dcerpc_ntlmssp = {
205         0x6e746c6d, 0x7373, 0x700a,
206         { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x", 0x }
207 };
208 static guint16 ver_dcerpc_ntlmssp = 0;
209
210 const value_string ntlmssp_ntlmssp_MessageType_vals[] = {
211         { NtLmNegotiate, "NtLmNegotiate" },
212         { NtLmChallenge, "NtLmChallenge" },
213         { NtLmAuthenticate, "NtLmAuthenticate" },
214 { 0, NULL }
215 };
216 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_UNICODE_tfs = {
217    "NTLMSSP_NEGOTIATE_UNICODE is SET",
218    "NTLMSSP_NEGOTIATE_UNICODE is NOT SET",
219 };
220 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_tfs = {
221    "NTLMSSP_NEGOTIATE_OEM is SET",
222    "NTLMSSP_NEGOTIATE_OEM is NOT SET",
223 };
224 static const true_false_string NEGOTIATE_NTLMSSP_REQUEST_TARGET_tfs = {
225    "NTLMSSP_REQUEST_TARGET is SET",
226    "NTLMSSP_REQUEST_TARGET is NOT SET",
227 };
228 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_SIGN_tfs = {
229    "NTLMSSP_NEGOTIATE_SIGN is SET",
230    "NTLMSSP_NEGOTIATE_SIGN is NOT SET",
231 };
232 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_SEAL_tfs = {
233    "NTLMSSP_NEGOTIATE_SEAL is SET",
234    "NTLMSSP_NEGOTIATE_SEAL is NOT SET",
235 };
236 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_DATAGRAM_tfs = {
237    "NTLMSSP_NEGOTIATE_DATAGRAM is SET",
238    "NTLMSSP_NEGOTIATE_DATAGRAM is NOT SET",
239 };
240 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_LM_KEY_tfs = {
241    "NTLMSSP_NEGOTIATE_LM_KEY is SET",
242    "NTLMSSP_NEGOTIATE_LM_KEY is NOT SET",
243 };
244 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_NETWARE_tfs = {
245    "NTLMSSP_NEGOTIATE_NETWARE is SET",
246    "NTLMSSP_NEGOTIATE_NETWARE is NOT SET",
247 };
248 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_NTLM_tfs = {
249    "NTLMSSP_NEGOTIATE_NTLM is SET",
250    "NTLMSSP_NEGOTIATE_NTLM is NOT SET",
251 };
252 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_NT_ONLY_tfs = {
253    "NTLMSSP_NEGOTIATE_NT_ONLY is SET",
254    "NTLMSSP_NEGOTIATE_NT_ONLY is NOT SET",
255 };
256 static const true_false_string NEGOTIATE_NTLMSSP_ANONYMOUS_tfs = {
257    "NTLMSSP_ANONYMOUS is SET",
258    "NTLMSSP_ANONYMOUS is NOT SET",
259 };
260 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED_tfs = {
261    "NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED is SET",
262    "NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED is NOT SET",
263 };
264 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED_tfs = {
265    "NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED is SET",
266    "NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED is NOT SET",
267 };
268 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL_tfs = {
269    "NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL is SET",
270    "NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL is NOT SET",
271 };
272 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_ALWAYS_SIGN_tfs = {
273    "NTLMSSP_NEGOTIATE_ALWAYS_SIGN is SET",
274    "NTLMSSP_NEGOTIATE_ALWAYS_SIGN is NOT SET",
275 };
276 static const true_false_string NEGOTIATE_NTLMSSP_TARGET_TYPE_DOMAIN_tfs = {
277    "NTLMSSP_TARGET_TYPE_DOMAIN is SET",
278    "NTLMSSP_TARGET_TYPE_DOMAIN is NOT SET",
279 };
280 static const true_false_string NEGOTIATE_NTLMSSP_TARGET_TYPE_SERVER_tfs = {
281    "NTLMSSP_TARGET_TYPE_SERVER is SET",
282    "NTLMSSP_TARGET_TYPE_SERVER is NOT SET",
283 };
284 static const true_false_string NEGOTIATE_NTLMSSP_TARGET_TYPE_SHARE_tfs = {
285    "NTLMSSP_TARGET_TYPE_SHARE is SET",
286    "NTLMSSP_TARGET_TYPE_SHARE is NOT SET",
287 };
288 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY_tfs = {
289    "NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY is SET",
290    "NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY is NOT SET",
291 };
292 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_IDENTIFY_tfs = {
293    "NTLMSSP_NEGOTIATE_IDENTIFY is SET",
294    "NTLMSSP_NEGOTIATE_IDENTIFY is NOT SET",
295 };
296 static const true_false_string NEGOTIATE_NTLMSSP_REQUEST_NON_NT_SESSION_KEY_tfs = {
297    "NTLMSSP_REQUEST_NON_NT_SESSION_KEY is SET",
298    "NTLMSSP_REQUEST_NON_NT_SESSION_KEY is NOT SET",
299 };
300 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_TARGET_INFO_tfs = {
301    "NTLMSSP_NEGOTIATE_TARGET_INFO is SET",
302    "NTLMSSP_NEGOTIATE_TARGET_INFO is NOT SET",
303 };
304 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_VERSION_tfs = {
305    "NTLMSSP_NEGOTIATE_VERSION is SET",
306    "NTLMSSP_NEGOTIATE_VERSION is NOT SET",
307 };
308 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_128_tfs = {
309    "NTLMSSP_NEGOTIATE_128 is SET",
310    "NTLMSSP_NEGOTIATE_128 is NOT SET",
311 };
312 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_KEY_EXCH_tfs = {
313    "NTLMSSP_NEGOTIATE_KEY_EXCH is SET",
314    "NTLMSSP_NEGOTIATE_KEY_EXCH is NOT SET",
315 };
316 static const true_false_string NEGOTIATE_NTLMSSP_NEGOTIATE_56_tfs = {
317    "NTLMSSP_NEGOTIATE_56 is SET",
318    "NTLMSSP_NEGOTIATE_56 is NOT SET",
319 };
320 const value_string ntlmssp_ntlmssp_WindowsMajorVersion_vals[] = {
321         { NTLMSSP_WINDOWS_MAJOR_VERSION_5, "NTLMSSP_WINDOWS_MAJOR_VERSION_5" },
322         { NTLMSSP_WINDOWS_MAJOR_VERSION_6, "NTLMSSP_WINDOWS_MAJOR_VERSION_6" },
323 { 0, NULL }
324 };
325 const value_string ntlmssp_ntlmssp_WindowsMinorVersion_vals[] = {
326         { NTLMSSP_WINDOWS_MINOR_VERSION_0, "NTLMSSP_WINDOWS_MINOR_VERSION_0" },
327         { NTLMSSP_WINDOWS_MINOR_VERSION_1, "NTLMSSP_WINDOWS_MINOR_VERSION_1" },
328         { NTLMSSP_WINDOWS_MINOR_VERSION_2, "NTLMSSP_WINDOWS_MINOR_VERSION_2" },
329 { 0, NULL }
330 };
331 const value_string ntlmssp_ntlmssp_NTLMRevisionCurrent_vals[] = {
332         { NTLMSSP_REVISION_W2K3_RC1, "NTLMSSP_REVISION_W2K3_RC1" },
333         { NTLMSSP_REVISION_W2K3, "NTLMSSP_REVISION_W2K3" },
334 { 0, NULL }
335 };
336 static int ntlmssp_dissect_element_VERSION_ProductMajorVersion(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
337 static int ntlmssp_dissect_element_VERSION_ProductMinorVersion(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
338 static int ntlmssp_dissect_element_VERSION_ProductBuild(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
339 static int ntlmssp_dissect_element_VERSION_Reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
340 static int ntlmssp_dissect_element_VERSION_Reserved_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
341 static int ntlmssp_dissect_element_VERSION_NTLMRevisionCurrent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
342 static int ntlmssp_dissect_element_Version_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
343 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
344 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
345 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
346 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_NegotiateFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
347 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainNameLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
348 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
349 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
350 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
351 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
352 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_WorkstationLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
353 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_WorkstationMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
354 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
355 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
356 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
357 static int ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *);
358 const value_string ntlmssp_ntlmssp_AvId_vals[] = {
359         { MsvAvEOL, "MsvAvEOL" },
360         { MsvAvNbComputerName, "MsvAvNbComputerName" },
361         { MsvAvNbDomainName, "MsvAvNbDomainName" },
362         { MsvAvDnsComputerName, "MsvAvDnsComputerName" },
363         { MsvAvDnsDomainName, "MsvAvDnsDomainName" },
364         { MsvAvDnsTreeName, "MsvAvDnsTreeName" },
365         { MsvAvFlags, "MsvAvFlags" },
366         { MsvAvTimestamp, "MsvAvTimestamp" },
367         { MsAvRestrictions, "MsAvRestrictions" },
368         { MsvAvTargetName, "MsvAvTargetName" },
369         { MsvChannelBindings, "MsvChannelBindings" },
370 { 0, NULL }
371 };
372 static int ntlmssp_dissect_element_Restriction_Encoding_Size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
373 static int ntlmssp_dissect_element_Restriction_Encoding_Z4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
374 static int ntlmssp_dissect_element_Restriction_Encoding_IntegrityLevel(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
375 static int ntlmssp_dissect_element_Restriction_Encoding_SubjectIntegrityLevel(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
376 static int ntlmssp_dissect_element_Restriction_Encoding_MachineId(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
377 static int ntlmssp_dissect_element_Restriction_Encoding_MachineId_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
378 static const true_false_string ntlmssp_AvFlags_NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT_tfs = {
379    "NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT is SET",
380    "NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT is NOT SET",
381 };
382 static const true_false_string ntlmssp_AvFlags_NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE_tfs = {
383    "NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE is SET",
384    "NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE is NOT SET",
385 };
386 static int ntlmssp_dissect_element_AvValue_AvNbComputerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
387 static int ntlmssp_dissect_element_AvValue_AvNbDomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
388 static int ntlmssp_dissect_element_AvValue_AvDnsComputerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
389 static int ntlmssp_dissect_element_AvValue_AvDnsDomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
390 static int ntlmssp_dissect_element_AvValue_AvDnsTreeName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
391 static int ntlmssp_dissect_element_AvValue_AvFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
392 static int ntlmssp_dissect_element_AvValue_AvTimestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
393 static int ntlmssp_dissect_element_AvValue_AvRestrictions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
394 static int ntlmssp_dissect_element_AvValue_AvTargetName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
395 static int ntlmssp_dissect_element_AvValue_ChannelBindings(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
396 static int ntlmssp_dissect_element_AvValue_ChannelBindings_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
397 static int ntlmssp_dissect_element_AvValue_blob(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
398 static int ntlmssp_dissect_element_AV_PAIR_AvId(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *AvId);
399 static int ntlmssp_dissect_element_AV_PAIR_AvLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
400 static int ntlmssp_dissect_element_AV_PAIR_Value(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *AvId);
401 static int ntlmssp_dissect_element_AV_PAIR_Value_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *AvId);
402 static int ntlmssp_dissect_element_AV_PAIR_LIST_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
403 static int ntlmssp_dissect_element_AV_PAIR_LIST_pair(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
404 static int ntlmssp_dissect_element_AV_PAIR_LIST_pair_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
405 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
406 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_Signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
407 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
408 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
409 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
410 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
411 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
412 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
413 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_NegotiateFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
414 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_ServerChallenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
415 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_ServerChallenge_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
416 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_Reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
417 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_Reserved_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
418 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfoLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
419 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameInfoMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
420 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
421 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
422 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
423 static int ntlmssp_dissect_element_CHALLENGE_MESSAGE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *);
424 static int ntlmssp_dissect_element_LM_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
425 static int ntlmssp_dissect_element_LM_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
426 static int ntlmssp_dissect_element_LMv2_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
427 static int ntlmssp_dissect_element_LMv2_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
428 static int ntlmssp_dissect_element_LMv2_RESPONSE_ChallengeFromClient(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
429 static int ntlmssp_dissect_element_LMv2_RESPONSE_ChallengeFromClient_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
430 static int ntlmssp_dissect_element_LM_RESPONSE_v1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
431 static int ntlmssp_dissect_element_NTLM_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
432 static int ntlmssp_dissect_element_NTLM_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
433 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_RespType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
434 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_HiRespType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
435 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
436 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
437 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_TimeStamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
438 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
439 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
440 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
441 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_AvPairs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
442 static int ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_AvPairs_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
443 static int ntlmssp_dissect_element_NTLMv2_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
444 static int ntlmssp_dissect_element_NTLMv2_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
445 static int ntlmssp_dissect_element_NTLMv2_RESPONSE_Challenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
446 static int ntlmssp_dissect_element_NTLM_RESPONSE_v1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
447 static int ntlmssp_dissect_element_NTLM_RESPONSE_v2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
448 static int ntlmssp_dissect_element_MIC_MIC(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
449 static int ntlmssp_dissect_element_MIC_MIC_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
450 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
451 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
452 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
453 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponseLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen);
454 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponseMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
455 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen);
456 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen);
457 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen);
458 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponseLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen);
459 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponseMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
460 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen);
461 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen);
462 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen);
463 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainNameLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
464 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
465 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
466 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
467 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
468 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserNameLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
469 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
470 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
471 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
472 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
473 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_WorkstationLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
474 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_WorkstationMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
475 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
476 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
477 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
478 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
479 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
480 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
481 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
482 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
483 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NegotiateFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
484 static int ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *);
485 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
486 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_RandomPad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
487 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_Checksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
488 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_SeqNum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
489 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
490 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
491 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
492 static int ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_SeqNum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
493 static int ntlmssp_dissect_element_decode_NEGOTIATE_MESSAGE_negotiate(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
494 static int ntlmssp_dissect_element_decode_CHALLENGE_MESSAGE_challenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
495 static int ntlmssp_dissect_element_decode_AUTHENTICATE_MESSAGE_authenticate(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
496 static int ntlmssp_dissect_element_decode_NTLMv2_CLIENT_CHALLENGE_challenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
497 static int ntlmssp_dissect_element_decode_NTLMv2_RESPONSE_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
498
499
500 /* IDL: enum { */
501 /* IDL:         NtLmNegotiate=0x00000001, */
502 /* IDL:         NtLmChallenge=0x00000002, */
503 /* IDL:         NtLmAuthenticate=0x00000003, */
504 /* IDL: } */
505
506 int
507 ntlmssp_dissect_enum_MessageType(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_)
508 {
509         guint32 parameter=0;
510         if(param){
511                 parameter=(guint32)*param;
512         }
513         offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
514         if(param){
515                 *param=(guint32)parameter;
516         }
517         return offset;
518 }
519
520
521 /* IDL: bitmap { */
522 /* IDL:         NTLMSSP_NEGOTIATE_UNICODE =  0x00000001 , */
523 /* IDL:         NTLMSSP_NEGOTIATE_OEM =  0x00000002 , */
524 /* IDL:         NTLMSSP_REQUEST_TARGET =  0x00000004 , */
525 /* IDL:         NTLMSSP_NEGOTIATE_SIGN =  0x00000010 , */
526 /* IDL:         NTLMSSP_NEGOTIATE_SEAL =  0x00000020 , */
527 /* IDL:         NTLMSSP_NEGOTIATE_DATAGRAM =  0x00000040 , */
528 /* IDL:         NTLMSSP_NEGOTIATE_LM_KEY =  0x00000080 , */
529 /* IDL:         NTLMSSP_NEGOTIATE_NETWARE =  0x00000100 , */
530 /* IDL:         NTLMSSP_NEGOTIATE_NTLM =  0x00000200 , */
531 /* IDL:         NTLMSSP_NEGOTIATE_NT_ONLY =  0x00000400 , */
532 /* IDL:         NTLMSSP_ANONYMOUS =  0x00000800 , */
533 /* IDL:         NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED =  0x00001000 , */
534 /* IDL:         NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED =  0x00002000 , */
535 /* IDL:         NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL =  0x00004000 , */
536 /* IDL:         NTLMSSP_NEGOTIATE_ALWAYS_SIGN =  0x00008000 , */
537 /* IDL:         NTLMSSP_TARGET_TYPE_DOMAIN =  0x00010000 , */
538 /* IDL:         NTLMSSP_TARGET_TYPE_SERVER =  0x00020000 , */
539 /* IDL:         NTLMSSP_TARGET_TYPE_SHARE =  0x00040000 , */
540 /* IDL:         NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY =  0x00080000 , */
541 /* IDL:         NTLMSSP_NEGOTIATE_IDENTIFY =  0x00100000 , */
542 /* IDL:         NTLMSSP_REQUEST_NON_NT_SESSION_KEY =  0x00400000 , */
543 /* IDL:         NTLMSSP_NEGOTIATE_TARGET_INFO =  0x00800000 , */
544 /* IDL:         NTLMSSP_NEGOTIATE_VERSION =  0x02000000 , */
545 /* IDL:         NTLMSSP_NEGOTIATE_128 =  0x20000000 , */
546 /* IDL:         NTLMSSP_NEGOTIATE_KEY_EXCH =  0x40000000 , */
547 /* IDL:         NTLMSSP_NEGOTIATE_56 =  0x80000000 , */
548 /* IDL: } */
549
550 int
551 ntlmssp_dissect_bitmap_NEGOTIATE(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_)
552 {
553         proto_item *item = NULL;
554         proto_tree *tree = NULL;
555
556         guint32 flags;
557         ALIGN_TO_4_BYTES;
558
559         if (parent_tree) {
560                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, DREP_ENC_INTEGER(drep));
561                 tree = proto_item_add_subtree(item,ett_ntlmssp_NEGOTIATE);
562         }
563
564         offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);
565         proto_item_append_text(item, ": ");
566
567         if (!flags)
568                 proto_item_append_text(item, "(No values set)");
569
570         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_UNICODE, tvb, offset-4, 4, flags);
571         if (flags&( 0x00000001 )){
572                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_UNICODE");
573                 if (flags & (~( 0x00000001 )))
574                         proto_item_append_text(item, ", ");
575         }
576         flags&=(~( 0x00000001 ));
577
578         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM, tvb, offset-4, 4, flags);
579         if (flags&( 0x00000002 )){
580                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_OEM");
581                 if (flags & (~( 0x00000002 )))
582                         proto_item_append_text(item, ", ");
583         }
584         flags&=(~( 0x00000002 ));
585
586         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_REQUEST_TARGET, tvb, offset-4, 4, flags);
587         if (flags&( 0x00000004 )){
588                 proto_item_append_text(item, "NTLMSSP_REQUEST_TARGET");
589                 if (flags & (~( 0x00000004 )))
590                         proto_item_append_text(item, ", ");
591         }
592         flags&=(~( 0x00000004 ));
593
594         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_SIGN, tvb, offset-4, 4, flags);
595         if (flags&( 0x00000010 )){
596                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_SIGN");
597                 if (flags & (~( 0x00000010 )))
598                         proto_item_append_text(item, ", ");
599         }
600         flags&=(~( 0x00000010 ));
601
602         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_SEAL, tvb, offset-4, 4, flags);
603         if (flags&( 0x00000020 )){
604                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_SEAL");
605                 if (flags & (~( 0x00000020 )))
606                         proto_item_append_text(item, ", ");
607         }
608         flags&=(~( 0x00000020 ));
609
610         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_DATAGRAM, tvb, offset-4, 4, flags);
611         if (flags&( 0x00000040 )){
612                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_DATAGRAM");
613                 if (flags & (~( 0x00000040 )))
614                         proto_item_append_text(item, ", ");
615         }
616         flags&=(~( 0x00000040 ));
617
618         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_LM_KEY, tvb, offset-4, 4, flags);
619         if (flags&( 0x00000080 )){
620                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_LM_KEY");
621                 if (flags & (~( 0x00000080 )))
622                         proto_item_append_text(item, ", ");
623         }
624         flags&=(~( 0x00000080 ));
625
626         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NETWARE, tvb, offset-4, 4, flags);
627         if (flags&( 0x00000100 )){
628                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_NETWARE");
629                 if (flags & (~( 0x00000100 )))
630                         proto_item_append_text(item, ", ");
631         }
632         flags&=(~( 0x00000100 ));
633
634         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NTLM, tvb, offset-4, 4, flags);
635         if (flags&( 0x00000200 )){
636                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_NTLM");
637                 if (flags & (~( 0x00000200 )))
638                         proto_item_append_text(item, ", ");
639         }
640         flags&=(~( 0x00000200 ));
641
642         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NT_ONLY, tvb, offset-4, 4, flags);
643         if (flags&( 0x00000400 )){
644                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_NT_ONLY");
645                 if (flags & (~( 0x00000400 )))
646                         proto_item_append_text(item, ", ");
647         }
648         flags&=(~( 0x00000400 ));
649
650         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_ANONYMOUS, tvb, offset-4, 4, flags);
651         if (flags&( 0x00000800 )){
652                 proto_item_append_text(item, "NTLMSSP_ANONYMOUS");
653                 if (flags & (~( 0x00000800 )))
654                         proto_item_append_text(item, ", ");
655         }
656         flags&=(~( 0x00000800 ));
657
658         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED, tvb, offset-4, 4, flags);
659         if (flags&( 0x00001000 )){
660                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED");
661                 if (flags & (~( 0x00001000 )))
662                         proto_item_append_text(item, ", ");
663         }
664         flags&=(~( 0x00001000 ));
665
666         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED, tvb, offset-4, 4, flags);
667         if (flags&( 0x00002000 )){
668                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED");
669                 if (flags & (~( 0x00002000 )))
670                         proto_item_append_text(item, ", ");
671         }
672         flags&=(~( 0x00002000 ));
673
674         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL, tvb, offset-4, 4, flags);
675         if (flags&( 0x00004000 )){
676                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL");
677                 if (flags & (~( 0x00004000 )))
678                         proto_item_append_text(item, ", ");
679         }
680         flags&=(~( 0x00004000 ));
681
682         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_ALWAYS_SIGN, tvb, offset-4, 4, flags);
683         if (flags&( 0x00008000 )){
684                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_ALWAYS_SIGN");
685                 if (flags & (~( 0x00008000 )))
686                         proto_item_append_text(item, ", ");
687         }
688         flags&=(~( 0x00008000 ));
689
690         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_DOMAIN, tvb, offset-4, 4, flags);
691         if (flags&( 0x00010000 )){
692                 proto_item_append_text(item, "NTLMSSP_TARGET_TYPE_DOMAIN");
693                 if (flags & (~( 0x00010000 )))
694                         proto_item_append_text(item, ", ");
695         }
696         flags&=(~( 0x00010000 ));
697
698         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_SERVER, tvb, offset-4, 4, flags);
699         if (flags&( 0x00020000 )){
700                 proto_item_append_text(item, "NTLMSSP_TARGET_TYPE_SERVER");
701                 if (flags & (~( 0x00020000 )))
702                         proto_item_append_text(item, ", ");
703         }
704         flags&=(~( 0x00020000 ));
705
706         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_SHARE, tvb, offset-4, 4, flags);
707         if (flags&( 0x00040000 )){
708                 proto_item_append_text(item, "NTLMSSP_TARGET_TYPE_SHARE");
709                 if (flags & (~( 0x00040000 )))
710                         proto_item_append_text(item, ", ");
711         }
712         flags&=(~( 0x00040000 ));
713
714         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY, tvb, offset-4, 4, flags);
715         if (flags&( 0x00080000 )){
716                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY");
717                 if (flags & (~( 0x00080000 )))
718                         proto_item_append_text(item, ", ");
719         }
720         flags&=(~( 0x00080000 ));
721
722         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_IDENTIFY, tvb, offset-4, 4, flags);
723         if (flags&( 0x00100000 )){
724                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_IDENTIFY");
725                 if (flags & (~( 0x00100000 )))
726                         proto_item_append_text(item, ", ");
727         }
728         flags&=(~( 0x00100000 ));
729
730         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_REQUEST_NON_NT_SESSION_KEY, tvb, offset-4, 4, flags);
731         if (flags&( 0x00400000 )){
732                 proto_item_append_text(item, "NTLMSSP_REQUEST_NON_NT_SESSION_KEY");
733                 if (flags & (~( 0x00400000 )))
734                         proto_item_append_text(item, ", ");
735         }
736         flags&=(~( 0x00400000 ));
737
738         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_TARGET_INFO, tvb, offset-4, 4, flags);
739         if (flags&( 0x00800000 )){
740                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_TARGET_INFO");
741                 if (flags & (~( 0x00800000 )))
742                         proto_item_append_text(item, ", ");
743         }
744         flags&=(~( 0x00800000 ));
745
746         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_VERSION, tvb, offset-4, 4, flags);
747         if (flags&( 0x02000000 )){
748                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_VERSION");
749                 if (flags & (~( 0x02000000 )))
750                         proto_item_append_text(item, ", ");
751         }
752         flags&=(~( 0x02000000 ));
753
754         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_128, tvb, offset-4, 4, flags);
755         if (flags&( 0x20000000 )){
756                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_128");
757                 if (flags & (~( 0x20000000 )))
758                         proto_item_append_text(item, ", ");
759         }
760         flags&=(~( 0x20000000 ));
761
762         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_KEY_EXCH, tvb, offset-4, 4, flags);
763         if (flags&( 0x40000000 )){
764                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_KEY_EXCH");
765                 if (flags & (~( 0x40000000 )))
766                         proto_item_append_text(item, ", ");
767         }
768         flags&=(~( 0x40000000 ));
769
770         proto_tree_add_boolean(tree, hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_56, tvb, offset-4, 4, flags);
771         if (flags&( 0x80000000 )){
772                 proto_item_append_text(item, "NTLMSSP_NEGOTIATE_56");
773                 if (flags & (~( 0x80000000 )))
774                         proto_item_append_text(item, ", ");
775         }
776         flags&=(~( 0x80000000 ));
777
778         if (flags) {
779                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
780         }
781
782         return offset;
783 }
784
785
786 /* IDL: enum { */
787 /* IDL:         NTLMSSP_WINDOWS_MAJOR_VERSION_5=0x05, */
788 /* IDL:         NTLMSSP_WINDOWS_MAJOR_VERSION_6=0x06, */
789 /* IDL: } */
790
791 int
792 ntlmssp_dissect_enum_WindowsMajorVersion(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_)
793 {
794         guint8 parameter=0;
795         if(param){
796                 parameter=(guint8)*param;
797         }
798         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
799         if(param){
800                 *param=(guint32)parameter;
801         }
802         return offset;
803 }
804
805
806 /* IDL: enum { */
807 /* IDL:         NTLMSSP_WINDOWS_MINOR_VERSION_0=0x00, */
808 /* IDL:         NTLMSSP_WINDOWS_MINOR_VERSION_1=0x01, */
809 /* IDL:         NTLMSSP_WINDOWS_MINOR_VERSION_2=0x02, */
810 /* IDL: } */
811
812 int
813 ntlmssp_dissect_enum_WindowsMinorVersion(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_)
814 {
815         guint8 parameter=0;
816         if(param){
817                 parameter=(guint8)*param;
818         }
819         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
820         if(param){
821                 *param=(guint32)parameter;
822         }
823         return offset;
824 }
825
826
827 /* IDL: enum { */
828 /* IDL:         NTLMSSP_REVISION_W2K3_RC1=0x0A, */
829 /* IDL:         NTLMSSP_REVISION_W2K3=0x0F, */
830 /* IDL: } */
831
832 int
833 ntlmssp_dissect_enum_NTLMRevisionCurrent(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_)
834 {
835         guint8 parameter=0;
836         if(param){
837                 parameter=(guint8)*param;
838         }
839         offset = dissect_ndr_uint8(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
840         if(param){
841                 *param=(guint32)parameter;
842         }
843         return offset;
844 }
845
846
847 /* IDL: struct { */
848 /* IDL:         ntlmssp_WindowsMajorVersion ProductMajorVersion; */
849 /* IDL:         ntlmssp_WindowsMinorVersion ProductMinorVersion; */
850 /* IDL:         uint16 ProductBuild; */
851 /* IDL:         uint8 Reserved[3]; */
852 /* IDL:         ntlmssp_NTLMRevisionCurrent NTLMRevisionCurrent; */
853 /* IDL: } */
854
855 static int
856 ntlmssp_dissect_element_VERSION_ProductMajorVersion(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
857 {
858         offset = ntlmssp_dissect_enum_WindowsMajorVersion(tvb, offset, pinfo, tree, drep, hf_ntlmssp_ntlmssp_VERSION_ProductMajorVersion, 0);
859
860         return offset;
861 }
862
863 static int
864 ntlmssp_dissect_element_VERSION_ProductMinorVersion(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
865 {
866         offset = ntlmssp_dissect_enum_WindowsMinorVersion(tvb, offset, pinfo, tree, drep, hf_ntlmssp_ntlmssp_VERSION_ProductMinorVersion, 0);
867
868         return offset;
869 }
870
871 static int
872 ntlmssp_dissect_element_VERSION_ProductBuild(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
873 {
874         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_ntlmssp_VERSION_ProductBuild, 0);
875
876         return offset;
877 }
878
879 static int
880 ntlmssp_dissect_element_VERSION_Reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
881 {
882         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
883         int conformant = di->conformant_run;
884         if (!conformant) {
885                 offset = ntlmssp_dissect_element_VERSION_Reserved_(tvb, offset, 3, pinfo, tree, drep);
886         }
887
888         return offset;
889 }
890
891 static int
892 ntlmssp_dissect_element_VERSION_Reserved_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
893 {
894         proto_tree_add_bytes(tree, hf_ntlmssp_ntlmssp_VERSION_Reserved, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
895
896         return offset;
897 }
898
899 static int
900 ntlmssp_dissect_element_VERSION_NTLMRevisionCurrent(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
901 {
902         offset = ntlmssp_dissect_enum_NTLMRevisionCurrent(tvb, offset, pinfo, tree, drep, hf_ntlmssp_ntlmssp_VERSION_NTLMRevisionCurrent, 0);
903
904         return offset;
905 }
906
907 int
908 ntlmssp_dissect_struct_VERSION(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_)
909 {
910         proto_item *item = NULL;
911         proto_tree *tree = NULL;
912         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
913         int old_offset;
914
915         ALIGN_TO_2_BYTES;
916
917         old_offset = offset;
918
919         if (parent_tree) {
920                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
921                 tree = proto_item_add_subtree(item, ett_ntlmssp_ntlmssp_VERSION);
922         }
923         
924         offset = ntlmssp_dissect_element_VERSION_ProductMajorVersion(tvb, offset, pinfo, tree, drep);
925
926         offset = ntlmssp_dissect_element_VERSION_ProductMinorVersion(tvb, offset, pinfo, tree, drep);
927
928         offset = ntlmssp_dissect_element_VERSION_ProductBuild(tvb, offset, pinfo, tree, drep);
929
930         offset = ntlmssp_dissect_element_VERSION_Reserved(tvb, offset, pinfo, tree, drep);
931
932         offset = ntlmssp_dissect_element_VERSION_NTLMRevisionCurrent(tvb, offset, pinfo, tree, drep);
933
934
935         proto_item_set_len(item, offset-old_offset);
936
937
938         if (di->call_data->flags & DCERPC_IS_NDR64) {
939                 ALIGN_TO_2_BYTES;
940         }
941
942         return offset;
943 }
944
945
946 /* IDL: [noprint(1)] [nodiscriminant(1)] union { */
947 /* IDL: [case(NTLMSSP_NEGOTIATE_VERSION)] [case(NTLMSSP_NEGOTIATE_VERSION)] ntlmssp_VERSION version; */
948 /* IDL: [default] ; */
949 /* IDL: } */
950
951 static int
952 ntlmssp_dissect_element_Version_version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
953 {
954         offset = ntlmssp_dissect_struct_VERSION(tvb,offset,pinfo,tree,drep,hf_ntlmssp_ntlmssp_Version_version,0);
955
956         return offset;
957 }
958
959 static int
960 ntlmssp_dissect_Version(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_)
961 {
962         proto_item *item = NULL;
963         proto_tree *tree = NULL;
964         int old_offset;
965         guint32 level = param;
966
967         old_offset = offset;
968         if (parent_tree) {
969                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "ntlmssp_Version");
970                 tree = proto_item_add_subtree(item, ett_ntlmssp_ntlmssp_Version);
971         }
972
973         switch(level) {
974                 case NTLMSSP_NEGOTIATE_VERSION:
975                         offset = ntlmssp_dissect_element_Version_version(tvb, offset, pinfo, tree, drep);
976                 break;
977
978                 default:
979                 break;
980         }
981         proto_item_set_len(item, offset-old_offset);
982
983
984         return offset;
985 }
986
987 /* IDL: struct { */
988 /* IDL:         [value("NTLMSSP")] [charset(DOS)] uint8 Signature[8]; */
989 /* IDL:         [value(NtLmNegotiate)] ntlmssp_MessageType MessageType; */
990 /* IDL:         NEGOTIATE NegotiateFlags; */
991 /* IDL:         [value(DomainName?strlen(DomainName):0)] uint16 DomainNameLen; */
992 /* IDL:         [value(DomainNameLen)] uint16 DomainNameMaxLen; */
993 /* IDL:         [relative(1)] [subcontext_size(DomainNameLen)] [subcontext(0)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] string *DomainName; */
994 /* IDL:         [value(Workstation?strlen(Workstation):0)] uint16 WorkstationLen; */
995 /* IDL:         [value(WorkstationLen)] uint16 WorkstationMaxLen; */
996 /* IDL:         [relative(1)] [subcontext_size(WorkstationLen)] [subcontext(0)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_OEM))] string *Workstation; */
997 /* IDL:         [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] ntlmssp_Version Version; */
998 /* IDL: } */
999
1000 static int
1001 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1002 {
1003         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1004         int conformant = di->conformant_run;
1005         if (!conformant) {
1006                 offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Signature_(tvb, offset, 8, pinfo, tree, drep);
1007         }
1008
1009         return offset;
1010 }
1011
1012 static int
1013 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1014 {
1015         proto_tree_add_bytes(tree, hf_ntlmssp_NEGOTIATE_MESSAGE_Signature, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1016
1017         return offset;
1018 }
1019
1020 static int
1021 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1022 {
1023         offset = ntlmssp_dissect_enum_MessageType(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_MessageType, 0);
1024
1025         return offset;
1026 }
1027
1028 static int
1029 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_NegotiateFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1030 {
1031         offset = ntlmssp_dissect_bitmap_NEGOTIATE(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_NegotiateFlags, 0);
1032
1033         return offset;
1034 }
1035
1036 static int
1037 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainNameLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1038 {
1039         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_DomainNameLen, 0);
1040
1041         return offset;
1042 }
1043
1044 static int
1045 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1046 {
1047         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_DomainNameMaxLen, 0);
1048
1049         return offset;
1050 }
1051
1052 static int
1053 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1054 {
1055         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName_, , "Pointer to Domainname (string)",hf_ntlmssp_NEGOTIATE_MESSAGE_DomainName);
1056
1057         return offset;
1058 }
1059
1060 static int
1061 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1062 {
1063         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1064         guint0 size;
1065         int conformant = di->conformant_run;
1066         tvbuff_t *subtvb;
1067
1068         if (!conformant) {
1069                 guint32 saved_flags = di->call_data->flags;
1070                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_DomainName_, &size);
1071                 di->call_data->flags &= ~DCERPC_IS_NDR64;
1072                 subtvb = tvb_new_subset(tvb, offset, size, -1);
1073                 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName__(subtvb, 0, pinfo, tree, drep);
1074                 offset += size;
1075                 di->call_data->flags = saved_flags;
1076         }
1077
1078         return offset;
1079 }
1080
1081 static int
1082 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1083 {
1084
1085         return offset;
1086 }
1087
1088 static int
1089 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_WorkstationLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1090 {
1091         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_WorkstationLen, 0);
1092
1093         return offset;
1094 }
1095
1096 static int
1097 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_WorkstationMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1098 {
1099         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_WorkstationMaxLen, 0);
1100
1101         return offset;
1102 }
1103
1104 static int
1105 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1106 {
1107         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation_, , "Pointer to Workstation (string)",hf_ntlmssp_NEGOTIATE_MESSAGE_Workstation);
1108
1109         return offset;
1110 }
1111
1112 static int
1113 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1114 {
1115         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1116         guint0 size;
1117         int conformant = di->conformant_run;
1118         tvbuff_t *subtvb;
1119
1120         if (!conformant) {
1121                 guint32 saved_flags = di->call_data->flags;
1122                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_Workstation_, &size);
1123                 di->call_data->flags &= ~DCERPC_IS_NDR64;
1124                 subtvb = tvb_new_subset(tvb, offset, size, -1);
1125                 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation__(subtvb, 0, pinfo, tree, drep);
1126                 offset += size;
1127                 di->call_data->flags = saved_flags;
1128         }
1129
1130         return offset;
1131 }
1132
1133 static int
1134 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1135 {
1136
1137         return offset;
1138 }
1139
1140 static int
1141 ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *)
1142 {
1143         offset = ntlmssp_dissect_Version(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NEGOTIATE_MESSAGE_Version, *);
1144
1145         return offset;
1146 }
1147
1148 int
1149 ntlmssp_dissect_struct_NEGOTIATE_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_)
1150 {
1151         proto_item *item = NULL;
1152         proto_tree *tree = NULL;
1153         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1154         int old_offset;
1155
1156         ALIGN_TO_5_BYTES;
1157
1158         old_offset = offset;
1159
1160         if (parent_tree) {
1161                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1162                 tree = proto_item_add_subtree(item, ett_ntlmssp_NEGOTIATE_MESSAGE);
1163         }
1164         
1165         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Signature(tvb, offset, pinfo, tree, drep);
1166
1167         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_MessageType(tvb, offset, pinfo, tree, drep);
1168
1169         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_NegotiateFlags(tvb, offset, pinfo, tree, drep);
1170
1171         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainNameLen(tvb, offset, pinfo, tree, drep);
1172
1173         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainNameMaxLen(tvb, offset, pinfo, tree, drep);
1174
1175         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_DomainName(tvb, offset, pinfo, tree, drep);
1176
1177         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_WorkstationLen(tvb, offset, pinfo, tree, drep);
1178
1179         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_WorkstationMaxLen(tvb, offset, pinfo, tree, drep);
1180
1181         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Workstation(tvb, offset, pinfo, tree, drep);
1182
1183         offset = ntlmssp_dissect_element_NEGOTIATE_MESSAGE_Version(tvb, offset, pinfo, tree, drep, &);
1184
1185
1186         proto_item_set_len(item, offset-old_offset);
1187
1188
1189         if (di->call_data->flags & DCERPC_IS_NDR64) {
1190                 ALIGN_TO_5_BYTES;
1191         }
1192
1193         return offset;
1194 }
1195
1196
1197 /* IDL: enum { */
1198 /* IDL:         MsvAvEOL=0, */
1199 /* IDL:         MsvAvNbComputerName=1, */
1200 /* IDL:         MsvAvNbDomainName=2, */
1201 /* IDL:         MsvAvDnsComputerName=3, */
1202 /* IDL:         MsvAvDnsDomainName=4, */
1203 /* IDL:         MsvAvDnsTreeName=5, */
1204 /* IDL:         MsvAvFlags=6, */
1205 /* IDL:         MsvAvTimestamp=7, */
1206 /* IDL:         MsAvRestrictions=8, */
1207 /* IDL:         MsvAvTargetName=9, */
1208 /* IDL:         MsvChannelBindings=10, */
1209 /* IDL: } */
1210
1211 int
1212 ntlmssp_dissect_enum_AvId(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_)
1213 {
1214         guint1632 parameter=0;
1215         if(param){
1216                 parameter=(guint1632)*param;
1217         }
1218         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
1219         if(param){
1220                 *param=(guint32)parameter;
1221         }
1222         return offset;
1223 }
1224
1225
1226 /* IDL: struct { */
1227 /* IDL:         uint32 Size; */
1228 /* IDL:         [value(0)] uint32 Z4; */
1229 /* IDL:         uint32 IntegrityLevel; */
1230 /* IDL:         uint32 SubjectIntegrityLevel; */
1231 /* IDL:         uint8 MachineId[32]; */
1232 /* IDL: } */
1233
1234 static int
1235 ntlmssp_dissect_element_Restriction_Encoding_Size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1236 {
1237         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_Restriction_Encoding_Size, 0);
1238
1239         return offset;
1240 }
1241
1242 static int
1243 ntlmssp_dissect_element_Restriction_Encoding_Z4(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1244 {
1245         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_Restriction_Encoding_Z4, 0);
1246
1247         return offset;
1248 }
1249
1250 static int
1251 ntlmssp_dissect_element_Restriction_Encoding_IntegrityLevel(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1252 {
1253         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_Restriction_Encoding_IntegrityLevel, 0);
1254
1255         return offset;
1256 }
1257
1258 static int
1259 ntlmssp_dissect_element_Restriction_Encoding_SubjectIntegrityLevel(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1260 {
1261         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_Restriction_Encoding_SubjectIntegrityLevel, 0);
1262
1263         return offset;
1264 }
1265
1266 static int
1267 ntlmssp_dissect_element_Restriction_Encoding_MachineId(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1268 {
1269         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1270         int conformant = di->conformant_run;
1271         if (!conformant) {
1272                 offset = ntlmssp_dissect_element_Restriction_Encoding_MachineId_(tvb, offset, 32, pinfo, tree, drep);
1273         }
1274
1275         return offset;
1276 }
1277
1278 static int
1279 ntlmssp_dissect_element_Restriction_Encoding_MachineId_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1280 {
1281         proto_tree_add_bytes(tree, hf_ntlmssp_Restriction_Encoding_MachineId, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1282
1283         return offset;
1284 }
1285
1286 int
1287 ntlmssp_dissect_struct_Restriction_Encoding(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_)
1288 {
1289         proto_item *item = NULL;
1290         proto_tree *tree = NULL;
1291         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1292         int old_offset;
1293
1294         ALIGN_TO_4_BYTES;
1295
1296         old_offset = offset;
1297
1298         if (parent_tree) {
1299                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1300                 tree = proto_item_add_subtree(item, ett_ntlmssp_Restriction_Encoding);
1301         }
1302         
1303         offset = ntlmssp_dissect_element_Restriction_Encoding_Size(tvb, offset, pinfo, tree, drep);
1304
1305         offset = ntlmssp_dissect_element_Restriction_Encoding_Z4(tvb, offset, pinfo, tree, drep);
1306
1307         offset = ntlmssp_dissect_element_Restriction_Encoding_IntegrityLevel(tvb, offset, pinfo, tree, drep);
1308
1309         offset = ntlmssp_dissect_element_Restriction_Encoding_SubjectIntegrityLevel(tvb, offset, pinfo, tree, drep);
1310
1311         offset = ntlmssp_dissect_element_Restriction_Encoding_MachineId(tvb, offset, pinfo, tree, drep);
1312
1313
1314         proto_item_set_len(item, offset-old_offset);
1315
1316
1317         if (di->call_data->flags & DCERPC_IS_NDR64) {
1318                 ALIGN_TO_4_BYTES;
1319         }
1320
1321         return offset;
1322 }
1323
1324
1325 /* IDL: bitmap { */
1326 /* IDL:         NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT =  0x00000001 , */
1327 /* IDL:         NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE =  0x00000002 , */
1328 /* IDL: } */
1329
1330 int
1331 ntlmssp_dissect_bitmap_AvFlags(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_)
1332 {
1333         proto_item *item = NULL;
1334         proto_tree *tree = NULL;
1335
1336         guint32 flags;
1337         ALIGN_TO_4_BYTES;
1338
1339         if (parent_tree) {
1340                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 4, DREP_ENC_INTEGER(drep));
1341                 tree = proto_item_add_subtree(item,ett_ntlmssp_ntlmssp_AvFlags);
1342         }
1343
1344         offset = dissect_ndr_uint32(tvb, offset, pinfo, NULL, drep, -1, &flags);
1345         proto_item_append_text(item, ": ");
1346
1347         if (!flags)
1348                 proto_item_append_text(item, "(No values set)");
1349
1350         proto_tree_add_boolean(tree, hf_ntlmssp_ntlmssp_AvFlags_NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT, tvb, offset-4, 4, flags);
1351         if (flags&( 0x00000001 )){
1352                 proto_item_append_text(item, "NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT");
1353                 if (flags & (~( 0x00000001 )))
1354                         proto_item_append_text(item, ", ");
1355         }
1356         flags&=(~( 0x00000001 ));
1357
1358         proto_tree_add_boolean(tree, hf_ntlmssp_ntlmssp_AvFlags_NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE, tvb, offset-4, 4, flags);
1359         if (flags&( 0x00000002 )){
1360                 proto_item_append_text(item, "NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE");
1361                 if (flags & (~( 0x00000002 )))
1362                         proto_item_append_text(item, ", ");
1363         }
1364         flags&=(~( 0x00000002 ));
1365
1366         if (flags) {
1367                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
1368         }
1369
1370         return offset;
1371 }
1372
1373
1374 /* IDL: [gensize(1)] [nodiscriminant(1)] [flag(LIBNDR_FLAG_NOALIGN)] union { */
1375 /* IDL: [case(MsvAvEOL)] [case(MsvAvEOL)] EMPTY ; */
1376 /* IDL: [case(MsvAvNbComputerName)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] [case(MsvAvNbComputerName)] string AvNbComputerName; */
1377 /* IDL: [case(MsvAvNbDomainName)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] [case(MsvAvNbDomainName)] string AvNbDomainName; */
1378 /* IDL: [case(MsvAvDnsComputerName)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] [case(MsvAvDnsComputerName)] string AvDnsComputerName; */
1379 /* IDL: [case(MsvAvDnsDomainName)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] [case(MsvAvDnsDomainName)] string AvDnsDomainName; */
1380 /* IDL: [case(MsvAvDnsTreeName)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] [case(MsvAvDnsTreeName)] string AvDnsTreeName; */
1381 /* IDL: [case(MsvAvFlags)] [case(MsvAvFlags)] ntlmssp_AvFlags AvFlags; */
1382 /* IDL: [case(MsvAvTimestamp)] [case(MsvAvTimestamp)] NTTIME AvTimestamp; */
1383 /* IDL: [case(MsAvRestrictions)] [case(MsAvRestrictions)] Restriction_Encoding AvRestrictions; */
1384 /* IDL: [case(MsvAvTargetName)] [flag(ndr_ntlmssp_negotiated_string_flags(NTLMSSP_NEGOTIATE_UNICODE))] [case(MsvAvTargetName)] string AvTargetName; */
1385 /* IDL: [case(MsvChannelBindings)] [case(MsvChannelBindings)] uint8 ChannelBindings[16]; */
1386 /* IDL: [default] ; */
1387 /* IDL: } */
1388
1389 static int
1390 ntlmssp_dissect_element_AvValue_AvNbComputerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1391 {
1392
1393         return offset;
1394 }
1395
1396 static int
1397 ntlmssp_dissect_element_AvValue_AvNbDomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1398 {
1399
1400         return offset;
1401 }
1402
1403 static int
1404 ntlmssp_dissect_element_AvValue_AvDnsComputerName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1405 {
1406
1407         return offset;
1408 }
1409
1410 static int
1411 ntlmssp_dissect_element_AvValue_AvDnsDomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1412 {
1413
1414         return offset;
1415 }
1416
1417 static int
1418 ntlmssp_dissect_element_AvValue_AvDnsTreeName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1419 {
1420
1421         return offset;
1422 }
1423
1424 static int
1425 ntlmssp_dissect_element_AvValue_AvFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1426 {
1427         offset = ntlmssp_dissect_bitmap_AvFlags(tvb, offset, pinfo, tree, drep, hf_ntlmssp_ntlmssp_AvValue_AvFlags, 0);
1428
1429         return offset;
1430 }
1431
1432 static int
1433 ntlmssp_dissect_element_AvValue_AvTimestamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1434 {
1435         offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, drep, hf_ntlmssp_ntlmssp_AvValue_AvTimestamp);
1436
1437         return offset;
1438 }
1439
1440 static int
1441 ntlmssp_dissect_element_AvValue_AvRestrictions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1442 {
1443         offset = ntlmssp_dissect_struct_Restriction_Encoding(tvb,offset,pinfo,tree,drep,hf_ntlmssp_ntlmssp_AvValue_AvRestrictions,0);
1444
1445         return offset;
1446 }
1447
1448 static int
1449 ntlmssp_dissect_element_AvValue_AvTargetName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1450 {
1451
1452         return offset;
1453 }
1454
1455 static int
1456 ntlmssp_dissect_element_AvValue_ChannelBindings(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1457 {
1458         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1459         int conformant = di->conformant_run;
1460         if (!conformant) {
1461                 offset = ntlmssp_dissect_element_AvValue_ChannelBindings_(tvb, offset, 16, pinfo, tree, drep);
1462         }
1463
1464         return offset;
1465 }
1466
1467 static int
1468 ntlmssp_dissect_element_AvValue_ChannelBindings_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1469 {
1470         proto_tree_add_bytes(tree, hf_ntlmssp_ntlmssp_AvValue_ChannelBindings, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1471
1472         return offset;
1473 }
1474
1475 static int
1476 ntlmssp_dissect_element_AvValue_blob(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1477 {
1478         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_ntlmssp_ntlmssp_AvValue_blob, 1);
1479
1480         return offset;
1481 }
1482
1483 static int
1484 ntlmssp_dissect_AvValue(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_)
1485 {
1486         proto_item *item = NULL;
1487         proto_tree *tree = NULL;
1488         int old_offset;
1489         guint32 level = param;
1490
1491         old_offset = offset;
1492         if (parent_tree) {
1493                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "ntlmssp_AvValue");
1494                 tree = proto_item_add_subtree(item, ett_ntlmssp_ntlmssp_AvValue);
1495         }
1496
1497         switch(level) {
1498                 case MsvAvEOL:
1499                 break;
1500
1501                 case MsvAvNbComputerName:
1502                         offset = ntlmssp_dissect_element_AvValue_AvNbComputerName(tvb, offset, pinfo, tree, drep);
1503                 break;
1504
1505                 case MsvAvNbDomainName:
1506                         offset = ntlmssp_dissect_element_AvValue_AvNbDomainName(tvb, offset, pinfo, tree, drep);
1507                 break;
1508
1509                 case MsvAvDnsComputerName:
1510                         offset = ntlmssp_dissect_element_AvValue_AvDnsComputerName(tvb, offset, pinfo, tree, drep);
1511                 break;
1512
1513                 case MsvAvDnsDomainName:
1514                         offset = ntlmssp_dissect_element_AvValue_AvDnsDomainName(tvb, offset, pinfo, tree, drep);
1515                 break;
1516
1517                 case MsvAvDnsTreeName:
1518                         offset = ntlmssp_dissect_element_AvValue_AvDnsTreeName(tvb, offset, pinfo, tree, drep);
1519                 break;
1520
1521                 case MsvAvFlags:
1522                         offset = ntlmssp_dissect_element_AvValue_AvFlags(tvb, offset, pinfo, tree, drep);
1523                 break;
1524
1525                 case MsvAvTimestamp:
1526                         offset = ntlmssp_dissect_element_AvValue_AvTimestamp(tvb, offset, pinfo, tree, drep);
1527                 break;
1528
1529                 case MsAvRestrictions:
1530                         offset = ntlmssp_dissect_element_AvValue_AvRestrictions(tvb, offset, pinfo, tree, drep);
1531                 break;
1532
1533                 case MsvAvTargetName:
1534                         offset = ntlmssp_dissect_element_AvValue_AvTargetName(tvb, offset, pinfo, tree, drep);
1535                 break;
1536
1537                 case MsvChannelBindings:
1538                         offset = ntlmssp_dissect_element_AvValue_ChannelBindings(tvb, offset, pinfo, tree, drep);
1539                 break;
1540
1541                 default:
1542                         offset = ntlmssp_dissect_element_AvValue_blob(tvb, offset, pinfo, tree, drep);
1543                 break;
1544         }
1545         proto_item_set_len(item, offset-old_offset);
1546
1547
1548         return offset;
1549 }
1550
1551 /* IDL: struct { */
1552 /* IDL:         ntlmssp_AvId AvId; */
1553 /* IDL:         [value(ndr_size_ntlmssp_AvValue(&r->Value,r->AvId,0))] uint16 AvLen; */
1554 /* IDL:         [subcontext_size(AvLen)] [subcontext(0)] [switch_is(AvId)] ntlmssp_AvValue Value; */
1555 /* IDL: } */
1556
1557 static int
1558 ntlmssp_dissect_element_AV_PAIR_AvId(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *AvId)
1559 {
1560         offset = ntlmssp_dissect_enum_AvId(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AV_PAIR_AvId, AvId);
1561
1562         return offset;
1563 }
1564
1565 static int
1566 ntlmssp_dissect_element_AV_PAIR_AvLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1567 {
1568         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AV_PAIR_AvLen, 0);
1569
1570         return offset;
1571 }
1572
1573 static int
1574 ntlmssp_dissect_element_AV_PAIR_Value(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *AvId)
1575 {
1576         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1577         guint0 size;
1578         int conformant = di->conformant_run;
1579         tvbuff_t *subtvb;
1580
1581         if (!conformant) {
1582                 guint32 saved_flags = di->call_data->flags;
1583                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AV_PAIR_Value_, &size);
1584                 di->call_data->flags &= ~DCERPC_IS_NDR64;
1585                 subtvb = tvb_new_subset(tvb, offset, size, -1);
1586                 ntlmssp_dissect_element_AV_PAIR_Value_(subtvb, 0, pinfo, tree, drep, AvId);
1587                 offset += size;
1588                 di->call_data->flags = saved_flags;
1589         }
1590
1591         return offset;
1592 }
1593
1594 static int
1595 ntlmssp_dissect_element_AV_PAIR_Value_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint1632 *AvId)
1596 {
1597         offset = ntlmssp_dissect_AvValue(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AV_PAIR_Value, *AvId);
1598
1599         return offset;
1600 }
1601
1602 int
1603 ntlmssp_dissect_struct_AV_PAIR(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_)
1604 {
1605         guint1632 AvId;
1606         proto_item *item = NULL;
1607         proto_tree *tree = NULL;
1608         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1609         int old_offset;
1610
1611
1612         old_offset = offset;
1613
1614         if (parent_tree) {
1615                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1616                 tree = proto_item_add_subtree(item, ett_ntlmssp_AV_PAIR);
1617         }
1618         
1619         offset = ntlmssp_dissect_element_AV_PAIR_AvId(tvb, offset, pinfo, tree, drep, &AvId);
1620
1621         offset = ntlmssp_dissect_element_AV_PAIR_AvLen(tvb, offset, pinfo, tree, drep);
1622
1623         offset = ntlmssp_dissect_element_AV_PAIR_Value(tvb, offset, pinfo, tree, drep, &AvId);
1624
1625
1626         proto_item_set_len(item, offset-old_offset);
1627
1628
1629         if (di->call_data->flags & DCERPC_IS_NDR64) {
1630                 ALIGN_TO_4_BYTES;
1631         }
1632
1633         return offset;
1634 }
1635
1636
1637 /* IDL: struct { */
1638 /* IDL:         uint32 count; */
1639 /* IDL:         AV_PAIR pair[count]; */
1640 /* IDL: } */
1641
1642 static int
1643 ntlmssp_dissect_element_AV_PAIR_LIST_count(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1644 {
1645         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AV_PAIR_LIST_count, 0);
1646
1647         return offset;
1648 }
1649
1650 static int
1651 ntlmssp_dissect_element_AV_PAIR_LIST_pair(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1652 {
1653
1654         return offset;
1655 }
1656
1657 static int
1658 ntlmssp_dissect_element_AV_PAIR_LIST_pair_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1659 {
1660         offset = ntlmssp_dissect_struct_AV_PAIR(tvb,offset,pinfo,tree,drep,hf_ntlmssp_AV_PAIR_LIST_pair,0);
1661
1662         return offset;
1663 }
1664
1665 int
1666 ntlmssp_dissect_struct_AV_PAIR_LIST(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_)
1667 {
1668         proto_item *item = NULL;
1669         proto_tree *tree = NULL;
1670         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1671         int old_offset;
1672
1673
1674         old_offset = offset;
1675
1676         if (parent_tree) {
1677                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1678                 tree = proto_item_add_subtree(item, ett_ntlmssp_AV_PAIR_LIST);
1679         }
1680         
1681         offset = ntlmssp_dissect_element_AV_PAIR_LIST_count(tvb, offset, pinfo, tree, drep);
1682
1683         offset = ntlmssp_dissect_element_AV_PAIR_LIST_pair(tvb, offset, pinfo, tree, drep);
1684
1685
1686         proto_item_set_len(item, offset-old_offset);
1687
1688
1689         if (di->call_data->flags & DCERPC_IS_NDR64) {
1690                 ALIGN_TO_4_BYTES;
1691         }
1692
1693         return offset;
1694 }
1695
1696
1697 /* IDL: struct { */
1698 /* IDL:         [value("NTLMSSP")] [charset(DOS)] uint8 Signature[8]; */
1699 /* IDL:         [value(NtLmChallenge)] ntlmssp_MessageType MessageType; */
1700 /* IDL:         [value(ndr_ntlmssp_string_length(NegotiateFlags,TargetName))] uint16 TargetNameLen; */
1701 /* IDL:         [value(TargetNameLen)] uint16 TargetNameMaxLen; */
1702 /* IDL:         [relative(1)] [subcontext_size(TargetNameLen)] [subcontext(0)] [flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] string *TargetName; */
1703 /* IDL:         NEGOTIATE NegotiateFlags; */
1704 /* IDL:         uint8 ServerChallenge[8]; */
1705 /* IDL:         uint8 Reserved[8]; */
1706 /* IDL:         [value(ndr_size_AV_PAIR_LIST(TargetInfo,ndr->flags))] uint16 TargetInfoLen; */
1707 /* IDL:         [value(TargetInfoLen)] uint16 TargetNameInfoMaxLen; */
1708 /* IDL:         [relative(1)] [subcontext_size(TargetInfoLen)] [subcontext(0)] AV_PAIR_LIST *TargetInfo; */
1709 /* IDL:         [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] ntlmssp_Version Version; */
1710 /* IDL: } */
1711
1712 static int
1713 ntlmssp_dissect_element_CHALLENGE_MESSAGE_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1714 {
1715         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1716         int conformant = di->conformant_run;
1717         if (!conformant) {
1718                 offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_Signature_(tvb, offset, 8, pinfo, tree, drep);
1719         }
1720
1721         return offset;
1722 }
1723
1724 static int
1725 ntlmssp_dissect_element_CHALLENGE_MESSAGE_Signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1726 {
1727         proto_tree_add_bytes(tree, hf_ntlmssp_CHALLENGE_MESSAGE_Signature, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1728
1729         return offset;
1730 }
1731
1732 static int
1733 ntlmssp_dissect_element_CHALLENGE_MESSAGE_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1734 {
1735         offset = ntlmssp_dissect_enum_MessageType(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_MessageType, 0);
1736
1737         return offset;
1738 }
1739
1740 static int
1741 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameLen(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_ntlmssp_CHALLENGE_MESSAGE_TargetNameLen, 0);
1744
1745         return offset;
1746 }
1747
1748 static int
1749 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1750 {
1751         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameMaxLen, 0);
1752
1753         return offset;
1754 }
1755
1756 static int
1757 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1758 {
1759         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName_, , "Pointer to Targetname (string)",hf_ntlmssp_CHALLENGE_MESSAGE_TargetName);
1760
1761         return offset;
1762 }
1763
1764 static int
1765 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1766 {
1767         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1768         guint0 size;
1769         int conformant = di->conformant_run;
1770         tvbuff_t *subtvb;
1771
1772         if (!conformant) {
1773                 guint32 saved_flags = di->call_data->flags;
1774                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_TargetName_, &size);
1775                 di->call_data->flags &= ~DCERPC_IS_NDR64;
1776                 subtvb = tvb_new_subset(tvb, offset, size, -1);
1777                 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName__(subtvb, 0, pinfo, tree, drep);
1778                 offset += size;
1779                 di->call_data->flags = saved_flags;
1780         }
1781
1782         return offset;
1783 }
1784
1785 static int
1786 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1787 {
1788
1789         return offset;
1790 }
1791
1792 static int
1793 ntlmssp_dissect_element_CHALLENGE_MESSAGE_NegotiateFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1794 {
1795         offset = ntlmssp_dissect_bitmap_NEGOTIATE(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_NegotiateFlags, 0);
1796
1797         return offset;
1798 }
1799
1800 static int
1801 ntlmssp_dissect_element_CHALLENGE_MESSAGE_ServerChallenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1802 {
1803         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1804         int conformant = di->conformant_run;
1805         if (!conformant) {
1806                 offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_ServerChallenge_(tvb, offset, 8, pinfo, tree, drep);
1807         }
1808
1809         return offset;
1810 }
1811
1812 static int
1813 ntlmssp_dissect_element_CHALLENGE_MESSAGE_ServerChallenge_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1814 {
1815         proto_tree_add_bytes(tree, hf_ntlmssp_CHALLENGE_MESSAGE_ServerChallenge, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1816
1817         return offset;
1818 }
1819
1820 static int
1821 ntlmssp_dissect_element_CHALLENGE_MESSAGE_Reserved(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1822 {
1823         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1824         int conformant = di->conformant_run;
1825         if (!conformant) {
1826                 offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_Reserved_(tvb, offset, 8, pinfo, tree, drep);
1827         }
1828
1829         return offset;
1830 }
1831
1832 static int
1833 ntlmssp_dissect_element_CHALLENGE_MESSAGE_Reserved_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1834 {
1835         proto_tree_add_bytes(tree, hf_ntlmssp_CHALLENGE_MESSAGE_Reserved, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1836
1837         return offset;
1838 }
1839
1840 static int
1841 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfoLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1842 {
1843         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfoLen, 0);
1844
1845         return offset;
1846 }
1847
1848 static int
1849 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameInfoMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1850 {
1851         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameInfoMaxLen, 0);
1852
1853         return offset;
1854 }
1855
1856 static int
1857 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1858 {
1859         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo_, , "Pointer to Targetinfo (AV_PAIR_LIST)",hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfo);
1860
1861         return offset;
1862 }
1863
1864 static int
1865 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1866 {
1867         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1868         guint0 size;
1869         int conformant = di->conformant_run;
1870         tvbuff_t *subtvb;
1871
1872         if (!conformant) {
1873                 guint32 saved_flags = di->call_data->flags;
1874                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfo_, &size);
1875                 di->call_data->flags &= ~DCERPC_IS_NDR64;
1876                 subtvb = tvb_new_subset(tvb, offset, size, -1);
1877                 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo__(subtvb, 0, pinfo, tree, drep);
1878                 offset += size;
1879                 di->call_data->flags = saved_flags;
1880         }
1881
1882         return offset;
1883 }
1884
1885 static int
1886 ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1887 {
1888         offset = ntlmssp_dissect_struct_AV_PAIR_LIST(tvb,offset,pinfo,tree,drep,hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfo,0);
1889
1890         return offset;
1891 }
1892
1893 static int
1894 ntlmssp_dissect_element_CHALLENGE_MESSAGE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *)
1895 {
1896         offset = ntlmssp_dissect_Version(tvb, offset, pinfo, tree, drep, hf_ntlmssp_CHALLENGE_MESSAGE_Version, *);
1897
1898         return offset;
1899 }
1900
1901 int
1902 ntlmssp_dissect_struct_CHALLENGE_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_)
1903 {
1904         proto_item *item = NULL;
1905         proto_tree *tree = NULL;
1906         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1907         int old_offset;
1908
1909         ALIGN_TO_5_BYTES;
1910
1911         old_offset = offset;
1912
1913         if (parent_tree) {
1914                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1915                 tree = proto_item_add_subtree(item, ett_ntlmssp_CHALLENGE_MESSAGE);
1916         }
1917         
1918         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_Signature(tvb, offset, pinfo, tree, drep);
1919
1920         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_MessageType(tvb, offset, pinfo, tree, drep);
1921
1922         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameLen(tvb, offset, pinfo, tree, drep);
1923
1924         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameMaxLen(tvb, offset, pinfo, tree, drep);
1925
1926         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetName(tvb, offset, pinfo, tree, drep);
1927
1928         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_NegotiateFlags(tvb, offset, pinfo, tree, drep);
1929
1930         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_ServerChallenge(tvb, offset, pinfo, tree, drep);
1931
1932         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_Reserved(tvb, offset, pinfo, tree, drep);
1933
1934         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfoLen(tvb, offset, pinfo, tree, drep);
1935
1936         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetNameInfoMaxLen(tvb, offset, pinfo, tree, drep);
1937
1938         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_TargetInfo(tvb, offset, pinfo, tree, drep);
1939
1940         offset = ntlmssp_dissect_element_CHALLENGE_MESSAGE_Version(tvb, offset, pinfo, tree, drep, &);
1941
1942
1943         proto_item_set_len(item, offset-old_offset);
1944
1945
1946         if (di->call_data->flags & DCERPC_IS_NDR64) {
1947                 ALIGN_TO_5_BYTES;
1948         }
1949
1950         return offset;
1951 }
1952
1953
1954 /* IDL: struct { */
1955 /* IDL:         uint8 Response[24]; */
1956 /* IDL: } */
1957
1958 static int
1959 ntlmssp_dissect_element_LM_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1960 {
1961         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
1962         int conformant = di->conformant_run;
1963         if (!conformant) {
1964                 offset = ntlmssp_dissect_element_LM_RESPONSE_Response_(tvb, offset, 24, pinfo, tree, drep);
1965         }
1966
1967         return offset;
1968 }
1969
1970 static int
1971 ntlmssp_dissect_element_LM_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1972 {
1973         proto_tree_add_bytes(tree, hf_ntlmssp_LM_RESPONSE_Response, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
1974
1975         return offset;
1976 }
1977
1978 int
1979 ntlmssp_dissect_struct_LM_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_)
1980 {
1981         proto_item *item = NULL;
1982         proto_tree *tree = NULL;
1983         int old_offset;
1984
1985
1986         old_offset = offset;
1987
1988         if (parent_tree) {
1989                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1990                 tree = proto_item_add_subtree(item, ett_ntlmssp_LM_RESPONSE);
1991         }
1992         
1993         offset = ntlmssp_dissect_element_LM_RESPONSE_Response(tvb, offset, pinfo, tree, drep);
1994
1995
1996         proto_item_set_len(item, offset-old_offset);
1997
1998
1999         return offset;
2000 }
2001
2002
2003 /* IDL: struct { */
2004 /* IDL:         uint8 Response[16]; */
2005 /* IDL:         uint8 ChallengeFromClient[8]; */
2006 /* IDL: } */
2007
2008 static int
2009 ntlmssp_dissect_element_LMv2_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2010 {
2011         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2012         int conformant = di->conformant_run;
2013         if (!conformant) {
2014                 offset = ntlmssp_dissect_element_LMv2_RESPONSE_Response_(tvb, offset, 16, pinfo, tree, drep);
2015         }
2016
2017         return offset;
2018 }
2019
2020 static int
2021 ntlmssp_dissect_element_LMv2_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2022 {
2023         proto_tree_add_bytes(tree, hf_ntlmssp_LMv2_RESPONSE_Response, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2024
2025         return offset;
2026 }
2027
2028 static int
2029 ntlmssp_dissect_element_LMv2_RESPONSE_ChallengeFromClient(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2030 {
2031         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2032         int conformant = di->conformant_run;
2033         if (!conformant) {
2034                 offset = ntlmssp_dissect_element_LMv2_RESPONSE_ChallengeFromClient_(tvb, offset, 8, pinfo, tree, drep);
2035         }
2036
2037         return offset;
2038 }
2039
2040 static int
2041 ntlmssp_dissect_element_LMv2_RESPONSE_ChallengeFromClient_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2042 {
2043         proto_tree_add_bytes(tree, hf_ntlmssp_LMv2_RESPONSE_ChallengeFromClient, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2044
2045         return offset;
2046 }
2047
2048 int
2049 ntlmssp_dissect_struct_LMv2_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_)
2050 {
2051         proto_item *item = NULL;
2052         proto_tree *tree = NULL;
2053         int old_offset;
2054
2055
2056         old_offset = offset;
2057
2058         if (parent_tree) {
2059                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2060                 tree = proto_item_add_subtree(item, ett_ntlmssp_LMv2_RESPONSE);
2061         }
2062         
2063         offset = ntlmssp_dissect_element_LMv2_RESPONSE_Response(tvb, offset, pinfo, tree, drep);
2064
2065         offset = ntlmssp_dissect_element_LMv2_RESPONSE_ChallengeFromClient(tvb, offset, pinfo, tree, drep);
2066
2067
2068         proto_item_set_len(item, offset-old_offset);
2069
2070
2071         return offset;
2072 }
2073
2074
2075 /* IDL: [nodiscriminant(1)] union { */
2076 /* IDL: [case(24)] [case(24)] LM_RESPONSE v1; */
2077 /* IDL: [default] ; */
2078 /* IDL: } */
2079
2080 static int
2081 ntlmssp_dissect_element_LM_RESPONSE_v1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2082 {
2083         offset = ntlmssp_dissect_struct_LM_RESPONSE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_ntlmssp_LM_RESPONSE_v1,0);
2084
2085         return offset;
2086 }
2087
2088 static int
2089 ntlmssp_dissect_LM_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_)
2090 {
2091         proto_item *item = NULL;
2092         proto_tree *tree = NULL;
2093         int old_offset;
2094         guint32 level = param;
2095
2096         old_offset = offset;
2097         if (parent_tree) {
2098                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "ntlmssp_LM_RESPONSE");
2099                 tree = proto_item_add_subtree(item, ett_ntlmssp_ntlmssp_LM_RESPONSE);
2100         }
2101
2102         switch(level) {
2103                 case 24:
2104                         offset = ntlmssp_dissect_element_LM_RESPONSE_v1(tvb, offset, pinfo, tree, drep);
2105                 break;
2106
2107                 default:
2108                 break;
2109         }
2110         proto_item_set_len(item, offset-old_offset);
2111
2112
2113         return offset;
2114 }
2115
2116 /* IDL: struct { */
2117 /* IDL:         uint8 Response[24]; */
2118 /* IDL: } */
2119
2120 static int
2121 ntlmssp_dissect_element_NTLM_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2122 {
2123         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2124         int conformant = di->conformant_run;
2125         if (!conformant) {
2126                 offset = ntlmssp_dissect_element_NTLM_RESPONSE_Response_(tvb, offset, 24, pinfo, tree, drep);
2127         }
2128
2129         return offset;
2130 }
2131
2132 static int
2133 ntlmssp_dissect_element_NTLM_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2134 {
2135         proto_tree_add_bytes(tree, hf_ntlmssp_NTLM_RESPONSE_Response, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2136
2137         return offset;
2138 }
2139
2140 int
2141 ntlmssp_dissect_struct_NTLM_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_)
2142 {
2143         proto_item *item = NULL;
2144         proto_tree *tree = NULL;
2145         int old_offset;
2146
2147
2148         old_offset = offset;
2149
2150         if (parent_tree) {
2151                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2152                 tree = proto_item_add_subtree(item, ett_ntlmssp_NTLM_RESPONSE);
2153         }
2154         
2155         offset = ntlmssp_dissect_element_NTLM_RESPONSE_Response(tvb, offset, pinfo, tree, drep);
2156
2157
2158         proto_item_set_len(item, offset-old_offset);
2159
2160
2161         return offset;
2162 }
2163
2164
2165 /* IDL: struct { */
2166 /* IDL:         [value(1)] uint8 RespType; */
2167 /* IDL:         [value(1)] uint8 HiRespType; */
2168 /* IDL:         uint16 Reserved1; */
2169 /* IDL:         uint32 Reserved2; */
2170 /* IDL:         NTTIME TimeStamp; */
2171 /* IDL:         uint8 ChallengeFromClient[8]; */
2172 /* IDL:         uint32 Reserved3; */
2173 /* IDL:         [subcontext(0)] [flag(LIBNDR_FLAG_REMAINING)] AV_PAIR_LIST AvPairs; */
2174 /* IDL: } */
2175
2176 static int
2177 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_RespType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2178 {
2179         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_RespType, 0);
2180
2181         return offset;
2182 }
2183
2184 static int
2185 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_HiRespType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2186 {
2187         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_HiRespType, 0);
2188
2189         return offset;
2190 }
2191
2192 static int
2193 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2194 {
2195         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved1, 0);
2196
2197         return offset;
2198 }
2199
2200 static int
2201 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2202 {
2203         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved2, 0);
2204
2205         return offset;
2206 }
2207
2208 static int
2209 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_TimeStamp(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2210 {
2211         offset = dissect_ndr_nt_NTTIME(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_TimeStamp);
2212
2213         return offset;
2214 }
2215
2216 static int
2217 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2218 {
2219         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2220         int conformant = di->conformant_run;
2221         if (!conformant) {
2222                 offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient_(tvb, offset, 8, pinfo, tree, drep);
2223         }
2224
2225         return offset;
2226 }
2227
2228 static int
2229 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2230 {
2231         proto_tree_add_bytes(tree, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2232
2233         return offset;
2234 }
2235
2236 static int
2237 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved3(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2238 {
2239         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved3, 0);
2240
2241         return offset;
2242 }
2243
2244 static int
2245 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_AvPairs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2246 {
2247         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2248         guint0 size;
2249         int conformant = di->conformant_run;
2250         tvbuff_t *subtvb;
2251
2252         if (!conformant) {
2253                 guint32 saved_flags = di->call_data->flags;
2254                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_AvPairs_, &size);
2255                 di->call_data->flags &= ~DCERPC_IS_NDR64;
2256                 subtvb = tvb_new_subset(tvb, offset, size, -1);
2257                 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_AvPairs_(subtvb, 0, pinfo, tree, drep);
2258                 offset += size;
2259                 di->call_data->flags = saved_flags;
2260         }
2261
2262         return offset;
2263 }
2264
2265 static int
2266 ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_AvPairs_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2267 {
2268         offset = ntlmssp_dissect_struct_AV_PAIR_LIST(tvb,offset,pinfo,tree,drep,hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_AvPairs,0);
2269
2270         return offset;
2271 }
2272
2273 int
2274 ntlmssp_dissect_struct_NTLMv2_CLIENT_CHALLENGE(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_)
2275 {
2276         proto_item *item = NULL;
2277         proto_tree *tree = NULL;
2278         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2279         int old_offset;
2280
2281         ALIGN_TO_4_BYTES;
2282
2283         old_offset = offset;
2284
2285         if (parent_tree) {
2286                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2287                 tree = proto_item_add_subtree(item, ett_ntlmssp_NTLMv2_CLIENT_CHALLENGE);
2288         }
2289         
2290         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_RespType(tvb, offset, pinfo, tree, drep);
2291
2292         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_HiRespType(tvb, offset, pinfo, tree, drep);
2293
2294         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved1(tvb, offset, pinfo, tree, drep);
2295
2296         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved2(tvb, offset, pinfo, tree, drep);
2297
2298         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_TimeStamp(tvb, offset, pinfo, tree, drep);
2299
2300         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient(tvb, offset, pinfo, tree, drep);
2301
2302         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_Reserved3(tvb, offset, pinfo, tree, drep);
2303
2304         offset = ntlmssp_dissect_element_NTLMv2_CLIENT_CHALLENGE_AvPairs(tvb, offset, pinfo, tree, drep);
2305
2306
2307         proto_item_set_len(item, offset-old_offset);
2308
2309
2310         if (di->call_data->flags & DCERPC_IS_NDR64) {
2311                 ALIGN_TO_4_BYTES;
2312         }
2313
2314         return offset;
2315 }
2316
2317
2318 /* IDL: struct { */
2319 /* IDL:         uint8 Response[16]; */
2320 /* IDL:         NTLMv2_CLIENT_CHALLENGE Challenge; */
2321 /* IDL: } */
2322
2323 static int
2324 ntlmssp_dissect_element_NTLMv2_RESPONSE_Response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2325 {
2326         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2327         int conformant = di->conformant_run;
2328         if (!conformant) {
2329                 offset = ntlmssp_dissect_element_NTLMv2_RESPONSE_Response_(tvb, offset, 16, pinfo, tree, drep);
2330         }
2331
2332         return offset;
2333 }
2334
2335 static int
2336 ntlmssp_dissect_element_NTLMv2_RESPONSE_Response_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2337 {
2338         proto_tree_add_bytes(tree, hf_ntlmssp_NTLMv2_RESPONSE_Response, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2339
2340         return offset;
2341 }
2342
2343 static int
2344 ntlmssp_dissect_element_NTLMv2_RESPONSE_Challenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2345 {
2346         offset = ntlmssp_dissect_struct_NTLMv2_CLIENT_CHALLENGE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_NTLMv2_RESPONSE_Challenge,0);
2347
2348         return offset;
2349 }
2350
2351 int
2352 ntlmssp_dissect_struct_NTLMv2_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_)
2353 {
2354         proto_item *item = NULL;
2355         proto_tree *tree = NULL;
2356         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2357         int old_offset;
2358
2359         ALIGN_TO_4_BYTES;
2360
2361         old_offset = offset;
2362
2363         if (parent_tree) {
2364                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2365                 tree = proto_item_add_subtree(item, ett_ntlmssp_NTLMv2_RESPONSE);
2366         }
2367         
2368         offset = ntlmssp_dissect_element_NTLMv2_RESPONSE_Response(tvb, offset, pinfo, tree, drep);
2369
2370         offset = ntlmssp_dissect_element_NTLMv2_RESPONSE_Challenge(tvb, offset, pinfo, tree, drep);
2371
2372
2373         proto_item_set_len(item, offset-old_offset);
2374
2375
2376         if (di->call_data->flags & DCERPC_IS_NDR64) {
2377                 ALIGN_TO_4_BYTES;
2378         }
2379
2380         return offset;
2381 }
2382
2383
2384 /* IDL: [public(1)] [nodiscriminant(1)] union { */
2385 /* IDL: [case(0)] [case(0)] EMPTY ; */
2386 /* IDL: [case(0x18)] [case(0x18)] NTLM_RESPONSE v1; */
2387 /* IDL: [default] ; */
2388 /* IDL: } */
2389
2390 static int
2391 ntlmssp_dissect_element_NTLM_RESPONSE_v1(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2392 {
2393         offset = ntlmssp_dissect_struct_NTLM_RESPONSE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_ntlmssp_NTLM_RESPONSE_v1,0);
2394
2395         return offset;
2396 }
2397
2398 static int
2399 ntlmssp_dissect_element_NTLM_RESPONSE_v2(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2400 {
2401         offset = ntlmssp_dissect_struct_NTLMv2_RESPONSE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_ntlmssp_NTLM_RESPONSE_v2,0);
2402
2403         return offset;
2404 }
2405
2406 static int
2407 ntlmssp_dissect_NTLM_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_)
2408 {
2409         proto_item *item = NULL;
2410         proto_tree *tree = NULL;
2411         int old_offset;
2412         guint32 level = param;
2413
2414         old_offset = offset;
2415         if (parent_tree) {
2416                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "ntlmssp_NTLM_RESPONSE");
2417                 tree = proto_item_add_subtree(item, ett_ntlmssp_ntlmssp_NTLM_RESPONSE);
2418         }
2419
2420         switch(level) {
2421                 case 0:
2422                 break;
2423
2424                 case 0x18:
2425                         offset = ntlmssp_dissect_element_NTLM_RESPONSE_v1(tvb, offset, pinfo, tree, drep);
2426                 break;
2427
2428                 default:
2429                         offset = ntlmssp_dissect_element_NTLM_RESPONSE_v2(tvb, offset, pinfo, tree, drep);
2430                 break;
2431         }
2432         proto_item_set_len(item, offset-old_offset);
2433
2434
2435         return offset;
2436 }
2437
2438 /* IDL: struct { */
2439 /* IDL:         uint8 MIC[16]; */
2440 /* IDL: } */
2441
2442 static int
2443 ntlmssp_dissect_element_MIC_MIC(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2444 {
2445         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2446         int conformant = di->conformant_run;
2447         if (!conformant) {
2448                 offset = ntlmssp_dissect_element_MIC_MIC_(tvb, offset, 16, pinfo, tree, drep);
2449         }
2450
2451         return offset;
2452 }
2453
2454 static int
2455 ntlmssp_dissect_element_MIC_MIC_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2456 {
2457         proto_tree_add_bytes(tree, hf_ntlmssp_MIC_MIC, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2458
2459         return offset;
2460 }
2461
2462 int
2463 ntlmssp_dissect_struct_MIC(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_)
2464 {
2465         proto_item *item = NULL;
2466         proto_tree *tree = NULL;
2467         int old_offset;
2468
2469
2470         old_offset = offset;
2471
2472         if (parent_tree) {
2473                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2474                 tree = proto_item_add_subtree(item, ett_ntlmssp_MIC);
2475         }
2476         
2477         offset = ntlmssp_dissect_element_MIC_MIC(tvb, offset, pinfo, tree, drep);
2478
2479
2480         proto_item_set_len(item, offset-old_offset);
2481
2482
2483         return offset;
2484 }
2485
2486
2487 /* IDL: struct { */
2488 /* IDL:         [value("NTLMSSP")] [charset(DOS)] uint8 Signature[8]; */
2489 /* IDL:         [value(NtLmAuthenticate)] ntlmssp_MessageType MessageType; */
2490 /* IDL:         uint16 LmChallengeResponseLen; */
2491 /* IDL:         [value(LmChallengeResponseLen)] uint16 LmChallengeResponseMaxLen; */
2492 /* IDL:         [relative(1)] [subcontext_size(LmChallengeResponseLen)] [subcontext(0)] [switch_is(LmChallengeResponseLen)] ntlmssp_LM_RESPONSE *LmChallengeResponse; */
2493 /* IDL:         uint16 NtChallengeResponseLen; */
2494 /* IDL:         [value(NtChallengeResponseLen)] uint16 NtChallengeResponseMaxLen; */
2495 /* IDL:         [relative(1)] [subcontext_size(NtChallengeResponseMaxLen)] [subcontext(0)] [switch_is(NtChallengeResponseLen)] ntlmssp_NTLM_RESPONSE *NtChallengeResponse; */
2496 /* IDL:         [value(ndr_ntlmssp_string_length(NegotiateFlags,DomainName))] uint16 DomainNameLen; */
2497 /* IDL:         [value(DomainNameLen)] uint16 DomainNameMaxLen; */
2498 /* IDL:         [relative(1)] [subcontext_size(DomainNameLen)] [subcontext(0)] [flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] string *DomainName; */
2499 /* IDL:         [value(ndr_ntlmssp_string_length(NegotiateFlags,UserName))] uint16 UserNameLen; */
2500 /* IDL:         [value(UserNameLen)] uint16 UserNameMaxLen; */
2501 /* IDL:         [relative(1)] [subcontext_size(UserNameLen)] [subcontext(0)] [flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] string *UserName; */
2502 /* IDL:         [value(ndr_ntlmssp_string_length(NegotiateFlags,Workstation))] uint16 WorkstationLen; */
2503 /* IDL:         [value(WorkstationLen)] uint16 WorkstationMaxLen; */
2504 /* IDL:         [relative(1)] [subcontext_size(WorkstationLen)] [subcontext(0)] [flag(ndr_ntlmssp_negotiated_string_flags(r->NegotiateFlags))] string *Workstation; */
2505 /* IDL:         [value(EncryptedRandomSessionKey->length)] uint16 EncryptedRandomSessionKeyLen; */
2506 /* IDL:         [value(EncryptedRandomSessionKeyLen)] uint16 EncryptedRandomSessionKeyMaxLen; */
2507 /* IDL:         [relative(1)] [subcontext_size(EncryptedRandomSessionKeyLen)] [subcontext(0)] DATA_BLOB *EncryptedRandomSessionKey; */
2508 /* IDL:         NEGOTIATE NegotiateFlags; */
2509 /* IDL:         [switch_is(NegotiateFlags&NTLMSSP_NEGOTIATE_VERSION)] ntlmssp_Version Version; */
2510 /* IDL: } */
2511
2512 static int
2513 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Signature(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2514 {
2515         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2516         int conformant = di->conformant_run;
2517         if (!conformant) {
2518                 offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Signature_(tvb, offset, 8, pinfo, tree, drep);
2519         }
2520
2521         return offset;
2522 }
2523
2524 static int
2525 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Signature_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2526 {
2527         proto_tree_add_bytes(tree, hf_ntlmssp_AUTHENTICATE_MESSAGE_Signature, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
2528
2529         return offset;
2530 }
2531
2532 static int
2533 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_MessageType(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2534 {
2535         offset = ntlmssp_dissect_enum_MessageType(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_MessageType, 0);
2536
2537         return offset;
2538 }
2539
2540 static int
2541 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponseLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen)
2542 {
2543         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponseLen, LmChallengeResponseLen);
2544
2545         return offset;
2546 }
2547
2548 static int
2549 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponseMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2550 {
2551         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponseMaxLen, 0);
2552
2553         return offset;
2554 }
2555
2556 static int
2557 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen)
2558 {
2559         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse_, , "Pointer to Lmchallengeresponse (ntlmssp_LM_RESPONSE)",hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponse);
2560
2561         return offset;
2562 }
2563
2564 static int
2565 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen)
2566 {
2567         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2568         guint0 size;
2569         int conformant = di->conformant_run;
2570         tvbuff_t *subtvb;
2571
2572         if (!conformant) {
2573                 guint32 saved_flags = di->call_data->flags;
2574                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponse_, &size);
2575                 di->call_data->flags &= ~DCERPC_IS_NDR64;
2576                 subtvb = tvb_new_subset(tvb, offset, size, -1);
2577                 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse__(subtvb, 0, pinfo, tree, drep, LmChallengeResponseLen);
2578                 offset += size;
2579                 di->call_data->flags = saved_flags;
2580         }
2581
2582         return offset;
2583 }
2584
2585 static int
2586 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *LmChallengeResponseLen)
2587 {
2588         offset = ntlmssp_dissect_LM_RESPONSE(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponse, *LmChallengeResponseLen);
2589
2590         return offset;
2591 }
2592
2593 static int
2594 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponseLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen)
2595 {
2596         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponseLen, NtChallengeResponseLen);
2597
2598         return offset;
2599 }
2600
2601 static int
2602 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponseMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2603 {
2604         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponseMaxLen, 0);
2605
2606         return offset;
2607 }
2608
2609 static int
2610 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen)
2611 {
2612         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse_, , "Pointer to Ntchallengeresponse (ntlmssp_NTLM_RESPONSE)",hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponse);
2613
2614         return offset;
2615 }
2616
2617 static int
2618 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen)
2619 {
2620         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2621         guint0 size;
2622         int conformant = di->conformant_run;
2623         tvbuff_t *subtvb;
2624
2625         if (!conformant) {
2626                 guint32 saved_flags = di->call_data->flags;
2627                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponse_, &size);
2628                 di->call_data->flags &= ~DCERPC_IS_NDR64;
2629                 subtvb = tvb_new_subset(tvb, offset, size, -1);
2630                 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse__(subtvb, 0, pinfo, tree, drep, NtChallengeResponseLen);
2631                 offset += size;
2632                 di->call_data->flags = saved_flags;
2633         }
2634
2635         return offset;
2636 }
2637
2638 static int
2639 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *NtChallengeResponseLen)
2640 {
2641         offset = ntlmssp_dissect_NTLM_RESPONSE(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponse, *NtChallengeResponseLen);
2642
2643         return offset;
2644 }
2645
2646 static int
2647 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainNameLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2648 {
2649         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainNameLen, 0);
2650
2651         return offset;
2652 }
2653
2654 static int
2655 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2656 {
2657         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainNameMaxLen, 0);
2658
2659         return offset;
2660 }
2661
2662 static int
2663 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2664 {
2665         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName_, , "Pointer to Domainname (string)",hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainName);
2666
2667         return offset;
2668 }
2669
2670 static int
2671 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2672 {
2673         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2674         guint0 size;
2675         int conformant = di->conformant_run;
2676         tvbuff_t *subtvb;
2677
2678         if (!conformant) {
2679                 guint32 saved_flags = di->call_data->flags;
2680                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainName_, &size);
2681                 di->call_data->flags &= ~DCERPC_IS_NDR64;
2682                 subtvb = tvb_new_subset(tvb, offset, size, -1);
2683                 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName__(subtvb, 0, pinfo, tree, drep);
2684                 offset += size;
2685                 di->call_data->flags = saved_flags;
2686         }
2687
2688         return offset;
2689 }
2690
2691 static int
2692 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2693 {
2694
2695         return offset;
2696 }
2697
2698 static int
2699 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserNameLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2700 {
2701         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_UserNameLen, 0);
2702
2703         return offset;
2704 }
2705
2706 static int
2707 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserNameMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2708 {
2709         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_UserNameMaxLen, 0);
2710
2711         return offset;
2712 }
2713
2714 static int
2715 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2716 {
2717         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName_, , "Pointer to Username (string)",hf_ntlmssp_AUTHENTICATE_MESSAGE_UserName);
2718
2719         return offset;
2720 }
2721
2722 static int
2723 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2724 {
2725         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2726         guint0 size;
2727         int conformant = di->conformant_run;
2728         tvbuff_t *subtvb;
2729
2730         if (!conformant) {
2731                 guint32 saved_flags = di->call_data->flags;
2732                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_UserName_, &size);
2733                 di->call_data->flags &= ~DCERPC_IS_NDR64;
2734                 subtvb = tvb_new_subset(tvb, offset, size, -1);
2735                 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName__(subtvb, 0, pinfo, tree, drep);
2736                 offset += size;
2737                 di->call_data->flags = saved_flags;
2738         }
2739
2740         return offset;
2741 }
2742
2743 static int
2744 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2745 {
2746
2747         return offset;
2748 }
2749
2750 static int
2751 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_WorkstationLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2752 {
2753         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_WorkstationLen, 0);
2754
2755         return offset;
2756 }
2757
2758 static int
2759 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_WorkstationMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2760 {
2761         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_WorkstationMaxLen, 0);
2762
2763         return offset;
2764 }
2765
2766 static int
2767 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2768 {
2769         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation_, , "Pointer to Workstation (string)",hf_ntlmssp_AUTHENTICATE_MESSAGE_Workstation);
2770
2771         return offset;
2772 }
2773
2774 static int
2775 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2776 {
2777         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2778         guint0 size;
2779         int conformant = di->conformant_run;
2780         tvbuff_t *subtvb;
2781
2782         if (!conformant) {
2783                 guint32 saved_flags = di->call_data->flags;
2784                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_Workstation_, &size);
2785                 di->call_data->flags &= ~DCERPC_IS_NDR64;
2786                 subtvb = tvb_new_subset(tvb, offset, size, -1);
2787                 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation__(subtvb, 0, pinfo, tree, drep);
2788                 offset += size;
2789                 di->call_data->flags = saved_flags;
2790         }
2791
2792         return offset;
2793 }
2794
2795 static int
2796 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2797 {
2798
2799         return offset;
2800 }
2801
2802 static int
2803 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2804 {
2805         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyLen, 0);
2806
2807         return offset;
2808 }
2809
2810 static int
2811 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyMaxLen(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2812 {
2813         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyMaxLen, 0);
2814
2815         return offset;
2816 }
2817
2818 static int
2819 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2820 {
2821         offset = dissect_ndr_embedded_pointer(tvb, offset, pinfo, tree, drep, ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey_, , "Pointer to Encryptedrandomsessionkey (DATA_BLOB)",hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey);
2822
2823         return offset;
2824 }
2825
2826 static int
2827 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2828 {
2829         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
2830         guint0 size;
2831         int conformant = di->conformant_run;
2832         tvbuff_t *subtvb;
2833
2834         if (!conformant) {
2835                 guint32 saved_flags = di->call_data->flags;
2836                 offset = dissect_ndr_uint0(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey_, &size);
2837                 di->call_data->flags &= ~DCERPC_IS_NDR64;
2838                 subtvb = tvb_new_subset(tvb, offset, size, -1);
2839                 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey__(subtvb, 0, pinfo, tree, drep);
2840                 offset += size;
2841                 di->call_data->flags = saved_flags;
2842         }
2843
2844         return offset;
2845 }
2846
2847 static int
2848 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey__(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2849 {
2850         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey, 0);
2851
2852         return offset;
2853 }
2854
2855 static int
2856 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NegotiateFlags(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2857 {
2858         offset = ntlmssp_dissect_bitmap_NEGOTIATE(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_NegotiateFlags, 0);
2859
2860         return offset;
2861 }
2862
2863 static int
2864 ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint32 *)
2865 {
2866         offset = ntlmssp_dissect_Version(tvb, offset, pinfo, tree, drep, hf_ntlmssp_AUTHENTICATE_MESSAGE_Version, *);
2867
2868         return offset;
2869 }
2870
2871 int
2872 ntlmssp_dissect_struct_AUTHENTICATE_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_)
2873 {
2874         guint16 LmChallengeResponseLen;
2875         guint16 NtChallengeResponseLen;
2876         proto_item *item = NULL;
2877         proto_tree *tree = NULL;
2878         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2879         int old_offset;
2880
2881         ALIGN_TO_5_BYTES;
2882
2883         old_offset = offset;
2884
2885         if (parent_tree) {
2886                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2887                 tree = proto_item_add_subtree(item, ett_ntlmssp_AUTHENTICATE_MESSAGE);
2888         }
2889         
2890         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Signature(tvb, offset, pinfo, tree, drep);
2891
2892         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_MessageType(tvb, offset, pinfo, tree, drep);
2893
2894         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponseLen(tvb, offset, pinfo, tree, drep, &LmChallengeResponseLen);
2895
2896         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponseMaxLen(tvb, offset, pinfo, tree, drep);
2897
2898         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_LmChallengeResponse(tvb, offset, pinfo, tree, drep, &LmChallengeResponseLen);
2899
2900         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponseLen(tvb, offset, pinfo, tree, drep, &NtChallengeResponseLen);
2901
2902         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponseMaxLen(tvb, offset, pinfo, tree, drep);
2903
2904         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NtChallengeResponse(tvb, offset, pinfo, tree, drep, &NtChallengeResponseLen);
2905
2906         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainNameLen(tvb, offset, pinfo, tree, drep);
2907
2908         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainNameMaxLen(tvb, offset, pinfo, tree, drep);
2909
2910         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_DomainName(tvb, offset, pinfo, tree, drep);
2911
2912         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserNameLen(tvb, offset, pinfo, tree, drep);
2913
2914         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserNameMaxLen(tvb, offset, pinfo, tree, drep);
2915
2916         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_UserName(tvb, offset, pinfo, tree, drep);
2917
2918         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_WorkstationLen(tvb, offset, pinfo, tree, drep);
2919
2920         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_WorkstationMaxLen(tvb, offset, pinfo, tree, drep);
2921
2922         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Workstation(tvb, offset, pinfo, tree, drep);
2923
2924         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyLen(tvb, offset, pinfo, tree, drep);
2925
2926         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyMaxLen(tvb, offset, pinfo, tree, drep);
2927
2928         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey(tvb, offset, pinfo, tree, drep);
2929
2930         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_NegotiateFlags(tvb, offset, pinfo, tree, drep);
2931
2932         offset = ntlmssp_dissect_element_AUTHENTICATE_MESSAGE_Version(tvb, offset, pinfo, tree, drep, &);
2933
2934
2935         proto_item_set_len(item, offset-old_offset);
2936
2937
2938         if (di->call_data->flags & DCERPC_IS_NDR64) {
2939                 ALIGN_TO_5_BYTES;
2940         }
2941
2942         return offset;
2943 }
2944
2945
2946 /* IDL: struct { */
2947 /* IDL:         [value(NTLMSSP_SIGN_VERSION)] uint32 Version; */
2948 /* IDL:         uint32 RandomPad; */
2949 /* IDL:         uint32 Checksum; */
2950 /* IDL:         uint32 SeqNum; */
2951 /* IDL: } */
2952
2953 static int
2954 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2955 {
2956         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_Version, 0);
2957
2958         return offset;
2959 }
2960
2961 static int
2962 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_RandomPad(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2963 {
2964         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_RandomPad, 0);
2965
2966         return offset;
2967 }
2968
2969 static int
2970 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_Checksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2971 {
2972         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_Checksum, 0);
2973
2974         return offset;
2975 }
2976
2977 static int
2978 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_SeqNum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2979 {
2980         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_SeqNum, 0);
2981
2982         return offset;
2983 }
2984
2985 int
2986 ntlmssp_dissect_struct_NTLMSSP_MESSAGE_SIGNATURE(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_)
2987 {
2988         proto_item *item = NULL;
2989         proto_tree *tree = NULL;
2990         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2991         int old_offset;
2992
2993         ALIGN_TO_4_BYTES;
2994
2995         old_offset = offset;
2996
2997         if (parent_tree) {
2998                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2999                 tree = proto_item_add_subtree(item, ett_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE);
3000         }
3001         
3002         offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_Version(tvb, offset, pinfo, tree, drep);
3003
3004         offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_RandomPad(tvb, offset, pinfo, tree, drep);
3005
3006         offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_Checksum(tvb, offset, pinfo, tree, drep);
3007
3008         offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_SeqNum(tvb, offset, pinfo, tree, drep);
3009
3010
3011         proto_item_set_len(item, offset-old_offset);
3012
3013
3014         if (di->call_data->flags & DCERPC_IS_NDR64) {
3015                 ALIGN_TO_4_BYTES;
3016         }
3017
3018         return offset;
3019 }
3020
3021
3022 /* IDL: struct { */
3023 /* IDL:         [value(NTLMSSP_SIGN_VERSION)] uint32 Version; */
3024 /* IDL:         uint8 Checksum[8]; */
3025 /* IDL:         uint32 SeqNum; */
3026 /* IDL: } */
3027
3028 static int
3029 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Version(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3030 {
3031         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Version, 0);
3032
3033         return offset;
3034 }
3035
3036 static int
3037 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3038 {
3039         dcerpc_info *di = (dcerpc_info*)pinfo->private_data;
3040         int conformant = di->conformant_run;
3041         if (!conformant) {
3042                 offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum_(tvb, offset, 8, pinfo, tree, drep);
3043         }
3044
3045         return offset;
3046 }
3047
3048 static int
3049 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum_(tvbuff_t *tvb _U_, int offset _U_,int length _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3050 {
3051         proto_tree_add_bytes(tree, hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum, tvb, offset, length, tvb_get_ptr(tvb, offset,length)); offset += length;
3052
3053         return offset;
3054 }
3055
3056 static int
3057 ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_SeqNum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3058 {
3059         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_SeqNum, 0);
3060
3061         return offset;
3062 }
3063
3064 int
3065 ntlmssp_dissect_struct_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2(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_)
3066 {
3067         proto_item *item = NULL;
3068         proto_tree *tree = NULL;
3069         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
3070         int old_offset;
3071
3072         ALIGN_TO_4_BYTES;
3073
3074         old_offset = offset;
3075
3076         if (parent_tree) {
3077                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
3078                 tree = proto_item_add_subtree(item, ett_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2);
3079         }
3080         
3081         offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Version(tvb, offset, pinfo, tree, drep);
3082
3083         offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum(tvb, offset, pinfo, tree, drep);
3084
3085         offset = ntlmssp_dissect_element_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_SeqNum(tvb, offset, pinfo, tree, drep);
3086
3087
3088         proto_item_set_len(item, offset-old_offset);
3089
3090
3091         if (di->call_data->flags & DCERPC_IS_NDR64) {
3092                 ALIGN_TO_4_BYTES;
3093         }
3094
3095         return offset;
3096 }
3097
3098 static int
3099 ntlmssp_dissect_element_decode_NEGOTIATE_MESSAGE_negotiate(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3100 {
3101         offset = ntlmssp_dissect_struct_NEGOTIATE_MESSAGE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_decode_NEGOTIATE_MESSAGE_negotiate,0);
3102
3103         return offset;
3104 }
3105
3106 /* IDL: void decode_NEGOTIATE_MESSAGE( */
3107 /* IDL: [in] NEGOTIATE_MESSAGE negotiate */
3108 /* IDL: ); */
3109
3110 static int
3111 ntlmssp_dissect_decode_NEGOTIATE_MESSAGE_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3112 {
3113         pinfo->dcerpc_procedure_name="decode_NEGOTIATE_MESSAGE";
3114         return offset;
3115 }
3116
3117 static int
3118 ntlmssp_dissect_decode_NEGOTIATE_MESSAGE_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3119 {
3120         pinfo->dcerpc_procedure_name="decode_NEGOTIATE_MESSAGE";
3121         offset = ntlmssp_dissect_element_decode_NEGOTIATE_MESSAGE_negotiate(tvb, offset, pinfo, tree, drep);
3122         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
3123         return offset;
3124 }
3125
3126 static int
3127 ntlmssp_dissect_element_decode_CHALLENGE_MESSAGE_challenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3128 {
3129         offset = ntlmssp_dissect_struct_CHALLENGE_MESSAGE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_decode_CHALLENGE_MESSAGE_challenge,0);
3130
3131         return offset;
3132 }
3133
3134 /* IDL: void decode_CHALLENGE_MESSAGE( */
3135 /* IDL: [in] CHALLENGE_MESSAGE challenge */
3136 /* IDL: ); */
3137
3138 static int
3139 ntlmssp_dissect_decode_CHALLENGE_MESSAGE_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3140 {
3141         pinfo->dcerpc_procedure_name="decode_CHALLENGE_MESSAGE";
3142         return offset;
3143 }
3144
3145 static int
3146 ntlmssp_dissect_decode_CHALLENGE_MESSAGE_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3147 {
3148         pinfo->dcerpc_procedure_name="decode_CHALLENGE_MESSAGE";
3149         offset = ntlmssp_dissect_element_decode_CHALLENGE_MESSAGE_challenge(tvb, offset, pinfo, tree, drep);
3150         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
3151         return offset;
3152 }
3153
3154 static int
3155 ntlmssp_dissect_element_decode_AUTHENTICATE_MESSAGE_authenticate(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3156 {
3157         offset = ntlmssp_dissect_struct_AUTHENTICATE_MESSAGE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_decode_AUTHENTICATE_MESSAGE_authenticate,0);
3158
3159         return offset;
3160 }
3161
3162 /* IDL: void decode_AUTHENTICATE_MESSAGE( */
3163 /* IDL: [in] AUTHENTICATE_MESSAGE authenticate */
3164 /* IDL: ); */
3165
3166 static int
3167 ntlmssp_dissect_decode_AUTHENTICATE_MESSAGE_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3168 {
3169         pinfo->dcerpc_procedure_name="decode_AUTHENTICATE_MESSAGE";
3170         return offset;
3171 }
3172
3173 static int
3174 ntlmssp_dissect_decode_AUTHENTICATE_MESSAGE_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3175 {
3176         pinfo->dcerpc_procedure_name="decode_AUTHENTICATE_MESSAGE";
3177         offset = ntlmssp_dissect_element_decode_AUTHENTICATE_MESSAGE_authenticate(tvb, offset, pinfo, tree, drep);
3178         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
3179         return offset;
3180 }
3181
3182 static int
3183 ntlmssp_dissect_element_decode_NTLMv2_CLIENT_CHALLENGE_challenge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3184 {
3185         offset = ntlmssp_dissect_struct_NTLMv2_CLIENT_CHALLENGE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_decode_NTLMv2_CLIENT_CHALLENGE_challenge,0);
3186
3187         return offset;
3188 }
3189
3190 /* IDL: void decode_NTLMv2_CLIENT_CHALLENGE( */
3191 /* IDL: [in] NTLMv2_CLIENT_CHALLENGE challenge */
3192 /* IDL: ); */
3193
3194 static int
3195 ntlmssp_dissect_decode_NTLMv2_CLIENT_CHALLENGE_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3196 {
3197         pinfo->dcerpc_procedure_name="decode_NTLMv2_CLIENT_CHALLENGE";
3198         return offset;
3199 }
3200
3201 static int
3202 ntlmssp_dissect_decode_NTLMv2_CLIENT_CHALLENGE_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3203 {
3204         pinfo->dcerpc_procedure_name="decode_NTLMv2_CLIENT_CHALLENGE";
3205         offset = ntlmssp_dissect_element_decode_NTLMv2_CLIENT_CHALLENGE_challenge(tvb, offset, pinfo, tree, drep);
3206         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
3207         return offset;
3208 }
3209
3210 static int
3211 ntlmssp_dissect_element_decode_NTLMv2_RESPONSE_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3212 {
3213         offset = ntlmssp_dissect_struct_NTLMv2_RESPONSE(tvb,offset,pinfo,tree,drep,hf_ntlmssp_decode_NTLMv2_RESPONSE_response,0);
3214
3215         return offset;
3216 }
3217
3218 /* IDL: void decode_NTLMv2_RESPONSE( */
3219 /* IDL: [in] NTLMv2_RESPONSE response */
3220 /* IDL: ); */
3221
3222 static int
3223 ntlmssp_dissect_decode_NTLMv2_RESPONSE_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3224 {
3225         pinfo->dcerpc_procedure_name="decode_NTLMv2_RESPONSE";
3226         return offset;
3227 }
3228
3229 static int
3230 ntlmssp_dissect_decode_NTLMv2_RESPONSE_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
3231 {
3232         pinfo->dcerpc_procedure_name="decode_NTLMv2_RESPONSE";
3233         offset = ntlmssp_dissect_element_decode_NTLMv2_RESPONSE_response(tvb, offset, pinfo, tree, drep);
3234         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
3235         return offset;
3236 }
3237
3238
3239 static dcerpc_sub_dissector ntlmssp_dissectors[] = {
3240         { 0, "decode_NEGOTIATE_MESSAGE",
3241            ntlmssp_dissect_decode_NEGOTIATE_MESSAGE_request, ntlmssp_dissect_decode_NEGOTIATE_MESSAGE_response},
3242         { 1, "decode_CHALLENGE_MESSAGE",
3243            ntlmssp_dissect_decode_CHALLENGE_MESSAGE_request, ntlmssp_dissect_decode_CHALLENGE_MESSAGE_response},
3244         { 2, "decode_AUTHENTICATE_MESSAGE",
3245            ntlmssp_dissect_decode_AUTHENTICATE_MESSAGE_request, ntlmssp_dissect_decode_AUTHENTICATE_MESSAGE_response},
3246         { 3, "decode_NTLMv2_CLIENT_CHALLENGE",
3247            ntlmssp_dissect_decode_NTLMv2_CLIENT_CHALLENGE_request, ntlmssp_dissect_decode_NTLMv2_CLIENT_CHALLENGE_response},
3248         { 4, "decode_NTLMv2_RESPONSE",
3249            ntlmssp_dissect_decode_NTLMv2_RESPONSE_request, ntlmssp_dissect_decode_NTLMv2_RESPONSE_response},
3250         { 0, NULL, NULL, NULL }
3251 };
3252
3253 void proto_register_dcerpc_ntlmssp(void)
3254 {
3255         static hf_register_info hf[] = {
3256         { &hf_ntlmssp_decode_NTLMv2_RESPONSE_response,
3257           { "Response", "ntlmssp.decode_NTLMv2_RESPONSE.response", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3258         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameInfoMaxLen,
3259           { "Targetnameinfomaxlen", "ntlmssp.CHALLENGE_MESSAGE.TargetNameInfoMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3260         { &hf_ntlmssp_ntlmssp_VERSION_Reserved,
3261           { "Reserved", "ntlmssp.ntlmssp_VERSION.Reserved", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3262         { &hf_ntlmssp_ntlmssp_AvValue_AvNbComputerName,
3263           { "Avnbcomputername", "ntlmssp.ntlmssp_AvValue.AvNbComputerName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3264         { &hf_ntlmssp_CHALLENGE_MESSAGE_Reserved,
3265           { "Reserved", "ntlmssp.CHALLENGE_MESSAGE.Reserved", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3266         { &hf_ntlmssp_ntlmssp_AvValue_AvTimestamp,
3267           { "Avtimestamp", "ntlmssp.ntlmssp_AvValue.AvTimestamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
3268         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM,
3269           { "Ntlmssp Negotiate Oem", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_OEM", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_tfs), ( 0x00000002 ), NULL, HFILL }},
3270         { &hf_ntlmssp_Restriction_Encoding_MachineId,
3271           { "Machineid", "ntlmssp.Restriction_Encoding.MachineId", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3272         { &hf_ntlmssp_NEGOTIATE_MESSAGE_WorkstationLen,
3273           { "Workstationlen", "ntlmssp.NEGOTIATE_MESSAGE.WorkstationLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3274         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NTLM,
3275           { "Ntlmssp Negotiate Ntlm", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_NTLM", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_NTLM_tfs), ( 0x00000200 ), NULL, HFILL }},
3276         { &hf_ntlmssp_ntlmssp_AvValue_ChannelBindings,
3277           { "Channelbindings", "ntlmssp.ntlmssp_AvValue.ChannelBindings", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3278         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_Signature,
3279           { "Signature", "ntlmssp.AUTHENTICATE_MESSAGE.Signature", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3280         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_SEAL,
3281           { "Ntlmssp Negotiate Seal", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_SEAL", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_SEAL_tfs), ( 0x00000020 ), NULL, HFILL }},
3282         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_KEY_EXCH,
3283           { "Ntlmssp Negotiate Key Exch", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_KEY_EXCH", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_KEY_EXCH_tfs), ( 0x40000000 ), NULL, HFILL }},
3284         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved1,
3285           { "Reserved1", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.Reserved1", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3286         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_AvPairs,
3287           { "Avpairs", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.AvPairs", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3288         { &hf_ntlmssp_NEGOTIATE_MESSAGE_DomainName_,
3289           { "Subcontext length", "ntlmssp.NEGOTIATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3290         { &hf_ntlmssp_NEGOTIATE_MESSAGE_WorkstationMaxLen,
3291           { "Workstationmaxlen", "ntlmssp.NEGOTIATE_MESSAGE.WorkstationMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3292         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_IDENTIFY,
3293           { "Ntlmssp Negotiate Identify", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_IDENTIFY", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_IDENTIFY_tfs), ( 0x00100000 ), NULL, HFILL }},
3294         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfoLen,
3295           { "Targetinfolen", "ntlmssp.CHALLENGE_MESSAGE.TargetInfoLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3296         { &hf_ntlmssp_LMv2_RESPONSE_ChallengeFromClient,
3297           { "Challengefromclient", "ntlmssp.LMv2_RESPONSE.ChallengeFromClient", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3298         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponse_,
3299           { "Subcontext length", "ntlmssp.AUTHENTICATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3300         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponse,
3301           { "Lmchallengeresponse", "ntlmssp.AUTHENTICATE_MESSAGE.LmChallengeResponse", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3302         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED,
3303           { "Ntlmssp Negotiate Oem Workstation Supplied", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED_tfs), ( 0x00002000 ), NULL, HFILL }},
3304         { &hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_Checksum,
3305           { "Checksum", "ntlmssp.NTLMSSP_MESSAGE_SIGNATURE.Checksum", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3306         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_Version,
3307           { "Version", "ntlmssp.AUTHENTICATE_MESSAGE.Version", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3308         { &hf_ntlmssp_LM_RESPONSE_Response,
3309           { "Response", "ntlmssp.LM_RESPONSE.Response", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3310         { &hf_ntlmssp_NEGOTIATE_MESSAGE_DomainNameLen,
3311           { "Domainnamelen", "ntlmssp.NEGOTIATE_MESSAGE.DomainNameLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3312         { &hf_ntlmssp_NTLMv2_RESPONSE_Response,
3313           { "Response", "ntlmssp.NTLMv2_RESPONSE.Response", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3314         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NETWARE,
3315           { "Ntlmssp Negotiate Netware", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_NETWARE", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_NETWARE_tfs), ( 0x00000100 ), NULL, HFILL }},
3316         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_RespType,
3317           { "Resptype", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.RespType", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
3318         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_UserNameMaxLen,
3319           { "Usernamemaxlen", "ntlmssp.AUTHENTICATE_MESSAGE.UserNameMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3320         { &hf_ntlmssp_ntlmssp_Version_version,
3321           { "Version", "ntlmssp.ntlmssp_Version.version", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3322         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameLen,
3323           { "Targetnamelen", "ntlmssp.CHALLENGE_MESSAGE.TargetNameLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3324         { &hf_ntlmssp_NEGOTIATE_MESSAGE_DomainNameMaxLen,
3325           { "Domainnamemaxlen", "ntlmssp.NEGOTIATE_MESSAGE.DomainNameMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3326         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_56,
3327           { "Ntlmssp Negotiate 56", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_56", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_56_tfs), ( 0x80000000 ), NULL, HFILL }},
3328         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyMaxLen,
3329           { "Encryptedrandomsessionkeymaxlen", "ntlmssp.AUTHENTICATE_MESSAGE.EncryptedRandomSessionKeyMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3330         { &hf_ntlmssp_NEGOTIATE_MESSAGE_MessageType,
3331           { "Messagetype", "ntlmssp.NEGOTIATE_MESSAGE.MessageType", FT_UINT32, BASE_DEC, VALS(ntlmssp_ntlmssp_MessageType_vals), 0, NULL, HFILL }},
3332         { &hf_ntlmssp_ntlmssp_AvValue_AvNbDomainName,
3333           { "Avnbdomainname", "ntlmssp.ntlmssp_AvValue.AvNbDomainName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3334         { &hf_ntlmssp_ntlmssp_AvFlags_NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE,
3335           { "Ntlmssp Avflag Mic In Authenticate Message", "ntlmssp.ntlmssp_AvFlags.NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE", FT_BOOLEAN, 32, TFS(&ntlmssp_AvFlags_NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE_tfs), ( 0x00000002 ), NULL, HFILL }},
3336         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_VERSION,
3337           { "Ntlmssp Negotiate Version", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_VERSION", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_VERSION_tfs), ( 0x02000000 ), NULL, HFILL }},
3338         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetName_,
3339           { "Subcontext length", "ntlmssp.CHALLENGE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3340         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_REQUEST_TARGET,
3341           { "Ntlmssp Request Target", "ntlmssp.NEGOTIATE.NTLMSSP_REQUEST_TARGET", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_REQUEST_TARGET_tfs), ( 0x00000004 ), NULL, HFILL }},
3342         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_Workstation_,
3343           { "Subcontext length", "ntlmssp.AUTHENTICATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3344         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainNameMaxLen,
3345           { "Domainnamemaxlen", "ntlmssp.AUTHENTICATE_MESSAGE.DomainNameMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3346         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_DOMAIN,
3347           { "Ntlmssp Target Type Domain", "ntlmssp.NEGOTIATE.NTLMSSP_TARGET_TYPE_DOMAIN", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_TARGET_TYPE_DOMAIN_tfs), ( 0x00010000 ), NULL, HFILL }},
3348         { &hf_ntlmssp_decode_CHALLENGE_MESSAGE_challenge,
3349           { "Challenge", "ntlmssp.decode_CHALLENGE_MESSAGE.challenge", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3350         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_UserName_,
3351           { "Subcontext length", "ntlmssp.AUTHENTICATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3352         { &hf_ntlmssp_ntlmssp_LM_RESPONSE_v1,
3353           { "V1", "ntlmssp.ntlmssp_LM_RESPONSE.v1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3354         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetName,
3355           { "Targetname", "ntlmssp.CHALLENGE_MESSAGE.TargetName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3356         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved2,
3357           { "Reserved2", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.Reserved2", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3358         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL,
3359           { "Ntlmssp Negotiate This Is Local Call", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL_tfs), ( 0x00004000 ), NULL, HFILL }},
3360         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_MessageType,
3361           { "Messagetype", "ntlmssp.AUTHENTICATE_MESSAGE.MessageType", FT_UINT32, BASE_DEC, VALS(ntlmssp_ntlmssp_MessageType_vals), 0, NULL, HFILL }},
3362         { &hf_ntlmssp_ntlmssp_NTLM_RESPONSE_v2,
3363           { "V2", "ntlmssp.ntlmssp_NTLM_RESPONSE.v2", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3364         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_WorkstationLen,
3365           { "Workstationlen", "ntlmssp.AUTHENTICATE_MESSAGE.WorkstationLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3366         { &hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_Version,
3367           { "Version", "ntlmssp.NTLMSSP_MESSAGE_SIGNATURE.Version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3368         { &hf_ntlmssp_AV_PAIR_AvLen,
3369           { "Avlen", "ntlmssp.AV_PAIR.AvLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3370         { &hf_ntlmssp_decode_NTLMv2_CLIENT_CHALLENGE_challenge,
3371           { "Challenge", "ntlmssp.decode_NTLMv2_CLIENT_CHALLENGE.challenge", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3372         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainName_,
3373           { "Subcontext length", "ntlmssp.AUTHENTICATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3374         { &hf_ntlmssp_LMv2_RESPONSE_Response,
3375           { "Response", "ntlmssp.LMv2_RESPONSE.Response", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3376         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_WorkstationMaxLen,
3377           { "Workstationmaxlen", "ntlmssp.AUTHENTICATE_MESSAGE.WorkstationMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3378         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponseMaxLen,
3379           { "Lmchallengeresponsemaxlen", "ntlmssp.AUTHENTICATE_MESSAGE.LmChallengeResponseMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3380         { &hf_ntlmssp_AV_PAIR_AvId,
3381           { "Avid", "ntlmssp.AV_PAIR.AvId", FT_UINT1632, BASE_DEC, VALS(ntlmssp_ntlmssp_AvId_vals), 0, NULL, HFILL }},
3382         { &hf_ntlmssp_ntlmssp_AvValue_blob,
3383           { "Blob", "ntlmssp.ntlmssp_AvValue.blob", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3384         { &hf_ntlmssp_CHALLENGE_MESSAGE_ServerChallenge,
3385           { "Serverchallenge", "ntlmssp.CHALLENGE_MESSAGE.ServerChallenge", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3386         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_NT_ONLY,
3387           { "Ntlmssp Negotiate Nt Only", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_NT_ONLY", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_NT_ONLY_tfs), ( 0x00000400 ), NULL, HFILL }},
3388         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_SIGN,
3389           { "Ntlmssp Negotiate Sign", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_SIGN", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_SIGN_tfs), ( 0x00000010 ), NULL, HFILL }},
3390         { &hf_ntlmssp_AV_PAIR_LIST_pair,
3391           { "Pair", "ntlmssp.AV_PAIR_LIST.pair", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3392         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponseLen,
3393           { "Lmchallengeresponselen", "ntlmssp.AUTHENTICATE_MESSAGE.LmChallengeResponseLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3394         { &hf_ntlmssp_NTLM_RESPONSE_Response,
3395           { "Response", "ntlmssp.NTLM_RESPONSE.Response", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3396         { &hf_ntlmssp_AV_PAIR_LIST_count,
3397           { "Count", "ntlmssp.AV_PAIR_LIST.count", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3398         { &hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Checksum,
3399           { "Checksum", "ntlmssp.NTLMSSP_MESSAGE_SIGNATURE_NTLMv2.Checksum", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3400         { &hf_ntlmssp_CHALLENGE_MESSAGE_Version,
3401           { "Version", "ntlmssp.CHALLENGE_MESSAGE.Version", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3402         { &hf_ntlmssp_Restriction_Encoding_SubjectIntegrityLevel,
3403           { "Subjectintegritylevel", "ntlmssp.Restriction_Encoding.SubjectIntegrityLevel", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3404         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponse,
3405           { "Ntchallengeresponse", "ntlmssp.AUTHENTICATE_MESSAGE.NtChallengeResponse", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3406         { &hf_ntlmssp_decode_NEGOTIATE_MESSAGE_negotiate,
3407           { "Negotiate", "ntlmssp.decode_NEGOTIATE_MESSAGE.negotiate", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3408         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_UserName,
3409           { "Username", "ntlmssp.AUTHENTICATE_MESSAGE.UserName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3410         { &hf_ntlmssp_ntlmssp_AvValue_AvFlags,
3411           { "Avflags", "ntlmssp.ntlmssp_AvValue.AvFlags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
3412         { &hf_ntlmssp_CHALLENGE_MESSAGE_Signature,
3413           { "Signature", "ntlmssp.CHALLENGE_MESSAGE.Signature", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3414         { &hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_Version,
3415           { "Version", "ntlmssp.NTLMSSP_MESSAGE_SIGNATURE_NTLMv2.Version", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3416         { &hf_ntlmssp_Restriction_Encoding_Z4,
3417           { "Z4", "ntlmssp.Restriction_Encoding.Z4", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3418         { &hf_ntlmssp_ntlmssp_AvValue_AvDnsTreeName,
3419           { "Avdnstreename", "ntlmssp.ntlmssp_AvValue.AvDnsTreeName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3420         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey,
3421           { "Encryptedrandomsessionkey", "ntlmssp.AUTHENTICATE_MESSAGE.EncryptedRandomSessionKey", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3422         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponseLen,
3423           { "Ntchallengeresponselen", "ntlmssp.AUTHENTICATE_MESSAGE.NtChallengeResponseLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3424         { &hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_SeqNum,
3425           { "Seqnum", "ntlmssp.NTLMSSP_MESSAGE_SIGNATURE.SeqNum", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3426         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_REQUEST_NON_NT_SESSION_KEY,
3427           { "Ntlmssp Request Non Nt Session Key", "ntlmssp.NEGOTIATE.NTLMSSP_REQUEST_NON_NT_SESSION_KEY", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_REQUEST_NON_NT_SESSION_KEY_tfs), ( 0x00400000 ), NULL, HFILL }},
3428         { &hf_ntlmssp_ntlmssp_VERSION_NTLMRevisionCurrent,
3429           { "Ntlmrevisioncurrent", "ntlmssp.ntlmssp_VERSION.NTLMRevisionCurrent", FT_UINT8, BASE_DEC, VALS(ntlmssp_ntlmssp_NTLMRevisionCurrent_vals), 0, NULL, HFILL }},
3430         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_TARGET_INFO,
3431           { "Ntlmssp Negotiate Target Info", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_TARGET_INFO", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_TARGET_INFO_tfs), ( 0x00800000 ), NULL, HFILL }},
3432         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_NtChallengeResponseMaxLen,
3433           { "Ntchallengeresponsemaxlen", "ntlmssp.AUTHENTICATE_MESSAGE.NtChallengeResponseMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3434         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainNameLen,
3435           { "Domainnamelen", "ntlmssp.AUTHENTICATE_MESSAGE.DomainNameLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3436         { &hf_ntlmssp_NEGOTIATE_MESSAGE_Signature,
3437           { "Signature", "ntlmssp.NEGOTIATE_MESSAGE.Signature", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3438         { &hf_ntlmssp_ntlmssp_AvValue_AvRestrictions,
3439           { "Avrestrictions", "ntlmssp.ntlmssp_AvValue.AvRestrictions", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3440         { &hf_ntlmssp_MIC_MIC,
3441           { "Mic", "ntlmssp.MIC.MIC", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3442         { &hf_ntlmssp_AV_PAIR_Value_,
3443           { "Subcontext length", "ntlmssp.AV_PAIR.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3444         { &hf_ntlmssp_Restriction_Encoding_Size,
3445           { "Size", "ntlmssp.Restriction_Encoding.Size", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3446         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_AvPairs_,
3447           { "Subcontext length", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3448         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_HiRespType,
3449           { "Hiresptype", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.HiRespType", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
3450         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_ChallengeFromClient,
3451           { "Challengefromclient", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.ChallengeFromClient", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
3452         { &hf_ntlmssp_ntlmssp_AvFlags_NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT,
3453           { "Ntlmssp Avflag Constrainted Account", "ntlmssp.ntlmssp_AvFlags.NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT", FT_BOOLEAN, 32, TFS(&ntlmssp_AvFlags_NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT_tfs), ( 0x00000001 ), NULL, HFILL }},
3454         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_ANONYMOUS,
3455           { "Ntlmssp Anonymous", "ntlmssp.NEGOTIATE.NTLMSSP_ANONYMOUS", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_ANONYMOUS_tfs), ( 0x00000800 ), NULL, HFILL }},
3456         { &hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_RandomPad,
3457           { "Randompad", "ntlmssp.NTLMSSP_MESSAGE_SIGNATURE.RandomPad", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3458         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_NegotiateFlags,
3459           { "Negotiateflags", "ntlmssp.AUTHENTICATE_MESSAGE.NegotiateFlags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
3460         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_SHARE,
3461           { "Ntlmssp Target Type Share", "ntlmssp.NEGOTIATE.NTLMSSP_TARGET_TYPE_SHARE", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_TARGET_TYPE_SHARE_tfs), ( 0x00040000 ), NULL, HFILL }},
3462         { &hf_ntlmssp_NEGOTIATE_MESSAGE_Workstation_,
3463           { "Subcontext length", "ntlmssp.NEGOTIATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3464         { &hf_ntlmssp_ntlmssp_NTLM_RESPONSE_v1,
3465           { "V1", "ntlmssp.ntlmssp_NTLM_RESPONSE.v1", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3466         { &hf_ntlmssp_NEGOTIATE_MESSAGE_Version,
3467           { "Version", "ntlmssp.NEGOTIATE_MESSAGE.Version", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3468         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_LM_KEY,
3469           { "Ntlmssp Negotiate Lm Key", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_LM_KEY", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_LM_KEY_tfs), ( 0x00000080 ), NULL, HFILL }},
3470         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_UNICODE,
3471           { "Ntlmssp Negotiate Unicode", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_UNICODE", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_UNICODE_tfs), ( 0x00000001 ), NULL, HFILL }},
3472         { &hf_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2_SeqNum,
3473           { "Seqnum", "ntlmssp.NTLMSSP_MESSAGE_SIGNATURE_NTLMv2.SeqNum", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3474         { &hf_ntlmssp_decode_AUTHENTICATE_MESSAGE_authenticate,
3475           { "Authenticate", "ntlmssp.decode_AUTHENTICATE_MESSAGE.authenticate", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3476         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfo,
3477           { "Targetinfo", "ntlmssp.CHALLENGE_MESSAGE.TargetInfo", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3478         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetInfo_,
3479           { "Subcontext length", "ntlmssp.CHALLENGE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3480         { &hf_ntlmssp_opnum,
3481           { "Operation", "ntlmssp.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3482         { &hf_ntlmssp_ntlmssp_VERSION_ProductBuild,
3483           { "Productbuild", "ntlmssp.ntlmssp_VERSION.ProductBuild", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3484         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_DATAGRAM,
3485           { "Ntlmssp Negotiate Datagram", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_DATAGRAM", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_DATAGRAM_tfs), ( 0x00000040 ), NULL, HFILL }},
3486         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_DomainName,
3487           { "Domainname", "ntlmssp.AUTHENTICATE_MESSAGE.DomainName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3488         { &hf_ntlmssp_ntlmssp_AvValue_AvDnsComputerName,
3489           { "Avdnscomputername", "ntlmssp.ntlmssp_AvValue.AvDnsComputerName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3490         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_128,
3491           { "Ntlmssp Negotiate 128", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_128", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_128_tfs), ( 0x20000000 ), NULL, HFILL }},
3492         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_Reserved3,
3493           { "Reserved3", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.Reserved3", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3494         { &hf_ntlmssp_NEGOTIATE_MESSAGE_NegotiateFlags,
3495           { "Negotiateflags", "ntlmssp.NEGOTIATE_MESSAGE.NegotiateFlags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
3496         { &hf_ntlmssp_NTLMv2_RESPONSE_Challenge,
3497           { "Challenge", "ntlmssp.NTLMv2_RESPONSE.Challenge", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3498         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKey_,
3499           { "Subcontext length", "ntlmssp.AUTHENTICATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3500         { &hf_ntlmssp_CHALLENGE_MESSAGE_TargetNameMaxLen,
3501           { "Targetnamemaxlen", "ntlmssp.CHALLENGE_MESSAGE.TargetNameMaxLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3502         { &hf_ntlmssp_ntlmssp_VERSION_ProductMinorVersion,
3503           { "Productminorversion", "ntlmssp.ntlmssp_VERSION.ProductMinorVersion", FT_UINT8, BASE_DEC, VALS(ntlmssp_ntlmssp_WindowsMinorVersion_vals), 0, NULL, HFILL }},
3504         { &hf_ntlmssp_NEGOTIATE_MESSAGE_Workstation,
3505           { "Workstation", "ntlmssp.NEGOTIATE_MESSAGE.Workstation", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3506         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY,
3507           { "Ntlmssp Negotiate Extended Sessionsecurity", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY_tfs), ( 0x00080000 ), NULL, HFILL }},
3508         { &hf_ntlmssp_CHALLENGE_MESSAGE_NegotiateFlags,
3509           { "Negotiateflags", "ntlmssp.CHALLENGE_MESSAGE.NegotiateFlags", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
3510         { &hf_ntlmssp_ntlmssp_AvValue_AvTargetName,
3511           { "Avtargetname", "ntlmssp.ntlmssp_AvValue.AvTargetName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3512         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_TARGET_TYPE_SERVER,
3513           { "Ntlmssp Target Type Server", "ntlmssp.NEGOTIATE.NTLMSSP_TARGET_TYPE_SERVER", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_TARGET_TYPE_SERVER_tfs), ( 0x00020000 ), NULL, HFILL }},
3514         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED,
3515           { "Ntlmssp Negotiate Oem Domain Supplied", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED_tfs), ( 0x00001000 ), NULL, HFILL }},
3516         { &hf_ntlmssp_CHALLENGE_MESSAGE_MessageType,
3517           { "Messagetype", "ntlmssp.CHALLENGE_MESSAGE.MessageType", FT_UINT32, BASE_DEC, VALS(ntlmssp_ntlmssp_MessageType_vals), 0, NULL, HFILL }},
3518         { &hf_ntlmssp_NEGOTIATE_NTLMSSP_NEGOTIATE_ALWAYS_SIGN,
3519           { "Ntlmssp Negotiate Always Sign", "ntlmssp.NEGOTIATE.NTLMSSP_NEGOTIATE_ALWAYS_SIGN", FT_BOOLEAN, 32, TFS(&NEGOTIATE_NTLMSSP_NEGOTIATE_ALWAYS_SIGN_tfs), ( 0x00008000 ), NULL, HFILL }},
3520         { &hf_ntlmssp_AV_PAIR_Value,
3521           { "Value", "ntlmssp.AV_PAIR.Value", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3522         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_UserNameLen,
3523           { "Usernamelen", "ntlmssp.AUTHENTICATE_MESSAGE.UserNameLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3524         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_LmChallengeResponse_,
3525           { "Subcontext length", "ntlmssp.AUTHENTICATE_MESSAGE.subcontext", FT_UINT0, BASE_HEX, NULL, 0, NULL, HFILL }},
3526         { &hf_ntlmssp_Restriction_Encoding_IntegrityLevel,
3527           { "Integritylevel", "ntlmssp.Restriction_Encoding.IntegrityLevel", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
3528         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_EncryptedRandomSessionKeyLen,
3529           { "Encryptedrandomsessionkeylen", "ntlmssp.AUTHENTICATE_MESSAGE.EncryptedRandomSessionKeyLen", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
3530         { &hf_ntlmssp_NEGOTIATE_MESSAGE_DomainName,
3531           { "Domainname", "ntlmssp.NEGOTIATE_MESSAGE.DomainName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3532         { &hf_ntlmssp_ntlmssp_VERSION_ProductMajorVersion,
3533           { "Productmajorversion", "ntlmssp.ntlmssp_VERSION.ProductMajorVersion", FT_UINT8, BASE_DEC, VALS(ntlmssp_ntlmssp_WindowsMajorVersion_vals), 0, NULL, HFILL }},
3534         { &hf_ntlmssp_AUTHENTICATE_MESSAGE_Workstation,
3535           { "Workstation", "ntlmssp.AUTHENTICATE_MESSAGE.Workstation", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3536         { &hf_ntlmssp_ntlmssp_AvValue_AvDnsDomainName,
3537           { "Avdnsdomainname", "ntlmssp.ntlmssp_AvValue.AvDnsDomainName", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
3538         { &hf_ntlmssp_NTLMv2_CLIENT_CHALLENGE_TimeStamp,
3539           { "Timestamp", "ntlmssp.NTLMv2_CLIENT_CHALLENGE.TimeStamp", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0, NULL, HFILL }},
3540         };
3541
3542
3543         static gint *ett[] = {
3544                 &ett_dcerpc_ntlmssp,
3545                 &ett_ntlmssp_NEGOTIATE,
3546                 &ett_ntlmssp_ntlmssp_VERSION,
3547                 &ett_ntlmssp_ntlmssp_Version,
3548                 &ett_ntlmssp_NEGOTIATE_MESSAGE,
3549                 &ett_ntlmssp_Restriction_Encoding,
3550                 &ett_ntlmssp_ntlmssp_AvFlags,
3551                 &ett_ntlmssp_ntlmssp_AvValue,
3552                 &ett_ntlmssp_AV_PAIR,
3553                 &ett_ntlmssp_AV_PAIR_LIST,
3554                 &ett_ntlmssp_CHALLENGE_MESSAGE,
3555                 &ett_ntlmssp_LM_RESPONSE,
3556                 &ett_ntlmssp_LMv2_RESPONSE,
3557                 &ett_ntlmssp_ntlmssp_LM_RESPONSE,
3558                 &ett_ntlmssp_NTLM_RESPONSE,
3559                 &ett_ntlmssp_NTLMv2_CLIENT_CHALLENGE,
3560                 &ett_ntlmssp_NTLMv2_RESPONSE,
3561                 &ett_ntlmssp_ntlmssp_NTLM_RESPONSE,
3562                 &ett_ntlmssp_MIC,
3563                 &ett_ntlmssp_AUTHENTICATE_MESSAGE,
3564                 &ett_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE,
3565                 &ett_ntlmssp_NTLMSSP_MESSAGE_SIGNATURE_NTLMv2,
3566         };
3567
3568         proto_dcerpc_ntlmssp = proto_register_protocol("NTLM messages", "NTLMSSP", "ntlmssp");
3569         proto_register_field_array(proto_dcerpc_ntlmssp, hf, array_length (hf));
3570         proto_register_subtree_array(ett, array_length(ett));
3571 }
3572
3573 void proto_reg_handoff_dcerpc_ntlmssp(void)
3574 {
3575         dcerpc_init_uuid(proto_dcerpc_ntlmssp, ett_dcerpc_ntlmssp,
3576                 &uuid_dcerpc_ntlmssp, ver_dcerpc_ntlmssp,
3577                 ntlmssp_dissectors, hf_ntlmssp_opnum);
3578 }