3 * Routines for NetWare Core Protocol. This C code gets #include'd
4 * into packet-ncp2222.c, which is generated from ncp2222.py. It's
5 * #include'd instead of being in a separate compilation unit so
6 * that all the data tables in packet-ncp2222.c can remain static.
8 * Gilbert Ramirez <gram@alumni.rice.edu>
9 * Modified to decode NDS packets by Greg Morris <gmorris@novell.com>
11 * $Id: packet-ncp2222.inc,v 1.22 2002/09/26 02:08:21 jmayer Exp $
13 * Ethereal - Network traffic analyzer
14 * By Gerald Combs <gerald@ethereal.com>
15 * Copyright 2000 Gerald Combs
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #define NCP_PACKET_INIT_COUNT 200
33 #define PROTO_LENGTH_UNTIL_END -1
35 static const value_string nds_tags[] = {
36 { 0x00000000, "No Such Entry" },
37 { 0x00000001, "Local Entry" },
38 { 0x00000002, "Remote Entry" },
39 { 0x00000003, "Alias Entry" },
40 { 0x00000004, "Referral Information" },
41 { 0x00000006, "Entry and Referrals" },
45 static const value_string nds_info_type[] = {
46 { 0x00000000, "Attribute Names Only / " },
47 { 0x00000001, "Attribute Name & Value / " },
48 { 0x00000002, "Effective Privileges / " },
49 { 0x00000003, "Value Information / " },
50 { 0x00000004, "Abreviated Value / " },
54 static const value_string nds_kind_of_changes[] = {
55 { 0x00000000, "Add Attribute" },
56 { 0x00000001, "Remove Attribute" },
57 { 0x00000002, "Add Value" },
58 { 0x00000003, "Remove Value" },
59 { 0x00000004, "Add Additional Value" },
60 { 0x00000005, "Overwrite Value" },
61 { 0x00000006, "Clear Attribute" },
62 { 0x00000007, "Clear Value" },
66 static const value_string es_type[] = {
67 { 0x00000000, "No type is specified" },
68 { 0x00000001, "Unicode string" },
69 { 0x00000002, "Partial name" },
70 { 0x00000003, "Referrals" },
71 { 0x00000004, "Tuned name" },
72 { 0x00000005, "GUID attribute" },
73 { 0x00000006, "Local entry ID" },
74 { 0x00000007, "Number of defined entry specifiers" },
78 static const value_string nds_protocol_type[] = {
79 { 0x00000000, "(IPX Protocol)" },
80 { 0x00000001, "(IP Protocol)" },
81 { 0x00000002, "(SDLC Protocol)" },
82 { 0x00000003, "(TokenRing on Ethernet Protocol)" },
83 { 0x00000004, "(OSI Protocol)" },
84 { 0x00000005, "(AppleTalk Protocol)" },
85 { 0x00000006, "(NetBEUI Protocol)" },
86 { 0x00000007, "(Socket Address Protocol)" },
87 { 0x00000008, "(UDP Protocol)" },
88 { 0x00000009, "(TCP Protocol)" },
89 { 0x0000000a, "(UDP v6 Protocol)" },
90 { 0x0000000b, "(TCP v6 Protocol)" },
91 { 0x0000000c, "(Internal Protocol)" },
92 { 0x0000000d, "(URL Protocol)" },
97 static const value_string nds_syntax[] = {
98 { 0x00000000, "Unknown Syntax" },
99 { 0x00000001, "Distinguished Name" },
100 { 0x00000002, "Case Sensitive Unicode String" },
101 { 0x00000003, "Non Case Sensitive Unicode String" },
102 { 0x00000004, "Printable String" },
103 { 0x00000005, "Numeric String" },
104 { 0x00000006, "Case Insensitive List" },
105 { 0x00000007, "Boolean" },
106 { 0x00000008, "Signed Integer" },
107 { 0x00000009, "Binary String" },
108 { 0x0000000a, "Telephone Number" },
109 { 0x0000000b, "Fax Number" },
110 { 0x0000000c, "Network Address" },
111 { 0x0000000d, "Binary String List" },
112 { 0x0000000e, "Email Address" },
113 { 0x0000000f, "File System Path" },
114 { 0x00000010, "Replica Pointer" },
115 { 0x00000011, "Object ACL" },
116 { 0x00000012, "Postal Address" },
117 { 0x00000013, "Time Stamp" },
118 { 0x00000014, "Class Name" },
119 { 0x00000015, "Stream" },
120 { 0x00000016, "Counter" },
121 { 0x00000017, "Back Link" },
122 { 0x00000018, "Time" },
123 { 0x00000019, "Typed Name" },
124 { 0x0000001a, "Hold" },
125 { 0x0000001b, "Interval" },
129 static const value_string name_space_type[] = {
130 { 0x00000000, "DOS Name Space" },
131 { 0x00000001, "MAC Name Space" },
132 { 0x00000002, "NFS Name Space" },
133 { 0x00000003, "FTAM Name Space" },
134 { 0x00000004, "OS/2, Long Name Space" },
139 static const value_string nds_replica_state[] = {
143 { 0x0003, "Locked" },
144 { 0x0004, "Create Master State 0" },
145 { 0x0005, "Create Master State 1" },
146 { 0x0006, "Transition On" },
147 { 0x0007, "Dead Replica" },
148 { 0x0008, "Begin Add" },
149 { 0x000b, "Master Start" },
150 { 0x000c, "Master Done" },
151 { 0x0017, "Federated" },
152 { 0x0030, "Split State 0" },
153 { 0x0031, "Split State 1" },
154 { 0x0040, "Join State 0" },
155 { 0x0041, "Join State 1" },
156 { 0x0042, "Join State 2" },
157 { 0x0050, "Move Subtree State 0" },
158 { 0x0051, "Move Subtree State 1" },
162 static const value_string nds_replica_type[] = {
163 { 0x0000, "Master" },
164 { 0x0001, "Secondary" },
165 { 0x0002, "Read Only" },
166 { 0x0003, "Sub Ref" },
170 static const value_string class_def_type[] = {
171 { 0x0000, "Return Class Name" },
172 { 0x0001, "Return Class Name, Flag, and Definition" },
173 { 0x0002, "Return Class Name, Flag, Definition, and Super Class" },
174 { 0x0003, "Return Class Name, Flag, and ASN.1 identifier" },
175 { 0x0004, "Return Class Name, Flag, Definition, Super Class, and ACL" },
176 { 0x0005, "Return Class Name, Flag, Creation Timestamp, Modification Timestamp, Definition, and ACL" },
180 static const value_string nds_reply_errors[] = {
181 { 0xffffffff, "(-1) Insufficient Space" },
182 { 0xffffff89, "(-119) Buffer too Small" },
183 { 0xffffff88, "(-120) RR Volume Flag Not Set" },
184 { 0xffffff87, "(-121) No Items Found" },
185 { 0xffffff86, "(-122) Connection Already Temporary" },
186 { 0xffffff85, "(-123) Connection Already Logged In" },
187 { 0xffffff84, "(-124) Connection Not Authenticated" },
188 { 0xffffff83, "(-125) Connection Not Logged In" },
189 { 0xffffff82, "(-126) NCP Boundary Check Failed" },
190 { 0xffffff81, "(-127) Lock Waiting" },
191 { 0xffffff80, "(-128) Lock Fail" },
192 { 0xffffff7f, "(-129) Out of Handles" },
193 { 0xffffff7e, "(-130) No Open Privilege" },
194 { 0xffffff7d, "(-131) Hard IO Error" },
195 { 0xffffff7c, "(-132) No Create Privilege" },
196 { 0xffffff7b, "(-133) No Create Delete Privilege" },
197 { 0xffffff7a, "(-134) Create Duplicate When Read Only" },
198 { 0xffffff79, "(-135) Create File with Invalid Name" },
199 { 0xffffff78, "(-136) Invalid File Handle" },
200 { 0xffffff77, "(-137) No Search Privilege" },
201 { 0xffffff76, "(-138) No Delete Privilege" },
202 { 0xffffff75, "(-139) No Rename Privilege" },
203 { 0xffffff74, "(-140) No Set Privilege" },
204 { 0xffffff73, "(-141) Some File in Use" },
205 { 0xffffff72, "(-142) All File in Use" },
206 { 0xffffff71, "(-143) Some Read Only" },
207 { 0xffffff70, "(-144) All Read Only" },
208 { 0xffffff6f, "(-145) Some names Exist" },
209 { 0xffffff6e, "(-146) All Names Exist" },
210 { 0xffffff6d, "(-147) No Read Privilege" },
211 { 0xffffff6c, "(-148) No Write Privilege" },
212 { 0xffffff6b, "(-149) File Detached" },
213 { 0xffffff6a, "(-150) No Alloc Space/Target Not a Subdirectory/Insuffficient Memory" },
214 { 0xffffff69, "(-151) No Spool Space" },
215 { 0xffffff68, "(-152) Invalid Volume" },
216 { 0xffffff67, "(-153) Directory Full" },
217 { 0xffffff66, "(-154) Rename Across Volume" },
218 { 0xffffff65, "(-155) Bad Directory Handle" },
219 { 0xffffff64, "(-156) Invalid Path/No Such Extension" },
220 { 0xffffff63, "(-157) No Directory Handles" },
221 { 0xffffff62, "(-158) Bad File Name" },
222 { 0xffffff61, "(-159) Directory Active" },
223 { 0xffffff60, "(-160) Directory Not Empty" },
224 { 0xffffff5f, "(-161) Directory IO Error" },
225 { 0xffffff5e, "(-162) IO Locked" },
226 { 0xffffff5d, "(-163) Transaction Restarted" },
227 { 0xffffff5c, "(-164) Rename Directory Invalid" },
228 { 0xffffff5b, "(-165) Invalid Open/Create Mode" },
229 { 0xffffff5a, "(-166) Already in Use" },
230 { 0xffffff59, "(-167) Invalid Resource Tag" },
231 { 0xffffff58, "(-168) Access Denied" },
232 { 0xffffff44, "(-188) Login Signing Required" },
233 { 0xffffff43, "(-189) Login Encryption Required" },
234 { 0xffffff42, "(-190) Invalid Data Stream" },
235 { 0xffffff41, "(-191) Invalid Name Space" },
236 { 0xffffff40, "(-192) No Accounting Privileges" },
237 { 0xffffff3f, "(-193) No Account Balance" },
238 { 0xffffff3e, "(-194) Credit Limit Exceeded" },
239 { 0xffffff3d, "(-195) Too Many Holds" },
240 { 0xffffff3c, "(-196) Accounting Disabled" },
241 { 0xffffff3b, "(-197) Intruder Login Lockout" },
242 { 0xffffff3a, "(-198) No Console Rights" },
243 { 0xffffff30, "(-208) Queue IO Failure" },
244 { 0xffffff2f, "(-209) No Queue" },
245 { 0xffffff2e, "(-210) No Queue Server" },
246 { 0xffffff2d, "(-211) No Queue Rights" },
247 { 0xffffff2c, "(-212) Queue Full" },
248 { 0xffffff2b, "(-213) No Queue Job" },
249 { 0xffffff2a, "(-214) No Queue Job Rights/Unencrypted Not Allowed" },
250 { 0xffffff29, "(-215) Queue In Service/Duplicate Password" },
251 { 0xffffff28, "(-216) Queue Not Active/Password Too Short" },
252 { 0xffffff27, "(-217) Queue Station Not Server/Maximum Logins Exceeded" },
253 { 0xffffff26, "(-218) Queue Halted/Bad Login Time" },
254 { 0xffffff25, "(-219) Queue Maximum Servers/Node Address Violation" },
255 { 0xffffff24, "(-220) Login Account Expired" },
256 { 0xffffff22, "(-222) Bad Password" },
257 { 0xffffff21, "(-223) Password Expired" },
258 { 0xffffff20, "(-224) No Login Connection Available" },
259 { 0xffffff18, "(-232) Write to Group Property" },
260 { 0xffffff17, "(-233) Member Already Exists" },
261 { 0xffffff16, "(-234) No Such Member" },
262 { 0xffffff15, "(-235) Property Not Group" },
263 { 0xffffff14, "(-236) No Such Value Set" },
264 { 0xffffff13, "(-237) Property Already Exists" },
265 { 0xffffff12, "(-238) Object Already Exists" },
266 { 0xffffff11, "(-239) Illegal Name" },
267 { 0xffffff10, "(-240) Illegal Wildcard" },
268 { 0xffffff0f, "(-241) Bindery Security" },
269 { 0xffffff0e, "(-242) No Object Read Rights" },
270 { 0xffffff0d, "(-243) No Object Rename Rights" },
271 { 0xffffff0c, "(-244) No Object Delete Rights" },
272 { 0xffffff0b, "(-245) No Object Create Rights" },
273 { 0xffffff0a, "(-246) No Property Delete Rights" },
274 { 0xffffff09, "(-247) No Property Create Rigths" },
275 { 0xffffff08, "(-248) No Property Write Rights" },
276 { 0xffffff07, "(-249) No Propery Read Rights" },
277 { 0xffffff06, "(-250) Temp Remap" },
278 { 0xffffff05, "(-251) Unknown Request/No Such Property" },
279 { 0xffffff04, "(-252) Message Queue Full/Target Already Has Message/No Such Object" },
280 { 0xffffff03, "(-253) Bad Station Number" },
281 { 0xffffff02, "(-254) Bindery Locked/Directory Locked/Spool Delete/Trustee not Found/Timeout" },
282 { 0xffffff01, "(-255) Hard Failure" },
283 { 0xfffffed3, "(-301) Not Enough Memory" },
284 { 0xfffffed2, "(-302) Bad Key" },
285 { 0xfffffed1, "(-303) Bad Context" },
286 { 0xfffffed0, "(-304) Buffer Full" },
287 { 0xfffffecf, "(-305) List Empty" },
288 { 0xfffffece, "(-306) Bad Syntax" },
289 { 0xfffffecd, "(-307) Buffer Empty" },
290 { 0xfffffecc, "(-308) Bad Verb" },
291 { 0xfffffecb, "(-309) Expected Identifier" },
292 { 0xfffffeca, "(-310) Expected Equals" },
293 { 0xfffffec9, "(-311) Attribute Type Expected" },
294 { 0xfffffec8, "(-312) Attribute Type Not Expected" },
295 { 0xfffffec7, "(-313) Filter Tree Empty" },
296 { 0xfffffec6, "(-314) Invalid Object Name" },
297 { 0xfffffec5, "(-315) Expected RDN Delimiter" },
298 { 0xfffffec4, "(-316) Too Many Tokens" },
299 { 0xfffffec3, "(-317) Inconsistent MultiAVA" },
300 { 0xfffffec2, "(-318) Country Name Too Long" },
301 { 0xfffffec1, "(-319) Internal Error" },
302 { 0xfffffec0, "(-320) Can't Add Root" },
303 { 0xfffffebf, "(-321) Unable to Attach" },
304 { 0xfffffebe, "(-322) Invalid Iteration Handle" },
305 { 0xfffffebd, "(-323) Buffer Zero Length" },
306 { 0xfffffebc, "(-324) Invalid Replica Type" },
307 { 0xfffffebb, "(-325) Invalid Attribute Syntax" },
308 { 0xfffffeba, "(-326) Invalid Filter Syntax" },
309 { 0xfffffeb8, "(-328) Unicode Error during Context Creation" },
310 { 0xfffffeb7, "(-329) Invalid Union Tag" },
311 { 0xfffffeb6, "(-330) Invalid Server Response" },
312 { 0xfffffeb5, "(-331) Null Pointer" },
313 { 0xfffffeb4, "(-332) No Server Found" },
314 { 0xfffffeb3, "(-333) No Connection" },
315 { 0xfffffeb2, "(-334) RDN Too Long" },
316 { 0xfffffeb1, "(-335) Duplicate Type" },
317 { 0xfffffeb0, "(-336) Data Store Failure" },
318 { 0xfffffeaf, "(-337) Not Logged In" },
319 { 0xfffffeae, "(-338) Invalid Password Characters" },
320 { 0xfffffead, "(-339) Failed Server Authentication" },
321 { 0xfffffeac, "(-340) Transport Failed" },
322 { 0xfffffeab, "(-341) No Such Syntax" },
323 { 0xfffffeaa, "(-342) Invalid DS Name" },
324 { 0xfffffea9, "(-343) Attribute Name Too Long" },
325 { 0xfffffea8, "(-344) Invalid TDS" },
326 { 0xfffffea7, "(-345) Invalid DS Version" },
327 { 0xfffffea6, "(-346) Unicode Translation" },
328 { 0xfffffea5, "(-347) Schema Name Too Long" },
329 { 0xfffffea4, "(-348) Unicode File Not Found" },
330 { 0xfffffea3, "(-349) Unicode Already Loaded" },
331 { 0xfffffea2, "(-350) Not Context Owner" },
332 { 0xfffffea1, "(-351) Attempt to Authenticate" },
333 { 0xfffffea0, "(-352) No Writable Replicas" },
334 { 0xfffffe9f, "(-353) DN Too Long" },
335 { 0xfffffe9e, "(-354) Rename Not Allowed" },
336 { 0xfffffe9d, "(-355) Not NDS for NT" },
337 { 0xfffffe9c, "(-356) NDS for NT - No Domain" },
338 { 0xfffffe9b, "(-357) NDS for NT - Sync Disabled" },
339 { 0xfffffe9a, "(-358) Iterator Invalid Handle" },
340 { 0xfffffe99, "(-359) Iterator Invalid Position" },
341 { 0xfffffe98, "(-360) Iterator Invalid Search Data" },
342 { 0xfffffe97, "(-361) Iterator Invalid Scope" },
343 { 0xfffffda7, "(-601) No Such Entry" },
344 { 0xfffffda6, "(-602) No Such Value" },
345 { 0xfffffda5, "(-603) No Such Attribute" },
346 { 0xfffffda4, "(-604) No Such Class" },
347 { 0xfffffda3, "(-605) No Such Partition" },
348 { 0xfffffda2, "(-606) Entry Already Exists" },
349 { 0xfffffda1, "(-607) Not Effective Class" },
350 { 0xfffffda0, "(-608) Illegal Attribute" },
351 { 0xfffffd9f, "(-609) Missing Mandatory" },
352 { 0xfffffd9e, "(-610) Illegal DS Name" },
353 { 0xfffffd9d, "(-611) Illegal Containment" },
354 { 0xfffffd9c, "(-612) Can't Have Multiple Values" },
355 { 0xfffffd9b, "(-613) Syntax Violation" },
356 { 0xfffffd9a, "(-614) Duplicate Value" },
357 { 0xfffffd99, "(-615) Attribute Already Exists" },
358 { 0xfffffd98, "(-616) Maximum Entries Exist" },
359 { 0xfffffd97, "(-617) Database Format" },
360 { 0xfffffd96, "(-618) Inconsistent Database" },
361 { 0xfffffd95, "(-619) Invalid Comparison" },
362 { 0xfffffd94, "(-620) Comparison Failed" },
363 { 0xfffffd93, "(-621) Transaction Tracking Disabled" },
364 { 0xfffffd92, "(-622) Invalid Transport" },
365 { 0xfffffd91, "(-623) Syntax Invalid in Name" },
366 { 0xfffffd90, "(-624) Replica Already Exists" },
367 { 0xfffffd8f, "(-625) Transport Failure" },
368 { 0xfffffd8e, "(-626) All Referrals Failed" },
369 { 0xfffffd8d, "(-627) Can't Remove Naming Value" },
370 { 0xfffffd8c, "(-628) Object Class Violation" },
371 { 0xfffffd8b, "(-629) Entry is Not Leaf" },
372 { 0xfffffd8a, "(-630) Different Tree" },
373 { 0xfffffd89, "(-631) Illegal Replica Type" },
374 { 0xfffffd88, "(-632) System Failure" },
375 { 0xfffffd87, "(-633) Invalid Entry for Root" },
376 { 0xfffffd86, "(-634) No Referrals" },
377 { 0xfffffd85, "(-635) Remote Failure" },
378 { 0xfffffd84, "(-636) Unreachable Server" },
379 { 0xfffffd83, "(-637) Previous Move in Progress" },
380 { 0xfffffd82, "(-638) No Character Mapping" },
381 { 0xfffffd81, "(-639) Incomplete Authentication" },
382 { 0xfffffd80, "(-640) Invalid Certificate" },
383 { 0xfffffd7f, "(-641) Invalid Request" },
384 { 0xfffffd7e, "(-642) Invalid Iteration" },
385 { 0xfffffd7d, "(-643) Schema is Non-removable" },
386 { 0xfffffd7c, "(-644) Schema is in Use" },
387 { 0xfffffd7b, "(-645) Class Already Exists" },
388 { 0xfffffd7a, "(-646) Bad Naming Attributes" },
389 { 0xfffffd79, "(-647) Not Root Partition" },
390 { 0xfffffd78, "(-648) Insufficient Stack" },
391 { 0xfffffd77, "(-649) Insufficient Buffer" },
392 { 0xfffffd76, "(-650) Ambiguous Containment" },
393 { 0xfffffd75, "(-651) Ambiguous Naming" },
394 { 0xfffffd74, "(-652) Duplicate Mandatory" },
395 { 0xfffffd73, "(-653) Duplicate Optional" },
396 { 0xfffffd72, "(-654) Partition Busy" },
397 { 0xfffffd71, "(-655) Multiple Replicas" },
398 { 0xfffffd70, "(-656) Crucial Replica" },
399 { 0xfffffd6f, "(-657) Schema Sync in Progress" },
400 { 0xfffffd6e, "(-658) Skulk in Progress" },
401 { 0xfffffd6d, "(-659) Time Not Synchronized" },
402 { 0xfffffd6c, "(-660) Record in Use" },
403 { 0xfffffd6b, "(-661) DS Volume Not Mounted" },
404 { 0xfffffd6a, "(-662) DS Volume IO Failure" },
405 { 0xfffffd69, "(-663) DS Locked" },
406 { 0xfffffd68, "(-664) Old Epoch" },
407 { 0xfffffd67, "(-665) New Epoch" },
408 { 0xfffffd66, "(-666) Incompatible DS Version" },
409 { 0xfffffd65, "(-667) Partition Root" },
410 { 0xfffffd64, "(-668) Entry Not Container" },
411 { 0xfffffd63, "(-669) Failed Authentication" },
412 { 0xfffffd62, "(-670) Invalid Context" },
413 { 0xfffffd61, "(-671) No Such Parent" },
414 { 0xfffffd60, "(-672) No Access" },
415 { 0xfffffd5f, "(-673) Replica Not On" },
416 { 0xfffffd5e, "(-674) Invalid Name Service" },
417 { 0xfffffd5d, "(-675) Invalid Task" },
418 { 0xfffffd5c, "(-676) Invalide Connection Handle" },
419 { 0xfffffd5b, "(-677) Invalid Identity" },
420 { 0xfffffd5a, "(-678) Duplicate ACL" },
421 { 0xfffffd59, "(-679) Partition Already Exists" },
422 { 0xfffffd58, "(-680) Transport Modified" },
423 { 0xfffffd57, "(-681) Alias of an Alias" },
424 { 0xfffffd56, "(-682) Auditing Failed" },
425 { 0xfffffd55, "(-683) Invalid API Version" },
426 { 0xfffffd54, "(-684) Secure NCP Violation" },
427 { 0xfffffd53, "(-685) Move in Progress" },
428 { 0xfffffd52, "(-686) Not a Leaf Partition" },
429 { 0xfffffd51, "(-687) Cannot Abort" },
430 { 0xfffffd50, "(-688) Cache Overflow" },
431 { 0xfffffd4f, "(-689) Invalid Subordinate Count" },
432 { 0xfffffd4e, "(-690) Invalid RDN" },
433 { 0xfffffd4d, "(-691) Modification Time Not Current" },
434 { 0xfffffd4c, "(-692) Incorrect Base Class" },
435 { 0xfffffd4b, "(-693) Missing Reference" },
436 { 0xfffffd4a, "(-694) Lost Entry" },
437 { 0xfffffd49, "(-695) Agent Already Registered" },
438 { 0xfffffd48, "(-696) DS Loader Busy" },
439 { 0xfffffd47, "(-697) DS Cannot Reload" },
440 { 0xfffffd46, "(-698) Replica in Skulk" },
441 { 0xfffffd45, "(-699) Fatal" },
442 { 0xfffffd44, "(-700) Obsolete API" },
443 { 0xfffffd43, "(-701) Synchronization Disabled" },
444 { 0xfffffd42, "(-702) Invalid Parameter" },
445 { 0xfffffd41, "(-703) Duplicate Template" },
446 { 0xfffffd40, "(-704) No Master Replica" },
447 { 0xfffffd3f, "(-705) Duplicate Containment" },
448 { 0xfffffd3e, "(-706) Not a Sibling" },
449 { 0xfffffd3d, "(-707) Invalid Signature" },
450 { 0xfffffd3c, "(-708) Invalid Response" },
451 { 0xfffffd3b, "(-709) Insufficient Sockets" },
452 { 0xfffffd3a, "(-710) Database Read Fail" },
453 { 0xfffffd39, "(-711) Invalid Code Page" },
454 { 0xfffffd38, "(-712) Invalid Escape Character" },
455 { 0xfffffd37, "(-713) Invalide Delimiters" },
456 { 0xfffffd36, "(-714) Not Implemented" },
457 { 0xfffffd35, "(-715) Checksum Failure" },
458 { 0xfffffd34, "(-716) Checksumming Not Supported" },
459 { 0xfffffd33, "(-717) CRC Failure" },
460 { 0xfffffd32, "(-718) Invalid Entry Handle" },
461 { 0xfffffd31, "(-719) Invalid Value Handle" },
462 { 0xfffffd30, "(-720) Connection Denied" },
463 { 0xfffffd2f, "(-721) No Such Federation Link" },
464 { 0xfffffd2e, "(-722) Operetational Schema Mismatch" },
465 { 0xfffffd2d, "(-723) Stream Not Found" },
466 { 0xfffffd2c, "(-724) DClient Unavailable" },
467 { 0xfffffd2b, "(-725) MASV No Access" },
468 { 0xfffffd2a, "(-726) MASV Invalid Request" },
469 { 0xfffffd29, "(-727) MASV Failure" },
470 { 0xfffffd28, "(-728) MASV Already Exists" },
471 { 0xfffffd27, "(-729) MASV Not Found" },
472 { 0xfffffd26, "(-730) MASV Bad Range" },
473 { 0xfffffd25, "(-731) Value Data" },
474 { 0xfffffd24, "(-732) Database Locked" },
475 { 0xfffffd21, "(-735) Nothing to Abort" },
476 { 0xfffffd20, "(-736) End of Stream" },
477 { 0xfffffd1f, "(-737) No Such Template" },
478 { 0xfffffd1e, "(-738) SAS Locked" },
479 { 0xfffffd1d, "(-739) Invalid SAS Version" },
480 { 0xfffffd1c, "(-740) SAS Already Registered" },
481 { 0xfffffd1b, "(-741) Name Type Not Supported" },
482 { 0xfffffd1a, "(-742) Wrong DS Version" },
483 { 0xfffffd19, "(-743) Invalid Control Function" },
484 { 0xfffffd18, "(-744) Invalid Control State" },
485 { 0xfffffd17, "(-745) Cache in Use" },
486 { 0xfffffd16, "(-746) Zero Creation Time" },
487 { 0xfffffd15, "(-747) Would Block" },
488 { 0xfffffd14, "(-748) Connection Timeout" },
489 { 0xfffffd13, "(-749) Too Many Referrals" },
490 { 0xfffffd12, "(-750) Operation Cancelled" },
491 { 0xfffffd11, "(-751) Unknown Target" },
492 { 0xfffffd10, "(-752) GUID Failure" },
493 { 0xfffffd0f, "(-753) Incompatible OS" },
494 { 0xfffffd0e, "(-754) Callback Cancel" },
495 { 0xfffffd0d, "(-755) Invalid Synchronization Data" },
496 { 0xfffffd0c, "(-756) Stream Exists" },
497 { 0xfffffd0b, "(-757) Auxiliary Has Containment" },
498 { 0xfffffd0a, "(-758) Auxiliary Not Containere" },
499 { 0xfffffd09, "(-759) Auxiliary Not Effective" },
500 { 0xfffffd08, "(-760) Auxiliary On Alias" },
501 { 0xfffffd07, "(-761) Have Seen State" },
502 { 0xfffffd06, "(-762) Verb Locked" },
503 { 0xfffffd05, "(-763) Verb Exceeds Table Length" },
504 { 0xfffffd04, "(-764) BOF Hit" },
505 { 0xfffffd03, "(-765) EOF Hit" },
506 { 0xfffffd02, "(-766) Incompatible Replica Version" },
507 { 0xfffffd01, "(-767) Query Timeout" },
508 { 0xfffffd00, "(-768) Query Maximum Count" },
509 { 0xfffffcff, "(-769) Duplicate Naming" },
510 { 0xfffffcfe, "(-770) No Transaction Active" },
511 { 0xfffffcfd, "(-771) Transaction Active" },
512 { 0xfffffcfc, "(-772) Illegal Transaction Operation" },
513 { 0xfffffcfb, "(-773) Iterator Syntax" },
514 { 0xfffffcfa, "(-774) Repairing DIB" },
515 { 0xfffffcf9, "(-775) Invalid OID Format" },
516 { 0xffff0000, "Ok" },
523 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
524 int *req_cond_results, gboolean really_decode,
525 const ncp_record *ncp_rec);
527 /* NCP packets come in request/reply pairs. The request packets tell the type
528 * of NCP request and give a sequence ID. The response, unfortunately, only
529 * identifies itself via the sequence ID; you have to know what type of NCP
530 * request the request packet contained in order to successfully parse the NCP
531 * response. A global method for doing this does not exist in ethereal yet
532 * (NFS also requires it), so for now the NCP section will keep its own hash
533 * table keeping track of NCP packet types.
535 * We construct a conversation specified by the client and server
536 * addresses and the connection number; the key representing the unique
537 * NCP request then is composed of the pointer to the conversation
538 * structure, cast to a "guint" (which may throw away the upper 32
539 * bits of the pointer on a P64 platform, but the low-order 32 bits
540 * are more likely to differ between conversations than the upper 32 bits),
541 * and the sequence number.
543 * The value stored in the hash table is the ncp_req_hash_value pointer. This
544 * struct tells us the NCP type and gives the ncp2222_record pointer, if
545 * ncp_type == 0x2222.
548 conversation_t *conversation;
555 } ncp_req_eid_hash_key;
558 const ncp_record *ncp_rec;
559 gboolean *req_cond_results;
560 guint32 req_frame_num;
561 guint32 req_nds_flags;
562 guint8 nds_request_verb;
565 } ncp_req_hash_value;
568 char object_name[256];
570 } ncp_req_eid_hash_value;
572 static GHashTable *ncp_req_hash = NULL;
573 static GHashTable *ncp_req_eid_hash = NULL;
574 static GMemChunk *ncp_req_eid_hash_keys = NULL;
575 static GMemChunk *ncp_req_eid_hash_values = NULL;
576 static GMemChunk *ncp_req_hash_keys = NULL;
577 static GMemChunk *ncp_req_hash_values = NULL;
581 ncp_equal(gconstpointer v, gconstpointer v2)
583 ncp_req_hash_key *val1 = (ncp_req_hash_key*)v;
584 ncp_req_hash_key *val2 = (ncp_req_hash_key*)v2;
586 if (val1->conversation == val2->conversation &&
587 val1->nw_sequence == val2->nw_sequence ) {
594 ncp_eid_equal(gconstpointer v, gconstpointer v2)
596 ncp_req_eid_hash_key *val1 = (ncp_req_eid_hash_key*)v;
597 ncp_req_eid_hash_key *val2 = (ncp_req_eid_hash_key*)v2;
599 if (val1->nw_eid == val2->nw_eid ) {
606 ncp_hash(gconstpointer v)
608 ncp_req_hash_key *ncp_key = (ncp_req_hash_key*)v;
609 return GPOINTER_TO_UINT(ncp_key->conversation) + ncp_key->nw_sequence;
613 ncp_eid_hash(gconstpointer v)
615 ncp_req_eid_hash_key *ncp_eid_key = (ncp_req_eid_hash_key*)v;
616 return GPOINTER_TO_UINT(ncp_eid_key->nw_eid);
619 /* Frees memory used by the ncp_req_hash_value's */
621 ncp_req_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
623 ncp_req_hash_value *request_value = (ncp_req_hash_value*) value;
625 if (request_value->req_cond_results) {
626 g_free(request_value->req_cond_results);
630 /* Frees memory used by the ncp_req_hash_value's */
632 ncp_req_eid_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
634 ncp_req_eid_hash_value *request_eid_value = (ncp_req_eid_hash_value*) value;
636 if (request_eid_value->object_class) {
637 g_free(request_eid_value->object_name);
641 /* Initializes the hash table and the mem_chunk area each time a new
642 * file is loaded or re-loaded in ethereal */
644 ncp_init_protocol(void)
647 g_hash_table_foreach(ncp_req_hash, ncp_req_hash_cleanup, NULL);
648 g_hash_table_destroy(ncp_req_hash);
650 if (ncp_req_eid_hash) {
651 g_hash_table_foreach(ncp_req_eid_hash, ncp_req_eid_hash_cleanup, NULL);
652 g_hash_table_destroy(ncp_req_eid_hash);
654 if (ncp_req_hash_keys)
655 g_mem_chunk_destroy(ncp_req_hash_keys);
656 if (ncp_req_hash_values)
657 g_mem_chunk_destroy(ncp_req_hash_values);
658 if (ncp_req_eid_hash_keys)
659 g_mem_chunk_destroy(ncp_req_eid_hash_keys);
660 if (ncp_req_eid_hash_values)
661 g_mem_chunk_destroy(ncp_req_eid_hash_values);
663 ncp_req_hash = g_hash_table_new(ncp_hash, ncp_equal);
664 ncp_req_eid_hash = g_hash_table_new(ncp_eid_hash, ncp_eid_equal);
665 ncp_req_hash_keys = g_mem_chunk_new("ncp_req_hash_keys",
666 sizeof(ncp_req_hash_key),
667 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_key),
669 ncp_req_hash_values = g_mem_chunk_new("ncp_req_hash_values",
670 sizeof(ncp_req_hash_value),
671 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_value),
673 ncp_req_eid_hash_keys = g_mem_chunk_new("ncp_req_eid_hash_keys",
674 sizeof(ncp_req_eid_hash_key),
675 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_key),
677 ncp_req_eid_hash_values = g_mem_chunk_new("ncp_req_eid_hash_values",
678 sizeof(ncp_req_eid_hash_value),
679 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_value),
683 /* After the sequential run, we don't need the ncp_request hash and keys
684 * anymore; the lookups have already been done and the vital info
685 * saved in the reply-packets' private_data in the frame_data struct. */
687 ncp_postseq_cleanup(void)
690 /* Destroy the hash, but don't clean up request_condition data. */
691 g_hash_table_destroy(ncp_req_hash);
694 if (ncp_req_hash_keys) {
695 g_mem_chunk_destroy(ncp_req_hash_keys);
696 ncp_req_hash_keys = NULL;
698 /* Don't free the ncp_req_hash_values, as they're
699 * needed during random-access processing of the proto_tree.*/
700 if (ncp_req_eid_hash) {
701 /* Destroy the hash, but don't clean up request_condition data. */
702 g_hash_table_destroy(ncp_req_eid_hash);
703 ncp_req_eid_hash = NULL;
705 if (ncp_req_eid_hash_keys) {
706 g_mem_chunk_destroy(ncp_req_eid_hash_keys);
707 ncp_req_eid_hash_keys = NULL;
712 ncp_hash_insert(conversation_t *conversation, guint8 nw_sequence,
713 const ncp_record *ncp_rec)
715 ncp_req_hash_key *request_key;
716 ncp_req_hash_value *request_value;
718 /* Now remember the request, so we can find it if we later
720 request_key = g_mem_chunk_alloc(ncp_req_hash_keys);
721 request_key->conversation = conversation;
722 request_key->nw_sequence = nw_sequence;
724 request_value = g_mem_chunk_alloc(ncp_req_hash_values);
725 request_value->ncp_rec = ncp_rec;
726 request_value->req_cond_results = NULL;
727 request_value->req_nds_flags = 0;
729 g_hash_table_insert(ncp_req_hash, request_key, request_value);
731 return request_value;
734 ncp_req_eid_hash_value*
735 ncp_eid_hash_insert(guint32 nw_eid)
737 ncp_req_eid_hash_key *request_eid_key;
738 ncp_req_eid_hash_value *request_eid_value;
740 /* Now remember the request, so we can find it if we later
742 request_eid_key = g_mem_chunk_alloc(ncp_req_eid_hash_keys);
743 request_eid_key->nw_eid = nw_eid;
745 request_eid_value = g_mem_chunk_alloc(ncp_req_eid_hash_values);
746 strcpy(request_eid_value->object_name, " ");
747 request_eid_value->object_class = NULL;
749 g_hash_table_insert(ncp_req_eid_hash, request_eid_key, request_eid_value);
751 return request_eid_value;
754 /* Returns the ncp_rec*, or NULL if not found. */
756 ncp_hash_lookup(conversation_t *conversation, guint8 nw_sequence)
758 ncp_req_hash_key request_key;
760 request_key.conversation = conversation;
761 request_key.nw_sequence = nw_sequence;
763 return g_hash_table_lookup(ncp_req_hash, &request_key);
766 /* Returns the value_rec* for needed EID, or NULL if not found. */
767 ncp_req_eid_hash_value*
768 ncp_eid_hash_lookup(conversation_t *conversation _U_, guint32 nw_eid)
770 ncp_req_eid_hash_key request_eid_key;
772 request_eid_key.nw_eid = nw_eid;
774 return g_hash_table_lookup(ncp_req_eid_hash, &request_eid_key);
777 /* Does NCP func require a subfunction code? */
779 ncp_requires_subfunc(guint8 func)
781 const guint8 *ncp_func_requirement = ncp_func_requires_subfunc;
783 while (*ncp_func_requirement != 0) {
784 if (*ncp_func_requirement == func) {
787 ncp_func_requirement++;
792 /* Does the NCP func have a length parameter? */
794 ncp_has_length_parameter(guint8 func)
796 const guint8 *ncp_func_requirement = ncp_func_has_no_length_parameter;
798 while (*ncp_func_requirement != 0) {
799 if (*ncp_func_requirement == func) {
802 ncp_func_requirement++;
808 /* Return a ncp_record* based on func and possibly subfunc */
809 static const ncp_record *
810 ncp_record_find(guint8 func, guint8 subfunc)
812 const ncp_record *ncp_rec = ncp_packets;
814 while(ncp_rec->func != 0 || ncp_rec->subfunc != 0 ||
815 ncp_rec->name != NULL ) {
816 if (ncp_rec->func == func) {
817 if (ncp_rec->has_subfunc) {
818 if (ncp_rec->subfunc == subfunc) {
832 /* Given a proto_item*, assume it contains an integer value
833 * and return a guint from it. */
835 get_item_value(proto_item *item)
837 return fvalue_get_integer(PITEM_FINFO(item)->value);
842 get_item_string(proto_item *item)
844 return fvalue_get(PITEM_FINFO(item)->value);
848 get_item_name(proto_item *item)
850 return PITEM_FINFO(item)->hfinfo->name;
854 typedef proto_item* (*padd_func_t)(ptvcursor_t*, const ptvc_record*);
857 * XXX - are these just DOS-format dates and times?
859 * Should we put code to understand various date and time formats (UNIX,
860 * DOS, SMB weird mutant UNIX, NT, Mac, etc. into libethereal, and have
861 * the "display" member of an HF_ABSOLUTE_TIME field specify whether
862 * it's DOS date/DOS time, DOS time/DOS date, NT time, UNIX time_t,
863 * UNIX "struct timeval", NFSv3/NFSv4 seconds/nanoseconds, Mac, etc.?
865 * What about hijacking the "bitmask" field to specify the precision of
866 * the time stamp, or putting a combination of precision and format
867 * into the "display" member?
869 * What about relative times? Should they have units (seconds, milliseconds,
870 * microseconds, nanoseconds, etc.), precision, and format in there?
934 /* Given an integer, fill in a nw_date_t struct. */
936 uint_to_nwdate(guint data, nw_date_t *nwdate)
938 nwdate->day = data & 0x001f;
939 nwdate->month = (data & 0x01e0) >> 5;
940 nwdate->year = ((data & 0xfe00) >> 9) + 1980;
943 /* Given an integer, fill in a nw_time_t struct. */
945 uint_to_nwtime(guint data, nw_time_t *nwtime)
947 /* 2-second resolution */
948 nwtime->second = (data & 0x001f) * 2;
949 nwtime->minute = ((data & 0x07e0) >> 5) + 1;
950 nwtime->hour = ((data & 0xf800) >> 11) + 1;
954 unicode_to_string(char * data, guint32 length)
961 if (data[1] == 0x00){
963 for (i = 0; i < length; i++) {
964 character = data[offset];
965 buffer[i] = character & 0xff;
977 padd_normal(ptvcursor_t *ptvc, const ptvc_record *rec)
980 ptvcursor_add(ptvc, *rec->hf_ptr,
981 rec->length, rec->endianness);
986 padd_date(ptvcursor_t *ptvc, const ptvc_record *rec)
992 offset = ptvcursor_current_offset(ptvc);
994 item = ptvcursor_add(ptvc, *rec->hf_ptr,
995 rec->length, rec->endianness);
997 uint_to_nwdate(get_item_value(item), &nw_date);
999 proto_item_set_text(item, get_item_name(item));
1000 proto_item_append_text(item, ": %04u/%02u/%02u",
1001 nw_date.year, nw_date.month, nw_date.day);
1006 padd_time(ptvcursor_t *ptvc, const ptvc_record *rec)
1012 offset = ptvcursor_current_offset(ptvc);
1014 item = ptvcursor_add(ptvc, *rec->hf_ptr,
1015 rec->length, rec->endianness);
1017 uint_to_nwtime(get_item_value(item), &nw_time);
1019 proto_item_set_text(item, get_item_name(item));
1020 proto_item_append_text(item, ": %02u:%02u:%02u",
1021 nw_time.hour, nw_time.minute, nw_time.second);
1026 /* Convert a string from little-endian unicode to ascii. At the moment we
1027 fake it by taking every odd byte. )-: The caller must free the
1030 padd_uni(ptvcursor_t *ptvc, const ptvc_record *rec)
1036 nw_uni.buffer = "\0";
1037 offset = ptvcursor_current_offset(ptvc);
1039 item = ptvcursor_add(ptvc, *rec->hf_ptr,
1040 rec->length, rec->endianness);
1042 proto_item_set_text(item, get_item_name(item));
1043 proto_item_append_text(item, " %s",
1049 /* Add a value for a ptvc_record, and process the sub-ptvc_record
1050 * that it points to. */
1052 process_bitfield_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1053 gboolean really_decode)
1056 proto_tree *sub_tree;
1057 const ptvc_record *sub_rec;
1060 ptvcursor_t *sub_ptvc;
1062 if (really_decode) {
1063 /* Save the current offset */
1064 current_offset = ptvcursor_current_offset(ptvc);
1067 item = ptvcursor_add(ptvc, *rec->hf_ptr, rec->length,
1070 ett = *rec->sub_ptvc_rec->ett;
1072 /* Make a new protocol sub-tree */
1073 sub_tree = proto_item_add_subtree(item, ett);
1075 /* Make a new ptvcursor */
1076 sub_ptvc = ptvcursor_new(sub_tree, ptvcursor_tvbuff(ptvc),
1080 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
1081 while(sub_rec->hf_ptr != NULL) {
1082 g_assert(!sub_rec->sub_ptvc_rec);
1083 ptvcursor_add_no_advance(sub_ptvc, *sub_rec->hf_ptr,
1084 sub_rec->length, sub_rec->endianness);
1089 ptvcursor_free(sub_ptvc);
1092 ptvcursor_advance(ptvc, rec->length);
1096 /* Process a sub-ptvc_record that points to a "struct" ptvc_record. */
1098 process_struct_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1099 int *req_cond_results, gboolean really_decode,
1100 const ncp_record *ncp_rec)
1102 const ptvc_record *sub_rec;
1104 proto_tree *old_tree=NULL, *new_tree;
1105 proto_item *item=NULL;
1108 /* Create a sub-proto_tree? */
1109 if (rec->sub_ptvc_rec->descr) {
1110 ett = *rec->sub_ptvc_rec->ett;
1111 old_tree = ptvcursor_tree(ptvc);
1112 offset = ptvcursor_current_offset(ptvc);
1113 item = proto_tree_add_text(old_tree, ptvcursor_tvbuff(ptvc),
1114 offset, PROTO_LENGTH_UNTIL_END,
1115 rec->sub_ptvc_rec->descr);
1116 new_tree = proto_item_add_subtree(item, ett);
1117 ptvcursor_set_tree(ptvc, new_tree);
1120 /* Get the ptvc_record for the struct and call our caller
1122 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
1123 process_ptvc_record(ptvc, sub_rec, req_cond_results, really_decode, ncp_rec);
1125 /* Re-set the tree */
1126 if (rec->sub_ptvc_rec->descr) {
1127 proto_item_set_len(item, ptvcursor_current_offset(ptvc) - offset);
1128 ptvcursor_set_tree(ptvc, old_tree);
1132 /* Run through the table of ptvc_record's and add info to the tree. This
1133 * is the work-horse of process_ptvc_record(). */
1135 _process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1136 int *req_cond_results, gboolean really_decode,
1137 const ncp_record *ncp_rec)
1140 guint i, repeat_count;
1141 padd_func_t func = NULL;
1143 if (rec->sub_ptvc_rec) {
1145 if (rec->repeat_index == NO_REPEAT) {
1146 if (rec->hf_ptr == PTVC_STRUCT) {
1147 process_struct_sub_ptvc_record(ptvc, rec,
1148 req_cond_results, really_decode,
1152 process_bitfield_sub_ptvc_record(ptvc, rec,
1157 repeat_count = repeat_vars[rec->repeat_index];
1158 for (i = 0; i < repeat_count; i++ ) {
1159 if (rec->hf_ptr == PTVC_STRUCT) {
1160 process_struct_sub_ptvc_record(ptvc, rec,
1161 req_cond_results, really_decode,
1165 process_bitfield_sub_ptvc_record(ptvc, rec,
1172 /* If we can't repeat this field, we might use it
1173 * to set a 'var'. */
1174 if (rec->repeat_index == NO_REPEAT) {
1175 if (really_decode) {
1176 /* Handle any special formatting. */
1177 switch(rec->special_fmt) {
1181 case NCP_FMT_NW_DATE:
1184 case NCP_FMT_NW_TIME:
1187 case NCP_FMT_UNICODE:
1191 g_assert_not_reached();
1193 item = func(ptvc, rec);
1195 /* Set the value as a 'var' ? */
1196 if (rec->var_index != NO_VAR) {
1197 repeat_vars[rec->var_index] = get_item_value(item);
1201 /* If we don't decode the field, we
1202 * better not use the value to set a var.
1203 * Actually, we could, as long as we don't
1204 * *use* that var; for now keep this assert in
1206 g_assert(rec->var_index == NO_VAR);
1207 ptvcursor_advance(ptvc, rec->length);
1211 /* We do repeat this field. */
1212 repeat_count = repeat_vars[rec->repeat_index];
1213 if (really_decode) {
1214 /* Handle any special formatting. */
1215 switch(rec->special_fmt) {
1219 case NCP_FMT_NW_DATE:
1222 case NCP_FMT_NW_TIME:
1225 case NCP_FMT_UNICODE:
1229 g_assert_not_reached();
1231 for (i = 0; i < repeat_count; i++ ) {
1236 for (i = 0; i < repeat_count; i++ ) {
1237 ptvcursor_advance(ptvc, rec->length);
1244 /* Run through the table of ptvc_record's and add info to the tree.
1245 * Honor a request condition result. */
1247 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1248 int *req_cond_results, gboolean really_decode,
1249 const ncp_record *ncp_rec)
1253 while(rec->hf_ptr != NULL) {
1254 decode = really_decode;
1255 /* If we're supposed to decode, check the request condition
1256 * results to see if we should override this and *not* decode. */
1257 if (decode && req_cond_results) {
1258 if (rec->req_cond_index != NO_REQ_COND) {
1259 if (req_cond_results[rec->req_cond_index] == FALSE) {
1264 if (decode || ncp_rec->req_cond_size_type == REQ_COND_SIZE_CONSTANT) {
1265 _process_ptvc_record(ptvc, rec, req_cond_results, decode, ncp_rec);
1273 /* Clear the repeat_vars array. */
1275 clear_repeat_vars(void)
1279 for (i = 0 ; i < NUM_REPEAT_VARS; i++ ) {
1285 /* Given an error_equivalency table and a completion code, return
1286 * the string representing the error. */
1288 ncp_error_string(const error_equivalency *errors, guint8 completion_code)
1290 while (errors->ncp_error_index != -1) {
1291 if (errors->error_in_packet == completion_code) {
1292 return ncp_errors[errors->ncp_error_index];
1297 return "Unknown Error Code";
1300 static const ncp_record ncp1111_request =
1301 { 0x01, 0x00, NO_SUBFUNC, "Create Connection Service", NCP_GROUP_CONNECTION,
1302 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1304 static const ncp_record ncp5555_request =
1305 { 0x01, 0x00, NO_SUBFUNC, "Destroy Connection Service", NCP_GROUP_CONNECTION,
1306 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1308 static const ncp_record ncpbbbb_request =
1309 { 0x01, 0x00, NO_SUBFUNC, "Server Broadcast Message", NCP_GROUP_CONNECTION,
1310 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1312 static const ncp_record ncplip_echo =
1313 { 0x01, 0x00, NO_SUBFUNC, "LIP Echo Packet", NCP_GROUP_CONNECTION,
1314 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1316 /* Wrapper around proto_tree_free() */
1317 void free_proto_tree(void *tree)
1320 proto_tree_free((proto_tree*) tree);
1325 align_4(tvbuff_t *tvb, guint32 aoffset)
1327 if(tvb_length_remaining(tvb, aoffset) > 4 )
1335 get_string(tvbuff_t* tvb, guint offset, guint str_length, char *dest_buf)
1339 guint32 length_remaining = 0;
1341 length_remaining = tvb_length_remaining(tvb, offset);
1342 if(str_length > length_remaining)
1344 strcpy(dest_buf, "String too long to process");
1347 for ( i = 0; i < str_length; i++ )
1349 c_char = tvb_get_guint8(tvb, offset );
1350 if (c_char<0x20 || c_char>0x7e)
1355 dest_buf[i] = c_char & 0xff;
1365 dest_buf[i] = c_char & 0xff;
1370 if(length_remaining==1)
1372 dest_buf[i+1] = '\0';
1380 /*************************************
1381 * Return based on % format in request
1382 * %d = integer in decimal format = 0
1383 * %x = integer in hex format = 1
1385 **************************************/
1387 get_info_type(gchar* check_string)
1393 length = strlen(check_string);
1395 for (i = 0 ; i < length-1 ; i++ ) {
1396 char_val = check_string[i+1];
1397 if (check_string[i] == 0x25 && check_string[i+1] == 0x64) {
1400 if ( check_string[i] == 0x25 && check_string[i+1] == 0x78) {
1408 process_bitfield(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
1410 char flags_str[512];
1413 proto_tree *flags_tree;
1417 bvalue = 0x00000001;
1418 strcpy(flags_str, " (");
1420 for (i = 0 ; i < (values->vlength*8); i++ ) {
1421 if (values->vvalue & bvalue)
1423 strcat(flags_str, sep);
1426 strcat(flags_str, values->bit1);
1429 strcat(flags_str, values->bit2);
1432 strcat(flags_str, values->bit3);
1435 strcat(flags_str, values->bit4);
1438 strcat(flags_str, values->bit5);
1441 strcat(flags_str, values->bit6);
1444 strcat(flags_str, values->bit7);
1447 strcat(flags_str, values->bit8);
1450 strcat(flags_str, values->bit9);
1453 strcat(flags_str, values->bit10);
1456 strcat(flags_str, values->bit11);
1459 strcat(flags_str, values->bit12);
1462 strcat(flags_str, values->bit13);
1465 strcat(flags_str, values->bit14);
1468 strcat(flags_str, values->bit15);
1471 strcat(flags_str, values->bit16);
1480 if (flags_str[0] != '\0')
1482 strcat(flags_str, " )\0");
1483 if(values->vlength==4)
1485 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
1486 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%08x -%s",
1487 values->vdesc, values->vvalue, flags_str);
1491 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
1492 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%04x -%s",
1493 values->vdesc, values->vvalue, flags_str);
1497 flags_tree = proto_item_add_subtree(tinew, ett_nds);
1499 bvalue = 0x00000001;
1501 for (i = 0 ; i < (values->vlength*8); i++ ) {
1503 if (values->vvalue & bvalue)
1508 proto_tree_add_item(flags_tree, values->bit1hfname, tvb, values->voffset, values->vlength, TRUE);
1511 proto_tree_add_item(flags_tree, values->bit2hfname, tvb, values->voffset, values->vlength, TRUE);
1514 proto_tree_add_item(flags_tree, values->bit3hfname, tvb, values->voffset, values->vlength, TRUE);
1517 proto_tree_add_item(flags_tree, values->bit4hfname, tvb, values->voffset, values->vlength, TRUE);
1520 proto_tree_add_item(flags_tree, values->bit5hfname, tvb, values->voffset, values->vlength, TRUE);
1523 proto_tree_add_item(flags_tree, values->bit6hfname, tvb, values->voffset, values->vlength, TRUE);
1526 proto_tree_add_item(flags_tree, values->bit7hfname, tvb, values->voffset, values->vlength, TRUE);
1529 proto_tree_add_item(flags_tree, values->bit8hfname, tvb, values->voffset, values->vlength, TRUE);
1532 proto_tree_add_item(flags_tree, values->bit9hfname, tvb, values->voffset, values->vlength, TRUE);
1535 proto_tree_add_item(flags_tree, values->bit10hfname, tvb, values->voffset, values->vlength, TRUE);
1538 proto_tree_add_item(flags_tree, values->bit11hfname, tvb, values->voffset, values->vlength, TRUE);
1541 proto_tree_add_item(flags_tree, values->bit12hfname, tvb, values->voffset, values->vlength, TRUE);
1544 proto_tree_add_item(flags_tree, values->bit13hfname, tvb, values->voffset, values->vlength, TRUE);
1547 proto_tree_add_item(flags_tree, values->bit14hfname, tvb, values->voffset, values->vlength, TRUE);
1550 proto_tree_add_item(flags_tree, values->bit15hfname, tvb, values->voffset, values->vlength, TRUE);
1553 proto_tree_add_item(flags_tree, values->bit16hfname, tvb, values->voffset, values->vlength, TRUE);
1566 print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val *vvalues)
1574 guint32 voffset = 0;
1576 guint32 number_of_values = 0;
1577 guint32 number_of_items = 0;
1583 char *valuestr = NULL;
1589 voffset = vvalues->voffset;
1590 if(tvb_get_guint8(tvb, voffset) == 0x00)
1592 voffset = voffset+2;
1595 number_of_values = tvb_get_letohl(tvb, voffset);
1597 vitem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset,
1598 4, number_of_values, "Number of Values: %d", number_of_values);
1600 nvtree = proto_item_add_subtree(vitem, ett_nds);
1602 voffset = voffset + 4;
1604 for (icounter = 1 ; icounter <= number_of_values; icounter++ )
1608 case 0x00000006: /* Case Insensitive List */
1609 case 0x0000000d: /* Binary String List */
1610 case 0x00000012: /* Postal Address */
1611 voffset += align_4(tvb, voffset);
1612 voffset = voffset+4;
1613 number_of_items = tvb_get_letohl(tvb, voffset);
1614 voffset = voffset+4;
1615 for (r=1; r<=number_of_items; r++)
1617 value1 = tvb_get_letohl(tvb, voffset);
1618 voffset = voffset + 4;
1619 get_string(tvb, voffset, value1, vvalues->vstring);
1620 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1621 value1, vvalues->vstring);
1622 voffset = voffset + value1;
1624 voffset += align_4(tvb, voffset);
1626 case 0x00000007: /* Boolean */
1627 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1630 vvalues->vstring = "False";
1634 vvalues->vstring = "True";
1636 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1637 value1, vvalues->vstring);
1640 case 0x00000009: /* Binary String */
1641 case 0x00000015: /* Stream */
1642 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1643 if(value1 > tvb_length_remaining(tvb, voffset))
1648 proto_tree_add_bytes(nvtree, hf_value_bytes, tvb, voffset, value1, tvb_get_ptr(tvb, voffset, value1));
1650 voffset += (value1%2);
1652 case 0x00000008: /* Signed Integer */
1653 case 0x00000016: /* Counter */
1654 case 0x00000018: /* Time */
1655 case 0x0000001b: /* Interval */
1656 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1657 voffset = voffset+4;
1658 value2 = tvb_get_letohl(tvb, voffset); /* Value */
1659 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1660 value1, value2, "Value %d", value2);
1661 voffset = voffset+4;
1663 case 0x0000000b: /* Fax Number */
1664 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1665 voffset = voffset+4;
1666 get_string(tvb, voffset, value1, vvalues->vstring);
1667 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1668 value1, vvalues->vstring);
1669 voffset = voffset + value1;
1670 voffset += align_4(tvb, voffset);
1671 value2 = tvb_get_letohl(tvb, voffset); /* Bit Count */
1673 value3 = tvb_get_letohl(tvb, voffset); /* Bit length */
1674 voffset = voffset+4;
1675 get_string(tvb, voffset, value3, vvalues->vstring);
1676 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1677 value3, vvalues->vstring);
1678 voffset = voffset+value3;
1679 voffset += align_4(tvb, voffset);
1681 case 0x0000000c: /* Network Address */
1682 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1683 voffset = voffset + 4;
1684 value2 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
1685 valuestr = match_strval(value2, nds_protocol_type);
1686 if (valuestr == NULL)
1688 valuestr="(Undefined Protocol)";
1690 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1691 value1, value2, valuestr, value2);
1692 voffset = voffset+4;
1693 value3 = tvb_get_letohl(tvb, voffset); /* length of address */
1694 voffset = voffset+4;
1698 proto_tree_add_item(nvtree, hf_nds_net, tvb, voffset, 4, FALSE);
1699 proto_tree_add_item(nvtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
1700 proto_tree_add_item(nvtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
1702 /*proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1703 value4 = tvb_get_letohl(tvb, voffset+2);
1704 proto_tree_add_ipv4(nvtree, hf_add_ref_ip, tvb, voffset+2, 4, value4);
1707 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1708 value4 = tvb_get_letohl(tvb, voffset+2);
1709 proto_tree_add_ipv4(nvtree, hf_add_ref_udp, tvb, voffset+2, 4, value4);
1712 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1713 value4 = tvb_get_letohl(tvb, voffset+2);
1714 proto_tree_add_ipv4(nvtree, hf_add_ref_tcp, tvb, voffset+2, 4, value4);
1718 get_string(tvb, voffset, value3, vvalues->vstring);
1719 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1720 value3, vvalues->vstring);
1725 voffset = voffset + value3;
1726 voffset += align_4(tvb, voffset);
1728 case 0x0000000f: /* File System Path */
1729 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1730 voffset = voffset + 4;
1731 value2 = tvb_get_letohl(tvb, voffset); /* Name Space */
1732 valuestr = match_strval(value2, name_space_type);
1733 if (valuestr == NULL)
1735 valuestr = "Unknown Name Space";
1737 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1739 voffset = voffset+4;
1740 value3 = tvb_get_letohl(tvb, voffset); /* Length of Volume name */
1741 voffset = voffset+4;
1742 get_string(tvb, voffset, value3, vvalues->vstring);
1743 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1744 value3, vvalues->vstring);
1745 voffset = voffset+value3;
1746 voffset += align_4(tvb, voffset);
1747 value4 = tvb_get_letohl(tvb, voffset); /* Length of Path name */
1748 voffset = voffset+4;
1749 get_string(tvb, voffset, value4, vvalues->vstring);
1750 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1751 value4, vvalues->vstring);
1752 voffset = voffset+value4;
1753 voffset += align_4(tvb, voffset);
1755 case 0x00000010: /* Replica Pointer */
1756 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1757 voffset = voffset + 4;
1758 value2 = tvb_get_letohl(tvb, voffset); /* Length of Server name */
1759 voffset = voffset+4;
1760 get_string(tvb, voffset, value2, vvalues->vstring);
1761 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1762 value2, vvalues->vstring);
1763 voffset = voffset+value2;
1764 voffset += align_4(tvb, voffset);
1765 rtype = tvb_get_letohs(tvb, voffset); /* replica type */
1766 valuestr = match_strval(rtype, nds_replica_type);
1767 if (valuestr == NULL)
1769 valuestr="(Unknown Replica Type)";
1771 proto_tree_add_string(nvtree, hf_replica_type, tvb, voffset,
1773 voffset = voffset+2;
1774 rstate = tvb_get_letohs(tvb, voffset); /* replica state */
1775 valuestr = match_strval(rstate, nds_replica_state);
1776 if (valuestr == NULL)
1778 valuestr="(Unknown Replica State)";
1780 proto_tree_add_string(nvtree, hf_replica_state, tvb, voffset,
1782 voffset = voffset+2;
1783 value3 = tvb_get_letohl(tvb, voffset); /* Replica number */
1784 proto_tree_add_uint_format(nvtree, hf_replica_number, tvb, voffset,
1785 4, value3, "Replica Number %d", value3);
1786 voffset = voffset+4;
1787 if(vvalues->nds_version == 0xfe)
1791 number_of_items = tvb_get_letohl(tvb, voffset); /* Number of Addresses */
1792 aditem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset,
1793 4, number_of_items, "Number of Addresses: %d", number_of_items);
1795 adtree = proto_item_add_subtree(aditem, ett_nds);
1796 voffset = voffset+4;
1797 for (r=1; r <= number_of_items; r++)
1799 voffset += align_4(tvb, voffset);
1800 value4 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
1801 valuestr = match_strval(value4, nds_protocol_type);
1802 if (valuestr == NULL)
1804 valuestr="(Undefined Protocol)";
1806 proto_tree_add_uint_format(adtree, hf_nds_uint32value, tvb, voffset,
1807 4, value4, valuestr, value4);
1808 voffset = voffset+4;
1809 value5 = tvb_get_letohl(tvb, voffset); /* length of address */
1810 voffset = voffset+4;
1814 proto_tree_add_item(adtree, hf_nds_net, tvb, voffset, 4, FALSE);
1815 proto_tree_add_item(adtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
1816 proto_tree_add_item(adtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
1819 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1820 value6 = tvb_get_letohl(tvb, voffset+2);
1821 proto_tree_add_ipv4(adtree, hf_add_ref_ip, tvb, voffset+2, 4, value6);
1824 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1825 value6 = tvb_get_letohl(tvb, voffset+2);
1826 proto_tree_add_ipv4(adtree, hf_add_ref_udp, tvb, voffset+2, 4, value6);
1829 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1830 value6 = tvb_get_letohl(tvb, voffset+2);
1831 proto_tree_add_ipv4(adtree, hf_add_ref_tcp, tvb, voffset+2, 4, value6);
1834 get_string(tvb, voffset, value5, vvalues->vstring);
1835 proto_tree_add_string(adtree, hf_value_string, tvb, voffset,
1836 value5, vvalues->vstring);
1841 voffset = voffset + value5;
1843 voffset += align_4(tvb, voffset);
1845 case 0x00000011: /* Object ACL */
1846 value1 = tvb_get_letohl(tvb, voffset); /* Length of Field */
1847 voffset = voffset + 4;
1848 value2 = tvb_get_letohl(tvb, voffset);
1849 voffset = voffset + 4;
1850 get_string(tvb, voffset, value2, vvalues->vstring); /* Unicode String */
1851 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1852 value2, vvalues->vstring);
1853 voffset = voffset + value2;
1854 voffset += align_4(tvb, voffset);
1855 value3 = tvb_get_letohl(tvb, voffset);
1856 voffset = voffset + 4;
1857 get_string(tvb, voffset, value3, vvalues->vstring); /* Unicode Subject Name */
1858 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1859 value3, vvalues->vstring);
1860 voffset = voffset + value3;
1861 voffset += align_4(tvb, voffset);
1862 value4 = tvb_get_letohl(tvb, voffset); /* Privileges */
1863 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1864 4, value4, "Privileges %8x", value4);
1865 voffset = voffset+4;
1866 voffset += align_4(tvb, voffset);
1868 case 0x00000013: /* Time Stamp */
1869 value1 = tvb_get_letohl(tvb, voffset); /* Seconds */
1870 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1871 4, value1, "Lenght of Record: %d", value1);
1872 voffset = voffset+4;
1873 value2 = tvb_get_letohl(tvb, voffset);
1874 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1875 4, value2, "Seconds: %d", value2);
1876 voffset = voffset + 4;
1877 rnum = tvb_get_letohs(tvb, voffset); /* replica number */
1878 proto_tree_add_uint_format(nvtree, hf_nds_rnum, tvb, voffset,
1879 2, rnum, "Replica Number: %d", rnum);
1880 voffset = voffset+2;
1881 revent = tvb_get_letohs(tvb, voffset); /* Event */
1882 proto_tree_add_uint_format(nvtree, hf_nds_revent, tvb, voffset,
1883 2, revent, "Event: %d", revent);
1884 voffset = voffset+14;
1885 voffset += align_4(tvb, voffset);
1887 case 0x00000017: /* Back Link */
1888 value1 = tvb_get_letohl(tvb, voffset); /* Length */
1889 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1890 4, value1, "Length of Record %08x", value1);
1891 voffset = voffset+4;
1892 value2 = tvb_get_letohl(tvb, voffset); /* Remote ID */
1893 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1894 4, value2, "Remote ID %08x", value2);
1895 voffset = voffset+4;
1896 value3 = tvb_get_letohl(tvb, voffset); /* Length of string */
1897 voffset = voffset+4;
1898 get_string(tvb, voffset, value3, vvalues->vstring);
1899 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
1900 value3, "Server Distinguished Name - %s", vvalues->vstring);
1901 voffset = voffset+value3;
1902 voffset += align_4(tvb, voffset);
1904 case 0x00000019: /* Typed Name */
1905 value1 = tvb_get_letohl(tvb, voffset); /* Length */
1906 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1907 4, value1, "Length of Record %08x", value1);
1908 voffset = voffset+4;
1909 value2 = tvb_get_letohl(tvb, voffset); /* Level */
1910 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1911 4, value2, "Level %d", value2);
1912 voffset = voffset+4;
1913 value3 = tvb_get_letohl(tvb, voffset); /* Interval */
1914 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1915 4, value3, "Interval %d", value3);
1916 voffset = voffset+4;
1917 value4 = tvb_get_letohl(tvb, voffset); /* Distinguished Name */
1918 voffset = voffset+4;
1919 get_string(tvb, voffset, value4, vvalues->vstring);
1920 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
1921 value4, "Distinguished Name - %s", vvalues->vstring);
1922 voffset = voffset+value4;
1923 voffset += align_4(tvb, voffset);
1925 case 0x0000001a: /* Hold */
1926 value1 = tvb_get_letohl(tvb, voffset); /* Length */
1927 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1928 4, value1, "Length of Record %08x", value1);
1929 voffset = voffset+4;
1930 value2 = tvb_get_letohl(tvb, voffset); /* Amount */
1931 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1932 4, value2, "Amount %d", value2);
1933 voffset = voffset+4;
1934 value3 = tvb_get_letohl(tvb, voffset); /* Subject */
1935 voffset = voffset+4;
1936 get_string(tvb, voffset, value3, vvalues->vstring);
1937 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
1938 value3, "Subject - %s", vvalues->vstring);
1939 voffset = voffset+value3;
1940 voffset += align_4(tvb, voffset);
1942 case 0x00000001: /* Distinguished Name */
1943 case 0x00000002: /* Case Sensitive Unicode String */
1944 case 0x00000003: /* Non Case Sensitive Unicode String */
1945 case 0x00000004: /* Printable String */
1946 case 0x00000005: /* Numeric String */
1947 case 0x0000000a: /* Telephone Number */
1948 case 0x0000000e: /* Email Address */
1949 case 0x00000014: /* Class Name */
1951 value1 = tvb_get_letohl(tvb, voffset);
1952 voffset = voffset + 4;
1953 get_string(tvb, voffset, value1, vvalues->vstring);
1954 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1955 value1, vvalues->vstring);
1956 voffset = voffset + value1;
1957 voffset += align_4(tvb, voffset);
1960 voffset += align_4(tvb, voffset);
1962 vvalues->voffset=voffset;
1967 print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, guint32 ioffset)
1974 guint32 number_of_referals;
1977 guint16 replica_num;
1980 proto_tree *nestree;
1981 proto_item *nesitem;
1986 mval_buf.buffer = "";
1990 case 0: /* No Specifier Type */
1991 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
1992 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
1994 ioffset = ioffset + 4;
1996 case 1: /* Unicode String */
1997 value1 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
1998 ioffset = ioffset + 4;
1999 get_string(tvb, ioffset, value1, mval_buf.buffer);
2000 values->vstring = mval_buf.buffer;
2001 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2002 value1, values->vstring, "Delimeter ->%s", values->vstring);
2003 ioffset=ioffset + value1;
2004 ioffset += align_4(tvb, ioffset);
2005 value2 = tvb_get_letohl(tvb, ioffset);
2006 ioffset = ioffset + 4;
2007 get_string(tvb, ioffset, value2, mval_buf.buffer);
2008 values->vstring = mval_buf.buffer;
2009 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2010 value2, values->vstring);
2011 values->voffset=ioffset + value2;
2012 ioffset = values->voffset;
2015 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2016 vstring = match_strval(value1, es_type);
2017 if (vstring == NULL)
2019 vstring = "No ES Type Found";
2021 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2022 4, vstring, "Base Context Type - %s", vstring);
2023 nestree = proto_item_add_subtree(nesitem, ett_nds);
2024 ioffset = ioffset + 4;
2027 case 0: /* No Specifier Type */
2028 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2029 proto_tree_add_item(nestree, hf_es_value, tvb, ioffset,
2031 ioffset = ioffset + 4;
2033 case 1: /* Unicode String */
2034 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2035 ioffset = ioffset + 4;
2036 get_string(tvb, ioffset, value2, mval_buf.buffer);
2037 values->vstring = mval_buf.buffer;
2038 proto_tree_add_string_format(nestree, hf_mv_string, tvb, ioffset,
2039 value2, values->vstring, "Delimeter ->%s", values->vstring);
2040 ioffset=ioffset + value2;
2041 ioffset += align_4(tvb, ioffset);
2042 value3 = tvb_get_letohl(tvb, ioffset);
2043 ioffset = ioffset + 4;
2044 get_string(tvb, ioffset, value3, mval_buf.buffer);
2045 values->vstring = mval_buf.buffer;
2046 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
2047 value3, values->vstring);
2048 values->voffset=ioffset + value3;
2049 ioffset = values->voffset;
2053 case 3: /* Hinted */
2056 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2057 proto_tree_add_item(nestree, hf_es_rdn_count, tvb, ioffset,
2059 ioffset = ioffset + 4;
2060 for (r = 1 ; r <= value2; r++ )
2062 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2063 proto_tree_add_item(nestree, hf_es_seconds, tvb, ioffset,
2065 ioffset = ioffset + 4;
2066 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2067 proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset,
2069 ioffset = ioffset + 2;
2070 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2071 proto_tree_add_item(nestree, hf_nds_event_num, tvb, ioffset,
2073 ioffset = ioffset + 2;
2075 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2076 ioffset = ioffset + 4;
2077 get_string(tvb, ioffset, value4, mval_buf.buffer);
2078 values->vstring = mval_buf.buffer;
2079 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
2080 value4, values->vstring);
2081 ioffset=ioffset + value4;
2082 ioffset += align_4(tvb, ioffset);
2083 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2084 ioffset = ioffset + 4;
2085 get_string(tvb, ioffset, value5, mval_buf.buffer);
2086 values->vstring = mval_buf.buffer;
2087 proto_tree_add_string(nestree, hf_rdn_string, tvb, ioffset,
2088 value5, values->vstring);
2089 ioffset=ioffset + value5;
2090 ioffset += align_4(tvb, ioffset);
2096 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2097 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2099 ioffset = ioffset + 4;
2102 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2103 vstring = match_strval(value1, es_type);
2104 if (vstring == NULL)
2106 vstring = "No ES Type Found";
2108 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2109 4, vstring, "Object Name Type - %s", vstring);
2110 nestree = proto_item_add_subtree(nesitem, ett_nds);
2111 ioffset = ioffset + 4;
2114 case 0: /* No Specifier Type */
2115 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2116 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2118 ioffset = ioffset + 4;
2120 case 1: /* Unicode String */
2121 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2122 ioffset = ioffset + 4;
2123 get_string(tvb, ioffset, value2, mval_buf.buffer);
2124 values->vstring = mval_buf.buffer;
2125 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2126 value2, values->vstring, "Delimeter ->%s", values->vstring);
2127 ioffset=ioffset + value2;
2128 ioffset += align_4(tvb, ioffset);
2129 value3 = tvb_get_letohl(tvb, ioffset);
2130 ioffset = ioffset + 4;
2131 get_string(tvb, ioffset, value3, mval_buf.buffer);
2132 values->vstring = mval_buf.buffer;
2133 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2134 value3, values->vstring);
2135 values->voffset=ioffset + value3;
2136 ioffset = values->voffset;
2140 case 3: /* Hinted */
2143 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2144 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2146 ioffset = ioffset + 4;
2147 for (r = 1 ; r <= value2; r++ )
2149 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2150 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2152 ioffset = ioffset + 4;
2153 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2154 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2156 ioffset = ioffset + 2;
2157 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2158 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2160 ioffset = ioffset + 2;
2162 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2163 ioffset = ioffset + 4;
2164 get_string(tvb, ioffset, value4, mval_buf.buffer);
2165 values->vstring = mval_buf.buffer;
2166 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2167 value4, values->vstring);
2168 ioffset=ioffset + value4;
2169 ioffset += align_4(tvb, ioffset);
2170 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2171 ioffset = ioffset + 4;
2172 get_string(tvb, ioffset, value5, mval_buf.buffer);
2173 values->vstring = mval_buf.buffer;
2174 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2175 value5, values->vstring);
2176 ioffset=ioffset + value5;
2177 ioffset += align_4(tvb, ioffset);
2183 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2184 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2186 ioffset = ioffset + 4;
2190 case 3: /* Hinted */
2191 number_of_referals = tvb_get_letohl(tvb, ioffset);
2193 for (r = 1 ; r <= number_of_referals; r++ )
2195 aitem = proto_tree_add_uint_format(estree, hf_referal_record, tvb, 6, 0,
2196 r, "NDS Referal Record #%d", r);
2197 atree = proto_item_add_subtree(aitem, ett_nds);
2199 value1 = tvb_get_letohl(tvb, ioffset);
2201 proto_tree_add_uint_format(atree, hf_referal_addcount, tvb, ioffset, 4,
2202 value1, "Number of Addresses in Referal - %d", value1);
2204 ioffset = ioffset + 4;
2205 for (i = 1 ; i <= value1; i++ )
2207 value2 = tvb_get_letohl(tvb, ioffset);
2208 values->vstring = match_strval(value2, nds_protocol_type);
2209 if (values->vstring == NULL)
2211 values->vstring="(Undefined Protocol)";
2213 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
2214 4, value2, vstring, value2);
2215 ioffset = ioffset+4;
2216 value3 = tvb_get_letohl(tvb, ioffset);
2217 ioffset = ioffset+4;
2221 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
2222 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
2223 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
2226 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2227 value4 = tvb_get_letohl(tvb, ioffset+2);
2228 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4);
2231 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2232 value4 = tvb_get_letohl(tvb, ioffset+2);
2233 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4);
2236 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2237 value4 = tvb_get_letohl(tvb, ioffset+2);
2238 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4);
2241 get_string(tvb, ioffset, value3, values->vstring);
2242 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
2243 value3, values->vstring);
2248 ioffset = ioffset + value3;
2249 ioffset += align_4(tvb, ioffset);
2253 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2254 vstring = match_strval(value1, es_type);
2255 if (vstring == NULL)
2257 vstring = "No ES Type Found";
2259 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2260 4, vstring, "Object Name Type - %s", vstring);
2261 nestree = proto_item_add_subtree(nesitem, ett_nds);
2262 ioffset = ioffset + 4;
2265 case 0: /* No Specifier Type */
2266 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2267 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2269 ioffset = ioffset + 4;
2271 case 1: /* Unicode String */
2272 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2273 ioffset = ioffset + 4;
2274 get_string(tvb, ioffset, value2, mval_buf.buffer);
2275 values->vstring = mval_buf.buffer;
2276 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2277 value2, values->vstring, "Delimeter ->%s", values->vstring);
2278 ioffset=ioffset + value2;
2279 ioffset += align_4(tvb, ioffset);
2280 value3 = tvb_get_letohl(tvb, ioffset);
2281 ioffset = ioffset + 4;
2282 get_string(tvb, ioffset, value3, mval_buf.buffer);
2283 values->vstring = mval_buf.buffer;
2284 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2285 value3, values->vstring);
2286 values->voffset=ioffset + value3;
2287 ioffset = values->voffset;
2291 case 3: /* Hinted */
2294 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2295 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2297 ioffset = ioffset + 4;
2298 for (r = 1 ; r <= value2; r++ )
2300 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2301 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2303 ioffset = ioffset + 4;
2304 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2305 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2307 ioffset = ioffset + 2;
2308 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2309 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2311 ioffset = ioffset + 2;
2313 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2314 ioffset = ioffset + 4;
2315 get_string(tvb, ioffset, value4, mval_buf.buffer);
2316 values->vstring = mval_buf.buffer;
2317 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2318 value4, values->vstring);
2319 ioffset=ioffset + value4;
2320 ioffset += align_4(tvb, ioffset);
2321 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2322 ioffset = ioffset + 4;
2323 get_string(tvb, ioffset, value5, mval_buf.buffer);
2324 values->vstring = mval_buf.buffer;
2325 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2326 value5, values->vstring);
2327 ioffset=ioffset + value5;
2328 ioffset += align_4(tvb, ioffset);
2334 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2335 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2337 ioffset = ioffset + 4;
2342 value1 = tvb_get_letohl(tvb, ioffset); /* Count */
2343 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2345 ioffset = ioffset + 4;
2346 for (r = 1 ; r <= value1; r++ )
2348 value2 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2349 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2351 ioffset = ioffset + 4;
2352 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2353 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2355 ioffset = ioffset + 2;
2356 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2357 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2359 ioffset = ioffset + 2;
2361 value3 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2362 ioffset = ioffset + 4;
2363 get_string(tvb, ioffset, value3, mval_buf.buffer);
2364 values->vstring = mval_buf.buffer;
2365 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2366 value3, values->vstring);
2367 ioffset=ioffset + value3;
2368 ioffset += align_4(tvb, ioffset);
2369 value4 = tvb_get_letohl(tvb, ioffset); /* RDN */
2370 ioffset = ioffset + 4;
2371 get_string(tvb, ioffset, value4, mval_buf.buffer);
2372 values->vstring = mval_buf.buffer;
2373 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2374 value4, values->vstring);
2375 ioffset=ioffset + value4;
2376 ioffset += align_4(tvb, ioffset);
2382 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2383 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2385 ioffset = ioffset + 4;
2392 process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
2396 guint32 ioffset = 0;
2404 char * valuestr = "";
2409 guint32 number_of_referals = 0;
2413 guint16 replica_num = 0;
2414 guint16 event_num = 0;
2416 nds_val temp_values;
2417 proto_tree *sub1tree;
2418 proto_item *sub1item;
2419 proto_tree *sub2tree;
2420 proto_item *sub2item;
2422 mval_buf.buffer = "";
2423 if(values->mvtype != 12)
2425 nitem = proto_tree_add_uint_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
2426 values->vlength, values->vvalue, values->vdesc, values->vvalue);
2430 nitem = proto_tree_add_string_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
2431 values->vlength, values->vdesc, "%s", values->vdesc);
2433 ioffset = (values->voffset+4);
2435 ntree = proto_item_add_subtree(nitem, ett_nds);
2437 switch (values->mvtype)
2439 case 1: /* Attribute Request */
2440 for (i = 1 ; i <= values->vvalue; i++ )
2442 ioffset += align_4(tvb, ioffset);
2443 value1 = tvb_get_letohl(tvb, ioffset);
2444 ioffset = ioffset + 4;
2445 get_string(tvb, ioffset, value1, mval_buf.buffer);
2446 values->vstring = mval_buf.buffer;
2447 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2448 value1, values->vstring);
2449 ioffset = ioffset + value1;
2452 case 2: /* Attribute Reply */
2453 switch(values->vflags)
2456 for (i = 1 ; i <= values->vvalue; i++ )
2458 ioffset += align_4(tvb, ioffset);
2459 value1 = tvb_get_letohl(tvb, ioffset);
2460 ioffset = ioffset + 4;
2461 get_string(tvb, ioffset, value1, mval_buf.buffer);
2462 values->vstring = mval_buf.buffer;
2463 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2464 value1, values->vstring);
2465 ioffset = ioffset + value1;
2469 for (i = 1 ; i <= values->vvalue; i++ )
2471 value1 = tvb_get_letohl(tvb, ioffset);
2472 values->vstring = match_strval(value1, nds_syntax);
2473 if (values->vstring == NULL)
2475 values->vstring = "No Syntax Found";
2477 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2478 4, values->vstring);
2479 ioffset = ioffset + 4;
2480 value2 = tvb_get_letohl(tvb, ioffset);
2481 ioffset = ioffset + 4;
2482 get_string(tvb, ioffset, value2, mval_buf.buffer);
2483 values->vstring = mval_buf.buffer;
2484 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2485 value2, values->vstring);
2486 values->voffset=ioffset + value2;
2487 print_nds_values(ntree, tvb, value1, values);
2488 ioffset = values->voffset;
2492 for (i = 1 ; i <= values->vvalue; i++ )
2494 value1 = tvb_get_letohl(tvb, ioffset);
2495 values->vstring = match_strval(value1, nds_syntax);
2496 if (values->vstring == NULL)
2498 values->vstring = "No Syntax Found";
2500 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2501 4, values->vstring);
2502 ioffset = ioffset + 4;
2503 value2 = tvb_get_letohl(tvb, ioffset);
2504 ioffset = ioffset + 4;
2505 get_string(tvb, ioffset, value2, mval_buf.buffer);
2506 values->vstring = mval_buf.buffer;
2507 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2508 value2, values->vstring);
2509 values->voffset=ioffset + value2;
2511 ioffset += align_4(tvb, ioffset);
2512 value3 = tvb_get_letohl(tvb, ioffset);
2514 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2515 value1, "Number of Values - %d", value1);
2517 ioffset = ioffset + 4;
2518 for (r = 1 ; r <= value3; r++ )
2520 ioffset += 4; /* Length = 4 */
2521 value4 = tvb_get_letohl(tvb, ioffset);
2522 proto_tree_add_uint(ntree, hf_nds_privileges, tvb, ioffset,
2523 values->vlength, value4);
2524 ioffset = ioffset+4;
2529 for (i = 1 ; i <= values->vvalue; i++ )
2531 value1 = tvb_get_letohl(tvb, ioffset);
2532 values->vstring = match_strval(value1, nds_syntax);
2533 if (values->vstring == NULL)
2535 values->vstring = "No Syntax Found";
2537 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2538 4, values->vstring);
2539 ioffset = ioffset + 4;
2540 value2 = tvb_get_letohl(tvb, ioffset);
2541 ioffset = ioffset + 4;
2542 get_string(tvb, ioffset, value2, mval_buf.buffer);
2543 values->vstring = mval_buf.buffer;
2544 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2545 value2, values->vstring);
2546 ioffset = ioffset + value2;
2547 ioffset += align_4(tvb, ioffset);
2548 value3 = tvb_get_letohl(tvb, ioffset);
2550 aitem = proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2551 value3, "Number of Values - %d", value3);
2553 atree = proto_item_add_subtree(aitem, ett_nds);
2555 ioffset = ioffset + 4;
2556 for (r = 1 ; r <= value3; r++ )
2558 ioffset += align_4(tvb, ioffset);
2559 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2560 temp_values.vlength = 2;
2561 temp_values.hfname = hf_nds_vflags;
2562 temp_values.voffset = ioffset;
2563 temp_values.vdesc = "Value Flags";
2564 temp_values.bit1 = "Naming";
2565 temp_values.bit1hfname = hf_bit1vflags;
2566 temp_values.bit2 = "Base Class";
2567 temp_values.bit2hfname = hf_bit2vflags;
2568 temp_values.bit3 = "Present";
2569 temp_values.bit3hfname = hf_bit3vflags;
2570 temp_values.bit4 = "Value Damaged";
2571 temp_values.bit4hfname = hf_bit4vflags;
2572 temp_values.bit5 = "Not Defined";
2573 temp_values.bit5hfname = hf_bit5vflags;
2574 temp_values.bit6 = "Not Defined";
2575 temp_values.bit6hfname = hf_bit6vflags;
2576 temp_values.bit7 = "Not Defined";
2577 temp_values.bit7hfname = hf_bit7vflags;
2578 temp_values.bit8 = "Not Defined";
2579 temp_values.bit8hfname = hf_bit8vflags;
2580 temp_values.bit9 = "Not Defined";
2581 temp_values.bit9hfname = hf_bit9vflags;
2582 temp_values.bit10 = "Not Defined";
2583 temp_values.bit10hfname = hf_bit10vflags;
2584 temp_values.bit11 = "Not Defined";
2585 temp_values.bit11hfname = hf_bit11vflags;
2586 temp_values.bit12 = "Not Defined";
2587 temp_values.bit12hfname = hf_bit12vflags;
2588 temp_values.bit13 = "Not Defined";
2589 temp_values.bit13hfname = hf_bit13vflags;
2590 temp_values.bit14 = "Not Defined";
2591 temp_values.bit14hfname = hf_bit14vflags;
2592 temp_values.bit15 = "Not Defined";
2593 temp_values.bit15hfname = hf_bit15vflags;
2594 temp_values.bit16 = "Not Defined";
2595 temp_values.bit16hfname = hf_bit16vflags;
2596 process_bitfield(atree, tvb, &temp_values);
2597 ioffset = ioffset + 4;
2598 value4 = tvb_get_letohl(tvb, ioffset);
2599 proto_tree_add_uint_format(atree, hf_es_seconds, tvb, ioffset,
2600 4, value4, "Seconds %d", value4);
2601 ioffset = ioffset + 4;
2602 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2603 proto_tree_add_item(atree, hf_nds_replica_num, tvb, ioffset,
2605 ioffset = ioffset + 2;
2606 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2607 proto_tree_add_item(atree, hf_nds_event_num, tvb, ioffset,
2609 ioffset = ioffset + 2;
2610 value5 = tvb_get_letohl(tvb, ioffset); /* length of field */
2611 if(value5 > tvb_length_remaining(tvb, ioffset))
2616 proto_tree_add_bytes(atree, hf_value_bytes, tvb, ioffset, value5, tvb_get_ptr(tvb, ioffset, value5));
2618 ioffset += (value5%2);
2623 for (i = 1 ; i <= values->vvalue; i++ )
2625 value1 = tvb_get_letohl(tvb, ioffset);
2626 values->vstring = match_strval(value1, nds_syntax);
2627 if (values->vstring == NULL)
2629 values->vstring = "No Syntax Found";
2631 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2632 4, values->vstring);
2633 ioffset = ioffset + 4;
2634 value2 = tvb_get_letohl(tvb, ioffset);
2635 ioffset = ioffset + 4;
2636 get_string(tvb, ioffset, value2, mval_buf.buffer);
2637 values->vstring = mval_buf.buffer;
2638 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2639 value2, values->vstring);
2640 ioffset = ioffset + value2;
2641 value3 = tvb_get_letohl(tvb, ioffset);
2643 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2644 value3, "Number of Values - %d", value3);
2646 ioffset = ioffset + 4;
2647 for (r = 1 ; r <= value3; r++ )
2649 ioffset += align_4(tvb, ioffset);
2650 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2651 temp_values.vlength = 2;
2652 temp_values.hfname = hf_nds_vflags;
2653 temp_values.voffset = ioffset;
2654 temp_values.vdesc = "Value Flags";
2655 temp_values.bit1 = "Naming";
2656 temp_values.bit1hfname = hf_bit1vflags;
2657 temp_values.bit2 = "Base Class";
2658 temp_values.bit2hfname = hf_bit2vflags;
2659 temp_values.bit3 = "Present";
2660 temp_values.bit3hfname = hf_bit3vflags;
2661 temp_values.bit4 = "Value Damaged";
2662 temp_values.bit4hfname = hf_bit4vflags;
2663 temp_values.bit5 = "Not Defined";
2664 temp_values.bit5hfname = hf_bit5vflags;
2665 temp_values.bit6 = "Not Defined";
2666 temp_values.bit6hfname = hf_bit6vflags;
2667 temp_values.bit7 = "Not Defined";
2668 temp_values.bit7hfname = hf_bit7vflags;
2669 temp_values.bit8 = "Not Defined";
2670 temp_values.bit8hfname = hf_bit8vflags;
2671 temp_values.bit9 = "Not Defined";
2672 temp_values.bit9hfname = hf_bit9vflags;
2673 temp_values.bit10 = "Not Defined";
2674 temp_values.bit10hfname = hf_bit10vflags;
2675 temp_values.bit11 = "Not Defined";
2676 temp_values.bit11hfname = hf_bit11vflags;
2677 temp_values.bit12 = "Not Defined";
2678 temp_values.bit12hfname = hf_bit12vflags;
2679 temp_values.bit13 = "Not Defined";
2680 temp_values.bit13hfname = hf_bit13vflags;
2681 temp_values.bit14 = "Not Defined";
2682 temp_values.bit14hfname = hf_bit14vflags;
2683 temp_values.bit15 = "Not Defined";
2684 temp_values.bit15hfname = hf_bit15vflags;
2685 temp_values.bit16 = "Not Defined";
2686 temp_values.bit16hfname = hf_bit16vflags;
2687 process_bitfield(ntree, tvb, &temp_values);
2688 ioffset = ioffset + 4;
2689 value1 = tvb_get_letohl(tvb, ioffset);
2690 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
2691 4, value1, "Seconds %d", value1);
2692 ioffset = ioffset + 4;
2693 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2694 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
2696 ioffset = ioffset + 2;
2697 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2698 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
2700 ioffset = ioffset + 2;
2701 value1 = tvb_get_letohl(tvb, ioffset);
2702 proto_tree_add_uint(ntree, hf_nds_value_len, tvb, ioffset,
2704 ioffset = ioffset + 4;
2712 case 3: /* Attribute Request */
2713 for (i = 1 ; i <= values->vvalue; i++ )
2715 ioffset += align_4(tvb, ioffset);
2716 value1 = tvb_get_letohl(tvb, ioffset);
2717 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
2718 4, value1, "Value %d", value1);
2719 ioffset = ioffset + value1;
2722 case 4: /* Read Class Request */
2723 for (i = 1 ; i <= values->vvalue; i++ )
2725 ioffset += align_4(tvb, ioffset);
2726 value1 = tvb_get_letohl(tvb, ioffset);
2727 ioffset = ioffset + 4;
2728 get_string(tvb, ioffset, value1, mval_buf.buffer);
2729 values->vstring = mval_buf.buffer;
2730 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
2731 value1, values->vstring);
2733 ioffset = ioffset + value1;
2736 case 5: /* Read Replicas */
2737 for (i = 1 ; i <= values->vvalue; i++ )
2740 bvalue = 0x00000001;
2742 for (r = 0 ; r < 9; r++ )
2745 if (values->vflags & bvalue)
2749 case 0x00000001: /*p3values.bit1 = "Output Flags"*/
2750 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2751 temp_values.vlength = 2;
2752 temp_values.hfname = hf_nds_rflags;
2753 temp_values.voffset = ioffset;
2754 temp_values.vdesc = "Output Flags";
2755 temp_values.bit1 = values->bit1;
2756 temp_values.bit1hfname = hf_bit1outflags;
2757 temp_values.bit2 = values->bit2;
2758 temp_values.bit2hfname = hf_bit2outflags;
2759 temp_values.bit3 = values->bit3;
2760 temp_values.bit3hfname = hf_bit3outflags;
2761 temp_values.bit4 = values->bit4;
2762 temp_values.bit4hfname = hf_bit4outflags;
2763 temp_values.bit5 = values->bit5;
2764 temp_values.bit5hfname = hf_bit5outflags;
2765 temp_values.bit6 = values->bit6;
2766 temp_values.bit6hfname = hf_bit6outflags;
2767 temp_values.bit7 = values->bit7;
2768 temp_values.bit7hfname = hf_bit7outflags;
2769 temp_values.bit8 = values->bit8;
2770 temp_values.bit8hfname = hf_bit8outflags;
2771 temp_values.bit9 = values->bit9;
2772 temp_values.bit9hfname = hf_bit9outflags;
2773 temp_values.bit10 = "Not Defined";
2774 temp_values.bit10hfname = hf_bit10outflags;
2775 temp_values.bit11 = "Not Defined";
2776 temp_values.bit11hfname = hf_bit11outflags;
2777 temp_values.bit12 = "Not Defined";
2778 temp_values.bit12hfname = hf_bit12outflags;
2779 temp_values.bit13 = "Not Defined";
2780 temp_values.bit13hfname = hf_bit13outflags;
2781 temp_values.bit14 = "Not Defined";
2782 temp_values.bit14hfname = hf_bit14outflags;
2783 temp_values.bit15 = "Not Defined";
2784 temp_values.bit15hfname = hf_bit15outflags;
2785 temp_values.bit16 = "Not Defined";
2786 temp_values.bit16hfname = hf_bit16outflags;
2787 process_bitfield(ntree, tvb, &temp_values);
2788 ioffset = ioffset + 4;
2790 case 0x00000002: /*p3values.bit2 = "Entry ID"*/
2791 value1 = tvb_get_letohl(tvb, ioffset);
2792 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
2793 4, value1, "Entry ID %08x", value1);
2794 ioffset = ioffset + 4;
2796 case 0x00000004: /*p3values.bit3 = "Replica State"*/
2797 value1 = tvb_get_letohl(tvb, ioffset);
2798 temp_values.vstring = match_strval(value1, nds_replica_state);
2799 if (temp_values.vstring == NULL)
2801 temp_values.vstring = "No Replica State Found";
2803 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
2804 4, temp_values.vstring);
2805 ioffset = ioffset + 4;
2807 case 0x0000008: /*p3values.bit4 = "Modification Timestamp"*/
2808 value1 = tvb_get_letohl(tvb, ioffset);
2809 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
2810 4, value1, "Seconds %d", value1);
2811 ioffset = ioffset + 4;
2812 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2813 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
2815 ioffset = ioffset + 2;
2816 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2817 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
2819 ioffset = ioffset + 2;
2821 case 0x00000010: /*p3values.bit5 = "Purge Time"*/
2822 value1 = tvb_get_letohl(tvb, ioffset);
2823 proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset,
2824 4, value1, "Purge Time %d", value1);
2825 ioffset = ioffset + 4;
2827 case 0x00000020: /*p3values.bit6 = "Local Partition ID"*/
2828 value1 = tvb_get_letohl(tvb, ioffset);
2829 proto_tree_add_uint_format(ntree, hf_nds_local_partition, tvb, ioffset,
2830 4, value1, "Local Partition ID %08x", value1);
2831 ioffset = ioffset + 4;
2833 case 0x00000040: /*p3values.bit7 = "Distinguished Name"*/
2834 value1 = tvb_get_letohl(tvb, ioffset);
2835 ioffset = ioffset + 4;
2836 get_string(tvb, ioffset, value1, mval_buf.buffer);
2837 temp_values.vstring = mval_buf.buffer;
2838 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
2839 value1, temp_values.vstring);
2840 ioffset = ioffset + value1;
2842 case 0x00000080: /*p3values.bit8 = "Replica Type & State"*/
2843 value1 = tvb_get_letohl(tvb, ioffset);
2844 value2 = value1 & 0x00ff;
2845 temp_values.vstring = match_strval(value2, nds_replica_type);
2846 if (temp_values.vstring == NULL)
2848 temp_values.vstring = "No Replica Type Found";
2850 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
2851 4, temp_values.vstring);
2852 value3 = value1 & 0xff00;
2853 temp_values.vstring = match_strval(value3, nds_replica_state);
2854 if (temp_values.vstring == NULL)
2856 temp_values.vstring = "No Replica State Found";
2858 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
2859 4, temp_values.vstring);
2860 ioffset = ioffset + 4;
2862 case 0x00000100: /*p3values.bit9 = "Partition Busy"*/
2863 value1 = tvb_get_letohs(tvb, ioffset);
2864 proto_tree_add_boolean(ntree, hf_partition_busy, tvb, ioffset, 4, value1);
2873 ioffset += align_4(tvb, ioffset);
2874 if(tvb_length_remaining(tvb, ioffset) < 4 )
2879 if(tvb_length_remaining(tvb, ioffset) < 4 )
2885 case 6: /* Modify Attribute Request */
2886 for (i = 0 ; i < values->vvalue; i++ )
2888 ioffset += align_4(tvb, ioffset);
2889 value1 = tvb_get_letohl(tvb, ioffset);
2890 valuestr = match_strval(value1, nds_kind_of_changes);
2891 if (valuestr == NULL)
2893 valuestr="(Kind Change Not Found)";
2895 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
2896 values->vlength, value1, valuestr, value1);
2897 ioffset = ioffset+4;
2898 value2 = tvb_get_letohl(tvb, ioffset);
2899 ioffset = ioffset + 4;
2900 get_string(tvb, ioffset, value2, mval_buf.buffer); /* Name of Attribute */
2901 temp_values.vstring = mval_buf.buffer;
2902 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2903 value2, temp_values.vstring);
2904 ioffset = ioffset + value2;
2905 ioffset += align_4(tvb, ioffset);
2906 if(value1 != 1 && value1 != 6)
2908 values->voffset = ioffset;
2909 print_nds_values(ntree, tvb, 9, values);
2910 ioffset = values->voffset;
2914 case 7: /* Address Referal Request */
2915 for (i = 0 ; i < values->vvalue; i++ )
2918 value1 = tvb_get_letohl(tvb, ioffset);
2919 valuestr = match_strval(value1, nds_protocol_type);
2920 if (valuestr == NULL)
2922 valuestr="(Undefined Protocol)";
2924 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
2925 values->vlength, value1, valuestr, value1);
2926 ioffset = ioffset+4;
2929 case 8: /* Address Referal Reply */
2930 number_of_referals = values->vvalue;
2932 for (r = 1 ; r <= number_of_referals; r++ )
2934 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, 6, 0,
2935 r, "NDS Referal Record #%d", r);
2936 atree = proto_item_add_subtree(aitem, ett_nds);
2938 value1 = tvb_get_letohl(tvb, ioffset);
2940 proto_tree_add_uint_format(atree, hf_referal_addcount, tvb, ioffset, 4,
2941 value1, "Number of Addresses in Referal - %d", value1);
2943 ioffset = ioffset + 4;
2944 for (i = 1 ; i <= value1; i++ )
2946 value2 = tvb_get_letohl(tvb, ioffset);
2947 valuestr = match_strval(value2, nds_protocol_type);
2948 if (valuestr == NULL)
2950 valuestr="(Undefined Protocol)";
2952 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
2953 values->vlength, value2, valuestr, value2);
2954 ioffset = ioffset+4;
2955 value3 = tvb_get_letohl(tvb, ioffset);
2956 ioffset = ioffset+4;
2960 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
2961 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
2962 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
2965 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2966 value4 = tvb_get_letohl(tvb, ioffset+2);
2967 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4);
2970 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2971 value4 = tvb_get_letohl(tvb, ioffset+2);
2972 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4);
2975 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2976 value4 = tvb_get_letohl(tvb, ioffset+2);
2977 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4);
2980 get_string(tvb, ioffset, value3, values->vstring);
2981 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
2982 value3, values->vstring);
2987 ioffset = ioffset + value3;
2988 ioffset += align_4(tvb, ioffset);
2994 case 9: /* Local Address Referal Reply */
2995 number_of_referals = values->vvalue;
2997 for (r = 1 ; r <= number_of_referals; r++ )
2999 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, 6, 0,
3000 r, "NDS Referal Record #%d", r);
3001 atree = proto_item_add_subtree(aitem, ett_nds);
3003 value2 = tvb_get_letohl(tvb, ioffset);
3004 valuestr = match_strval(value2, nds_protocol_type);
3005 if (valuestr == NULL)
3007 valuestr="(Undefined Protocol)";
3009 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
3010 values->vlength, value2, valuestr, value2);
3011 ioffset = ioffset+4;
3012 value3 = tvb_get_letohl(tvb, ioffset);
3013 ioffset = ioffset+4;
3018 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
3019 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
3020 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
3023 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3025 value4 = tvb_get_letohl(tvb, ioffset);
3026 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset, 4, value4);
3029 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3031 value4 = tvb_get_letohl(tvb, ioffset);
3032 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset, 4, value4);
3035 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3037 value4 = tvb_get_letohl(tvb, ioffset);
3038 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset, 4, value4);
3041 get_string(tvb, ioffset, value3, values->vstring);
3042 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
3043 value3, values->vstring);
3048 ioffset = ioffset + value3;
3049 ioffset += align_4(tvb, ioffset);
3052 case 10: /* Process Entry Specifiers */
3053 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3054 values->vstring = match_strval(value2, es_type);
3055 if (values->vstring == NULL)
3057 values->vstring = "No ES Type Found";
3059 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
3060 4, values->vstring, "Output Entry Specifier - %s", values->vstring);
3061 estree = proto_item_add_subtree(esitem, ett_nds);
3062 ioffset = ioffset + 4;
3063 ioffset = print_es_type(estree, tvb, values, value2, ioffset);
3064 value3 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3065 values->vstring = match_strval(value3, es_type);
3066 if (values->vstring == NULL)
3068 values->vstring = "No ES Type Found";
3070 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
3071 4, values->vstring, "Input Entry Specifier - %s", values->vstring);
3072 estree = proto_item_add_subtree(esitem, ett_nds);
3073 ioffset = ioffset + 4;
3074 ioffset = print_es_type(estree, tvb, values, value3, ioffset);
3075 value4 = tvb_get_letohl(tvb, ioffset);
3076 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, ioffset, 4,
3077 value4, "Referal Protocols - %d", value4);
3078 atree = proto_item_add_subtree(aitem, ett_nds);
3080 for (i = 0 ; i < value4; i++ )
3082 value5 = tvb_get_letohl(tvb, ioffset);
3083 valuestr = match_strval(value5, nds_protocol_type);
3084 if (valuestr == NULL)
3086 valuestr="(Undefined Protocol)";
3088 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
3089 4, valuestr, "Protocol -> %s", valuestr);
3090 ioffset = ioffset+4;
3092 value6 = tvb_get_letohl(tvb, ioffset);
3093 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, ioffset, 4,
3094 value6, "Tree Walking Protocols - %d", value6);
3095 atree = proto_item_add_subtree(aitem, ett_nds);
3097 for (i = 0 ; i < value6; i++ )
3099 value7 = tvb_get_letohl(tvb, ioffset);
3100 valuestr = match_strval(value7, nds_protocol_type);
3101 if (valuestr == NULL)
3103 valuestr="(Undefined Protocol)";
3105 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
3106 4, valuestr, "Protocol -> %s", valuestr);
3107 ioffset = ioffset+4;
3110 case 11: /* Print Timestamp */
3111 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3112 proto_tree_add_item(ncp_tree, hf_nds_replica_num, tvb, ioffset,
3114 ioffset = ioffset + 2;
3115 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3116 proto_tree_add_item(ncp_tree, hf_nds_event_num, tvb, ioffset,
3118 ioffset = ioffset + 2;
3119 case 12: /* List Partitions */
3120 number_of_referals = values->vvalue;
3121 for (i = 0; i < number_of_referals; i++)
3123 bvalue = 0x00000001;
3125 for (r = 0 ; r < 32; r++ )
3127 if (values->vflags & bvalue)
3131 case 0x00000001: /* Information Flags */
3132 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
3133 temp_values.vtype = 5; /* Bitfield */
3134 temp_values.vstring = "";
3135 temp_values.vdesc = "Information Flags (low) Byte:";
3136 temp_values.vlength = 2;
3137 temp_values.hfname= hf_nds_rflags;
3138 temp_values.voffset = ioffset;
3139 temp_values.bit1 = "Output Flags";
3140 temp_values.bit1hfname = hf_bit1infoflagsl;
3141 temp_values.bit2 = "Entry ID";
3142 temp_values.bit2hfname = hf_bit2infoflagsl;
3143 temp_values.bit3 = "Entry Flags";
3144 temp_values.bit3hfname = hf_bit3infoflagsl;
3145 temp_values.bit4 = "Subordinate Count";
3146 temp_values.bit4hfname = hf_bit4infoflagsl;
3147 temp_values.bit5 = "Modification Time";
3148 temp_values.bit5hfname = hf_bit5infoflagsl;
3149 temp_values.bit6 = "Modification Timestamp";
3150 temp_values.bit6hfname = hf_bit6infoflagsl;
3151 temp_values.bit7 = "Creation Timestamp";
3152 temp_values.bit7hfname = hf_bit7infoflagsl;
3153 temp_values.bit8 = "Partition Root ID";
3154 temp_values.bit8hfname = hf_bit8infoflagsl;
3155 temp_values.bit9 = "Parent ID";
3156 temp_values.bit9hfname = hf_bit9infoflagsl;
3157 temp_values.bit10 = "Revision Count";
3158 temp_values.bit10hfname = hf_bit10infoflagsl;
3159 temp_values.bit11 = "Replica Type";
3160 temp_values.bit11hfname = hf_bit11infoflagsl;
3161 temp_values.bit12 = "Base Class";
3162 temp_values.bit12hfname = hf_bit12infoflagsl;
3163 temp_values.bit13 = "Relative Distinguished Name";
3164 temp_values.bit13hfname = hf_bit13infoflagsl;
3165 temp_values.bit14 = "Distinguished Name";
3166 temp_values.bit14hfname = hf_bit14infoflagsl;
3167 temp_values.bit15 = "Root Distinguished Name";
3168 temp_values.bit15hfname = hf_bit15infoflagsl;
3169 temp_values.bit16 = "Parent Distinguished Name";
3170 temp_values.bit16hfname = hf_bit16infoflagsl;
3171 process_bitfield(ntree, tvb, &temp_values);
3172 ioffset = ioffset+2;
3173 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
3174 temp_values.vtype = 5; /* Bitfield */
3175 temp_values.vstring = "";
3176 temp_values.vdesc = "Information Flags (high) Byte:";
3177 temp_values.vlength = 2;
3178 temp_values.hfname= hf_nds_rflags;
3179 temp_values.voffset = ioffset;
3180 temp_values.bit1 = "Purge Time";
3181 temp_values.bit1hfname = hf_bit1infoflagsh;
3182 temp_values.bit2 = "Dereference Base Class";
3183 temp_values.bit2hfname = hf_bit2infoflagsh;
3184 temp_values.bit3 = "Not Defined";
3185 temp_values.bit3hfname = hf_bit3infoflagsh;
3186 temp_values.bit4 = "Not Defined";
3187 temp_values.bit4hfname = hf_bit4infoflagsh;
3188 temp_values.bit5 = "Not Defined";
3189 temp_values.bit5hfname = hf_bit5infoflagsh;
3190 temp_values.bit6 = "Not Defined";
3191 temp_values.bit6hfname = hf_bit6infoflagsh;
3192 temp_values.bit7 = "Not Defined";
3193 temp_values.bit7hfname = hf_bit7infoflagsh;
3194 temp_values.bit8 = "Not Defined";
3195 temp_values.bit8hfname = hf_bit8infoflagsh;
3196 temp_values.bit9 = "Not Defined";
3197 temp_values.bit9hfname = hf_bit9infoflagsh;
3198 temp_values.bit10 = "Not Defined";
3199 temp_values.bit10hfname = hf_bit10infoflagsh;
3200 temp_values.bit11 = "Not Defined";
3201 temp_values.bit11hfname = hf_bit11infoflagsh;
3202 temp_values.bit12 = "Not Defined";
3203 temp_values.bit12hfname = hf_bit12infoflagsh;
3204 temp_values.bit13 = "Not Defined";
3205 temp_values.bit13hfname = hf_bit13infoflagsh;
3206 temp_values.bit14 = "Not Defined";
3207 temp_values.bit14hfname = hf_bit14infoflagsh;
3208 temp_values.bit15 = "Not Defined";
3209 temp_values.bit15hfname = hf_bit15infoflagsh;
3210 temp_values.bit16 = "Not Defined";
3211 temp_values.bit16hfname = hf_bit16infoflagsh;
3212 process_bitfield(ntree, tvb, &temp_values);
3213 ioffset = ioffset+2;
3215 case 0x00000002: /* Entry ID */
3216 value1 = tvb_get_letohl(tvb, ioffset);
3217 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
3218 4, value1, "Entry ID %08x", value1);
3219 ioffset = ioffset + 4;
3221 case 0x00000004: /* Entry Flags */
3222 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
3223 temp_values.vtype = 5; /* Bitfield */
3224 temp_values.vstring = "";
3225 temp_values.vdesc = "Entry Flags:";
3226 temp_values.vlength = 2;
3227 temp_values.hfname= hf_nds_eflags;
3228 temp_values.voffset = ioffset;
3229 temp_values.bit1 = "Alias Entry";
3230 temp_values.bit1hfname = hf_bit1eflags;
3231 temp_values.bit2 = "Partition Root";
3232 temp_values.bit2hfname = hf_bit2eflags;
3233 temp_values.bit3 = "Container Entry";
3234 temp_values.bit3hfname = hf_bit3eflags;
3235 temp_values.bit4 = "Container Alias";
3236 temp_values.bit4hfname = hf_bit4eflags;
3237 temp_values.bit5 = "Matches List Filter";
3238 temp_values.bit5hfname = hf_bit5eflags;
3239 temp_values.bit6 = "Reference Entry";
3240 temp_values.bit6hfname = hf_bit6eflags;
3241 temp_values.bit7 = "40x Reference Entry";
3242 temp_values.bit7hfname = hf_bit7eflags;
3243 temp_values.bit8 = "Back Linked";
3244 temp_values.bit8hfname = hf_bit8eflags;
3245 temp_values.bit9 = "New Entry";
3246 temp_values.bit9hfname = hf_bit9eflags;
3247 temp_values.bit10 = "Temporary Reference";
3248 temp_values.bit10hfname = hf_bit10eflags;
3249 temp_values.bit11 = "Audited";
3250 temp_values.bit11hfname = hf_bit11eflags;
3251 temp_values.bit12 = "Entry Not Present";
3252 temp_values.bit12hfname = hf_bit12eflags;
3253 temp_values.bit13 = "Entry Verify CTS";
3254 temp_values.bit13hfname = hf_bit13eflags;
3255 temp_values.bit14 = "Entry Damaged";
3256 temp_values.bit14hfname = hf_bit14eflags;
3257 temp_values.bit15 = "Not Defined";
3258 temp_values.bit15hfname = hf_bit15eflags;
3259 temp_values.bit16 = "Not Defined";
3260 temp_values.bit16hfname = hf_bit16eflags;
3261 process_bitfield(ntree, tvb, &temp_values);
3262 ioffset = ioffset+4;
3264 case 0x0000008: /* Subordinate Count */
3265 value1 = tvb_get_letohl(tvb, ioffset);
3266 proto_tree_add_uint_format(ntree, hf_sub_count, tvb, ioffset,
3267 4, value1, "Subordinate Count %d", value1);
3268 ioffset = ioffset + 4;
3270 case 0x0000010: /* Modification Time */
3271 value1 = tvb_get_letohl(tvb, ioffset);
3272 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3273 4, value1, "Modification Time in Seconds %d", value1);
3274 ioffset = ioffset + 4;
3276 case 0x0000020: /* Modification Timestamp */
3277 value1 = tvb_get_letohl(tvb, ioffset);
3278 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3279 4, value1, "Modification Timestamp Seconds %d", value1);
3280 ioffset = ioffset + 4;
3281 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3282 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
3284 ioffset = ioffset + 2;
3285 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3286 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
3288 ioffset = ioffset + 2;
3290 case 0x0000040: /* Creation Timestamp */
3291 value1 = tvb_get_letohl(tvb, ioffset);
3292 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3293 4, value1, "Creation Timestamp Seconds %d", value1);
3294 ioffset = ioffset + 4;
3295 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3296 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
3298 ioffset = ioffset + 2;
3299 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3300 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
3302 ioffset = ioffset + 2;
3304 case 0x00000080: /* Partition Root ID */
3305 value1 = tvb_get_letohl(tvb, ioffset);
3306 proto_tree_add_uint_format(ntree, hf_nds_partition_root_id, tvb, ioffset,
3307 4, value1, "Partition Root ID %08x", value1);
3308 ioffset = ioffset + 4;
3310 case 0x00000100: /* Parent ID */
3311 value1 = tvb_get_letohl(tvb, ioffset);
3312 proto_tree_add_uint_format(ntree, hf_nds_parent, tvb, ioffset,
3313 4, value1, "Parent ID %08x", value1);
3314 ioffset = ioffset + 4;
3316 case 0x00000200: /* Revision Count */
3317 value1 = tvb_get_letohl(tvb, ioffset);
3318 proto_tree_add_uint_format(ntree, hf_nds_revision, tvb, ioffset,
3319 4, value1, "Revision Count %d", value1);
3320 ioffset = ioffset + 4;
3322 case 0x00000400: /* Replica Type & State */
3323 value1 = tvb_get_letohl(tvb, ioffset);
3324 value2 = value1 & 0x00ff;
3325 temp_values.vstring = match_strval(value2, nds_replica_type);
3326 if (temp_values.vstring == NULL)
3328 temp_values.vstring = "No Replica Type Found";
3330 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
3331 4, temp_values.vstring);
3332 value3 = value1 & 0xff00;
3333 temp_values.vstring = match_strval(value3, nds_replica_state);
3334 if (temp_values.vstring == NULL)
3336 temp_values.vstring = "No Replica State Found";
3338 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
3339 4, temp_values.vstring);
3340 ioffset = ioffset + 4;
3342 case 0x00000800: /* Base Class */
3343 value1 = tvb_get_letohl(tvb, ioffset);
3344 ioffset = ioffset + 4;
3345 get_string(tvb, ioffset, value1, mval_buf.buffer);
3346 temp_values.vstring = mval_buf.buffer;
3347 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
3348 value1, temp_values.vstring);
3349 ioffset = ioffset + value1;
3351 case 0x00001000: /* Relative Distinguished Name */
3352 value1 = tvb_get_letohl(tvb, ioffset);
3353 ioffset = ioffset + 4;
3354 get_string(tvb, ioffset, value1, mval_buf.buffer);
3355 temp_values.vstring = mval_buf.buffer;
3356 proto_tree_add_string(ntree, hf_nds_relative_dn, tvb, ioffset,
3357 value1, temp_values.vstring);
3358 ioffset = ioffset + value1;
3360 case 0x00002000: /* Distinguished Name */
3361 value1 = tvb_get_letohl(tvb, ioffset);
3362 ioffset = ioffset + 4;
3363 get_string(tvb, ioffset, value1, mval_buf.buffer);
3364 temp_values.vstring = mval_buf.buffer;
3365 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3366 value1, temp_values.vstring);
3367 ioffset = ioffset + value1;
3369 case 0x00004000: /* Root Distinguished Name */
3370 value1 = tvb_get_letohl(tvb, ioffset);
3371 ioffset = ioffset + 4;
3372 get_string(tvb, ioffset, value1, mval_buf.buffer);
3373 temp_values.vstring = mval_buf.buffer;
3374 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3375 value1, temp_values.vstring);
3376 ioffset = ioffset + value1;
3378 case 0x00008000: /* Parent Distinguished Name */
3379 value1 = tvb_get_letohl(tvb, ioffset);
3380 ioffset = ioffset + 4;
3381 get_string(tvb, ioffset, value1, mval_buf.buffer);
3382 temp_values.vstring = mval_buf.buffer;
3383 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3384 value1, temp_values.vstring);
3385 ioffset = ioffset + value1;
3387 case 0x00010000: /* Purge Time */
3388 value1 = tvb_get_letohl(tvb, ioffset);
3389 proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset,
3390 4, value1, "Purge Time %d", value1);
3391 ioffset = ioffset + 4;
3393 case 0x00020000: /* Dereference Base Class */
3394 value1 = tvb_get_letohl(tvb, ioffset);
3395 ioffset = ioffset + 4;
3396 get_string(tvb, ioffset, value1, mval_buf.buffer);
3397 temp_values.vstring = mval_buf.buffer;
3398 proto_tree_add_string(ntree, hf_deref_base, tvb, ioffset,
3399 value1, temp_values.vstring);
3400 ioffset = ioffset + value1;
3406 ioffset += align_4(tvb, ioffset);
3409 if(tvb_length_remaining(tvb, ioffset) < 4 )
3414 if(tvb_length_remaining(tvb, ioffset) < 4 )
3420 case 13: /* Class Names */
3421 number_of_referals = values->vvalue;
3422 for (i = 0; i < number_of_referals; i++)
3424 ioffset += align_4(tvb, ioffset);
3425 value1 = tvb_get_letohl(tvb, ioffset);
3426 ioffset = ioffset + 4;
3427 get_string(tvb, ioffset, value1, mval_buf.buffer);
3428 temp_values.vstring = mval_buf.buffer;
3429 sub1item = proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset,
3430 value1, temp_values.vstring);
3431 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
3432 ioffset = ioffset + value1;
3433 ioffset += align_4(tvb, ioffset);
3434 if(values->vflags != 0)
3436 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
3437 temp_values.vtype = 5; /* Bitfield */
3438 temp_values.vstring = "";
3439 temp_values.vdesc = "Class Flags:";
3440 temp_values.vlength = 2;
3441 temp_values.hfname= hf_nds_cflags;
3442 temp_values.voffset = ioffset;
3443 temp_values.bit1 = "Ambiguous Containment";
3444 temp_values.bit1hfname = hf_bit1cflags;
3445 temp_values.bit2 = "Ambiguous Naming";
3446 temp_values.bit2hfname = hf_bit2cflags;
3447 temp_values.bit3 = "Class Definition Cannot be Removed";
3448 temp_values.bit3hfname = hf_bit3cflags;
3449 temp_values.bit4 = "Effective Class";
3450 temp_values.bit4hfname = hf_bit4cflags;
3451 temp_values.bit5 = "Container Class";
3452 temp_values.bit5hfname = hf_bit5cflags;
3453 temp_values.bit6 = "Not Defined";
3454 temp_values.bit6hfname = hf_bit6cflags;
3455 temp_values.bit7 = "Not Defined";
3456 temp_values.bit7hfname = hf_bit7cflags;
3457 temp_values.bit8 = "Not Defined";
3458 temp_values.bit8hfname = hf_bit8cflags;
3459 temp_values.bit9 = "Not Defined";
3460 temp_values.bit9hfname = hf_bit9cflags;
3461 temp_values.bit10 = "Not Defined";
3462 temp_values.bit10hfname = hf_bit10cflags;
3463 temp_values.bit11 = "Not Defined";
3464 temp_values.bit11hfname = hf_bit11cflags;
3465 temp_values.bit12 = "Not Defined";
3466 temp_values.bit12hfname = hf_bit12cflags;
3467 temp_values.bit13 = "Not Defined";
3468 temp_values.bit13hfname = hf_bit13cflags;
3469 temp_values.bit14 = "Not Defined";
3470 temp_values.bit14hfname = hf_bit14cflags;
3471 temp_values.bit15 = "Not Defined";
3472 temp_values.bit15hfname = hf_bit15cflags;
3473 temp_values.bit16 = "Not Defined";
3474 temp_values.bit16hfname = hf_bit16cflags;
3475 process_bitfield(sub1tree, tvb, &temp_values);
3476 ioffset = ioffset+4;
3477 if(values->vflags != 5)
3479 value1 = tvb_get_letohl(tvb, ioffset); /* length of field */
3480 if(value1 > tvb_length_remaining(tvb, ioffset))
3485 proto_tree_add_bytes(sub1tree, hf_nds_asn1, tvb, ioffset, value1, tvb_get_ptr(tvb, ioffset, value1));
3487 ioffset += (value1%2);
3489 if(values->vflags == 1 || values->vflags == 2 || values->vflags == 4)
3491 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
3492 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3493 4, value1, "Super Classes %d", value1);
3494 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3495 ioffset = ioffset + 4;
3496 for (r = 0; r < value1; r++)
3498 value2 = tvb_get_letohl(tvb, ioffset);
3499 ioffset = ioffset + 4;
3500 get_string(tvb, ioffset, value2, mval_buf.buffer);
3501 temp_values.vstring = mval_buf.buffer;
3502 proto_tree_add_string(sub2tree, hf_nds_super, tvb, ioffset,
3503 value2, temp_values.vstring);
3504 ioffset = ioffset + value2;
3505 ioffset += align_4(tvb, ioffset);
3507 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3508 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3509 4, value1, "Containment Classes %d", value1);
3510 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3511 ioffset = ioffset + 4;
3512 for (r = 0; r < value1; r++)
3514 value2 = tvb_get_letohl(tvb, ioffset);
3515 ioffset = ioffset + 4;
3516 get_string(tvb, ioffset, value2, mval_buf.buffer);
3517 temp_values.vstring = mval_buf.buffer;
3518 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3519 value2, temp_values.vstring);
3520 ioffset = ioffset + value2;
3521 ioffset += align_4(tvb, ioffset);
3523 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3524 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3525 4, value1, "Naming Attributes %d", value1);
3526 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3527 ioffset = ioffset + 4;
3528 for (r = 0; r < value1; r++)
3530 value2 = tvb_get_letohl(tvb, ioffset);
3531 ioffset = ioffset + 4;
3532 get_string(tvb, ioffset, value2, mval_buf.buffer);
3533 temp_values.vstring = mval_buf.buffer;
3534 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3535 value2, temp_values.vstring);
3536 ioffset = ioffset + value2;
3537 ioffset += align_4(tvb, ioffset);
3539 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3540 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3541 4, value1, "Mandatory Attributes %d", value1);
3542 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3543 ioffset = ioffset + 4;
3544 for (r = 0; r < value1; r++)
3546 value2 = tvb_get_letohl(tvb, ioffset);
3547 ioffset = ioffset + 4;
3548 get_string(tvb, ioffset, value2, mval_buf.buffer);
3549 temp_values.vstring = mval_buf.buffer;
3550 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3551 value2, temp_values.vstring);
3552 ioffset = ioffset + value2;
3553 ioffset += align_4(tvb, ioffset);
3555 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3556 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3557 4, value1, "Optional Attributes %d", value1);
3558 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3559 ioffset = ioffset + 4;
3560 for (r = 0; r < value1; r++)
3562 ioffset += align_4(tvb, ioffset);
3563 value2 = tvb_get_letohl(tvb, ioffset);
3564 ioffset = ioffset + 4;
3565 get_string(tvb, ioffset, value2, mval_buf.buffer);
3566 temp_values.vstring = mval_buf.buffer;
3567 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3568 value2, temp_values.vstring);
3569 ioffset = ioffset + value2;
3570 if(tvb_length_remaining(tvb, ioffset) < 4 )
3576 if(values->vflags == 2 || values->vflags == 4) /* Class Definitions of Super Classes */
3578 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3579 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3580 4, value1, "Containment Classes %d", value1);
3581 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3582 ioffset = ioffset + 4;
3583 for (r = 0; r < value1; r++)
3585 value2 = tvb_get_letohl(tvb, ioffset);
3586 ioffset = ioffset + 4;
3587 get_string(tvb, ioffset, value2, mval_buf.buffer);
3588 temp_values.vstring = mval_buf.buffer;
3589 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3590 value2, temp_values.vstring);
3591 ioffset = ioffset + value2;
3592 ioffset += align_4(tvb, ioffset);
3594 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3595 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3596 4, value1, "Naming Attributes %d", value1);
3597 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3598 ioffset = ioffset + 4;
3599 for (r = 0; r < value1; r++)
3601 value2 = tvb_get_letohl(tvb, ioffset);
3602 ioffset = ioffset + 4;
3603 get_string(tvb, ioffset, value2, mval_buf.buffer);
3604 temp_values.vstring = mval_buf.buffer;
3605 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3606 value2, temp_values.vstring);
3607 ioffset = ioffset + value2;
3608 ioffset += align_4(tvb, ioffset);
3610 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3611 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3612 4, value1, "Mandatory Attributes %d", value1);
3613 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3614 ioffset = ioffset + 4;
3615 for (r = 0; r < value1; r++)
3617 value2 = tvb_get_letohl(tvb, ioffset);
3618 ioffset = ioffset + 4;
3619 get_string(tvb, ioffset, value2, mval_buf.buffer);
3620 temp_values.vstring = mval_buf.buffer;
3621 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3622 value2, temp_values.vstring);
3623 ioffset = ioffset + value2;
3624 ioffset += align_4(tvb, ioffset);
3626 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3627 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3628 4, value1, "Optional Attributes %d", value1);
3629 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3630 ioffset = ioffset + 4;
3631 for (r = 0; r < value1; r++)
3633 value2 = tvb_get_letohl(tvb, ioffset);
3634 ioffset = ioffset + 4;
3635 get_string(tvb, ioffset, value2, mval_buf.buffer);
3636 temp_values.vstring = mval_buf.buffer;
3637 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3638 value2, temp_values.vstring);
3639 ioffset = ioffset + value2;
3640 ioffset += align_4(tvb, ioffset);
3642 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
3643 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
3644 4, value1, "Default ACL %08x", value1);
3645 ioffset = ioffset + 4;
3646 if(tvb_length_remaining(tvb, ioffset) < 4 )
3651 if(values->vflags == 5) /* Base Class Definitions */
3653 value1 = tvb_get_letohl(tvb, ioffset); /* Creation Timestamp */
3654 proto_tree_add_uint_format(sub1tree, hf_es_seconds, tvb, ioffset,
3655 4, value1, "Creation Timestamp Seconds %d", value1);
3656 ioffset = ioffset + 4;
3657 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3658 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
3660 ioffset = ioffset + 2;
3661 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3662 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
3664 ioffset = ioffset + 2;
3665 value1 = tvb_get_letohl(tvb, ioffset); /* Modification Timestamp */
3666 proto_tree_add_uint_format(sub1tree, hf_es_seconds, tvb, ioffset,
3667 4, value1, "Modification Timestamp Seconds %d", value1);
3668 ioffset = ioffset + 4;
3669 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3670 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
3672 ioffset = ioffset + 2;
3673 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3674 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
3676 ioffset = ioffset + 2;
3677 /* Class Definition */
3678 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
3679 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3680 4, value1, "Super Classes %d", value1);
3681 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3682 ioffset = ioffset + 4;
3683 for (r = 0; r < value1; r++)
3685 value2 = tvb_get_letohl(tvb, ioffset);
3686 ioffset = ioffset + 4;
3687 get_string(tvb, ioffset, value2, mval_buf.buffer);
3688 temp_values.vstring = mval_buf.buffer;
3689 proto_tree_add_string(sub2tree, hf_nds_super, tvb, ioffset,
3690 value2, temp_values.vstring);
3691 ioffset = ioffset + value2;
3692 ioffset += align_4(tvb, ioffset);
3694 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3695 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3696 4, value1, "Containment Classes %d", value1);
3697 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3698 ioffset = ioffset + 4;
3699 for (r = 0; r < value1; r++)
3701 value2 = tvb_get_letohl(tvb, ioffset);
3702 ioffset = ioffset + 4;
3703 get_string(tvb, ioffset, value2, mval_buf.buffer);
3704 temp_values.vstring = mval_buf.buffer;
3705 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3706 value2, temp_values.vstring);
3707 ioffset = ioffset + value2;
3708 ioffset += align_4(tvb, ioffset);
3710 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3711 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3712 4, value1, "Naming Attributes %d", value1);
3713 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3714 ioffset = ioffset + 4;
3715 for (r = 0; r < value1; r++)
3717 value2 = tvb_get_letohl(tvb, ioffset);
3718 ioffset = ioffset + 4;
3719 get_string(tvb, ioffset, value2, mval_buf.buffer);
3720 temp_values.vstring = mval_buf.buffer;
3721 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3722 value2, temp_values.vstring);
3723 ioffset = ioffset + value2;
3724 ioffset += align_4(tvb, ioffset);
3726 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3727 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3728 4, value1, "Mandatory Attributes %d", value1);
3729 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3730 ioffset = ioffset + 4;
3731 for (r = 0; r < value1; r++)
3733 value2 = tvb_get_letohl(tvb, ioffset);
3734 ioffset = ioffset + 4;
3735 get_string(tvb, ioffset, value2, mval_buf.buffer);
3736 temp_values.vstring = mval_buf.buffer;
3737 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3738 value2, temp_values.vstring);
3739 ioffset = ioffset + value2;
3740 ioffset += align_4(tvb, ioffset);
3742 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3743 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3744 4, value1, "Optional Attributes %d", value1);
3745 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3746 ioffset = ioffset + 4;
3747 for (r = 0; r < value1; r++)
3749 value2 = tvb_get_letohl(tvb, ioffset);
3750 ioffset = ioffset + 4;
3751 get_string(tvb, ioffset, value2, mval_buf.buffer);
3752 temp_values.vstring = mval_buf.buffer;
3753 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3754 value2, temp_values.vstring);
3755 ioffset = ioffset + value2;
3756 ioffset += align_4(tvb, ioffset);
3758 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
3759 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
3760 4, value1, "Default ACL %08x", value1);
3761 ioffset = ioffset + 4;
3762 if(tvb_length_remaining(tvb, ioffset) < 4 )
3770 case 14: /* Modify Class */
3771 for (i = 1 ; i <= values->vvalue; i++ ) /* Attribute Names to add*/
3773 ioffset += align_4(tvb, ioffset);
3774 value1 = tvb_get_letohl(tvb, ioffset);
3775 ioffset = ioffset + 4;
3776 get_string(tvb, ioffset, value1, mval_buf.buffer);
3777 values->vstring = mval_buf.buffer;
3778 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
3779 value1, values->vstring);
3780 ioffset = ioffset + value1;
3782 if(tvb_length_remaining(tvb, ioffset) < 4 )
3786 ioffset += align_4(tvb, ioffset);
3787 value1 = tvb_get_letohl(tvb, ioffset);
3788 proto_tree_add_uint_format(ntree, hf_nds_att_del, tvb, ioffset,
3789 4, value1, "Attribute Names to Delete %d", value1);
3790 ioffset = ioffset + 4;
3791 for (i = 1 ; i <= value1; i++ ) /* Attribute Names to delete*/
3793 ioffset += align_4(tvb, ioffset);
3794 value2 = tvb_get_letohl(tvb, ioffset);
3795 ioffset = ioffset + 4;
3796 get_string(tvb, ioffset, value2, mval_buf.buffer);
3797 values->vstring = mval_buf.buffer;
3798 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
3799 value2, values->vstring);
3800 ioffset = ioffset + value2;
3802 if(tvb_length_remaining(tvb, ioffset) < 4 )
3806 ioffset += align_4(tvb, ioffset);
3807 value1 = tvb_get_letohl(tvb, ioffset);
3808 proto_tree_add_uint_format(ntree, hf_nds_acl_add, tvb, ioffset,
3809 4, value1, "ACL Templates to Add %d", value1);
3810 ioffset = ioffset + 4;
3811 for (i = 1 ; i <= value1; i++ ) /* ACL templates to add*/
3813 ioffset += align_4(tvb, ioffset);
3814 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
3815 ioffset = ioffset + 4;
3816 get_string(tvb, ioffset, value2, mval_buf.buffer);
3817 values->vstring = mval_buf.buffer;
3818 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
3819 value2, values->vstring);
3820 ioffset = ioffset + value2;
3821 ioffset += align_4(tvb, ioffset);
3822 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
3823 ioffset = ioffset + 4;
3824 get_string(tvb, ioffset, value2, mval_buf.buffer);
3825 values->vstring = mval_buf.buffer;
3826 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
3827 value2, values->vstring);
3828 ioffset = ioffset + value2;
3829 ioffset += align_4(tvb, ioffset);
3830 value1 = tvb_get_letohl(tvb, ioffset);
3831 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
3832 4, value1, "Priviledges 0x%08x", value1);
3833 ioffset = ioffset + 4;
3835 if(tvb_length_remaining(tvb, ioffset) < 4 )
3839 ioffset += align_4(tvb, ioffset);
3840 value1 = tvb_get_letohl(tvb, ioffset);
3841 proto_tree_add_uint_format(ntree, hf_nds_acl_del, tvb, ioffset,
3842 4, value1, "ACL Templates to Delete %d", value1);
3843 ioffset = ioffset + 4;
3844 for (i = 1 ; i <= value1; i++ ) /* ACL templates to delete*/
3846 ioffset += align_4(tvb, ioffset);
3847 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
3848 ioffset = ioffset + 4;
3849 get_string(tvb, ioffset, value2, mval_buf.buffer);
3850 values->vstring = mval_buf.buffer;
3851 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
3852 value2, values->vstring);
3853 ioffset = ioffset + value2;
3854 ioffset += align_4(tvb, ioffset);
3855 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
3856 ioffset = ioffset + 4;
3857 get_string(tvb, ioffset, value2, mval_buf.buffer);
3858 values->vstring = mval_buf.buffer;
3859 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
3860 value2, values->vstring);
3861 ioffset = ioffset + value2;
3862 ioffset += align_4(tvb, ioffset);
3863 value1 = tvb_get_letohl(tvb, ioffset); /* Priviledges */
3864 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
3865 4, value1, "Priviledges 0x%08x", value1);
3866 ioffset = ioffset + 4;
3875 dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
3876 guint16 nw_connection, guint8 sequence,
3877 guint16 type, proto_tree *ncp_tree)
3879 guint8 func, subfunc = 0;
3880 gboolean requires_subfunc;
3881 gboolean has_length = TRUE;
3882 ncp_req_hash_value *request_value = NULL;
3883 const ncp_record *ncp_rec = NULL;
3884 conversation_t *conversation;
3885 ptvcursor_t *ptvc = NULL;
3886 proto_tree *temp_tree = NULL;
3887 gboolean run_req_cond = FALSE;
3888 gboolean run_info_str = FALSE;
3889 guint32 length_remaining;
3892 func = tvb_get_guint8(tvb, 6);
3894 requires_subfunc = ncp_requires_subfunc(func);
3895 has_length = ncp_has_length_parameter(func);
3896 if (requires_subfunc) {
3898 subfunc = tvb_get_guint8(tvb, 9);
3901 subfunc = tvb_get_guint8(tvb, 7);
3905 /* Determine which ncp_record to use. */
3907 case NCP_ALLOCATE_SLOT:
3908 length_remaining = tvb_length_remaining(tvb, 4);
3909 if (length_remaining > 4)
3911 testvar = tvb_get_ntohl(tvb, 4);
3912 if( testvar == 0x4c495020)
3914 ncp_rec = &ncplip_echo;
3918 ncp_rec = &ncp1111_request;
3923 ncp_rec = &ncp1111_request;
3926 case NCP_SERVICE_REQUEST:
3927 ncp_rec = ncp_record_find(func, subfunc);
3929 case NCP_DEALLOCATE_SLOT:
3930 ncp_rec = &ncp5555_request;
3932 case NCP_BROADCAST_SLOT:
3933 ncp_rec = &ncpbbbb_request;
3936 ncp_rec = &ncplip_echo;
3942 /* Fill in the INFO column. */
3943 if (check_col(pinfo->cinfo, COL_INFO)) {
3945 col_add_fstr(pinfo->cinfo, COL_INFO, "C %s", ncp_rec->name);
3948 if (requires_subfunc) {
3949 col_add_fstr(pinfo->cinfo, COL_INFO,
3950 "C Unknown Function %d %d (0x%02X/0x%02x)",
3951 func, subfunc, func, subfunc);
3954 col_add_fstr(pinfo->cinfo, COL_INFO,
3955 "C Unknown Function %d (0x%02x)",
3961 if (!pinfo->fd->flags.visited) {
3962 /* This is the first time we've looked at this packet.
3963 Keep track of the address and connection whence the request
3964 came, and the address and connection to which the request
3965 is being sent, so that we can match up calls with replies.
3966 (We don't include the sequence number, as we may want
3967 to have all packets over the same connection treated
3968 as being part of a single conversation so that we can
3969 let the user select that conversation to be displayed.) */
3970 conversation = find_conversation(&pinfo->src, &pinfo->dst,
3971 PT_NCP, nw_connection, nw_connection, 0);
3973 if (conversation == NULL) {
3974 /* It's not part of any conversation - create a new one. */
3975 conversation = conversation_new(&pinfo->src, &pinfo->dst,
3976 PT_NCP, nw_connection, nw_connection, 0);
3978 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
3979 request_value->req_frame_num = pinfo->fd->num;
3981 /* If this is the first time we're examining the packet,
3982 * check to see if this NCP type uses a "request condition".
3983 * If so, we have to build a proto_tree because request conditions
3984 * use display filters to work, and without a proto_tree,
3985 * display filters can't possibly work. If we already have
3986 * a proto_tree, then wonderful. If we don't, we need to build
3989 if (ncp_rec->req_cond_indexes) {
3990 run_req_cond = TRUE;
3992 /* Only create info string if COL_INFO is available. */
3993 if (ncp_rec->req_info_str && check_col(pinfo->cinfo, COL_INFO)) {
3994 run_info_str = TRUE;
3996 /* We also have to use a tree if we have to construct an info_str */
3997 if ((run_info_str || run_req_cond) && !ncp_tree) {
4000 temp_tree = proto_tree_create_root();
4001 proto_tree_set_visible(temp_tree, FALSE);
4002 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
4003 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
4009 /* If the dissection throws an exception, be sure to free
4010 * the temporary proto_tree that was created. Because of the
4011 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
4012 * block; it has to be in the same scope as the terminating
4013 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
4014 * call CLEANUP_POP and friends, but the value of temp_tree is
4015 * NULL if no cleanup is needed, and non-null if cleanup is needed. */
4016 CLEANUP_PUSH(free_proto_tree, temp_tree);
4018 /* Before the dissection, if we're saving data for a request
4019 * condition, we have to prime the proto tree using the
4020 * dfilter information */
4025 needed = ncp_rec->req_cond_indexes;
4027 while (*needed != -1) {
4028 dfilter = req_conds[*needed].dfilter;
4029 /* Prime the proto_tree with "interesting fields". */
4030 dfilter_prime_proto_tree(dfilter, ncp_tree);
4035 /* Before the dissection, if we need a field for the info_str,
4036 * prime the tree. */
4038 proto_tree_prime_hfid(ncp_tree, *ncp_rec->req_info_str->hf_ptr);
4041 conversation = find_conversation(&pinfo->src, &pinfo->dst,
4042 PT_NCP, nw_connection, nw_connection, 0);
4045 case NCP_BROADCAST_SLOT:
4049 case NCP_SERVICE_REQUEST:
4050 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
4051 func, "Function: %d (0x%02X), %s",
4052 func, func, ncp_rec ? ncp_rec->name : "Unknown");
4060 if (requires_subfunc) {
4062 proto_tree_add_item(ncp_tree, hf_ncp_length, tvb, 7,
4064 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 9, 1,
4065 subfunc, "SubFunction: %d (0x%02x)",
4067 ptvc = ptvcursor_new(ncp_tree, tvb, 10);
4070 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
4071 subfunc, "SubFunction: %d (0x%02x)",
4073 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
4077 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
4080 /* The group is not part of the packet, but it's useful
4081 * information to display anyway. */
4083 proto_tree_add_text(ncp_tree, tvb, 6, 1, "Group: %s",
4084 ncp_groups[ncp_rec->group]);
4087 if (ncp_rec && ncp_rec->request_ptvc) {
4088 clear_repeat_vars();
4089 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
4091 ptvcursor_free(ptvc);
4093 /* Now that the dissection is done, do we need to run
4094 * some display filters on the resulting tree in order
4095 * to save results for "request conditions" ? */
4101 results = g_new0(gboolean, NUM_REQ_CONDS);
4102 needed = ncp_rec->req_cond_indexes;
4104 while (*needed != -1) {
4105 /* ncp_tree is not a root proto_tree, but
4106 * dfilters will still work on it. */
4107 dfilter = req_conds[*needed].dfilter;
4108 results[*needed] = dfilter_apply(dfilter, ncp_tree);
4112 /* Save the results so the reply packet dissection
4114 request_value->req_cond_results = results;
4117 /* Construct the info string if necessary */
4124 parray = proto_get_finfo_ptr_array(ncp_tree,
4125 *ncp_rec->req_info_str->hf_ptr);
4126 len = g_ptr_array_len(parray);
4130 col_set_str(pinfo->cinfo, COL_INFO, "C ");
4132 finfo = g_ptr_array_index(parray, 0);
4134 info_type = get_info_type((gchar*) ncp_rec->req_info_str->first_string);
4136 if (info_type == 2) { // Is this a string or not?
4138 col_append_fstr(pinfo->cinfo, COL_INFO,
4139 (gchar*) ncp_rec->req_info_str->first_string,
4140 fvalue_get(finfo->value));
4145 col_append_fstr(pinfo->cinfo, COL_INFO,
4146 (gchar*) ncp_rec->req_info_str->first_string,
4147 fvalue_get_integer(finfo->value));
4151 for (i = 1; i < len; i++) {
4152 finfo = g_ptr_array_index(parray, i);
4153 info_type = get_info_type((gchar*) ncp_rec->req_info_str->repeat_string);
4155 if (info_type == 2) { // Is this a string or not?
4157 col_append_fstr(pinfo->cinfo, COL_INFO,
4158 (gchar*) ncp_rec->req_info_str->repeat_string,
4159 fvalue_get(finfo->value));
4164 col_append_fstr(pinfo->cinfo, COL_INFO,
4165 (gchar*) ncp_rec->req_info_str->repeat_string,
4166 fvalue_get_integer(finfo->value));
4173 /* Free the temporary proto_tree */
4174 CLEANUP_CALL_AND_POP;
4180 dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
4181 guint16 nw_connection, guint8 sequence, guint16 type,
4182 proto_tree *ncp_tree)
4184 conversation_t *conversation = NULL;
4185 ncp_req_hash_value *request_value = NULL;
4186 ncp_req_eid_hash_value *request_eid_value = NULL;
4187 const ncp_record *ncp_rec = NULL;
4188 int *req_cond_results;
4189 guint8 completion_code=0;
4191 ptvcursor_t *ptvc = NULL;
4192 const char *error_string;
4193 guint32 nds_string_len = 0;
4194 guint8 ping_version = 0;
4195 guint32 nds_flags = 0;
4196 guint32 nds_offset = 0;
4197 nw_uni_t reply_buffer;
4198 char * verb_string="";
4199 guint32 nds_error_code = 0;
4200 guint32 nds_reply_buffer = 0;
4201 char * nds_error_string = NULL;
4212 gboolean resolve_eid=FALSE;
4213 guint32 global_eid=0;
4214 gboolean add_eid = FALSE;
4215 char *global_object_name='\0';
4218 reply_buffer.buffer = "\0";
4219 if (!pinfo->fd->flags.visited) {
4220 /* Find the conversation whence the request would have come. */
4221 conversation = find_conversation(&pinfo->src, &pinfo->dst,
4222 PT_NCP, nw_connection, nw_connection, 0);
4223 if (conversation != NULL) {
4224 /* find the record telling us the request made that caused
4226 request_value = ncp_hash_lookup(conversation, sequence);
4227 if (request_value) {
4228 ncp_rec = request_value->ncp_rec;
4230 p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
4232 /* else... we haven't seen an NCP Request for that conversation and sequence. */
4235 request_value = p_get_proto_data(pinfo->fd, proto_ncp);
4236 if (request_value) {
4237 ncp_rec = request_value->ncp_rec;
4241 /* A completion code of 0 always means OK. Non-zero means failure,
4242 * but each non-zero value has a different meaning. And the same value
4243 * can have different meanings, depending on the ncp.func (and ncp.subfunc)
4245 completion_code = tvb_get_guint8(tvb, 6);
4246 if (ncp_rec && ncp_rec->errors) {
4247 error_string = ncp_error_string(ncp_rec->errors, completion_code);
4249 else if (completion_code == 0) {
4250 if(type == NCP_POSITIVE_ACK)
4252 error_string = "Server Busy, Request Being Processed";
4256 error_string = "OK";
4260 error_string = "Not OK";
4262 if (ncp_rec && ncp_rec->func==0x68 && ncp_rec->subfunc==0x02)
4265 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
4266 nds_frag = tvb_get_letohl(tvb, 12);
4267 if (nds_reply_buffer > 7)
4270 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4271 error_string = match_strval(nds_error_code, nds_reply_errors);
4272 if (error_string == NULL)
4275 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4276 error_string = match_strval(nds_error_code, nds_reply_errors);
4278 if (error_string == NULL || nds_error_code == 0x00000000)
4280 if (nds_frag != 0xffffffff)
4282 error_string = "NDS Fragment";
4286 error_string = "Ok";
4292 if (check_col(pinfo->cinfo, COL_INFO)) {
4293 if (ncp_rec && ncp_rec->func==0x68 && ncp_rec->subfunc==0x02) {
4294 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
4296 if (ncp_rec && ncp_rec->func==0x68 && ncp_rec->subfunc==0x01) {
4297 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
4299 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
4300 type == NCP_SERVICE_REPLY ? "R" : "ACK",
4306 if (request_value) {
4307 proto_tree_add_uint(ncp_tree, hf_ncp_req_frame_num, tvb, 0, 0,
4308 request_value->req_frame_num);
4312 /* Put the func (and maybe subfunc) from the request packet
4313 * in the proto tree, but hidden. That way filters on ncp.func
4314 * or ncp.subfunc will find both the requests and the replies.
4317 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 0,
4318 ncp_rec->func, "Function: %d (0x%02X), %s",
4319 ncp_rec->func, ncp_rec->func, ncp_rec->name);
4320 if (ncp_requires_subfunc(ncp_rec->func)) {
4321 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 6, 0,
4322 ncp_rec->subfunc, "SubFunction: %d (0x%02x)",
4323 ncp_rec->subfunc, ncp_rec->subfunc);
4327 proto_tree_add_uint_format(ncp_tree, hf_ncp_completion_code, tvb, 6, 1,
4328 completion_code, "Completion Code: %d (0x%02x), %s",
4329 completion_code, completion_code, error_string);
4331 proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb, 7, 1, FALSE);
4332 /* Decode NDS Reply packets */
4334 if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x01) {
4335 ping_version = tvb_get_guint8(tvb, 8);
4336 proto_tree_add_item(ncp_tree, hf_ping_version, tvb, 8, 1, TRUE);
4337 if (ping_version == 9) {
4338 nds_string_len = tvb_get_ntohl(tvb, 9);
4339 nds_offset = nds_string_len+16;
4340 proto_tree_add_item(ncp_tree, hf_nds_string, tvb, 16, nds_string_len, FALSE);
4341 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, FALSE);
4342 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, (nds_offset+4), 4, FALSE);
4343 proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, (nds_offset+8), 4, TRUE);
4347 nds_flags = request_value->req_nds_flags;
4348 if (nds_flags & 0x00200000) {
4349 nds_offset = nds_offset+4;
4351 if (nds_flags & 0x00000002) {
4352 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, TRUE);
4353 nds_offset = nds_offset+4;
4355 if (nds_flags & 0x00000004) {
4356 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, nds_offset, 4, TRUE);
4357 nds_offset = nds_offset+4;
4359 if (nds_flags & 0x00000008) {
4360 proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, nds_offset, 4, TRUE);
4361 nds_offset = nds_offset+4;
4363 if (nds_flags & 0x00020000) {
4364 nds_string_len = tvb_get_letohl(tvb, nds_offset);
4365 get_string(tvb, nds_offset+4, nds_string_len, reply_buffer.buffer);
4366 proto_tree_add_text(ncp_tree, tvb, nds_offset+4, nds_string_len, "NDS Tree Name: %s", reply_buffer.buffer);
4370 if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x02)
4374 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
4375 proto_tree_add_uint_format(ncp_tree, hf_ncp_fragment_size, tvb, 8,
4376 4, nds_reply_buffer, "NDS Fragment Size %d",
4378 nds_frag = tvb_get_letohl(tvb, 12);
4379 proto_tree_add_uint_format(ncp_tree, hf_ncp_fragment_handle, tvb, 12,
4380 4, nds_frag, "NDS Fragment Handle 0x%08x",
4382 if (nds_reply_buffer > 7)
4385 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4386 nds_error_string = match_strval(nds_error_code, nds_reply_errors);
4387 if (nds_error_string == NULL)
4390 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4391 error_string = match_strval(nds_error_code, nds_reply_errors);
4393 if (nds_error_string == NULL || nds_error_code == 0x00000000)
4395 if (nds_frag != 0xffffffff)
4397 nds_error_string = "NDS Fragment";
4401 nds_error_string = "Ok";
4403 nds_error_code = 0x00000000;
4405 proto_tree_add_uint_format(ncp_tree, hf_nds_reply_error, tvb, nds_offset,
4406 4, nds_error_code, "NDS Completion Code: 0x%08x, %s",
4407 nds_error_code, nds_error_string);
4410 if (request_value && nds_error_code == 0x00000000 && nds_frag == 0xffffffff)
4422 p1values.vvalue = 0;
4423 p2values.vvalue = 0;
4424 p3values.vvalue = 0;
4425 p4values.vvalue = 0;
4426 p5values.vvalue = 0;
4427 p6values.vvalue = 0;
4428 p7values.vvalue = 0;
4429 p8values.vvalue = 0;
4430 p9values.vvalue = 0;
4431 p1values.vlength = 0;
4432 p2values.vlength = 0;
4433 p3values.vlength = 0;
4434 p4values.vlength = 0;
4435 p5values.vlength = 0;
4436 p6values.vlength = 0;
4437 p7values.vlength = 0;
4438 p8values.vlength = 0;
4439 p9values.vlength = 0;
4440 p1values.voffset = 0;
4441 p2values.voffset = 0;
4442 p3values.voffset = 0;
4443 p4values.voffset = 0;
4444 p5values.voffset = 0;
4445 p6values.voffset = 0;
4446 p7values.voffset = 0;
4447 p8values.voffset = 0;
4448 p9values.voffset = 0;
4449 p1values.hfname = 0;
4450 p2values.hfname = 0;
4451 p3values.hfname = 0;
4452 p4values.hfname = 0;
4453 p5values.hfname = 0;
4454 p6values.hfname = 0;
4455 p7values.hfname = 0;
4456 p8values.hfname = 0;
4457 p9values.hfname = 0;
4458 p1values.vdesc = "";
4459 p2values.vdesc = "";
4460 p3values.vdesc = "";
4461 p4values.vdesc = "";
4462 p5values.vdesc = "";
4463 p6values.vdesc = "";
4464 p7values.vdesc = "";
4465 p8values.vdesc = "";
4466 p9values.vdesc = "";
4467 p1values.vstring = "";
4468 p2values.vstring = "";
4469 p3values.vstring = "";
4470 p4values.vstring = "";
4471 p5values.vstring = "";
4472 p6values.vstring = "";
4473 p7values.vstring = "";
4474 p8values.vstring = "";
4475 p9values.vstring = "";
4476 switch (request_value->nds_request_verb)
4479 verb_string = "Resolve Name";
4480 if(request_value->nds_version == 0)
4482 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4483 p1values.vstring = match_strval(p1values.vvalue, nds_tags);
4484 if(p1values.vstring == NULL)
4486 p1values.vstring = "No Tags Set";
4488 p1values.vtype = 4; /* String */
4489 p1values.vdesc = "Tag: %s";
4490 p1values.vlength = 4;
4491 p1values.voffset = nds_offset;
4492 p1values.hfname = hf_nds_tag_string;
4493 nds_offset = nds_offset+p1values.vlength;
4494 switch(p1values.vvalue)
4496 case 0: /* No Such Entry */
4498 case 1: /* Local Entry */
4499 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4500 p2values.vstring = "";
4501 p2values.vtype = 3; /* Uint32 */
4502 p2values.vdesc = "Entry ID: 0x%08x";
4504 global_object_name = request_value->object_name;
4505 global_eid = p2values.vvalue;
4506 p2values.vlength = 4;
4507 p2values.voffset = nds_offset;
4508 p2values.hfname = hf_nds_eid;
4509 nds_offset = nds_offset+p2values.vlength;
4510 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4511 p3values.vtype = 6; /* Multivalue Uint32 */
4512 p3values.vstring = "";
4513 p3values.vdesc = "Referal Records: %d";
4514 p3values.vlength = 4;
4515 p3values.voffset = nds_offset;
4516 p3values.hfname = hf_nds_referals;
4517 p3values.mvtype = 9;
4519 case 2: /* Remote Entry */
4520 nds_offset += 4; /* GUINT32 reserved field */
4521 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4522 p2values.vstring = "";
4523 p2values.vtype = 3; /* Uint32 */
4524 p2values.vdesc = "Entry ID: 0x%08x";
4526 global_eid = p2values.vvalue;
4527 global_object_name = request_value->object_name;
4528 p2values.vlength = 4;
4529 p2values.voffset = nds_offset;
4530 p2values.hfname = hf_nds_eid;
4531 nds_offset = nds_offset+p2values.vlength;
4532 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4533 p3values.vtype = 6; /* Multivalue Uint32 */
4534 p3values.vstring = "";
4535 p3values.vdesc = "Referal Records: %d";
4536 p3values.vlength = 4;
4537 p3values.voffset = nds_offset;
4538 p3values.hfname = hf_nds_referals;
4539 p3values.mvtype = 9;
4541 case 3: /* Alias Entry */
4542 p2values.vtype = 4; /* String */
4543 p2values.vdesc = "Alias Name: %s";
4544 p2values.vstring = "";
4545 p2values.mvtype = 1;
4546 p2values.vvalue = 0;
4547 p2values.vlength = 256;
4548 p2values.vlength = tvb_get_letohl(tvb, nds_offset);
4549 if (p2values.vlength == 0x00)
4554 p2values.voffset = nds_offset+4;
4556 get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring);
4557 nds_offset += p2values.vlength;
4558 nds_offset += align_4(tvb, nds_offset);
4559 p2values.hfname= hf_nds_name;
4561 case 4: /* Referral Information */
4562 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4563 p2values.vstring = "";
4564 p2values.vtype = 3; /* Uint32 */
4565 p2values.vdesc = "Distance Object is From Root: 0x%08x";
4566 p2values.vlength = 4;
4567 p2values.voffset = nds_offset;
4568 p2values.hfname = hf_nds_eid;
4569 nds_offset = nds_offset+p2values.vlength;
4570 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4571 p3values.vtype = 6; /* Multivalue Uint32 */
4572 p3values.vstring = "";
4573 p3values.vdesc = "Referal Records: %d";
4574 p3values.vlength = 4;
4575 p3values.voffset = nds_offset;
4576 p3values.hfname = hf_nds_depth;
4577 p3values.mvtype = 9;
4579 case 6: /* Entry and Referrals */
4580 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4581 p2values.vstring = "";
4582 p2values.vtype = 3; /* Uint32 */
4583 p2values.vdesc = "Result Flags: 0x%08x";
4584 p2values.vlength = 4;
4585 p2values.voffset = nds_offset;
4586 p2values.hfname = hf_nds_result_flags;
4587 nds_offset = nds_offset+p2values.vlength;
4588 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4589 p3values.vstring = "";
4590 p3values.vtype = 3; /* Uint32 */
4591 p3values.vdesc = "Entry ID: 0x%08x";
4593 global_eid = p3values.vvalue;
4594 global_object_name = request_value->object_name;
4595 p3values.vlength = 4;
4596 p3values.voffset = nds_offset;
4597 p3values.hfname = hf_nds_eid;
4598 nds_offset = nds_offset+p3values.vlength;
4599 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4600 p4values.vtype = 6; /* Multivalue Uint32 */
4601 p4values.vstring = "";
4602 p4values.vdesc = "Referal Records: %d";
4603 p4values.vlength = 4;
4604 p4values.voffset = nds_offset;
4605 p4values.mvtype = 8;
4606 p4values.hfname = hf_nds_referals;
4614 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4615 p1values.vstring = "";
4616 p1values.vtype = 3; /* Uint32 */
4617 p1values.vdesc = "CRC: 0x%08x";
4618 p1values.vlength = 4;
4619 p1values.voffset = nds_offset;
4620 p1values.hfname = hf_nds_crc;
4621 nds_offset = nds_offset+p1values.vlength;
4622 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4623 p2values.vstring = match_strval(p2values.vvalue, nds_tags);
4624 if(p2values.vstring == NULL)
4626 p2values.vstring = "No Tags Set";
4628 p2values.vtype = 4; /* String */
4629 p2values.vdesc = "Tag: %s";
4630 p2values.vlength = 4;
4631 p2values.voffset = nds_offset;
4632 nds_offset = nds_offset+p2values.vlength;
4633 p2values.hfname = hf_nds_tag_string;
4634 switch(p2values.vvalue)
4636 case 0: /* No Such Entry */
4638 case 1: /* Local Entry */
4639 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4640 p3values.vstring = "";
4641 p3values.vtype = 3; /* Uint32 */
4642 p3values.vdesc = "Entry ID: 0x%08x";
4644 global_eid = p3values.vvalue;
4645 global_object_name = request_value->object_name;
4646 p3values.vlength = 4;
4647 p3values.voffset = nds_offset;
4648 p3values.hfname = hf_nds_eid;
4649 nds_offset = nds_offset+p3values.vlength;
4650 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4651 p4values.vtype = 6; /* Multivalue Uint32 */
4652 p4values.vstring = "";
4653 p4values.vdesc = "Referal Records: %d";
4654 p4values.vlength = 4;
4655 p4values.voffset = nds_offset;
4656 p4values.hfname = hf_nds_referals;
4657 p4values.mvtype = 9;
4659 case 2: /* Remote Entry */
4660 nds_offset += 4; /* GUINT32 reserved field */
4661 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4662 p3values.vstring = "";
4664 global_eid = p3values.vvalue;
4665 global_object_name = request_value->object_name;
4666 p3values.vtype = 3; /* Uint32 */
4667 p3values.vdesc = "Entry ID: 0x%08x";
4668 p3values.vlength = 4;
4669 p3values.voffset = nds_offset;
4670 p3values.hfname = hf_nds_eid;
4671 nds_offset = nds_offset+p3values.vlength;
4672 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4673 p4values.vtype = 6; /* Multivalue Uint32 */
4674 p4values.vstring = "";
4675 p4values.vdesc = "Referal Records: %d";
4676 p4values.vlength = 4;
4677 p4values.voffset = nds_offset;
4678 p4values.hfname = hf_nds_referals;
4679 p4values.mvtype = 9;
4681 case 3: /* Alias Entry */
4682 p3values.vtype = 4; /* String */
4683 p3values.vdesc = "Alias Name: %s";
4684 p3values.vstring = "";
4685 p3values.mvtype = 1;
4686 p3values.vvalue = 0;
4687 p3values.vlength = 256;
4688 p3values.vlength = tvb_get_letohl(tvb, nds_offset);
4689 if (p3values.vlength == 0x00)
4694 p3values.voffset = nds_offset+4;
4696 get_string(tvb, p3values.voffset, p3values.vlength, p3values.vstring);
4697 nds_offset += p3values.vlength;
4698 nds_offset += align_4(tvb, nds_offset);
4699 p3values.hfname= hf_nds_name;
4701 case 4: /* Referral Information */
4702 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4703 p3values.vstring = "";
4704 p3values.vtype = 3; /* Uint32 */
4705 p3values.vdesc = "Distance Object is From Root: 0x%08x";
4706 p3values.vlength = 4;
4707 p3values.voffset = nds_offset;
4708 p3values.hfname = hf_nds_eid;
4709 nds_offset = nds_offset+p3values.vlength;
4710 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4711 p4values.vtype = 6; /* Multivalue Uint32 */
4712 p4values.vstring = "";
4713 p4values.vdesc = "Referal Records: %d";
4714 p4values.vlength = 4;
4715 p4values.voffset = nds_offset;
4716 p4values.hfname = hf_nds_depth;
4717 p4values.mvtype = 8;
4719 case 6: /* Entry and Referrals */
4720 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4721 p3values.vstring = "";
4722 p3values.vtype = 3; /* Uint32 */
4723 p3values.vdesc = "Result Flags: 0x%08x";
4724 p3values.vlength = 4;
4725 p3values.voffset = nds_offset;
4726 p3values.hfname = hf_nds_result_flags;
4727 nds_offset = nds_offset+p3values.vlength;
4728 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4729 p4values.vstring = "";
4730 p4values.vtype = 3; /* Uint32 */
4731 p4values.vdesc = "Entry ID: 0x%08x";
4733 global_object_name = request_value->object_name;
4734 global_eid = p4values.vvalue;
4735 p4values.vlength = 4;
4736 p4values.voffset = nds_offset;
4737 p4values.hfname = hf_nds_eid;
4738 nds_offset = nds_offset+p4values.vlength;
4739 p5values.vvalue = tvb_get_letohl(tvb, nds_offset);
4740 p5values.vtype = 6; /* Multivalue Uint32 */
4741 p5values.vstring = "";
4742 p5values.vdesc = "Referal Records: %d";
4743 p5values.vlength = 4;
4744 p5values.voffset = nds_offset;
4745 p5values.mvtype = 8;
4746 p5values.hfname = hf_nds_referals;
4755 verb_string = "Read Entry Information";
4756 if(request_value->nds_version != 0x000000fe)
4758 p1values.vvalue = 1;
4759 p1values.vtype = 6; /* Multivalue Uint32 */
4760 p1values.vstring = "";
4761 p1values.vdesc = "Entry Information";
4762 p1values.vlength = 0;
4763 p1values.voffset = nds_offset-4;
4764 p1values.hfname = hf_nds_name;
4765 p1values.mvtype = 12;
4766 p1values.vflags = request_value->req_nds_flags;
4770 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4771 p1values.vstring = "";
4772 p1values.vtype = 3; /* Uint32 */
4773 p1values.vdesc = "CRC: 0x%08x";
4774 p1values.vlength = 4;
4775 p1values.voffset = nds_offset;
4776 p1values.hfname = hf_nds_crc;
4777 nds_offset = nds_offset+p1values.vlength;
4778 p2values.vvalue = 1;
4779 p2values.vtype = 6; /* Multivalue Uint32 */
4780 p2values.vstring = "";
4781 p2values.vdesc = "Entry Information";
4782 p2values.vlength = 0;
4783 p2values.voffset = nds_offset-4;
4784 p2values.hfname = hf_nds_name;
4785 p2values.mvtype = 12;
4786 p2values.vflags = request_value->req_nds_flags;
4790 verb_string = "Read";
4791 if(request_value->nds_version != 0x000000fe)
4793 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4794 p1values.vstring = "";
4795 p1values.vtype = 3; /* Uint32 */
4796 p1values.vdesc = "Iteration Handle: 0x%08x";
4797 p1values.vlength = 4;
4798 p1values.voffset = nds_offset;
4799 p1values.hfname = hf_nds_iteration;
4800 nds_offset = nds_offset+p1values.vlength;
4801 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4802 p2values.vstring = match_strval(p2values.vvalue, nds_info_type);
4803 if(p2values.vstring == NULL)
4805 p2values.vstring = "No Info Type Set";
4807 p2values.vtype = 4; /* String */
4808 p2values.vdesc = "Info Type: %s";
4809 p2values.vlength = 4;
4810 p2values.voffset = nds_offset;
4811 p2values.hfname = hf_nds_info_type;
4812 nds_offset = nds_offset+p2values.vlength;
4813 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4814 p3values.vtype = 6; /* Multivalue Uint32 */
4815 p3values.vstring = "";
4816 p3values.vdesc = "Number of Attributes: %d";
4817 p3values.vlength = 4;
4818 p3values.voffset = nds_offset;
4819 p3values.hfname = hf_nds_attr;
4820 p3values.mvtype = 2;
4821 p3values.vflags = request_value->req_nds_flags;
4822 p3values.nds_version = request_value->nds_version;
4826 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4827 p1values.vstring = "";
4828 p1values.vtype = 3; /* Uint32 */
4829 p1values.vdesc = "CRC: 0x%08x";
4830 p1values.vlength = 4;
4831 p1values.voffset = nds_offset;
4832 p1values.hfname = hf_nds_crc;
4833 nds_offset = nds_offset+p1values.vlength;
4834 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4835 p2values.vstring = "";
4836 p2values.vtype = 3; /* Uint32 */
4837 p2values.vdesc = "Iteration Handle: 0x%08x";
4838 p2values.vlength = 4;
4839 p2values.voffset = nds_offset;
4840 p2values.hfname = hf_nds_iteration;
4841 nds_offset = nds_offset+p2values.vlength;
4842 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4843 p3values.vstring = match_strval(p3values.vvalue, nds_info_type);
4844 if(p3values.vstring == NULL)
4846 p3values.vstring = "No Info Type Set";
4848 p3values.vtype = 4; /* String */
4849 p3values.vdesc = "Info Type: %s";
4850 p3values.vlength = 4;
4851 p3values.voffset = nds_offset;
4852 p3values.hfname = hf_nds_info_type;
4853 nds_offset = nds_offset+p3values.vlength;
4854 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4855 p4values.vtype = 6; /* Multivalue Uint32 */
4856 p4values.vstring = "";
4857 p4values.vdesc = "Number of Attributes: %d";
4858 p4values.vlength = 4;
4859 p4values.voffset = nds_offset;
4860 p4values.hfname = hf_nds_attr;
4861 p4values.mvtype = 2;
4862 p4values.vflags = request_value->req_nds_flags;
4863 p4values.nds_version = request_value->nds_version;
4867 verb_string = "Compare";
4868 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4869 if (p1values.vvalue == 0x00000000)
4871 p1values.vstring = "Did Not Match";
4875 p1values.vstring = "Matched";
4877 p1values.vtype = 4; /* String */
4878 p1values.vdesc = "Compare Values Returned - %s";
4879 p1values.vlength = 4;
4880 p1values.voffset = nds_offset;
4881 p1values.mvtype = 0;
4882 p1values.hfname= hf_nds_compare_results;
4883 nds_offset += p1values.vlength;
4886 verb_string = "List";
4887 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4888 p1values.vstring = "";
4889 p1values.vtype = 3; /* Uint32 */
4890 p1values.vdesc = "Iteration Handle: 0x%08x";
4891 p1values.vlength = 4;
4892 p1values.voffset = nds_offset;
4893 p1values.hfname = hf_nds_iteration;
4894 nds_offset = nds_offset+p1values.vlength;
4895 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);;
4896 p2values.vtype = 6; /* Multivalue Uint32 */
4897 p2values.vstring = "";
4898 p2values.vdesc = "Entry Information";
4899 p2values.vlength = 0;
4900 p2values.voffset = nds_offset;
4901 p2values.hfname = hf_nds_name;
4902 p2values.mvtype = 12;
4903 p2values.vflags = request_value->req_nds_flags;
4906 verb_string = "Search Entries";
4909 verb_string = "Add Entry";
4912 verb_string = "Remove Entry";
4915 verb_string = "Modify Entry";
4918 verb_string = "Modify RDN";
4921 verb_string = "Define Attribute";
4924 verb_string = "Read Attribute Definition";
4927 verb_string = "Remove Attribute Definition";
4930 verb_string = "Define Class";
4933 verb_string = "Read Class Definition";
4934 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4935 p1values.vstring = "";
4936 p1values.vtype = 3; /* Uint32 */
4937 p1values.vdesc = "Iteration Handle: 0x%08x";
4938 p1values.vlength = 4;
4939 p1values.voffset = nds_offset;
4940 p1values.hfname = hf_nds_iteration;
4941 nds_offset = nds_offset+p1values.vlength;
4942 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4943 p2values.vstring = match_strval(p2values.vvalue, class_def_type);
4944 if(p2values.vstring == NULL)
4946 p2values.vstring = "No Class Definition Type Set";
4948 p2values.vtype = 4; /* String */
4949 p2values.vdesc = "Class Definition Type: %s";
4950 p2values.vlength = 4;
4951 p2values.voffset = nds_offset;
4952 p2values.mvtype = 0;
4953 p2values.hfname= hf_nds_class_def_type;
4954 nds_offset = nds_offset + p2values.vlength;
4955 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);;
4956 p3values.vtype = 6; /* Multivalue Uint32 */
4957 p3values.vstring = "";
4958 p3values.vdesc = "Class Definitions %d";
4959 p3values.vlength = 0;
4960 p3values.voffset = nds_offset;
4961 p3values.hfname = hf_nds_classes;
4962 p3values.mvtype = 13;
4963 p3values.vflags = request_value->req_nds_flags;
4966 verb_string = "Modify Class Definition";
4969 verb_string = "Remove Class Definition";
4972 verb_string = "List Containable Classes";
4973 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4974 p1values.vstring = "";
4975 p1values.vtype = 3; /* Uint32 */
4976 p1values.vdesc = "Iteration Handle: 0x%08x";
4977 p1values.vlength = 4;
4978 p1values.voffset = nds_offset;
4979 p1values.hfname = hf_nds_iteration;
4980 nds_offset = nds_offset+p1values.vlength;
4981 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4982 p2values.vtype = 6; /* Multivalue Uint32 */
4983 p2values.vstring = "";
4984 p2values.vdesc = "Classes: %d";
4985 p2values.vlength = 4;
4986 p2values.voffset = nds_offset;
4987 p2values.mvtype = 4;
4988 p2values.hfname= hf_nds_classes;
4991 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4992 p1values.vstring = "";
4993 p1values.vtype = 3; /* Uint32 */
4994 p1values.vdesc = "Privileges: 0x%08x";
4995 p1values.vlength = 4;
4996 p1values.voffset = nds_offset;
4997 p1values.hfname = hf_nds_privileges;
4998 nds_offset = nds_offset+p1values.vlength;
5001 verb_string = "Add Partition";
5004 verb_string = "Remove Partition";
5007 verb_string = "List Partitions";
5008 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
5009 p1values.vstring = "";
5010 p1values.vtype = 3; /* Uint32 */
5011 p1values.vdesc = "Iteration Handle: 0x%08x";
5012 p1values.vlength = 4;
5013 p1values.voffset = nds_offset;
5014 p1values.hfname = hf_nds_iteration;
5015 nds_offset = nds_offset+p1values.vlength;
5016 p2values.vtype = 4; /* String */
5017 p2values.vdesc = "Server Distinguished Name: %s";
5018 p2values.vstring = "";
5019 p2values.mvtype = 1;
5020 p2values.vvalue = 0;
5021 p2values.vlength = 256;
5022 p2values.vlength = tvb_get_letohl(tvb, nds_offset);
5023 if (p2values.vlength == 0x00)
5028 p2values.voffset = nds_offset+4;
5030 get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring);
5031 nds_offset += p2values.vlength;
5032 nds_offset += align_4(tvb, nds_offset);
5033 p2values.hfname= hf_nds_name;
5034 nds_offset += align_4(tvb, nds_offset);
5035 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
5036 p3values.vtype = 6; /* Multivalue Uint32 */
5037 p3values.vstring = "";
5038 p3values.vdesc = "Replicas: %d";
5039 p3values.vlength = 4;
5040 p3values.voffset = nds_offset;
5041 p3values.hfname = hf_nds_replicas;
5042 p3values.mvtype = 5;
5043 p3values.bit1 = "Output Flags";
5044 p3values.bit2 = "Entry ID";
5045 p3values.bit3 = "Replica State";
5046 p3values.bit4 = "Modification Timestamp";
5047 p3values.bit5 = "Purge Time";
5048 p3values.bit6 = "Local Partition ID";
5049 p3values.bit7 = "Distinguished Name";
5050 p3values.bit8 = "Replica Type";
5051 p3values.bit9 = "Partition Busy";
5052 p3values.vflags = request_value->req_nds_flags;
5055 verb_string = "Split Partition";
5058 verb_string = "Join Partitions";
5061 verb_string = "Add Replica";
5064 verb_string = "Remove Replica";
5067 verb_string = "Open Stream";
5068 p1values.vvalue = tvb_get_ntohl(tvb, nds_offset);
5069 p1values.vstring = "";
5070 p1values.vtype = 3; /* Uint32 */
5071 p1values.vdesc = "File Handle: 0x%08x";
5072 p1values.vlength = 4;
5073 p1values.voffset = nds_offset;
5074 p1values.hfname = hf_nds_file_handle;
5075 nds_offset = nds_offset+p1values.vlength;
5076 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
5077 p2values.vstring = "";
5078 p2values.vtype = 3; /* Uint32 */
5079 p2values.vdesc = "File Size: %d";
5080 p2values.vlength = 4;
5081 p2values.voffset = nds_offset;
5082 p2values.hfname = hf_nds_file_size;
5083 nds_offset = nds_offset+p2values.vlength;
5086 verb_string = "Search Filter";
5089 verb_string = "Create Subordinate Reference";
5092 verb_string = "Link Replica";
5095 verb_string = "Change Replica Type";
5098 verb_string = "Start Update Schema";
5101 verb_string = "End Update Schema";
5104 verb_string = "Update Schema";
5107 verb_string = "Start Update Replica";
5110 verb_string = "End Update Replica";
5113 verb_string = "Update Replica";
5116 verb_string = "Synchronize Partition";
5119 verb_string = "Synchronize Schema";
5122 verb_string = "Read Syntaxes";
5125 verb_string = "Get Replica Root ID";
5128 verb_string = "Begin Move Entry";
5131 verb_string = "Finish Move Entry";
5134 verb_string = "Release Moved Entry";
5137 verb_string = "Backup Entry";
5140 verb_string = "Restore Entry";
5143 verb_string = "Save DIB";
5146 verb_string = "Control";
5149 verb_string = "Remove Backlink";
5152 verb_string = "Close Iteration";
5155 verb_string = "Mutate Entry";
5158 verb_string = "Audit Skulking";
5161 verb_string = "Get Server Address";
5162 if(request_value->nds_version != 0x000000fe)
5164 p1values.vtype = 4; /* String */
5165 p1values.vdesc = "Distinguished Name: %s";
5166 p1values.vstring = "";
5167 p1values.mvtype = 1;
5168 p1values.vvalue = 0;
5169 p1values.vlength = 256;
5170 p1values.vlength = tvb_get_letohl(tvb, nds_offset);
5171 if (p1values.vlength == 0x00)
5176 p1values.voffset = nds_offset+4;
5178 get_string(tvb, p1values.voffset, p1values.vlength, p1values.vstring);
5179 nds_offset += p1values.vlength;
5180 nds_offset += align_4(tvb, nds_offset);
5181 p1values.hfname= hf_nds_name;
5182 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
5183 p2values.vtype = 6; /* Multivalue Uint32 */
5184 p2values.vstring = "";
5185 p2values.vdesc = "Referal Records: %d";
5186 p2values.vlength = 4;
5187 p2values.voffset = nds_offset;
5188 p2values.hfname = hf_nds_referals;
5189 p2values.mvtype = 9;
5193 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
5194 p1values.vstring = "";
5195 p1values.vtype = 3; /* Uint32 */
5196 p1values.vdesc = "Iteration Handle: 0x%08x";
5197 p1values.vlength = 4;
5198 p1values.voffset = nds_offset;
5199 p1values.hfname = hf_nds_iteration;
5200 nds_offset = nds_offset+p1values.vlength;
5201 p2values.vtype = 4; /* String */
5202 p2values.vdesc = "Distinguished Name: %s";
5203 p2values.vstring = "";
5204 p2values.mvtype = 1;
5205 p2values.vvalue = 0;
5206 p2values.vlength = 256;
5207 p2values.vlength = tvb_get_letohl(tvb, nds_offset);
5208 if (p2values.vlength == 0x00)
5213 p2values.voffset = nds_offset+4;
5215 get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring);
5216 nds_offset += p2values.vlength;
5217 nds_offset += align_4(tvb, nds_offset);
5218 p2values.hfname= hf_nds_name;
5219 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
5220 p3values.vtype = 6; /* Multivalue Uint32 */
5221 p3values.vstring = "";
5222 p3values.vdesc = "Referal Records: %d";
5223 p3values.vlength = 4;
5224 p3values.voffset = nds_offset;
5225 p3values.hfname = hf_nds_referals;
5226 p3values.mvtype = 9;
5230 verb_string = "Set Keys";
5233 verb_string = "Change Password";
5236 verb_string = "Verify Password";
5239 verb_string = "Begin Login";
5242 verb_string = "Finish Login";
5245 verb_string = "Begin Authentication";
5248 verb_string = "Finish Authentication";
5251 verb_string = "Logout";
5254 verb_string = "Repair Ring";
5257 verb_string = "Repair Timestamps";
5260 verb_string = "Create Back Link";
5263 verb_string = "Delete External Reference";
5266 verb_string = "Rename External Reference";
5269 verb_string = "Create Directory Entry";
5272 verb_string = "Remove Directory Entry";
5275 verb_string = "Designate New Master";
5278 verb_string = "Change Tree Name";
5281 verb_string = "Partition Entry Count";
5284 verb_string = "Check Login Restrictions";
5287 verb_string = "Start Join";
5290 verb_string = "Low Level Split";
5293 verb_string = "Low Level Join";
5296 verb_string = "Abort Low Level Join";
5299 verb_string = "Get All Servers";
5302 verb_string = "NDS Continuation Fragment";
5305 if(request_value->nds_request_verb != 0)
5307 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 6, 0,
5308 request_value->nds_request_verb, "NDS Verb: %d, %s",
5309 request_value->nds_request_verb, verb_string);
5311 /* NDS Entry ID's (EID) is identified in the reply packet of an NDS
5312 * resolve name. We need to store this EID and it's associated
5313 * name into our hash so that we can resolve the name for
5314 * other NDS requests. */
5315 if (!pinfo->fd->flags.visited) {
5318 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
5319 if (!request_eid_value) {
5320 request_eid_value = ncp_eid_hash_insert(global_eid);
5321 strcpy(request_eid_value->object_name, global_object_name);
5325 /* For NDS requests with just an EID, resolve name from hash table. */
5328 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
5329 if (request_eid_value) {
5330 global_object_name = request_eid_value->object_name;
5331 proto_tree_add_string_format(ncp_tree, hf_nds_name, tvb, 6, 0,
5332 global_object_name, "NDS Name for EID - %s",
5333 global_object_name);
5336 if (p1values.vtype != 0) {
5337 switch (p1values.vtype) {
5339 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5340 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
5343 case 2: /* uint16 */
5344 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5345 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
5348 case 3: /* uint32 */
5349 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5350 p1values.vlength, p1values.vvalue, p1values.vdesc,
5353 case 4: /* string */
5354 proto_tree_add_string_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5355 p1values.vlength, p1values.vdesc, p1values.vstring);
5357 case 5: /* boolean */
5358 process_bitfield(ncp_tree, tvb, &p1values);
5360 case 6: /*multivalue uint32 */
5361 process_multivalues(ncp_tree, tvb, &p1values);
5364 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, p1values.voffset,
5365 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
5369 switch (p2values.vtype) {
5372 case 2: /* uint16 */
5374 case 3: /* uint32 */
5375 proto_tree_add_uint_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
5376 p2values.vlength, p2values.vvalue, p2values.vdesc,
5379 case 4: /* string */
5380 proto_tree_add_string_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
5381 p2values.vlength, p2values.vdesc, p2values.vstring);
5383 case 5: /* boolean */
5384 process_bitfield(ncp_tree, tvb, &p2values);
5386 case 6: /*multivalue uint32 */
5387 process_multivalues(ncp_tree, tvb, &p2values);
5392 switch (p3values.vtype) {
5395 case 2: /* uint16 */
5397 case 3: /* uint32 */
5398 proto_tree_add_uint_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
5399 p3values.vlength, p3values.vvalue, p3values.vdesc,
5402 case 4: /* string */
5403 proto_tree_add_string_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
5404 p3values.vlength, p3values.vdesc, p3values.vstring);
5406 case 5: /* boolean */
5407 process_bitfield(ncp_tree, tvb, &p3values);
5409 case 6: /*multivalue uint32 */
5410 process_multivalues(ncp_tree, tvb, &p3values);
5415 switch (p4values.vtype) {
5418 case 2: /* uint16 */
5420 case 3: /* uint32 */
5421 proto_tree_add_uint_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
5422 p4values.vlength, p4values.vvalue, p4values.vdesc,
5425 case 4: /* string */
5426 proto_tree_add_string_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
5427 p4values.vlength, p4values.vdesc, p4values.vstring);
5429 case 5: /* boolean */
5430 process_bitfield(ncp_tree, tvb, &p4values);
5432 case 6: /*multivalue uint32 */
5433 process_multivalues(ncp_tree, tvb, &p4values);
5438 switch (p5values.vtype) {
5441 case 2: /* uint16 */
5443 case 3: /* uint32 */
5444 proto_tree_add_uint_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
5445 p5values.vlength, p5values.vvalue, p5values.vdesc,
5448 case 4: /* string */
5449 proto_tree_add_string_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
5450 p5values.vlength, p5values.vdesc, p5values.vstring);
5452 case 5: /* boolean */
5453 process_bitfield(ncp_tree, tvb, &p5values);
5455 case 6: /*multivalue uint32 */
5456 process_multivalues(ncp_tree, tvb, &p5values);
5461 switch (p6values.vtype) {
5464 case 2: /* uint16 */
5466 case 3: /* uint32 */
5467 proto_tree_add_uint_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
5468 p6values.vlength, p6values.vvalue, p6values.vdesc,
5471 case 4: /* string */
5472 proto_tree_add_string_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
5473 p6values.vlength, p6values.vdesc, p6values.vstring);
5475 case 5: /* boolean */
5476 process_bitfield(ncp_tree, tvb, &p6values);
5478 case 6: /*multivalue uint32 */
5479 process_multivalues(ncp_tree, tvb, &p6values);
5484 switch (p7values.vtype) {
5487 case 2: /* uint16 */
5489 case 3: /* uint32 */
5490 proto_tree_add_uint_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
5491 p7values.vlength, p7values.vvalue, p7values.vdesc,
5494 case 4: /* string */
5495 proto_tree_add_string_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
5496 p7values.vlength, p7values.vdesc, p7values.vstring);
5498 case 5: /* boolean */
5499 process_bitfield(ncp_tree, tvb, &p7values);
5501 case 6: /*multivalue uint32 */
5502 process_multivalues(ncp_tree, tvb, &p7values);
5507 switch (p8values.vtype) {
5510 case 2: /* uint16 */
5512 case 3: /* uint32 */
5513 proto_tree_add_uint_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
5514 p8values.vlength, p8values.vvalue, p8values.vdesc,
5517 case 4: /* string */
5518 proto_tree_add_string_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
5519 p8values.vlength, p8values.vdesc, p8values.vstring);
5521 case 5: /* boolean */
5522 process_bitfield(ncp_tree, tvb, &p8values);
5524 case 6: /*multivalue uint32 */
5525 process_multivalues(ncp_tree, tvb, &p8values);
5530 switch (p9values.vtype) {
5533 case 2: /* uint16 */
5535 case 3: /* uint32 */
5536 proto_tree_add_uint_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
5537 p9values.vlength, p9values.vvalue, p9values.vdesc,
5540 case 4: /* string */
5541 proto_tree_add_string_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
5542 p9values.vlength, p9values.vdesc, p9values.vstring);
5544 case 5: /* boolean */
5545 process_bitfield(ncp_tree, tvb, &p9values);
5547 case 6: /*multivalue uint32 */
5548 process_multivalues(ncp_tree, tvb, &p9values);
5558 * Unless this is a reply, that's all there is to parse.
5560 if (type != NCP_SERVICE_REPLY)
5563 length = tvb_length(tvb);
5564 if (!ncp_rec && length > 8) {
5565 proto_tree_add_text(ncp_tree, tvb, 8, length - 8,
5566 "No request record found. Parsing is impossible.");
5568 else if (ncp_rec && ncp_rec->reply_ptvc) {
5569 /* If a non-zero completion code was found, it is
5570 * legal to not have any fields, even if the packet
5571 * type is defined as having fields. */
5572 if (completion_code != 0 && tvb_length(tvb) == 8) {
5575 /*printf("func=0x%x subfunc=0x%x\n", ncp_rec->func, ncp_rec->subfunc);*/
5577 /* Any request condition results? */
5578 if (request_value) {
5579 req_cond_results = request_value->req_cond_results;
5582 req_cond_results = NULL;
5585 clear_repeat_vars();
5586 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
5587 process_ptvc_record(ptvc, ncp_rec->reply_ptvc, req_cond_results,
5589 ptvcursor_free(ptvc);
5595 dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
5596 guint16 nw_connection, guint8 sequence,
5597 guint16 type, proto_tree *ncp_tree)
5599 guint8 func, subfunc = 0;
5600 ncp_req_hash_value *request_value = NULL;
5601 ncp_req_eid_hash_value *request_eid_value = NULL;
5602 const ncp_record *ncp_rec = NULL;
5603 conversation_t *conversation;
5604 ptvcursor_t *ptvc = NULL;
5605 proto_tree *temp_tree = NULL;
5606 guint8 nds_verb = 0;
5607 char * verb_string = "";
5608 guint32 nds_frag = 0;
5618 guint8 nds_version = 0;
5619 guint32 foffset = 0;
5620 guint32 nds_reply_buffer;
5621 nw_uni_t req_buffer;
5622 char * global_object_name="\0";
5623 guint32 global_eid=0;
5624 gboolean resolve_eid=FALSE;
5625 guint32 global_flags=0;
5636 p1values.mvtype = 0;
5637 p2values.mvtype = 0;
5638 p3values.mvtype = 0;
5639 p4values.mvtype = 0;
5640 p5values.mvtype = 0;
5641 p6values.mvtype = 0;
5642 p7values.mvtype = 0;
5643 p8values.mvtype = 0;
5644 p9values.mvtype = 0;
5645 req_buffer.buffer = "\0";
5646 func = tvb_get_guint8(tvb, 6);
5647 subfunc = tvb_get_guint8(tvb, 7);
5649 ncp_rec = ncp_record_find(func, subfunc);
5651 /* Check to see if this is a fragment packet */
5652 nds_frag = tvb_get_letohl(tvb, 8);
5656 if (nds_frag == 0xffffffff) {
5657 nds_verb = tvb_get_guint8(tvb, 24);
5658 if (nds_verb == 0xfe)
5660 nds_version = nds_verb;
5661 nds_verb = tvb_get_guint8(tvb, 32);
5669 nds_reply_buffer = tvb_get_letohl(tvb, foffset);
5670 proto_tree_add_uint_format(ncp_tree, hf_nds_buffer_size, tvb, foffset,
5671 4, nds_reply_buffer, "NDS Reply Buffer Size %d",
5673 foffset = foffset+4;
5677 verb_string = "Resolve Name -> ";
5678 p1values.vvalue = tvb_get_letohl(tvb, foffset);
5679 nds_version = p1values.vvalue;
5680 p1values.vstring = "";
5681 p1values.vtype = 3; /* Uint32 */
5682 p1values.vdesc = "Version: %d";
5683 p1values.vlength = 4;
5684 p1values.hfname = hf_nds_ver;
5685 p1values.voffset = foffset;
5686 foffset = foffset+p1values.vlength;
5687 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5688 p2values.vtype = 5; /* Bitfield */
5689 p2values.vstring = "";
5690 p2values.vdesc = "Flags:";
5691 p2values.vlength = 2;
5692 p2values.hfname= hf_nds_nflags;
5693 p2values.voffset = foffset;
5694 p2values.bit1 = "Entry ID";
5695 p2values.bit1hfname = hf_bit1nflags;
5696 p2values.bit2 = "Readable";
5697 p2values.bit2hfname = hf_bit2nflags;
5698 p2values.bit3 = "Writeable";
5699 p2values.bit3hfname = hf_bit3nflags;
5700 p2values.bit4 = "Master";
5701 p2values.bit4hfname = hf_bit4nflags;
5702 p2values.bit5 = "Create ID";
5703 p2values.bit5hfname = hf_bit5nflags;
5704 p2values.bit6 = "Walk Tree";
5705 p2values.bit6hfname = hf_bit6nflags;
5706 p2values.bit7 = "Dereference Alias";
5707 p2values.bit7hfname = hf_bit7nflags;
5708 p2values.bit8 = "Not Defined";
5709 p2values.bit8hfname = hf_bit8nflags;
5710 p2values.bit9 = "Not Defined";
5711 p2values.bit9hfname = hf_bit9nflags;
5712 p2values.bit10 = "Not Defined";
5713 p2values.bit10hfname = hf_bit10nflags;
5714 p2values.bit11= "Not Defined";
5715 p2values.bit11hfname = hf_bit11nflags;
5716 p2values.bit12 = "Not Defined";
5717 p2values.bit12hfname = hf_bit12nflags;
5718 p2values.bit13 = "Not Defined";
5719 p2values.bit13hfname = hf_bit13nflags;
5720 p2values.bit14 = "Prefer Referalls";
5721 p2values.bit14hfname = hf_bit14nflags;
5722 p2values.bit15 = "Prefer Only Referalls";
5723 p2values.bit15hfname = hf_bit15nflags;
5724 p2values.bit16 = "Not Defined";
5725 p2values.bit16hfname = hf_bit16nflags;
5726 foffset = foffset+4;
5727 if (p1values.vvalue == 0 || p1values.vvalue == 1)
5729 p3values.vtype = 3; /* Uint32 */
5730 p3values.vdesc = "Scope: %d";
5731 p3values.vstring = "";
5732 p3values.vlength = 4;
5733 p3values.voffset = foffset;
5734 p3values.vvalue = tvb_get_letohl(tvb, foffset);
5735 p3values.hfname= hf_nds_scope;
5736 foffset = foffset+p3values.vlength;
5737 p4values.vtype = 4; /* String */
5738 p4values.vdesc = "Name: %s";
5739 p4values.vstring = "";
5740 p4values.mvtype = 1;
5741 p4values.vvalue = 0;
5742 p4values.vlength = 256;
5743 p4values.vlength = tvb_get_letohl(tvb, foffset);
5744 if (p4values.vlength == 0x00)
5749 p4values.voffset = foffset+4;
5750 foffset = foffset + 4;
5751 get_string(tvb, p4values.voffset, p4values.vlength, req_buffer.buffer);
5752 p4values.vstring = req_buffer.buffer;
5753 global_object_name = req_buffer.buffer;
5754 p4values.hfname= hf_nds_name;
5755 foffset = foffset+p4values.vlength;
5756 foffset += align_4(tvb, foffset);
5757 p5values.vvalue = tvb_get_letohl(tvb, foffset);
5758 p5values.vtype = 6; /* Mulitvalue Uint32 */
5759 p5values.vstring = "";
5760 p5values.vdesc = "Communications Transports: %d";
5761 p5values.vlength = 4;
5762 p5values.hfname= hf_nds_comm_trans;
5763 p5values.voffset = foffset;
5764 p5values.mvtype = 7;
5765 foffset = foffset + (p5values.vvalue * 4) + 4;
5766 p6values.vvalue = tvb_get_letohl(tvb, foffset);
5767 p6values.vtype = 6; /* Multivalue Uint32 */
5768 p6values.vstring = "";
5769 p6values.vdesc = "Tree Walker Transport Type: %d";
5770 p6values.vlength = 4;
5771 p6values.mvtype = 7;
5772 p6values.hfname= hf_nds_tree_trans;
5773 p6values.voffset = foffset;
5777 p3values.vtype = 3; /* Uint32 */
5778 p3values.vdesc = "Minimum DS Version: %d";
5779 p3values.vstring = "";
5780 p3values.vlength = 4;
5781 p3values.voffset = foffset;
5782 p3values.vvalue = tvb_get_letohl(tvb, foffset);
5783 p3values.hfname= hf_min_nds_ver;
5784 foffset = foffset+p3values.vlength;
5785 p4values.vvalue = tvb_get_letohl(tvb, foffset);
5786 p4values.vtype = 6; /* Multivalue Uint32 */
5787 p4values.vstring = "";
5788 p4values.vdesc = "Number of Versions to Include: %d";
5789 p4values.vlength = 4;
5790 p4values.mvtype = 3;
5791 p4values.voffset = foffset;
5792 p4values.hfname= hf_nds_ver_include;
5793 foffset += (p4values.vvalue * 4) + 4;
5794 p5values.vvalue = tvb_get_letohl(tvb, foffset);
5795 p5values.vtype = 6; /* Multivalue Uint32 */
5796 p5values.vstring = "";
5797 p5values.vdesc = "Number of Versions to Exclude: %d";
5798 p5values.vlength = 4;
5799 p5values.mvtype = 3;
5800 p5values.hfname= hf_nds_ver_exclude;
5801 p5values.voffset = foffset;
5803 p6values.vtype = 3; /* Uint32 */
5804 p6values.vdesc = "DN Output Type: %d";
5805 p6values.vstring = "";
5806 p6values.vlength = 4;
5807 p6values.voffset = foffset;
5808 p6values.vvalue = tvb_get_letohl(tvb, foffset);
5809 p6values.hfname= hf_nds_dn_output_type;
5810 foffset = foffset+p6values.vlength;
5811 p7values.vtype = 3; /* Uint32 */
5812 p7values.vdesc = "Nested Output Type: %d";
5813 p7values.vstring = "";
5814 p7values.vlength = 4;
5815 p7values.voffset = foffset;
5816 p7values.vvalue = tvb_get_letohl(tvb, foffset);
5817 p7values.hfname= hf_nds_nested_output_type;
5818 foffset = foffset+p7values.vlength;
5819 p8values.vtype = 4; /* String */
5820 p8values.vdesc = "Output Delimiter: %s";
5821 p8values.vstring = "";
5822 p8values.mvtype = 1;
5823 p8values.vvalue = 0;
5824 p8values.vlength = 256;
5825 p8values.vlength = tvb_get_letohl(tvb, foffset);
5826 p8values.voffset = foffset+4;
5827 foffset = foffset + 4;
5828 get_string(tvb, p8values.voffset, p8values.vlength, req_buffer.buffer);
5829 p8values.vstring = req_buffer.buffer;
5830 p8values.hfname= hf_nds_output_delimiter;
5831 foffset = foffset+p8values.vlength;
5832 foffset += align_4(tvb, foffset);
5833 p9values.vvalue = tvb_get_letohl(tvb, foffset);
5834 p9values.vtype = 6; /* Multivalue Uint32 */
5835 p9values.vstring = "";
5836 p9values.vdesc = "Size of Entry Specifier: %d";
5837 p9values.vlength = 4;
5838 p9values.mvtype = 10;
5839 p9values.hfname= hf_nds_output_entry_specifier;
5840 p9values.voffset = foffset;
5844 verb_string = "Read Entry Information";
5845 p1values.vvalue = tvb_get_letohl(tvb, foffset);
5846 p1values.vstring = "";
5847 p1values.vtype = 3; /* Uint32 */
5848 p1values.vdesc = "Version: %d";
5849 p1values.vlength = 4;
5850 p1values.voffset = foffset;
5851 p1values.hfname= hf_nds_ver;
5852 foffset = foffset+p1values.vlength;
5853 switch(p1values.vvalue)
5856 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5857 p2values.vstring = "";
5858 p2values.vtype = 3; /* Uint32 */
5859 p2values.vdesc = "Entry ID: 0x%08x";
5860 p2values.vlength = 4;
5862 global_eid = p2values.vvalue;
5863 p2values.voffset = foffset;
5864 p2values.hfname = hf_nds_eid;
5865 foffset = foffset+p2values.vlength;
5868 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5869 p2values.vtype = 5; /* Bitfield */
5870 p2values.vstring = "";
5871 p2values.vdesc = "Request Flags:";
5872 p2values.vlength = 2;
5873 p2values.hfname= hf_nds_rflags;
5874 p2values.voffset = foffset;
5875 p2values.bit1 = "Typeless";
5876 p2values.bit1hfname = hf_bit1rflags;
5877 p2values.bit2 = "Slashed";
5878 p2values.bit2hfname = hf_bit2rflags;
5879 p2values.bit3 = "Dotted";
5880 p2values.bit3hfname = hf_bit3rflags;
5881 p2values.bit4 = "Tuned";
5882 p2values.bit4hfname = hf_bit4rflags;
5883 p2values.bit5 = "Not Defined";
5884 p2values.bit5hfname = hf_bit5rflags;
5885 p2values.bit6 = "Not Defined";
5886 p2values.bit6hfname = hf_bit6rflags;
5887 p2values.bit7 = "Not Defined";
5888 p2values.bit7hfname = hf_bit7rflags;
5889 p2values.bit8 = "Not Defined";
5890 p2values.bit8hfname = hf_bit8rflags;
5891 p2values.bit9 = "Not Defined";
5892 p2values.bit9hfname = hf_bit9rflags;
5893 p2values.bit10 = "Not Defined";
5894 p2values.bit10hfname = hf_bit10rflags;
5895 p2values.bit11 = "Not Defined";
5896 p2values.bit11hfname = hf_bit11rflags;
5897 p2values.bit12 = "Not Defined";
5898 p2values.bit12hfname = hf_bit12rflags;
5899 p2values.bit13 = "Not Defined";
5900 p2values.bit13hfname = hf_bit13rflags;
5901 p2values.bit14 = "Not Defined";
5902 p2values.bit14hfname = hf_bit14rflags;
5903 p2values.bit15 = "Not Defined";
5904 p2values.bit15hfname = hf_bit15rflags;
5905 p2values.bit16 = "Not Defined";
5906 p2values.bit16hfname = hf_bit16rflags;
5907 if((p2values.vvalue&&0xf000) == 0xc000)
5909 p3values.vtype = 4; /* String */
5910 p3values.vdesc = "Name Type: %s";
5911 p3values.vstring = "Partial";
5912 p3values.mvtype = 0;
5913 p3values.vvalue = 0;
5914 p3values.vlength = 0;
5915 p3values.voffset = 0;
5916 p3values.hfname= hf_nds_name_type;
5920 p3values.vtype = 4; /* String */
5921 p3values.vdesc = "Name Type: %s";
5922 p3values.vstring = "Full";
5923 p3values.vvalue = 0;
5924 p3values.mvtype = 0;
5925 p3values.vlength = 0;
5926 p3values.voffset = 0;
5927 p3values.hfname= hf_nds_name_type;
5929 foffset = foffset+4;
5930 p4values.vvalue = tvb_get_letohl(tvb, foffset);
5931 p4values.vstring = "";
5932 p4values.vtype = 3; /* Uint32 */
5933 p4values.vdesc = "Entry ID: 0x%08x";
5934 p4values.vlength = 4;
5935 p4values.voffset = foffset;
5937 global_eid = p4values.vvalue;
5938 p4values.hfname = hf_nds_eid;
5939 foffset = foffset+p4values.vlength;
5942 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5943 p2values.vtype = 5; /* Bitfield */
5944 p2values.vstring = "";
5945 p2values.vdesc = "Request Flags:";
5946 p2values.vlength = 2;
5947 p2values.hfname= hf_nds_rflags;
5948 p2values.voffset = foffset;
5949 p2values.bit1 = "Typeless";
5950 p2values.bit1hfname = hf_bit1rflags;
5951 p2values.bit2 = "Slashed";
5952 p2values.bit2hfname = hf_bit2rflags;
5953 p2values.bit3 = "Dotted";
5954 p2values.bit3hfname = hf_bit3rflags;
5955 p2values.bit4 = "Tuned";
5956 p2values.bit4hfname = hf_bit4rflags;
5957 p2values.bit5 = "Not Defined";
5958 p2values.bit5hfname = hf_bit5rflags;
5959 p2values.bit6 = "Not Defined";
5960 p2values.bit6hfname = hf_bit6rflags;
5961 p2values.bit7 = "Not Defined";
5962 p2values.bit7hfname = hf_bit7rflags;
5963 p2values.bit8 = "Not Defined";
5964 p2values.bit8hfname = hf_bit8rflags;
5965 p2values.bit9 = "Not Defined";
5966 p2values.bit9hfname = hf_bit9rflags;
5967 p2values.bit10 = "Not Defined";
5968 p2values.bit10hfname = hf_bit10rflags;
5969 p2values.bit11 = "Not Defined";
5970 p2values.bit11hfname = hf_bit11rflags;
5971 p2values.bit12 = "Not Defined";
5972 p2values.bit12hfname = hf_bit12rflags;
5973 p2values.bit13 = "Not Defined";
5974 p2values.bit13hfname = hf_bit13rflags;
5975 p2values.bit14 = "Not Defined";
5976 p2values.bit14hfname = hf_bit14rflags;
5977 p2values.bit15 = "Not Defined";
5978 p2values.bit15hfname = hf_bit15rflags;
5979 p2values.bit16 = "Not Defined";
5980 p2values.bit16hfname = hf_bit16rflags;
5981 if((p2values.vvalue&&0xf000) == 0xc000)
5983 p3values.vtype = 4; /* String */
5984 p3values.vdesc = "Name Type: %s";
5985 p3values.vstring = "Return Partion Name";
5986 p3values.vvalue = 0;
5987 p3values.vlength = 4;
5988 p3values.voffset = p2values.voffset;
5989 p3values.mvtype = 0;
5990 p3values.hfname= hf_nds_name_type;
5994 p3values.vtype = 4; /* String */
5995 p3values.vdesc = "Name Type: %s";
5996 p3values.vstring = "Return Full Name";
5997 p3values.vvalue = 0;
5998 p3values.vlength = 4;
5999 p3values.mvtype = 0;
6000 p3values.voffset = p2values.voffset;
6001 p3values.hfname= hf_nds_name_type;
6003 foffset = foffset+4;
6004 p4values.vvalue = tvb_get_letohs(tvb, foffset);
6005 global_flags = tvb_get_letohl(tvb, foffset);
6006 p4values.vtype = 5; /* Bitfield */
6007 p4values.vstring = "";
6008 p4values.vdesc = "Information Flags (low) Byte:";
6009 p4values.vlength = 2;
6010 p4values.hfname= hf_nds_rflags;
6011 p4values.voffset = foffset;
6012 p4values.bit1 = "Output Flags";
6013 p4values.bit1hfname = hf_bit1infoflagsl;
6014 p4values.bit2 = "Entry ID";
6015 p4values.bit2hfname = hf_bit2infoflagsl;
6016 p4values.bit3 = "Entry Flags";
6017 p4values.bit3hfname = hf_bit3infoflagsl;
6018 p4values.bit4 = "Subordinate Count";
6019 p4values.bit4hfname = hf_bit4infoflagsl;
6020 p4values.bit5 = "Modification Time";
6021 p4values.bit5hfname = hf_bit5infoflagsl;
6022 p4values.bit6 = "Modification Timestamp";
6023 p4values.bit6hfname = hf_bit6infoflagsl;
6024 p4values.bit7 = "Creation Timestamp";
6025 p4values.bit7hfname = hf_bit7infoflagsl;
6026 p4values.bit8 = "Partition Root ID";
6027 p4values.bit8hfname = hf_bit8infoflagsl;
6028 p4values.bit9 = "Parent ID";
6029 p4values.bit9hfname = hf_bit9infoflagsl;
6030 p4values.bit10 = "Revision Count";
6031 p4values.bit10hfname = hf_bit10infoflagsl;
6032 p4values.bit11 = "Replica Type";
6033 p4values.bit11hfname = hf_bit11infoflagsl;
6034 p4values.bit12 = "Base Class";
6035 p4values.bit12hfname = hf_bit12infoflagsl;
6036 p4values.bit13 = "Relative Distinguished Name";
6037 p4values.bit13hfname = hf_bit13infoflagsl;
6038 p4values.bit14 = "Distinguished Name";
6039 p4values.bit14hfname = hf_bit14infoflagsl;
6040 p4values.bit15 = "Root Distinguished Name";
6041 p4values.bit15hfname = hf_bit15infoflagsl;
6042 p4values.bit16 = "Parent Distinguished Name";
6043 p4values.bit16hfname = hf_bit16infoflagsl;
6044 foffset = foffset+2;
6045 p5values.vvalue = tvb_get_letohs(tvb, foffset);
6046 p5values.vtype = 5; /* Bitfield */
6047 p5values.vstring = "";
6048 p5values.vdesc = "Information Flags (high) Byte:";
6049 p5values.vlength = 2;
6050 p5values.hfname= hf_nds_rflags;
6051 p5values.voffset = foffset;
6052 p5values.bit1 = "Purge Time";
6053 p5values.bit1hfname = hf_bit1infoflagsh;
6054 p5values.bit2 = "Dereference Base Class";
6055 p5values.bit2hfname = hf_bit2infoflagsh;
6056 p5values.bit3 = "Not Defined";
6057 p5values.bit3hfname = hf_bit3infoflagsh;
6058 p5values.bit4 = "Not Defined";
6059 p5values.bit4hfname = hf_bit4infoflagsh;
6060 p5values.bit5 = "Not Defined";
6061 p5values.bit5hfname = hf_bit5infoflagsh;
6062 p5values.bit6 = "Not Defined";
6063 p5values.bit6hfname = hf_bit6infoflagsh;
6064 p5values.bit7 = "Not Defined";
6065 p5values.bit7hfname = hf_bit7infoflagsh;
6066 p5values.bit8 = "Not Defined";
6067 p5values.bit8hfname = hf_bit8infoflagsh;
6068 p5values.bit9 = "Not Defined";
6069 p5values.bit9hfname = hf_bit9infoflagsh;
6070 p5values.bit10 = "Not Defined";
6071 p5values.bit10hfname = hf_bit10infoflagsh;
6072 p5values.bit11 = "Not Defined";
6073 p5values.bit11hfname = hf_bit11infoflagsh;
6074 p5values.bit12 = "Not Defined";
6075 p5values.bit12hfname = hf_bit12infoflagsh;
6076 p5values.bit13 = "Not Defined";
6077 p5values.bit13hfname = hf_bit13infoflagsh;
6078 p5values.bit14 = "Not Defined";
6079 p5values.bit14hfname = hf_bit14infoflagsh;
6080 p5values.bit15 = "Not Defined";
6081 p5values.bit15hfname = hf_bit15infoflagsh;
6082 p5values.bit16 = "Not Defined";
6083 p5values.bit16hfname = hf_bit16infoflagsh;
6084 foffset = foffset+2;
6085 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6086 p6values.vstring = "";
6087 p6values.vtype = 3; /* Uint32 */
6088 p6values.vdesc = "Entry ID: 0x%08x";
6089 p6values.vlength = 4;
6090 p6values.voffset = foffset;
6092 global_eid = p6values.vvalue;
6093 p6values.hfname = hf_nds_eid;
6094 foffset = foffset+p6values.vlength;
6102 verb_string = "Read -> ";
6103 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6104 p1values.vstring = "";
6105 p1values.vtype = 3; /* Uint32 */
6106 p1values.vdesc = "Version: %d";
6107 p1values.vlength = 4;
6108 p1values.voffset = foffset;
6109 p1values.hfname= hf_nds_ver;
6110 foffset = foffset+p1values.vlength;
6111 if(p1values.vvalue == 0)
6113 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6114 p2values.vstring = "";
6115 p2values.vtype = 3; /* Uint32 */
6116 p2values.vdesc = "Iteration Handle: 0x%08x";
6117 p2values.vlength = 4;
6118 p2values.voffset = foffset;
6119 p2values.hfname= hf_nds_iteration;
6120 foffset = foffset+p2values.vlength;
6121 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6122 p3values.vstring = "";
6123 p3values.vtype = 3; /* Uint32 */
6124 p3values.vdesc = "Entry ID: 0x%08x";
6125 p3values.vlength = 4;
6127 global_eid = p3values.vvalue;
6128 p3values.voffset = foffset;
6129 p3values.hfname= hf_nds_eid;
6130 foffset = foffset+p3values.vlength;
6131 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6132 p4values.vstring = match_strval(p4values.vvalue, nds_info_type);
6133 global_flags = p4values.vvalue;
6134 if(p4values.vstring == NULL)
6136 p4values.vstring = "No Info Type Set";
6138 p4values.vtype = 4; /* String */
6139 p4values.vdesc = "Info Type: %s";
6140 p4values.vlength = 4;
6141 p4values.voffset = foffset;
6142 p4values.mvtype = 1;
6143 p4values.hfname= hf_nds_info_type;
6144 foffset = foffset + p4values.vlength;
6145 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6146 p5values.vstring = "";
6147 p5values.vtype = 3; /* Uint32 */
6148 p5values.vdesc = "All Attributes: %d";
6149 p5values.vlength = 4;
6150 p5values.voffset = foffset;
6151 p5values.hfname= hf_nds_all_attr;
6152 foffset = foffset+p5values.vlength;
6153 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6154 p6values.vtype = 6; /* Multivalue Uint32 */
6155 p6values.vstring = "";
6156 p6values.vdesc = "Attributes: %d";
6157 p6values.vlength = 4;
6158 p6values.voffset = foffset;
6159 p6values.mvtype = 1;
6160 p6values.hfname= hf_nds_attr;
6164 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6165 p2values.vstring = "";
6166 p2values.vtype = 3; /* Uint32 */
6167 p2values.vdesc = "Request Flags: 0x%08x";
6168 p2values.vlength = 4;
6169 p2values.voffset = foffset;
6170 p2values.hfname= hf_nds_req_flags;
6171 foffset = foffset+p2values.vlength;
6172 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6173 p3values.vstring = "";
6174 p3values.vtype = 3; /* Uint32 */
6175 p3values.vdesc = "Iteration Handle: 0x%08x";
6176 p3values.vlength = 4;
6177 p3values.voffset = foffset;
6178 p3values.hfname= hf_nds_iteration;
6179 foffset = foffset+p3values.vlength;
6180 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6181 p4values.vstring = "";
6182 p4values.vtype = 3; /* Uint32 */
6183 p4values.vdesc = "Entry ID: 0x%08x";
6184 p4values.vlength = 4;
6186 global_eid = p4values.vvalue;
6187 p4values.voffset = foffset;
6188 p4values.hfname= hf_nds_eid;
6189 foffset = foffset+p4values.vlength;
6190 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6191 p5values.vstring = match_strval(p5values.vvalue, nds_info_type);
6192 global_flags = p5values.vvalue;
6193 if(p5values.vstring == NULL)
6195 p5values.vstring = "No Info Type Set";
6197 p5values.vtype = 4; /* String */
6198 p5values.vdesc = "Info Type: %s";
6199 p5values.vlength = 4;
6200 p5values.voffset = foffset;
6201 p5values.hfname= hf_nds_info_type;
6202 p5values.mvtype = 1;
6203 foffset = foffset+p5values.vlength;
6204 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6205 p6values.vstring = "";
6206 p6values.vtype = 3; /* Uint32 */
6207 p6values.vdesc = "All Attributes: %d";
6208 p6values.vlength = 4;
6209 p6values.voffset = foffset;
6210 p6values.hfname= hf_nds_all_attr;
6211 foffset = foffset+p6values.vlength;
6212 p7values.vvalue = tvb_get_letohl(tvb, foffset);
6213 p7values.vtype = 6; /* Multivalue Uint32 */
6214 p7values.vstring = "";
6215 p7values.vdesc = "Attributes: %d";
6216 p7values.vlength = 4;
6217 p7values.voffset = foffset;
6218 p7values.mvtype = 1;
6219 p7values.hfname= hf_nds_attr;
6223 verb_string = "Compare";
6224 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6225 p1values.vstring = "";
6226 p1values.vtype = 3; /* Uint32 */
6227 p1values.vdesc = "Version: %d";
6228 p1values.vlength = 4;
6229 p1values.voffset = foffset;
6230 p1values.hfname= hf_nds_ver;
6231 foffset = foffset+p1values.vlength;
6232 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6233 p2values.vstring = "";
6234 p2values.vtype = 3; /* Uint32 */
6235 p2values.vdesc = "Entry ID: 0x%08x";
6236 p2values.vlength = 4;
6238 global_eid = p2values.vvalue;
6239 p2values.voffset = foffset;
6240 p2values.hfname = hf_nds_eid;
6241 foffset = foffset+p2values.vlength;
6242 foffset += 4; /* Attribute Count = 1 */
6243 p3values.vtype = 4; /* String */
6244 p3values.vdesc = "Attribute Name Being Compared: %s";
6245 p3values.vstring = "";
6246 p3values.mvtype = 1;
6247 p3values.vvalue = 0;
6248 p3values.vlength = 256;
6249 p3values.vlength = tvb_get_letohl(tvb, foffset);
6250 if (p3values.vlength == 0x00)
6255 p3values.voffset = foffset+4;
6256 foffset = foffset + 4;
6257 get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer);
6258 p3values.vstring = req_buffer.buffer;
6259 global_object_name = req_buffer.buffer;
6260 p3values.hfname= hf_nds_name;
6261 foffset = foffset+p3values.vlength;
6262 foffset += align_4(tvb, foffset);
6263 foffset += 4; /* Attribute Value Count = 1 */
6265 * Need Trace file to test. Will have to create a
6266 * new mvtype to call print_nds_values.
6270 verb_string = "List -> ";
6271 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6272 p1values.vstring = "";
6273 p1values.vtype = 3; /* Uint32 */
6274 p1values.vdesc = "Version: %d";
6275 p1values.vlength = 4;
6276 p1values.voffset = foffset;
6277 p1values.hfname= hf_nds_ver;
6278 foffset = foffset+p1values.vlength;
6279 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6280 p2values.vtype = 5; /* Bitfield */
6281 p2values.vstring = "";
6282 p2values.vdesc = "Request Flags:";
6283 p2values.vlength = 2;
6284 p2values.hfname= hf_nds_rflags;
6285 p2values.voffset = foffset;
6286 p2values.bit1 = "List Typeless";
6287 p2values.bit1hfname = hf_bit1lflags;
6288 p2values.bit2 = "List Containers";
6289 p2values.bit2hfname = hf_bit2lflags;
6290 p2values.bit3 = "List Slashed";
6291 p2values.bit3hfname = hf_bit3lflags;
6292 p2values.bit4 = "List Dotted";
6293 p2values.bit4hfname = hf_bit4lflags;
6294 p2values.bit5 = "Dereference Alias";
6295 p2values.bit5hfname = hf_bit5lflags;
6296 p2values.bit6 = "List All Containers";
6297 p2values.bit6hfname = hf_bit6lflags;
6298 p2values.bit7 = "List Obsolete";
6299 p2values.bit7hfname = hf_bit7lflags;
6300 p2values.bit8 = "List Tuned Output";
6301 p2values.bit8hfname = hf_bit8lflags;
6302 p2values.bit9 = "List External Reference";
6303 p2values.bit9hfname = hf_bit9lflags;
6304 p2values.bit10 = "Not Defined";
6305 p2values.bit10hfname = hf_bit10lflags;
6306 p2values.bit11 = "Not Defined";
6307 p2values.bit11hfname = hf_bit11lflags;
6308 p2values.bit12 = "Not Defined";
6309 p2values.bit12hfname = hf_bit12lflags;
6310 p2values.bit13 = "Not Defined";
6311 p2values.bit13hfname = hf_bit13lflags;
6312 p2values.bit14 = "Not Defined";
6313 p2values.bit14hfname = hf_bit14lflags;
6314 p2values.bit15 = "Not Defined";
6315 p2values.bit15hfname = hf_bit15lflags;
6316 p2values.bit16 = "Not Defined";
6317 p2values.bit16hfname = hf_bit16lflags;
6318 foffset = foffset+p2values.vlength;
6320 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6321 p3values.vstring = "";
6322 p3values.vtype = 3; /* Uint32 */
6323 p3values.vdesc = "Iteration Handle: 0x%08x";
6324 p3values.vlength = 4;
6325 p3values.voffset = foffset;
6326 p3values.hfname= hf_nds_iteration;
6327 foffset = foffset+p3values.vlength;
6328 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6329 p4values.vstring = "";
6330 p4values.vtype = 3; /* Uint32 */
6331 p4values.vdesc = "Parent ID: 0x%08x";
6332 p4values.vlength = 4;
6333 p4values.voffset = foffset;
6334 p4values.hfname= hf_nds_parent;
6335 foffset = foffset+p4values.vlength;
6336 p5values.vvalue = tvb_get_letohs(tvb, foffset);
6337 global_flags = tvb_get_letohl(tvb, foffset);
6338 p5values.vtype = 5; /* Bitfield */
6339 p5values.vstring = "";
6340 p5values.vdesc = "Information Flags (low) Byte:";
6341 p5values.vlength = 2;
6342 p5values.hfname= hf_nds_rflags;
6343 p5values.voffset = foffset;
6344 p5values.bit1 = "Output Flags";
6345 p5values.bit1hfname = hf_bit1infoflagsl;
6346 p5values.bit2 = "Entry ID";
6347 p5values.bit2hfname = hf_bit2infoflagsl;
6348 p5values.bit3 = "Entry Flags";
6349 p5values.bit3hfname = hf_bit3infoflagsl;
6350 p5values.bit4 = "Subordinate Count";
6351 p5values.bit4hfname = hf_bit4infoflagsl;
6352 p5values.bit5 = "Modification Time";
6353 p5values.bit5hfname = hf_bit5infoflagsl;
6354 p5values.bit6 = "Modification Timestamp";
6355 p5values.bit6hfname = hf_bit6infoflagsl;
6356 p5values.bit7 = "Creation Timestamp";
6357 p5values.bit7hfname = hf_bit7infoflagsl;
6358 p5values.bit8 = "Partition Root ID";
6359 p5values.bit8hfname = hf_bit8infoflagsl;
6360 p5values.bit9 = "Parent ID";
6361 p5values.bit9hfname = hf_bit9infoflagsl;
6362 p5values.bit10 = "Revision Count";
6363 p5values.bit10hfname = hf_bit10infoflagsl;
6364 p5values.bit11 = "Replica Type";
6365 p5values.bit11hfname = hf_bit11infoflagsl;
6366 p5values.bit12 = "Base Class";
6367 p5values.bit12hfname = hf_bit12infoflagsl;
6368 p5values.bit13 = "Relative Distinguished Name";
6369 p5values.bit13hfname = hf_bit13infoflagsl;
6370 p5values.bit14 = "Distinguished Name";
6371 p5values.bit14hfname = hf_bit14infoflagsl;
6372 p5values.bit15 = "Root Distinguished Name";
6373 p5values.bit15hfname = hf_bit15infoflagsl;
6374 p5values.bit16 = "Parent Distinguished Name";
6375 p5values.bit16hfname = hf_bit16infoflagsl;
6376 foffset = foffset+2;
6377 p6values.vvalue = tvb_get_letohs(tvb, foffset);
6378 p6values.vtype = 5; /* Bitfield */
6379 p6values.vstring = "";
6380 p6values.vdesc = "Information Flags (high) Byte:";
6381 p6values.vlength = 2;
6382 p6values.hfname= hf_nds_rflags;
6383 p6values.voffset = foffset;
6384 p6values.bit1 = "Purge Time";
6385 p6values.bit1hfname = hf_bit1infoflagsh;
6386 p6values.bit2 = "Dereference Base Class";
6387 p6values.bit2hfname = hf_bit2infoflagsh;
6388 p6values.bit3 = "Not Defined";
6389 p6values.bit3hfname = hf_bit3infoflagsh;
6390 p6values.bit4 = "Not Defined";
6391 p6values.bit4hfname = hf_bit4infoflagsh;
6392 p6values.bit5 = "Not Defined";
6393 p6values.bit5hfname = hf_bit5infoflagsh;
6394 p6values.bit6 = "Not Defined";
6395 p6values.bit6hfname = hf_bit6infoflagsh;
6396 p6values.bit7 = "Not Defined";
6397 p6values.bit7hfname = hf_bit7infoflagsh;
6398 p6values.bit8 = "Not Defined";
6399 p6values.bit8hfname = hf_bit8infoflagsh;
6400 p6values.bit9 = "Not Defined";
6401 p6values.bit9hfname = hf_bit9infoflagsh;
6402 p6values.bit10 = "Not Defined";
6403 p6values.bit10hfname = hf_bit10infoflagsh;
6404 p6values.bit11 = "Not Defined";
6405 p6values.bit11hfname = hf_bit11infoflagsh;
6406 p6values.bit12 = "Not Defined";
6407 p6values.bit12hfname = hf_bit12infoflagsh;
6408 p6values.bit13 = "Not Defined";
6409 p6values.bit13hfname = hf_bit13infoflagsh;
6410 p6values.bit14 = "Not Defined";
6411 p6values.bit14hfname = hf_bit14infoflagsh;
6412 p6values.bit15 = "Not Defined";
6413 p6values.bit15hfname = hf_bit15infoflagsh;
6414 p6values.bit16 = "Not Defined";
6415 p6values.bit16hfname = hf_bit16infoflagsh;
6416 foffset = foffset+2;
6417 p7values.vtype = 4; /* String */
6418 p7values.vdesc = "Name Filter: %s";
6419 p7values.vstring = "";
6420 p7values.mvtype = 1;
6421 p7values.vvalue = 0;
6422 p7values.vlength = 256;
6423 p7values.vlength = tvb_get_letohl(tvb, foffset);
6424 p7values.voffset = foffset+4;
6425 foffset = foffset + 4;
6426 get_string(tvb, p7values.voffset, p7values.vlength, p7values.vstring);
6427 p7values.hfname= hf_nds_name_filter;
6428 foffset = foffset+p7values.vlength;
6429 if(p1values.vvalue == 0)
6433 foffset += align_4(tvb, foffset);
6434 p8values.vtype = 4; /* String */
6435 p8values.vdesc = "Class Filter: %s";
6436 p8values.vstring = "";
6437 p8values.mvtype = 1;
6438 p8values.vvalue = 0;
6439 p8values.vlength = 256;
6440 p8values.vlength = tvb_get_letohl(tvb, foffset);
6441 p8values.voffset = foffset+4;
6442 foffset = foffset + 4;
6443 get_string(tvb, p8values.voffset, p8values.vlength, p8values.vstring);
6444 p8values.hfname= hf_nds_class_filter;
6445 foffset = foffset+p8values.vlength;
6446 if(p1values.vvalue == 1)
6450 foffset += align_4(tvb, foffset);
6451 p9values.vvalue = tvb_get_letohl(tvb, foffset);
6452 p9values.vtype = 6; /* Multivalue Uint32 */
6453 p9values.vstring = "";
6454 p9values.vdesc = "Seconds %d";
6455 p9values.vlength = 4;
6456 p9values.mvtype = 11;
6457 p9values.hfname= hf_nds_time_filter;
6458 p9values.voffset = foffset;
6461 verb_string = "Search Entries";
6462 p1values.vtype = 0; /* Not Defined */
6465 verb_string = "Add Entry";
6466 p1values.vtype = 0; /* Not Defined */
6469 verb_string = "Remove Entry";
6470 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6471 p1values.vstring = "";
6472 p1values.vtype = 3; /* Uint32 */
6473 p1values.vdesc = "Version: %d";
6474 p1values.vlength = 4;
6475 p1values.voffset = foffset;
6476 p1values.hfname= hf_nds_ver;
6477 foffset = foffset+p1values.vlength;
6478 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6479 p2values.vstring = "";
6480 p2values.vtype = 3; /* Uint32 */
6481 p2values.vdesc = "Entry ID: 0x%08x";
6482 p2values.vlength = 4;
6484 global_eid = p2values.vvalue;
6485 p2values.voffset = foffset;
6486 p2values.hfname= hf_nds_eid;
6487 foffset = foffset+p2values.vlength;
6490 verb_string = "Modify Entry";
6491 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6492 p1values.vstring = "";
6493 p1values.vtype = 3; /* Uint32 */
6494 p1values.vdesc = "Version: %d";
6495 p1values.vlength = 4;
6496 p1values.voffset = foffset;
6497 p1values.hfname= hf_nds_ver;
6498 foffset = foffset+p1values.vlength;
6499 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6500 p2values.vtype = 3; /* Uint32 */
6501 p2values.vstring = "";
6502 p2values.vdesc = "Request Flags: 0x%08x"; /* always 0 */
6503 p2values.vlength = 4;
6504 p2values.hfname= hf_nds_rflags;
6505 p2values.voffset = foffset;
6506 foffset = foffset+4;
6507 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6508 p3values.vtype = 3; /* Uint32 */
6509 p3values.vstring = "";
6510 p3values.vdesc = "Iteration Handle: 0x%08x"; /* always 0 */
6511 p3values.vlength = 4;
6512 p3values.hfname= hf_nds_iteration;
6513 p3values.voffset = foffset;
6514 foffset = foffset+4;
6515 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6516 p4values.vstring = "";
6517 p4values.vtype = 3; /* Uint32 */
6518 p4values.vdesc = "Entry ID: 0x%08x";
6519 p4values.vlength = 4;
6520 p4values.voffset = foffset;
6522 global_eid = p4values.vvalue;
6523 p4values.hfname = hf_nds_eid;
6524 foffset = foffset+p4values.vlength;
6525 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6526 p5values.vtype = 6; /* Multivalue Uint32 */
6527 p5values.vstring = "";
6528 p5values.vdesc = "Number of Attributes to Change %d";
6529 p5values.vlength = 4;
6530 p5values.mvtype = 6;
6531 p5values.hfname= hf_nds_number_of_changes;
6532 p5values.voffset = foffset;
6535 verb_string = "Modify RDN";
6536 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6537 p1values.vstring = "";
6538 p1values.vtype = 3; /* Uint32 */
6539 p1values.vdesc = "Version: %d";
6540 p1values.vlength = 4;
6541 p1values.voffset = foffset;
6542 p1values.hfname= hf_nds_ver;
6543 foffset = foffset+p1values.vlength;
6544 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6545 p2values.vstring = "";
6546 p2values.vtype = 3; /* Uint32 */
6547 p2values.vdesc = "Entry ID: 0x%08x";
6548 p2values.vlength = 4;
6550 global_eid = p2values.vvalue;
6551 p2values.voffset = foffset;
6552 p2values.hfname = hf_nds_eid;
6553 foffset = foffset+p2values.vlength;
6554 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6555 p3values.vtype = 8; /* Boolean */
6556 p3values.vdesc = "Keep Original RDN: %s";
6557 p3values.vlength = 4;
6558 p3values.voffset = foffset;
6559 p3values.mvtype = 0;
6560 p3values.hfname= hf_nds_keep;
6561 foffset = foffset+4;
6562 foffset += align_4(tvb, foffset);
6563 p4values.vtype = 4; /* String */
6564 p4values.vdesc = "New RDN: %s";
6565 p4values.vstring = "";
6566 p4values.mvtype = 0;
6567 p4values.vvalue = 0;
6568 p4values.vlength = 256;
6569 p4values.vlength = tvb_get_letohl(tvb, foffset);
6570 p4values.voffset = foffset+4;
6571 foffset = foffset + 4;
6572 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
6573 p4values.hfname= hf_nds_new_rdn;
6574 foffset = foffset+p4values.vlength;
6577 verb_string = "Define Attribute ->";
6578 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6579 p1values.vstring = "";
6580 p1values.vtype = 3; /* Uint32 */
6581 p1values.vdesc = "Version: %d";
6582 p1values.vlength = 4;
6583 p1values.voffset = foffset;
6584 p1values.hfname= hf_nds_ver;
6585 foffset = foffset+p1values.vlength;
6586 p2values.vvalue = tvb_get_letohs(tvb, foffset);
6587 global_flags = tvb_get_letohl(tvb, foffset);
6588 p2values.vtype = 5; /* Bitfield */
6589 p2values.vstring = "";
6590 p2values.vdesc = "Attribute Constraints:";
6591 p2values.vlength = 2;
6592 p2values.hfname= hf_nds_acflags;
6593 p2values.voffset = foffset;
6594 p2values.bit1 = "Single Valued";
6595 p2values.bit1hfname = hf_bit1acflags;
6596 p2values.bit2 = "Sized";
6597 p2values.bit2hfname = hf_bit2acflags;
6598 p2values.bit3 = "Non-Removable";
6599 p2values.bit3hfname = hf_bit3acflags;
6600 p2values.bit4 = "Read Only";
6601 p2values.bit4hfname = hf_bit4acflags;
6602 p2values.bit5 = "Hidden";
6603 p2values.bit5hfname = hf_bit5acflags;
6604 p2values.bit6 = "String";
6605 p2values.bit6hfname = hf_bit6acflags;
6606 p2values.bit7 = "Synchronize Immediate";
6607 p2values.bit7hfname = hf_bit7acflags;
6608 p2values.bit8 = "Public Read";
6609 p2values.bit8hfname = hf_bit8acflags;
6610 p2values.bit9 = "Server Read";
6611 p2values.bit9hfname = hf_bit9acflags;
6612 p2values.bit10 = "Write Managed";
6613 p2values.bit10hfname = hf_bit10acflags;
6614 p2values.bit11 = "Per Replica";
6615 p2values.bit11hfname = hf_bit11acflags;
6616 p2values.bit12 = "Never Schedule Synchronization";
6617 p2values.bit12hfname = hf_bit12acflags;
6618 p2values.bit13 = "Operational";
6619 p2values.bit13hfname = hf_bit13acflags;
6620 p2values.bit14 = "Not Defined";
6621 p2values.bit14hfname = hf_bit14acflags;
6622 p2values.bit15 = "Not Defined";
6623 p2values.bit15hfname = hf_bit15acflags;
6624 p2values.bit16 = "Not Defined";
6625 p2values.bit16hfname = hf_bit16acflags;
6626 foffset = foffset+4;
6627 p3values.vtype = 4; /* String */
6628 p3values.vdesc = "Attribute Name: %s";
6629 p3values.vstring = "";
6630 p3values.mvtype = 1;
6631 p3values.vvalue = 0;
6632 p3values.vlength = 256;
6633 p3values.vlength = tvb_get_letohl(tvb, foffset);
6634 if (p3values.vlength == 0x00)
6639 p3values.voffset = foffset+4;
6640 foffset = foffset + 4;
6641 get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer);
6642 p3values.vstring = req_buffer.buffer;
6643 global_object_name = req_buffer.buffer;
6644 p3values.hfname= hf_nds_name;
6645 foffset = foffset+p3values.vlength;
6646 foffset += align_4(tvb, foffset);
6647 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6648 p4values.vstring = match_strval(p4values.vvalue, nds_syntax);
6649 if(p4values.vstring == NULL)
6651 p4values.vstring = "No Syntax Found";
6653 p4values.vtype = 4; /* String */
6654 p4values.vdesc = "Syntax: %s";
6655 p4values.vlength = 4;
6656 p4values.voffset = foffset;
6657 p4values.hfname= hf_nds_syntax;
6658 p4values.mvtype = 0;
6659 foffset = foffset+p4values.vlength;
6660 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6661 p5values.vstring = "";
6662 p5values.vtype = 3; /* Uint32 */
6663 p5values.vdesc = "Lower Limit Value %d";
6664 p5values.vlength = 4;
6665 p5values.voffset = foffset;
6666 p5values.hfname = hf_nds_lower;
6668 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6669 p6values.vstring = "";
6670 p6values.vtype = 3; /* Uint32 */
6671 p6values.vdesc = "Upper Limit Value %d";
6672 p6values.vlength = 4;
6673 p6values.voffset = foffset;
6674 p6values.hfname = hf_nds_upper;
6675 p7values.vvalue = tvb_get_letohl(tvb, foffset); /* Length of bytes field */
6677 p7values.vstring = "";
6678 p7values.vtype = 7; /* Bytes */
6679 p7values.vdesc = "ASN.1 ID";
6680 p7values.vlength = p7values.vvalue;
6681 p7values.voffset = foffset;
6682 p7values.hfname = hf_nds_asn1;
6685 verb_string = "Read Attribute Definition";
6686 p1values.vtype = 0; /* Not Defined */
6689 verb_string = "Remove Attribute Definition";
6690 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6691 p1values.vstring = "";
6692 p1values.vtype = 3; /* Uint32 */
6693 p1values.vdesc = "Version: %d";
6694 p1values.vlength = 4;
6695 p1values.voffset = foffset;
6696 p1values.hfname= hf_nds_ver;
6697 foffset = foffset+p1values.vlength;
6698 p2values.vtype = 4; /* String */
6699 p2values.vdesc = "Attribute Name: %s";
6700 p2values.vstring = "";
6701 p2values.mvtype = 1;
6702 p2values.vvalue = 0;
6703 p2values.vlength = 256;
6704 p2values.vlength = tvb_get_letohl(tvb, foffset);
6705 if (p2values.vlength == 0x00)
6710 p2values.voffset = foffset+4;
6711 foffset = foffset + 4;
6712 get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer);
6713 p2values.vstring = req_buffer.buffer;
6714 global_object_name = req_buffer.buffer;
6715 p2values.hfname= hf_nds_attribute_dn;
6718 verb_string = "Define Class";
6719 p1values.vtype = 0; /* Not Defined */
6722 verb_string = "Read Class Definition ->";
6723 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6724 p1values.vstring = "";
6725 p1values.vtype = 3; /* Uint32 */
6726 p1values.vdesc = "Version: %d";
6727 p1values.vlength = 4;
6728 p1values.voffset = foffset;
6729 p1values.hfname= hf_nds_ver;
6730 foffset = foffset+p1values.vlength;
6731 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6732 p2values.vstring = "";
6733 p2values.vtype = 3; /* Uint32 */
6734 p2values.vdesc = "Iteration Handle: 0x%08x";
6735 p2values.vlength = 4;
6736 p2values.voffset = foffset;
6737 p2values.hfname= hf_nds_iteration;
6738 foffset = foffset+p2values.vlength;
6739 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6740 global_flags = p3values.vvalue;
6741 p3values.vstring = match_strval(p3values.vvalue, class_def_type);
6742 if(p3values.vstring == NULL)
6744 p3values.vstring = "No Class Definition Type Set";
6746 p3values.vtype = 4; /* String */
6747 p3values.vdesc = "Class Definition Type: %s";
6748 p3values.vlength = 4;
6749 p3values.voffset = foffset;
6750 p3values.mvtype = 0;
6751 p3values.hfname= hf_nds_class_def_type;
6752 foffset = foffset + p3values.vlength;
6753 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6754 if (p4values.vvalue == 0x00000000)
6756 p4values.vstring = "Return All Classes = False";
6760 p4values.vstring = "Return All Classes = True";
6762 p4values.vtype = 4; /* String */
6763 p4values.vdesc = "Return all Classes %s";
6764 p4values.vlength = 4;
6765 p4values.voffset = foffset;
6766 p4values.mvtype = 0;
6767 p4values.hfname= hf_nds_return_all_classes;
6768 foffset = foffset + p4values.vlength;
6769 foffset += align_4(tvb, foffset);
6770 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6771 p5values.vtype = 6; /* Multivalue Uint32 */
6772 p5values.vstring = "";
6773 p5values.vdesc = "Classes: %d";
6774 p5values.vlength = 4;
6775 p5values.voffset = foffset;
6776 p5values.mvtype = 4;
6777 p5values.hfname= hf_nds_classes;
6780 verb_string = "Modify Class Definition -> ";
6781 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6782 p1values.vstring = "";
6783 p1values.vtype = 3; /* Uint32 */
6784 p1values.vdesc = "Version: %d";
6785 p1values.vlength = 4;
6786 p1values.voffset = foffset;
6787 p1values.hfname= hf_nds_ver;
6788 foffset = foffset+p1values.vlength;
6789 p2values.vtype = 4; /* String */
6790 p2values.vdesc = "Class Name: %s";
6791 p2values.vstring = "";
6792 p2values.mvtype = 1;
6793 p2values.vvalue = 0;
6794 p2values.vlength = 256;
6795 p2values.vlength = tvb_get_letohl(tvb, foffset);
6796 if (p2values.vlength == 0x00)
6801 p2values.voffset = foffset+4;
6802 foffset = foffset + 4;
6803 get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer);
6804 p2values.vstring = req_buffer.buffer;
6805 global_object_name = req_buffer.buffer;
6806 p2values.hfname= hf_nds_base_class;
6807 foffset = foffset+p2values.vlength;
6808 foffset += align_4(tvb, foffset);
6809 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6810 p3values.vtype = 6; /* Multivalue Uint32 */
6811 p3values.vstring = "";
6812 p3values.vdesc = "Number of Attributes to Add: %d";
6813 p3values.vlength = 4;
6814 p3values.voffset = foffset;
6815 p3values.mvtype = 14;
6816 p3values.hfname= hf_nds_att_add;
6819 verb_string = "Remove Class Definition";
6820 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6821 p1values.vstring = "";
6822 p1values.vtype = 3; /* Uint32 */
6823 p1values.vdesc = "Version: %d";
6824 p1values.vlength = 4;
6825 p1values.voffset = foffset;
6826 p1values.hfname= hf_nds_ver;
6827 foffset = foffset+p1values.vlength;
6828 p2values.vtype = 4; /* String */
6829 p2values.vdesc = "Class Name: %s";
6830 p2values.vstring = "";
6831 p2values.mvtype = 1;
6832 p2values.vvalue = 0;
6833 p2values.vlength = 256;
6834 p2values.vlength = tvb_get_letohl(tvb, foffset);
6835 if (p2values.vlength == 0x00)
6840 p2values.voffset = foffset+4;
6841 foffset = foffset + 4;
6842 get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer);
6843 p2values.vstring = req_buffer.buffer;
6844 global_object_name = req_buffer.buffer;
6845 p2values.hfname= hf_nds_base;
6848 verb_string = "List Containable Classes";
6849 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6850 p1values.vstring = "";
6851 p1values.vtype = 3; /* Uint32 */
6852 p1values.vdesc = "Version: %d";
6853 p1values.vlength = 4;
6854 p1values.voffset = foffset;
6855 p1values.hfname= hf_nds_ver;
6856 foffset = foffset+p1values.vlength;
6857 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6858 p2values.vstring = "";
6859 p2values.vtype = 3; /* Uint32 */
6860 p2values.vdesc = "Iteration Handle: 0x%08x";
6861 p2values.vlength = 4;
6862 p2values.voffset = foffset;
6863 p2values.hfname= hf_nds_iteration;
6864 foffset = foffset+p2values.vlength;
6865 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6866 p3values.vstring = "";
6867 p3values.vtype = 3; /* Uint32 */
6868 p3values.vdesc = "Entry ID: 0x%08x";
6869 p3values.vlength = 4;
6871 global_eid = p3values.vvalue;
6872 p3values.voffset = foffset;
6873 p3values.hfname= hf_nds_eid;
6874 foffset = foffset+p3values.vlength;
6877 verb_string = "Get Effective Rights -> ";
6878 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6879 p1values.vstring = "";
6880 p1values.vtype = 3; /* Uint32 */
6881 p1values.vdesc = "Version: %d";
6882 p1values.vlength = 4;
6883 p1values.voffset = foffset;
6884 p1values.hfname= hf_nds_ver;
6885 foffset = foffset+p1values.vlength;
6886 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6887 p2values.vstring = "";
6888 p2values.vtype = 3; /* Uint32 */
6889 p2values.vdesc = "Entry ID: 0x%08x";
6890 p2values.vlength = 4;
6892 global_eid = p2values.vvalue;
6893 p2values.voffset = foffset;
6894 p2values.hfname= hf_nds_eid;
6895 foffset = foffset+p2values.vlength;
6896 p3values.vtype = 4; /* String */
6897 p3values.vdesc = "Trustee Name: %s";
6898 p3values.vstring = "";
6899 p3values.mvtype = 1;
6900 p3values.vvalue = 0;
6901 p3values.vlength = 256;
6902 p3values.vlength = tvb_get_letohl(tvb, foffset);
6903 if (p3values.vlength == 0x00)
6908 p3values.voffset = foffset+4;
6909 foffset = foffset + 4;
6910 get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer);
6911 p3values.vstring = req_buffer.buffer;
6912 p3values.hfname= hf_nds_name;
6913 foffset = foffset+p3values.vlength;
6914 foffset += align_4(tvb, foffset);
6915 p4values.vtype = 4; /* String */
6916 p4values.vdesc = "Attribute to be Checked: %s";
6917 p4values.vstring = "";
6918 p4values.mvtype = 0;
6919 p4values.vvalue = 0;
6920 p4values.vlength = 256;
6921 p4values.vlength = tvb_get_letohl(tvb, foffset);
6922 if (p4values.vlength == 0x00)
6927 p4values.voffset = foffset+4;
6928 foffset = foffset + 4;
6929 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
6930 p4values.hfname= hf_nds_name;
6931 foffset = foffset+p4values.vlength;
6932 foffset += align_4(tvb, foffset);
6933 if(p1values.vvalue != 0)
6935 p5values.vtype = 4; /* String */
6936 p5values.vdesc = "Security Equivalence: %s";
6937 p5values.vstring = "";
6938 p5values.mvtype = 1;
6939 p5values.vvalue = 0;
6940 p5values.vlength = 256;
6941 p5values.vlength = tvb_get_letohl(tvb, foffset);
6942 if (p5values.vlength == 0x00)
6947 p5values.voffset = foffset+4;
6948 foffset = foffset + 4;
6949 get_string(tvb, p5values.voffset, p5values.vlength, p5values.vstring);
6950 p5values.hfname= hf_nds_name;
6951 foffset = foffset+p5values.vlength;
6952 foffset += align_4(tvb, foffset);
6956 verb_string = "Add Partition";
6957 p1values.vtype = 0; /* Not Defined */
6960 verb_string = "Remove Partition";
6961 p1values.vtype = 0; /* Not Defined */
6964 verb_string = "List Partitions";
6965 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6966 p1values.vstring = "";
6967 p1values.vtype = 3; /* Uint32 */
6968 p1values.vdesc = "Version: %d";
6969 p1values.vlength = 4;
6970 p1values.voffset = foffset;
6971 p1values.hfname= hf_nds_ver;
6972 foffset = foffset+p1values.vlength;
6973 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6974 p2values.vtype = 5; /* Bitfield */
6975 p2values.vstring = "";
6976 p2values.vdesc = "Request Flags:";
6977 p2values.vlength = 2;
6978 p2values.hfname= hf_nds_rflags;
6979 p2values.voffset = foffset;
6980 p2values.bit1 = "Typeless";
6981 p2values.bit1hfname = hf_nds_bit1;
6982 p2values.bit2 = "All Containers";
6983 p2values.bit2hfname = hf_nds_bit2;
6984 p2values.bit3 = "Slashed";
6985 p2values.bit3hfname = hf_nds_bit3;
6986 p2values.bit4 = "Dotted";
6987 p2values.bit4hfname = hf_nds_bit4;
6988 p2values.bit5 = "Tuned";
6989 p2values.bit5hfname = hf_nds_bit5;
6990 p2values.bit6 = "Not Defined";
6991 p2values.bit6hfname = hf_nds_bit6;
6992 p2values.bit7 = "Not Defined";
6993 p2values.bit7hfname = hf_nds_bit7;
6994 p2values.bit8 = "Not Defined";
6995 p2values.bit8hfname = hf_nds_bit8;
6996 p2values.bit9 = "Not Defined";
6997 p2values.bit9hfname = hf_nds_bit9;
6998 p2values.bit10 = "Not Defined";
6999 p2values.bit10hfname = hf_nds_bit10;
7000 p2values.bit11 = "Not Defined";
7001 p2values.bit11hfname = hf_nds_bit11;
7002 p2values.bit12 = "Not Defined";
7003 p2values.bit12hfname = hf_nds_bit12;
7004 p2values.bit13 = "Not Defined";
7005 p2values.bit13hfname = hf_nds_bit13;
7006 p2values.bit14 = "Not Defined";
7007 p2values.bit14hfname = hf_nds_bit14;
7008 p2values.bit15 = "Not Defined";
7009 p2values.bit15hfname = hf_nds_bit15;
7010 p2values.bit16 = "Not Defined";
7011 p2values.bit16hfname = hf_nds_bit16;
7012 foffset = foffset+p2values.vlength;
7013 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7014 p3values.vstring = "";
7015 p3values.vtype = 3; /* Uint32 */
7016 p3values.vdesc = "Iteration Handle: 0x%08x";
7017 p3values.vlength = 4;
7018 p3values.voffset = foffset;
7019 p3values.hfname= hf_nds_iteration;
7020 foffset = foffset+p3values.vlength;
7021 if(p1values.vvalue == 0)
7023 global_flags = 0x000000c0;
7026 p4values.vvalue = tvb_get_letohs(tvb, foffset);
7027 p4values.vtype = 5; /* Bitfield */
7028 p4values.vstring = "";
7029 p4values.vdesc = "Information Flags (low) Byte:";
7030 p4values.vlength = 2;
7031 p4values.hfname= hf_nds_rflags;
7032 p4values.voffset = foffset;
7033 p4values.bit1 = "Output Flags";
7034 p4values.bit1hfname = hf_bit1l1flagsl;
7035 p4values.bit2 = "Entry ID";
7036 p4values.bit2hfname = hf_bit2l1flagsl;
7037 p4values.bit3 = "Replica State";
7038 p4values.bit3hfname = hf_bit3l1flagsl;
7039 p4values.bit4 = "Modification Timestamp";
7040 p4values.bit4hfname = hf_bit4l1flagsl;
7041 p4values.bit5 = "Purge Time";
7042 p4values.bit5hfname = hf_bit5l1flagsl;
7043 p4values.bit6 = "Local Partition ID";
7044 p4values.bit6hfname = hf_bit6l1flagsl;
7045 p4values.bit7 = "Distinguished Name";
7046 p4values.bit7hfname = hf_bit7l1flagsl;
7047 p4values.bit8 = "Replica Type";
7048 p4values.bit8hfname = hf_bit8l1flagsl;
7049 p4values.bit9 = "Partition Busy";
7050 p4values.bit9hfname = hf_bit9l1flagsl;
7051 p4values.bit10 = "Not Defined";
7052 p4values.bit10hfname = hf_bit10l1flagsl;
7053 p4values.bit11 = "Not Defined";
7054 p4values.bit11hfname = hf_bit11l1flagsl;
7055 p4values.bit12 = "Not Defined";
7056 p4values.bit12hfname = hf_bit12l1flagsl;
7057 p4values.bit13 = "Not Defined";
7058 p4values.bit13hfname = hf_bit13l1flagsl;
7059 p4values.bit14 = "Not Defined";
7060 p4values.bit14hfname = hf_bit14l1flagsl;
7061 p4values.bit15 = "Not Defined";
7062 p4values.bit15hfname = hf_bit15l1flagsl;
7063 p4values.bit16 = "Not Defined";
7064 p4values.bit16hfname = hf_bit16l1flagsl;
7065 global_flags = p4values.vvalue;
7066 foffset = foffset+2;
7067 p5values.vvalue = tvb_get_letohs(tvb, foffset);
7068 p5values.vtype = 5; /* Bitfield */
7069 p5values.vstring = "";
7070 p5values.vdesc = "Information Flags (high) Byte:";
7071 p5values.vlength = 2;
7072 p5values.hfname= hf_nds_rflags;
7073 p5values.voffset = foffset;
7074 p5values.bit1 = "Not Defined";
7075 p5values.bit1hfname = hf_bit1l1flagsl;
7076 p5values.bit2 = "Not Defined";
7077 p5values.bit2hfname = hf_bit2l1flagsl;
7078 p5values.bit3 = "Not Defined";
7079 p5values.bit3hfname = hf_bit3l1flagsl;
7080 p5values.bit4 = "Not Defined";
7081 p5values.bit4hfname = hf_bit4l1flagsl;
7082 p5values.bit5 = "Not Defined";
7083 p5values.bit5hfname = hf_bit5l1flagsl;
7084 p5values.bit6 = "Not Defined";
7085 p5values.bit6hfname = hf_bit6l1flagsl;
7086 p5values.bit7 = "Not Defined";
7087 p5values.bit7hfname = hf_bit7l1flagsl;
7088 p5values.bit8 = "Not Defined";
7089 p5values.bit8hfname = hf_bit8l1flagsl;
7090 p5values.bit9 = "Not Defined";
7091 p5values.bit9hfname = hf_bit9l1flagsl;
7092 p5values.bit10 = "Not Defined";
7093 p5values.bit10hfname = hf_bit10l1flagsl;
7094 p5values.bit11 = "Not Defined";
7095 p5values.bit11hfname = hf_bit11l1flagsl;
7096 p5values.bit12 = "Not Defined";
7097 p5values.bit12hfname = hf_bit12l1flagsl;
7098 p5values.bit13 = "Not Defined";
7099 p5values.bit13hfname = hf_bit13l1flagsl;
7100 p5values.bit14 = "Not Defined";
7101 p5values.bit14hfname = hf_bit14l1flagsl;
7102 p5values.bit15 = "Not Defined";
7103 p5values.bit15hfname = hf_bit15l1flagsl;
7104 p5values.bit16 = "Not Defined";
7105 p5values.bit16hfname = hf_bit16l1flagsl;
7106 foffset = foffset+2;
7107 if(p1values.vvalue == 1)
7111 p6values.vvalue = tvb_get_letohl(tvb, foffset);
7112 p6values.vstring = "";
7113 p6values.vtype = 3; /* Uint32 */
7114 p6values.vdesc = "Partition Root ID: 0x%08x";
7115 p6values.vlength = 4;
7116 p6values.voffset = foffset;
7117 p6values.hfname= hf_nds_partition_root_id;
7118 foffset = foffset+p6values.vlength;
7121 verb_string = "Split Partition";
7122 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7123 nds_version = p1values.vvalue;
7124 p1values.vstring = "";
7125 p1values.vtype = 3; /* Uint32 */
7126 p1values.vdesc = "Version: %d";
7127 p1values.vlength = 4;
7128 p1values.hfname = hf_nds_ver;
7129 p1values.voffset = foffset;
7130 foffset = foffset+p1values.vlength;
7131 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7132 nds_version = p2values.vvalue;
7133 p2values.vstring = "";
7134 p2values.vtype = 3; /* Uint32 */
7135 p2values.vdesc = "Flags: 0x%08x";
7136 p2values.vlength = 4;
7137 p2values.hfname = hf_nds_req_flags;
7138 p2values.voffset = foffset;
7139 foffset = foffset+p2values.vlength;
7140 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7141 p3values.vstring = "";
7142 p3values.vtype = 3; /* Uint32 */
7143 p3values.vdesc = "New Partition Root ID: 0x%08x";
7144 p3values.vlength = 4;
7145 p3values.voffset = foffset;
7146 p3values.hfname= hf_nds_new_part_id;
7147 foffset = foffset+p3values.vlength;
7150 verb_string = "Join Partitions";
7151 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7152 nds_version = p1values.vvalue;
7153 p1values.vstring = "";
7154 p1values.vtype = 3; /* Uint32 */
7155 p1values.vdesc = "Version: %d";
7156 p1values.vlength = 4;
7157 p1values.hfname = hf_nds_ver;
7158 p1values.voffset = foffset;
7159 foffset = foffset+p1values.vlength;
7160 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7161 nds_version = p2values.vvalue;
7162 p2values.vstring = "";
7163 p2values.vtype = 3; /* Uint32 */
7164 p2values.vdesc = "Flags: 0x%08x";
7165 p2values.vlength = 4;
7166 p2values.hfname = hf_nds_req_flags;
7167 p2values.voffset = foffset;
7168 foffset = foffset+p2values.vlength;
7169 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7170 p3values.vstring = "";
7171 p3values.vtype = 3; /* Uint32 */
7172 p3values.vdesc = "Child Partition Root ID: 0x%08x";
7173 p3values.vlength = 4;
7174 p3values.voffset = foffset;
7175 p3values.hfname= hf_nds_child_part_id;
7176 foffset = foffset+p3values.vlength;
7179 verb_string = "Add Replica";
7180 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7181 nds_version = p1values.vvalue;
7182 p1values.vstring = "";
7183 p1values.vtype = 3; /* Uint32 */
7184 p1values.vdesc = "Version: %d";
7185 p1values.vlength = 4;
7186 p1values.hfname = hf_nds_ver;
7187 p1values.voffset = foffset;
7188 foffset = foffset+p1values.vlength;
7189 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7190 nds_version = p2values.vvalue;
7191 p2values.vstring = "";
7192 p2values.vtype = 3; /* Uint32 */
7193 p2values.vdesc = "Flags: 0x%08x";
7194 p2values.vlength = 4;
7195 p2values.hfname = hf_nds_req_flags;
7196 p2values.voffset = foffset;
7197 foffset = foffset+p2values.vlength;
7198 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7199 p3values.vstring = "";
7200 p3values.vtype = 3; /* Uint32 */
7201 p3values.vdesc = "Master Partition Root ID: 0x%08x";
7202 p3values.vlength = 4;
7203 p3values.voffset = foffset;
7204 p3values.hfname= hf_nds_master_part_id;
7205 foffset = foffset+p3values.vlength;
7206 p4values.vvalue = tvb_get_letohl(tvb, foffset);
7207 p4values.vstring = match_strval(p4values.vvalue, nds_replica_type);
7208 if(p4values.vstring == NULL)
7210 p4values.vstring = "No Replica Type Found";
7212 p4values.vtype = 4; /* String */
7213 p4values.vdesc = "Replica Type: %s";
7214 p4values.vlength = 4;
7215 p4values.voffset = foffset;
7216 p4values.mvtype = 0;
7217 p4values.hfname= hf_replica_type;
7218 foffset = foffset + p4values.vlength;
7219 p5values.vtype = 4; /* String */
7220 p5values.vdesc = "Target Server Name: %s";
7221 p5values.vstring = "";
7222 p5values.mvtype = 0;
7223 p5values.vvalue = 0;
7224 p5values.vlength = 256;
7225 p5values.vlength = tvb_get_letohl(tvb, foffset);
7226 if (p5values.vlength == 0x00)
7231 p5values.voffset = foffset+4;
7232 foffset = foffset + 4;
7233 get_string(tvb, p5values.voffset, p5values.vlength, p5values.vstring);
7234 p5values.hfname= hf_nds_target_name;
7237 verb_string = "Remove Replica";
7238 p1values.vtype = 0; /* Not Defined */
7241 verb_string = "Open Stream -> ";
7242 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7243 nds_version = p1values.vvalue;
7244 p1values.vstring = "";
7245 p1values.vtype = 3; /* Uint32 */
7246 p1values.vdesc = "Version: %d";
7247 p1values.vlength = 4;
7248 p1values.hfname = hf_nds_ver;
7249 p1values.voffset = foffset;
7250 foffset = foffset+p1values.vlength;
7251 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7252 nds_version = p2values.vvalue;
7253 p2values.vstring = "";
7254 p2values.vtype = 3; /* Uint32 */
7255 p2values.vdesc = "Streams Flags: 0x%08x";
7256 p2values.vlength = 4;
7257 p2values.hfname = hf_nds_stream_flags;
7258 p2values.voffset = foffset;
7259 foffset = foffset+p2values.vlength;
7260 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7261 p3values.vstring = "";
7262 p3values.vtype = 3; /* Uint32 */
7263 p3values.vdesc = "Entry ID: 0x%08x";
7264 p3values.vlength = 4;
7266 global_eid = p3values.vvalue;
7267 p3values.voffset = foffset;
7268 p3values.hfname= hf_nds_eid;
7269 foffset = foffset+p3values.vlength;
7270 p4values.vtype = 4; /* String */
7271 p4values.vdesc = "Stream Name: %s";
7272 p4values.vstring = "";
7273 p4values.mvtype = 1;
7274 p4values.vvalue = 0;
7275 p4values.vlength = 256;
7276 p4values.vlength = tvb_get_letohl(tvb, foffset);
7277 if (p4values.vlength == 0x00)
7282 p4values.voffset = foffset+4;
7284 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
7285 foffset += p4values.vlength;
7286 foffset += align_4(tvb, foffset);
7287 p4values.hfname= hf_nds_stream_name;
7290 verb_string = "Search Filter";
7291 p1values.vtype = 0; /* Not Defined */
7294 verb_string = "Create Subordinate Reference";
7295 p1values.vtype = 0; /* Not Defined */
7298 verb_string = "Link Replica";
7299 p1values.vtype = 0; /* Not Defined */
7302 verb_string = "Change Replica Type";
7303 p1values.vtype = 0; /* Not Defined */
7306 verb_string = "Start Update Schema";
7307 p1values.vtype = 0; /* Not Defined */
7310 verb_string = "End Update Schema";
7311 p1values.vtype = 0; /* Not Defined */
7314 verb_string = "Update Schema";
7315 p1values.vtype = 0; /* Not Defined */
7318 verb_string = "Start Update Replica";
7319 p1values.vtype = 0; /* Not Defined */
7322 verb_string = "End Update Replica";
7323 p1values.vtype = 0; /* Not Defined */
7326 verb_string = "Update Replica";
7327 p1values.vtype = 0; /* Not Defined */
7330 verb_string = "Synchronize Partition";
7331 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7332 nds_version = p1values.vvalue;
7333 p1values.vstring = "";
7334 p1values.vtype = 3; /* Uint32 */
7335 p1values.vdesc = "Version: %d";
7336 p1values.vlength = 4;
7337 p1values.hfname = hf_nds_ver;
7338 p1values.voffset = foffset;
7339 foffset = foffset+p1values.vlength;
7340 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7341 nds_version = p2values.vvalue;
7342 p2values.vstring = "";
7343 p2values.vtype = 3; /* Uint32 */
7344 p2values.vdesc = "Flags: 0x%08x";
7345 p2values.vlength = 4;
7346 p2values.hfname = hf_nds_req_flags;
7347 p2values.voffset = foffset;
7348 foffset = foffset+p2values.vlength;
7349 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7350 p3values.vstring = "";
7351 p3values.vtype = 3; /* Uint32 */
7352 p3values.vdesc = "Time Delay in Seconds: %d";
7353 p3values.vlength = 4;
7354 p3values.voffset = foffset;
7355 p3values.hfname= hf_nds_time_delay;
7356 foffset = foffset+p3values.vlength;
7357 if(p1values.vvalue == 0)
7359 p4values.vtype = 4; /* String */
7360 p4values.vdesc = "Root Most Object Name: %s";
7361 p4values.vstring = "";
7362 p4values.mvtype = 1;
7363 p4values.vvalue = 0;
7364 p4values.vlength = 256;
7365 p4values.vlength = tvb_get_letohl(tvb, foffset);
7366 if (p4values.vlength == 0x00)
7371 p4values.voffset = foffset+4;
7373 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
7374 foffset += p4values.vlength;
7375 foffset += align_4(tvb, foffset);
7376 p4values.hfname= hf_nds_root_name;
7380 p4values.vvalue = tvb_get_letohl(tvb, foffset);
7381 p4values.vstring = "";
7382 p4values.vtype = 3; /* Uint32 */
7383 p4values.vdesc = "Entry ID: 0x%08x";
7384 p4values.vlength = 4;
7386 global_eid = p4values.vvalue;
7387 p4values.voffset = foffset;
7388 p4values.hfname= hf_nds_eid;
7389 foffset = foffset+p4values.vlength;
7391 global_eid = p4values.vvalue;
7395 verb_string = "Synchronize Schema";
7396 p1values.vtype = 0; /* Not Defined */
7399 verb_string = "Read Syntaxes";
7400 p1values.vtype = 0; /* Not Defined */
7403 verb_string = "Get Replica Root ID";
7404 p1values.vtype = 0; /* Not Defined */
7407 verb_string = "Begin Move Entry";
7408 p1values.vtype = 0; /* Not Defined */
7411 verb_string = "Finish Move Entry";
7412 p1values.vtype = 0; /* Not Defined */
7415 verb_string = "Release Moved Entry";
7416 p1values.vtype = 0; /* Not Defined */
7419 verb_string = "Backup Entry";
7420 p1values.vtype = 0; /* Not Defined */
7423 verb_string = "Restore Entry";
7424 p1values.vtype = 0; /* Not Defined */
7427 verb_string = "Save DIB";
7428 p1values.vtype = 0; /* Not Defined */
7431 verb_string = "Control";
7432 p1values.vtype = 0; /* Not Defined */
7435 verb_string = "Remove Backlink";
7436 p1values.vtype = 0; /* Not Defined */
7439 verb_string = "Close Iteration";
7440 p1values.vtype = 0; /* Not Defined */
7443 verb_string = "Mutate Entry";
7444 p1values.vtype = 0; /* Not Defined */
7447 verb_string = "Audit Skulking";
7448 p1values.vtype = 0; /* Not Defined */
7451 verb_string = "Get Server Address";
7452 p1values.vvalue = 0;
7455 verb_string = "Set Keys";
7456 p1values.vtype = 0; /* Not Defined */
7459 verb_string = "Change Password";
7460 p1values.vtype = 0; /* Not Defined */
7463 verb_string = "Verify Password";
7464 p1values.vtype = 0; /* Not Defined */
7467 verb_string = "Begin Login";
7468 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7469 p1values.vstring = "";
7470 p1values.vtype = 3; /* Uint32 */
7471 p1values.vdesc = "Version: %d";
7472 p1values.vlength = 4;
7473 p1values.voffset = foffset;
7474 p1values.hfname= hf_nds_ver;
7475 foffset = foffset+p1values.vlength;
7476 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7477 p2values.vstring = "";
7478 p2values.vtype = 3; /* Uint32 */
7479 p2values.vdesc = "Entry ID: 0x%08x";
7480 p2values.vlength = 4;
7482 global_eid = p2values.vvalue;
7483 p2values.voffset = foffset;
7484 p2values.hfname= hf_nds_eid;
7485 foffset = foffset+p2values.vlength;
7488 verb_string = "Finish Login";
7489 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7490 p1values.vstring = "";
7491 p1values.vtype = 3; /* Uint32 */
7492 p1values.vdesc = "Reply Buffer Size: %d";
7493 p1values.vlength = 4;
7494 p1values.voffset = foffset;
7495 p1values.hfname= hf_nds_buffer_size;
7496 foffset = foffset+p1values.vlength;
7497 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7498 p2values.vstring = "";
7499 p2values.vtype = 3; /* Uint32 */
7500 p2values.vdesc = "Version: %d";
7501 p2values.vlength = 4;
7502 p2values.voffset = foffset;
7503 p2values.hfname= hf_nds_ver;
7504 foffset = foffset+p2values.vlength;
7505 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7506 p3values.vstring = "";
7507 p3values.vtype = 3; /* Uint32 */
7508 p3values.vdesc = "Entry ID: 0x%08x";
7509 p3values.vlength = 4;
7511 global_eid = p3values.vvalue;
7512 p3values.voffset = foffset;
7513 p3values.hfname= hf_nds_eid;
7514 foffset = foffset+p3values.vlength;
7517 verb_string = "Begin Authentication";
7518 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7519 p1values.vstring = "";
7520 p1values.vtype = 3; /* Uint32 */
7521 p1values.vdesc = "Version: %d";
7522 p1values.vlength = 4;
7523 p1values.voffset = foffset;
7524 p1values.hfname= hf_nds_ver;
7525 foffset = foffset+p1values.vlength;
7526 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7527 p2values.vstring = "";
7528 p2values.vtype = 3; /* Uint32 */
7529 p2values.vdesc = "Entry ID: 0x%08x";
7530 p2values.vlength = 4;
7532 global_eid = p2values.vvalue;
7533 p2values.voffset = foffset;
7534 p2values.hfname= hf_nds_eid;
7535 foffset = foffset+p2values.vlength;
7538 verb_string = "Finish Authentication";
7541 verb_string = "Logout";
7542 p1values.vtype = 0; /* Not Defined */
7545 verb_string = "Repair Ring";
7546 p1values.vtype = 0; /* Not Defined */
7549 verb_string = "Repair Timestamps";
7550 p1values.vtype = 0; /* Not Defined */
7553 verb_string = "Create Back Link";
7554 p1values.vtype = 0; /* Not Defined */
7557 verb_string = "Delete External Reference";
7558 p1values.vtype = 0; /* Not Defined */
7561 verb_string = "Rename External Reference";
7562 p1values.vtype = 0; /* Not Defined */
7565 verb_string = "Create Directory Entry";
7566 p1values.vtype = 0; /* Not Defined */
7569 verb_string = "Remove Directory Entry";
7570 p1values.vtype = 0; /* Not Defined */
7573 verb_string = "Designate New Master";
7574 p1values.vtype = 0; /* Not Defined */
7577 verb_string = "Change Tree Name";
7578 p1values.vtype = 0; /* Not Defined */
7581 verb_string = "Partition Entry Count";
7582 p1values.vtype = 0; /* Not Defined */
7585 verb_string = "Check Login Restrictions";
7586 p1values.vtype = 0; /* Not Defined */
7589 verb_string = "Start Join";
7590 p1values.vtype = 0; /* Not Defined */
7593 verb_string = "Low Level Split";
7594 p1values.vtype = 0; /* Not Defined */
7597 verb_string = "Low Level Join";
7598 p1values.vtype = 0; /* Not Defined */
7601 verb_string = "Abort Low Level Join";
7602 p1values.vtype = 0; /* Not Defined */
7605 verb_string = "Get All Servers";
7606 p1values.vtype = 0; /* Not Defined */
7609 verb_string = "NDS Continuation Fragment";
7610 p1values.vtype = 0; /* Not Defined */
7613 /* Fill in the INFO column. */
7614 if (check_col(pinfo->cinfo, COL_INFO)) {
7617 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
7618 if (nds_frag != 0xffffffff) {
7619 col_add_fstr(pinfo->cinfo, COL_INFO, "C Continue NDS Fragment %08x", nds_frag);
7622 col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string);
7626 col_add_fstr(pinfo->cinfo, COL_INFO,
7627 "C Unknown Function %d (0x%02x)",
7632 if (!pinfo->fd->flags.visited) {
7634 /* This is the first time we've looked at this packet.
7635 Keep track of the address and connection whence the request
7636 came, and the address and connection to which the request
7637 is being sent, so that we can match up calls with replies.
7638 (We don't include the sequence number, as we may want
7639 to have all packets over the same connection treated
7640 as being part of a single conversation so that we can
7641 let the user select that conversation to be displayed.) */
7643 conversation = find_conversation(&pinfo->src, &pinfo->dst,
7644 PT_NCP, nw_connection, nw_connection, 0);
7646 if (conversation == NULL) {
7647 /* It's not part of any conversation - create a new one. */
7648 conversation = conversation_new(&pinfo->src, &pinfo->dst,
7649 PT_NCP, nw_connection, nw_connection, 0);
7652 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
7653 request_value->req_frame_num = pinfo->fd->num;
7655 /* If this is the first time we're examining the packet,
7656 * check to see if this NCP type uses a "request condition".
7657 * If so, we have to build a proto_tree because request conditions
7658 * use display filters to work, and without a proto_tree,
7659 * display filters can't possibly work. If we already have
7660 * a proto_tree, then wonderful. If we don't, we need to build
7665 temp_tree = proto_tree_create_root();
7666 proto_tree_set_visible(temp_tree, FALSE);
7667 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
7668 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
7674 /* If the dissection throws an exception, be sure to free
7675 * the temporary proto_tree that was created. Because of the
7676 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
7677 * block; it has to be in the same scope as the terminating
7678 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
7679 * call CLEANUP_POP and friends, but the value of temp_tree is
7680 * NULL if no cleanup is needed, and non-null if cleanup is needed.
7683 CLEANUP_PUSH(free_proto_tree, temp_tree);
7685 conversation = find_conversation(&pinfo->src, &pinfo->dst,
7686 PT_NCP, nw_connection, nw_connection, 0);
7691 case NCP_BROADCAST_SLOT:
7695 case NCP_SERVICE_REQUEST:
7697 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
7698 if (ncp_rec && ncp_rec->request_ptvc)
7700 clear_repeat_vars();
7701 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
7703 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
7704 func, "Function: %d (0x%02X), %s",
7705 func, func, ncp_rec ? ncp_rec->name : "Unknown");
7707 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
7708 subfunc, "SubFunction: %d (0x%02x)",
7711 proto_tree_add_uint_format(ncp_tree, hf_ncp_fragment_handle, tvb, 8, 4,
7712 nds_frag, "Fragment Handle: (0x%08x)",
7715 if (nds_frag == 0xffffffff) {
7717 proto_tree_add_item(ncp_tree, hf_ncp_fragment_size, tvb, 12, 4, TRUE);
7719 proto_tree_add_item(ncp_tree, hf_ncp_message_size, tvb, 16, 4, TRUE);
7721 proto_tree_add_item(ncp_tree, hf_ncp_nds_flag, tvb, 20, 4, FALSE);
7723 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 24, 4,
7724 nds_verb, "NDS Verb: %d, (0x%02x), %s",
7725 nds_verb, nds_verb, verb_string);
7726 if (p1values.vtype != 0) {
7727 switch (p1values.vtype) {
7729 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7730 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
7733 case 2: /* uint16 */
7734 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7735 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
7738 case 3: /* uint32 */
7739 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7740 p1values.vlength, p1values.vvalue, p1values.vdesc,
7743 case 4: /* string */
7744 proto_tree_add_string_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7745 p1values.vlength, p1values.vstring, p1values.vdesc, p1values.vstring);
7746 if (p1values.mvtype == 1)
7748 if (check_col(pinfo->cinfo, COL_INFO))
7750 col_append_str(pinfo->cinfo, COL_INFO, p1values.vstring);
7754 case 5: /* bitfield */
7755 process_bitfield(ncp_tree, tvb, &p1values);
7757 case 6: /*multivalue uint32 */
7758 process_multivalues(ncp_tree, tvb, &p1values);
7759 if (p1values.mvtype == 1 || p1values.mvtype == 10)
7761 if (p1values.mvtype == 10)
7763 global_object_name = p1values.vstring;
7765 if (check_col(pinfo->cinfo, COL_INFO))
7767 col_append_str(pinfo->cinfo, COL_INFO, p1values.vstring);
7772 proto_tree_add_bytes(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7773 p1values.vlength, tvb_get_ptr(tvb, p1values.voffset, p1values.vvalue));
7776 proto_tree_add_item(ncp_tree, p1values.hfname, tvb, p1values.voffset, p1values.vlength, TRUE);
7779 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, p1values.voffset,
7780 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
7784 switch (p2values.vtype) {
7787 case 2: /* uint16 */
7789 case 3: /* uint32 */
7790 proto_tree_add_uint_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
7791 p2values.vlength, p2values.vvalue, p2values.vdesc,
7794 case 4: /* string */
7795 proto_tree_add_string_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
7796 p2values.vlength, p2values.vstring, p2values.vdesc, p2values.vstring);
7797 if (p2values.mvtype == 1)
7799 if (check_col(pinfo->cinfo, COL_INFO))
7801 col_append_str(pinfo->cinfo, COL_INFO, p2values.vstring);
7805 case 5: /* boolean */
7806 process_bitfield(ncp_tree, tvb, &p2values);
7808 case 6: /*multivalue uint32 */
7809 process_multivalues(ncp_tree, tvb, &p2values);
7810 if (p2values.mvtype == 1 || p2values.mvtype == 10)
7812 if (p2values.mvtype == 10)
7814 global_object_name = p1values.vstring;
7816 if (check_col(pinfo->cinfo, COL_INFO))
7818 col_append_str(pinfo->cinfo, COL_INFO, p2values.vstring);
7823 proto_tree_add_bytes(ncp_tree, p2values.hfname, tvb, p2values.voffset,
7824 p2values.vlength, tvb_get_ptr(tvb, p2values.voffset, p2values.vvalue));
7827 proto_tree_add_item(ncp_tree, p2values.hfname, tvb, p2values.voffset, p2values.vlength, TRUE);
7832 switch (p3values.vtype) {
7835 case 2: /* uint16 */
7837 case 3: /* uint32 */
7838 proto_tree_add_uint_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
7839 p3values.vlength, p3values.vvalue, p3values.vdesc,
7842 case 4: /* string */
7843 proto_tree_add_string_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
7844 p3values.vlength, p3values.vstring, p3values.vdesc, p3values.vstring);
7845 if (p3values.mvtype == 1)
7847 if (check_col(pinfo->cinfo, COL_INFO))
7849 col_append_str(pinfo->cinfo, COL_INFO, p3values.vstring);
7853 case 5: /* boolean */
7854 process_bitfield(ncp_tree, tvb, &p3values);
7856 case 6: /*multivalue uint32 */
7857 process_multivalues(ncp_tree, tvb, &p3values);
7858 if (p3values.mvtype == 1 || p3values.mvtype == 10)
7860 if (p3values.mvtype == 10)
7862 global_object_name = p3values.vstring;
7864 if (check_col(pinfo->cinfo, COL_INFO))
7866 col_append_str(pinfo->cinfo, COL_INFO, p3values.vstring);
7871 proto_tree_add_bytes(ncp_tree, p3values.hfname, tvb, p3values.voffset,
7872 p3values.vlength, tvb_get_ptr(tvb, p3values.voffset, p3values.vvalue));
7875 proto_tree_add_item(ncp_tree, p3values.hfname, tvb, p3values.voffset, p3values.vlength, TRUE);
7880 switch (p4values.vtype) {
7883 case 2: /* uint16 */
7885 case 3: /* uint32 */
7886 proto_tree_add_uint_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
7887 p4values.vlength, p4values.vvalue, p4values.vdesc,
7890 case 4: /* string */
7891 proto_tree_add_string_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
7892 p4values.vlength, p4values.vstring, p4values.vdesc, p4values.vstring);
7893 if (p4values.mvtype == 1)
7895 if (check_col(pinfo->cinfo, COL_INFO))
7897 col_append_str(pinfo->cinfo, COL_INFO, p4values.vstring);
7901 case 5: /* boolean */
7902 process_bitfield(ncp_tree, tvb, &p4values);
7904 case 6: /*multivalue uint32 */
7905 process_multivalues(ncp_tree, tvb, &p4values);
7906 if (p4values.mvtype == 1 || p4values.mvtype == 10)
7908 if (p4values.mvtype == 10)
7910 global_object_name = p4values.vstring;
7912 if (check_col(pinfo->cinfo, COL_INFO))
7914 col_append_str(pinfo->cinfo, COL_INFO, p4values.vstring);
7919 proto_tree_add_bytes(ncp_tree, p4values.hfname, tvb, p4values.voffset,
7920 p4values.vlength, tvb_get_ptr(tvb, p4values.voffset, p4values.vvalue));
7923 proto_tree_add_item(ncp_tree, p4values.hfname, tvb, p4values.voffset, p4values.vlength, TRUE);
7928 switch (p5values.vtype) {
7931 case 2: /* uint16 */
7933 case 3: /* uint32 */
7934 proto_tree_add_uint_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
7935 p5values.vlength, p5values.vvalue, p5values.vdesc,
7938 case 4: /* string */
7939 proto_tree_add_string_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
7940 p5values.vlength, p5values.vstring, p5values.vdesc, p5values.vstring);
7941 if (p5values.mvtype == 1 || p5values.mvtype == 10)
7943 if (p5values.mvtype == 10)
7945 global_object_name = p5values.vstring;
7947 if (check_col(pinfo->cinfo, COL_INFO))
7949 col_append_str(pinfo->cinfo, COL_INFO, p5values.vstring);
7953 case 5: /* boolean */
7954 process_bitfield(ncp_tree, tvb, &p5values);
7956 case 6: /*multivalue uint32 */
7957 process_multivalues(ncp_tree, tvb, &p5values);
7958 if (p5values.mvtype == 1)
7960 if (check_col(pinfo->cinfo, COL_INFO))
7962 col_append_str(pinfo->cinfo, COL_INFO, p5values.vstring);
7967 proto_tree_add_bytes(ncp_tree, p5values.hfname, tvb, p5values.voffset,
7968 p5values.vlength, tvb_get_ptr(tvb, p5values.voffset, p5values.vvalue));
7971 proto_tree_add_item(ncp_tree, p5values.hfname, tvb, p5values.voffset, p5values.vlength, TRUE);
7976 switch (p6values.vtype) {
7979 case 2: /* uint16 */
7981 case 3: /* uint32 */
7982 proto_tree_add_uint_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
7983 p6values.vlength, p6values.vvalue, p6values.vdesc,
7986 case 4: /* string */
7987 proto_tree_add_string_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
7988 p6values.vlength, p6values.vstring, p6values.vdesc, p6values.vstring);
7989 if (p6values.mvtype == 1 || p6values.mvtype == 10)
7991 if (p6values.mvtype == 10)
7993 global_object_name = p6values.vstring;
7995 if (check_col(pinfo->cinfo, COL_INFO))
7997 col_append_str(pinfo->cinfo, COL_INFO, p6values.vstring);
8001 case 5: /* boolean */
8002 process_bitfield(ncp_tree, tvb, &p6values);
8004 case 6: /*multivalue uint32 */
8005 process_multivalues(ncp_tree, tvb, &p6values);
8006 if (p6values.mvtype == 1)
8008 if (check_col(pinfo->cinfo, COL_INFO))
8010 col_append_str(pinfo->cinfo, COL_INFO, p6values.vstring);
8015 proto_tree_add_bytes(ncp_tree, p6values.hfname, tvb, p6values.voffset,
8016 p6values.vlength, tvb_get_ptr(tvb, p6values.voffset, p6values.vvalue));
8019 proto_tree_add_item(ncp_tree, p6values.hfname, tvb, p6values.voffset, p6values.vlength, TRUE);
8024 switch (p7values.vtype) {
8027 case 2: /* uint16 */
8029 case 3: /* uint32 */
8030 proto_tree_add_uint_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
8031 p7values.vlength, p7values.vvalue, p7values.vdesc,
8034 case 4: /* string */
8035 proto_tree_add_string_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
8036 p7values.vlength, p7values.vstring, p7values.vdesc, p7values.vstring);
8037 if (p7values.mvtype == 1 || p7values.mvtype == 10)
8039 if (p7values.mvtype == 10)
8041 global_object_name = p7values.vstring;
8043 if (check_col(pinfo->cinfo, COL_INFO))
8045 col_append_str(pinfo->cinfo, COL_INFO, p7values.vstring);
8049 case 5: /* boolean */
8050 process_bitfield(ncp_tree, tvb, &p7values);
8052 case 6: /*multivalue uint32 */
8053 process_multivalues(ncp_tree, tvb, &p7values);
8054 if (p7values.mvtype == 1)
8056 if (check_col(pinfo->cinfo, COL_INFO))
8058 col_append_str(pinfo->cinfo, COL_INFO, p7values.vstring);
8063 proto_tree_add_bytes(ncp_tree, p7values.hfname, tvb, p7values.voffset,
8064 p7values.vlength, tvb_get_ptr(tvb, p7values.voffset, p7values.vvalue));
8067 proto_tree_add_item(ncp_tree, p7values.hfname, tvb, p7values.voffset, p7values.vlength, TRUE);
8072 switch (p8values.vtype) {
8075 case 2: /* uint16 */
8077 case 3: /* uint32 */
8078 proto_tree_add_uint_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
8079 p8values.vlength, p8values.vvalue, p8values.vdesc,
8082 case 4: /* string */
8083 proto_tree_add_string_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
8084 p8values.vlength, p8values.vstring, p8values.vdesc, p8values.vstring);
8085 if (p8values.mvtype == 1)
8087 if (check_col(pinfo->cinfo, COL_INFO))
8089 col_append_str(pinfo->cinfo, COL_INFO, p8values.vstring);
8093 case 5: /* boolean */
8094 process_bitfield(ncp_tree, tvb, &p8values);
8096 case 6: /*multivalue uint32 */
8097 process_multivalues(ncp_tree, tvb, &p8values);
8098 if (p8values.mvtype == 1 || p8values.mvtype == 10)
8100 if (p8values.mvtype == 10)
8102 global_object_name = p8values.vstring;
8104 if (check_col(pinfo->cinfo, COL_INFO))
8106 col_append_str(pinfo->cinfo, COL_INFO, p8values.vstring);
8111 proto_tree_add_bytes(ncp_tree, p8values.hfname, tvb, p8values.voffset,
8112 p8values.vlength, tvb_get_ptr(tvb, p8values.voffset, p8values.vvalue));
8115 proto_tree_add_item(ncp_tree, p8values.hfname, tvb, p8values.voffset, p8values.vlength, TRUE);
8120 switch (p9values.vtype) {
8123 case 2: /* uint16 */
8125 case 3: /* uint32 */
8126 proto_tree_add_uint_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
8127 p9values.vlength, p9values.vvalue, p9values.vdesc,
8130 case 4: /* string */
8131 proto_tree_add_string_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
8132 p9values.vlength, p9values.vstring, p9values.vdesc, p9values.vstring);
8133 if (p9values.mvtype == 1)
8135 if (check_col(pinfo->cinfo, COL_INFO))
8137 col_append_str(pinfo->cinfo, COL_INFO, p9values.vstring);
8141 case 5: /* boolean */
8142 process_bitfield(ncp_tree, tvb, &p9values);
8144 case 6: /*multivalue uint32 */
8145 process_multivalues(ncp_tree, tvb, &p9values);
8146 if (p9values.mvtype == 1 || p9values.mvtype == 10)
8148 if (p9values.mvtype == 10)
8150 global_object_name = p9values.vstring;
8152 if (check_col(pinfo->cinfo, COL_INFO))
8154 col_append_str(pinfo->cinfo, COL_INFO, p9values.vstring);
8159 proto_tree_add_bytes(ncp_tree, p9values.hfname, tvb, p9values.voffset,
8160 p9values.vlength, tvb_get_ptr(tvb, p9values.voffset, p9values.vvalue));
8163 proto_tree_add_item(ncp_tree, p9values.hfname, tvb, p9values.voffset, p9values.vlength, TRUE);
8170 /* For NDS requests with just an EID, resolve name from hash table. */
8171 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
8172 if (request_eid_value) {
8173 global_object_name = request_eid_value->object_name;
8174 if (check_col(pinfo->cinfo, COL_INFO))
8176 col_append_str(pinfo->cinfo, COL_INFO, ", Object Name - ");
8177 col_append_str(pinfo->cinfo, COL_INFO, global_object_name);
8184 request_value->nds_request_verb = nds_verb;
8185 request_value->nds_version = nds_version;
8186 request_value->object_name = global_object_name;
8187 request_value->req_nds_flags = global_flags;
8196 ptvcursor_free(ptvc);
8198 /* Free the temporary proto_tree */
8199 CLEANUP_CALL_AND_POP;
8205 dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
8206 guint16 nw_connection, guint8 sequence,
8207 guint16 type, proto_tree *ncp_tree)
8209 guint8 func, subfunc = 0;
8210 ncp_req_hash_value *request_value = NULL;
8211 const ncp_record *ncp_rec = NULL;
8212 conversation_t *conversation;
8213 ptvcursor_t *ptvc = NULL;
8214 proto_tree *temp_tree = NULL;
8215 guint32 nds_version = 0;
8216 gint length_remaining = 0;
8217 char flags_str[1+3+1+3+1+3+1+3+1+1];
8219 proto_tree *flags_tree;
8222 guint32 nds_flag_tree = 0x00020000;
8223 guint32 nds_flag_depth = 0x00000002;
8224 guint32 nds_flag_rev = 0x00000004;
8225 guint32 nds_flag_flags = 0x00000008;
8227 func = tvb_get_guint8(tvb, 6);
8228 subfunc = tvb_get_guint8(tvb, 7);
8230 ncp_rec = ncp_record_find(func, subfunc);
8232 /* Fill in the INFO column. */
8233 if (check_col(pinfo->cinfo, COL_INFO))
8238 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
8239 col_add_fstr(pinfo->cinfo, COL_INFO, "C Ping for NDS");
8243 if (!pinfo->fd->flags.visited)
8246 /* This is the first time we've looked at this packet.
8247 Keep track of the address and connection whence the request
8248 came, and the address and connection to which the request
8249 is being sent, so that we can match up calls with replies.
8250 (We don't include the sequence number, as we may want
8251 to have all packets over the same connection treated
8252 as being part of a single conversation so that we can
8253 let the user select that conversation to be displayed.) */
8255 conversation = find_conversation(&pinfo->src, &pinfo->dst,
8256 PT_NCP, nw_connection, nw_connection, 0);
8258 if (conversation == NULL)
8260 /* It's not part of any conversation - create a new one. */
8261 conversation = conversation_new(&pinfo->src, &pinfo->dst,
8262 PT_NCP, nw_connection, nw_connection, 0);
8265 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
8266 request_value->req_frame_num = pinfo->fd->num;
8268 /* If this is the first time we're examining the packet,
8269 * check to see if this NCP type uses a "request condition".
8270 * If so, we have to build a proto_tree because request conditions
8271 * use display filters to work, and without a proto_tree,
8272 * display filters can't possibly work. If we already have
8273 * a proto_tree, then wonderful. If we don't, we need to build
8279 temp_tree = proto_tree_create_root();
8280 proto_tree_set_visible(temp_tree, FALSE);
8281 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
8282 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
8288 /* If the dissection throws an exception, be sure to free
8289 * the temporary proto_tree that was created. Because of the
8290 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
8291 * block; it has to be in the same scope as the terminating
8292 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
8293 * call CLEANUP_POP and friends, but the value of temp_tree is
8294 * NULL if no cleanup is needed, and non-null if cleanup is needed.
8297 CLEANUP_PUSH(free_proto_tree, temp_tree);
8299 conversation = find_conversation(&pinfo->src, &pinfo->dst,
8300 PT_NCP, nw_connection, nw_connection, 0);
8304 case NCP_BROADCAST_SLOT:
8308 case NCP_SERVICE_REQUEST:
8309 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
8310 func, "Function: %d (0x%02X), %s",
8311 func, func, ncp_rec ? ncp_rec->name : "Unknown");
8313 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
8314 subfunc, "SubFunction: %d (0x%02x)",
8317 proto_tree_add_uint_format(ncp_tree, hf_nds_version, tvb, 8, 4,
8318 nds_version, "NDS Version: (0x%x)",
8321 length_remaining = tvb_length_remaining(tvb, 8);
8322 if (length_remaining > 6)
8324 nds_flags = tvb_get_letohl(tvb, 12);
8325 strcpy(flags_str, " ");
8327 if (nds_flags & nds_flag_tree)
8329 strcat(flags_str, sep);
8330 strcat(flags_str, "Tree");
8333 if (nds_flags & nds_flag_depth)
8335 strcat(flags_str, sep);
8336 strcat(flags_str, "Depth");
8339 if (nds_flags & nds_flag_rev)
8341 strcat(flags_str, sep);
8342 strcat(flags_str, "Revision");
8344 if (nds_flags & nds_flag_flags)
8346 strcat(flags_str, sep);
8347 strcat(flags_str, "Flags");
8349 if (flags_str[0] != '\0')
8351 strcat(flags_str, ")");
8352 tinew = proto_tree_add_uint_format(ncp_tree, hf_nds_flags,
8353 tvb, 12, 4, nds_flags, "Flags: 0x%08x -%s", nds_flags,
8356 flags_tree = proto_item_add_subtree(tinew, ett_nds);
8360 request_value->req_nds_flags = nds_flags;
8363 proto_tree_add_item(flags_tree, hf_nds_flags_tree,
8365 proto_tree_add_item(flags_tree, hf_nds_flags_flags,
8367 proto_tree_add_item(flags_tree, hf_nds_flags_rev,
8369 proto_tree_add_item(flags_tree, hf_nds_flags_depth,
8380 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
8381 if (ncp_rec && ncp_rec->request_ptvc) {
8382 clear_repeat_vars();
8383 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
8385 ptvcursor_free(ptvc);
8387 /* Free the temporary proto_tree */
8388 CLEANUP_CALL_AND_POP;