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 * Portions Copyright (c) Gilbert Ramirez 2000-2002
12 * Portions Copyright (c) Novell, Inc. 2000-2003
14 * $Id: packet-ncp2222.inc,v 1.55 2003/04/25 20:36:29 guy Exp $
16 * Ethereal - Network traffic analyzer
17 * By Gerald Combs <gerald@ethereal.com>
18 * Copyright 2000 Gerald Combs
20 * This program is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU General Public License
22 * as published by the Free Software Foundation; either version 2
23 * of the License, or (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program; if not, write to the Free Software
32 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
35 #define NCP_PACKET_INIT_COUNT 200
36 #define PROTO_LENGTH_UNTIL_END -1
38 static const value_string nds_tags[] = {
39 { 0x00000000, "No Such Entry" },
40 { 0x00000001, "Local Entry" },
41 { 0x00000002, "Remote Entry" },
42 { 0x00000003, "Alias Entry" },
43 { 0x00000004, "Referral Information" },
44 { 0x00000006, "Entry and Referrals" },
48 static const value_string nds_info_type[] = {
49 { 0x00000000, "Attribute Names Only / " },
50 { 0x00000001, "Attribute Name & Value / " },
51 { 0x00000002, "Effective Privileges / " },
52 { 0x00000003, "Value Information / " },
53 { 0x00000004, "Abbreviated Value / " },
57 static const value_string nds_kind_of_changes[] = {
58 { 0x00000000, "Add Attribute" },
59 { 0x00000001, "Remove Attribute" },
60 { 0x00000002, "Add Value" },
61 { 0x00000003, "Remove Value" },
62 { 0x00000004, "Add Additional Value" },
63 { 0x00000005, "Overwrite Value" },
64 { 0x00000006, "Clear Attribute" },
65 { 0x00000007, "Clear Value" },
69 static const value_string es_type[] = {
70 { 0x00000000, "No type is specified" },
71 { 0x00000001, "Unicode string" },
72 { 0x00000002, "Partial name" },
73 { 0x00000003, "Referrals" },
74 { 0x00000004, "Tuned name" },
75 { 0x00000005, "GUID attribute" },
76 { 0x00000006, "Local entry ID" },
77 { 0x00000007, "Number of defined entry specifiers" },
81 static const value_string nds_protocol_type[] = {
82 { 0x00000000, "(IPX Protocol)" },
83 { 0x00000001, "(IP Protocol)" },
84 { 0x00000002, "(SDLC Protocol)" },
85 { 0x00000003, "(TokenRing on Ethernet Protocol)" },
86 { 0x00000004, "(OSI Protocol)" },
87 { 0x00000005, "(AppleTalk Protocol)" },
88 { 0x00000006, "(NetBEUI Protocol)" },
89 { 0x00000007, "(Socket Address Protocol)" },
90 { 0x00000008, "(UDP Protocol)" },
91 { 0x00000009, "(TCP Protocol)" },
92 { 0x0000000a, "(UDP v6 Protocol)" },
93 { 0x0000000b, "(TCP v6 Protocol)" },
94 { 0x0000000c, "(Internal Protocol)" },
95 { 0x0000000d, "(URL Protocol)" },
100 static const value_string nds_syntax[] = {
101 { 0x00000000, "Unknown Syntax" },
102 { 0x00000001, "Distinguished Name" },
103 { 0x00000002, "Case Sensitive Unicode String" },
104 { 0x00000003, "Non Case Sensitive Unicode String" },
105 { 0x00000004, "Printable String" },
106 { 0x00000005, "Numeric String" },
107 { 0x00000006, "Case Insensitive List" },
108 { 0x00000007, "Boolean" },
109 { 0x00000008, "Signed Integer" },
110 { 0x00000009, "Binary String" },
111 { 0x0000000a, "Telephone Number" },
112 { 0x0000000b, "Fax Number" },
113 { 0x0000000c, "Network Address" },
114 { 0x0000000d, "Binary String List" },
115 { 0x0000000e, "Email Address" },
116 { 0x0000000f, "File System Path" },
117 { 0x00000010, "Replica Pointer" },
118 { 0x00000011, "Object ACL" },
119 { 0x00000012, "Postal Address" },
120 { 0x00000013, "Time Stamp" },
121 { 0x00000014, "Class Name" },
122 { 0x00000015, "Stream" },
123 { 0x00000016, "Counter" },
124 { 0x00000017, "Back Link" },
125 { 0x00000018, "Time" },
126 { 0x00000019, "Typed Name" },
127 { 0x0000001a, "Hold" },
128 { 0x0000001b, "Interval" },
132 static const value_string name_space_type[] = {
133 { 0x00000000, "DOS Name Space" },
134 { 0x00000001, "MAC Name Space" },
135 { 0x00000002, "NFS Name Space" },
136 { 0x00000003, "FTAM Name Space" },
137 { 0x00000004, "OS/2, Long Name Space" },
142 static const value_string nds_replica_state[] = {
146 { 0x0003, "Locked" },
147 { 0x0004, "Create Master State 0" },
148 { 0x0005, "Create Master State 1" },
149 { 0x0006, "Transition On" },
150 { 0x0007, "Dead Replica" },
151 { 0x0008, "Begin Add" },
152 { 0x000b, "Master Start" },
153 { 0x000c, "Master Done" },
154 { 0x0017, "Federated" },
155 { 0x0030, "Split State 0" },
156 { 0x0031, "Split State 1" },
157 { 0x0040, "Join State 0" },
158 { 0x0041, "Join State 1" },
159 { 0x0042, "Join State 2" },
160 { 0x0050, "Move Subtree State 0" },
161 { 0x0051, "Move Subtree State 1" },
165 static const value_string nds_replica_type[] = {
166 { 0x0000, "Master" },
167 { 0x0001, "Secondary" },
168 { 0x0002, "Read Only" },
169 { 0x0003, "Sub Ref" },
173 static const value_string class_def_type[] = {
174 { 0x0000, "Return Class Name" },
175 { 0x0001, "Return Class Name, Flag, and Definition" },
176 { 0x0002, "Return Class Name, Flag, Definition, and Super Class" },
177 { 0x0003, "Return Class Name, Flag, and ASN.1 identifier" },
178 { 0x0004, "Return Class Name, Flag, Definition, Super Class, and ACL" },
179 { 0x0005, "Return Class Name, Flag, Creation Timestamp, Modification Timestamp, Definition, and ACL" },
183 static const value_string nds_search_scope[] = {
184 { 0x0000, "Examine the base object only" },
185 { 0x0001, "Search the immediate subordinates of the base object" },
186 { 0x0002, "Search the base object and all its subordinates" },
187 { 0x0003, "Search the base objects and all objects in its partition (Implemented in NDS 8)" },
191 static const value_string nds_reply_errors[] = {
192 { 0xffffffff, "(-1) Insufficient Space" },
193 { 0xffffff89, "(-119) Buffer too Small" },
194 { 0xffffff88, "(-120) RR Volume Flag Not Set" },
195 { 0xffffff87, "(-121) No Items Found" },
196 { 0xffffff86, "(-122) Connection Already Temporary" },
197 { 0xffffff85, "(-123) Connection Already Logged In" },
198 { 0xffffff84, "(-124) Connection Not Authenticated" },
199 { 0xffffff83, "(-125) Connection Not Logged In" },
200 { 0xffffff82, "(-126) NCP Boundary Check Failed" },
201 { 0xffffff81, "(-127) Lock Waiting" },
202 { 0xffffff80, "(-128) Lock Fail" },
203 { 0xffffff7f, "(-129) Out of Handles" },
204 { 0xffffff7e, "(-130) No Open Privilege" },
205 { 0xffffff7d, "(-131) Hard IO Error" },
206 { 0xffffff7c, "(-132) No Create Privilege" },
207 { 0xffffff7b, "(-133) No Create Delete Privilege" },
208 { 0xffffff7a, "(-134) Create Duplicate When Read Only" },
209 { 0xffffff79, "(-135) Create File with Invalid Name" },
210 { 0xffffff78, "(-136) Invalid File Handle" },
211 { 0xffffff77, "(-137) No Search Privilege" },
212 { 0xffffff76, "(-138) No Delete Privilege" },
213 { 0xffffff75, "(-139) No Rename Privilege" },
214 { 0xffffff74, "(-140) No Set Privilege" },
215 { 0xffffff73, "(-141) Some File in Use" },
216 { 0xffffff72, "(-142) All File in Use" },
217 { 0xffffff71, "(-143) Some Read Only" },
218 { 0xffffff70, "(-144) All Read Only" },
219 { 0xffffff6f, "(-145) Some names Exist" },
220 { 0xffffff6e, "(-146) All Names Exist" },
221 { 0xffffff6d, "(-147) No Read Privilege" },
222 { 0xffffff6c, "(-148) No Write Privilege" },
223 { 0xffffff6b, "(-149) File Detached" },
224 { 0xffffff6a, "(-150) No Alloc Space/Target Not a Subdirectory/Insuffficient Memory" },
225 { 0xffffff69, "(-151) No Spool Space" },
226 { 0xffffff68, "(-152) Invalid Volume" },
227 { 0xffffff67, "(-153) Directory Full" },
228 { 0xffffff66, "(-154) Rename Across Volume" },
229 { 0xffffff65, "(-155) Bad Directory Handle" },
230 { 0xffffff64, "(-156) Invalid Path/No Such Extension" },
231 { 0xffffff63, "(-157) No Directory Handles" },
232 { 0xffffff62, "(-158) Bad File Name" },
233 { 0xffffff61, "(-159) Directory Active" },
234 { 0xffffff60, "(-160) Directory Not Empty" },
235 { 0xffffff5f, "(-161) Directory IO Error" },
236 { 0xffffff5e, "(-162) IO Locked" },
237 { 0xffffff5d, "(-163) Transaction Restarted" },
238 { 0xffffff5c, "(-164) Rename Directory Invalid" },
239 { 0xffffff5b, "(-165) Invalid Open/Create Mode" },
240 { 0xffffff5a, "(-166) Already in Use" },
241 { 0xffffff59, "(-167) Invalid Resource Tag" },
242 { 0xffffff58, "(-168) Access Denied" },
243 { 0xffffff44, "(-188) Login Signing Required" },
244 { 0xffffff43, "(-189) Login Encryption Required" },
245 { 0xffffff42, "(-190) Invalid Data Stream" },
246 { 0xffffff41, "(-191) Invalid Name Space" },
247 { 0xffffff40, "(-192) No Accounting Privileges" },
248 { 0xffffff3f, "(-193) No Account Balance" },
249 { 0xffffff3e, "(-194) Credit Limit Exceeded" },
250 { 0xffffff3d, "(-195) Too Many Holds" },
251 { 0xffffff3c, "(-196) Accounting Disabled" },
252 { 0xffffff3b, "(-197) Intruder Login Lockout" },
253 { 0xffffff3a, "(-198) No Console Rights" },
254 { 0xffffff30, "(-208) Queue IO Failure" },
255 { 0xffffff2f, "(-209) No Queue" },
256 { 0xffffff2e, "(-210) No Queue Server" },
257 { 0xffffff2d, "(-211) No Queue Rights" },
258 { 0xffffff2c, "(-212) Queue Full" },
259 { 0xffffff2b, "(-213) No Queue Job" },
260 { 0xffffff2a, "(-214) No Queue Job Rights/Unencrypted Not Allowed" },
261 { 0xffffff29, "(-215) Queue In Service/Duplicate Password" },
262 { 0xffffff28, "(-216) Queue Not Active/Password Too Short" },
263 { 0xffffff27, "(-217) Queue Station Not Server/Maximum Logins Exceeded" },
264 { 0xffffff26, "(-218) Queue Halted/Bad Login Time" },
265 { 0xffffff25, "(-219) Queue Maximum Servers/Node Address Violation" },
266 { 0xffffff24, "(-220) Login Account Expired" },
267 { 0xffffff22, "(-222) Bad Password" },
268 { 0xffffff21, "(-223) Password Expired" },
269 { 0xffffff20, "(-224) No Login Connection Available" },
270 { 0xffffff18, "(-232) Write to Group Property" },
271 { 0xffffff17, "(-233) Member Already Exists" },
272 { 0xffffff16, "(-234) No Such Member" },
273 { 0xffffff15, "(-235) Property Not Group" },
274 { 0xffffff14, "(-236) No Such Value Set" },
275 { 0xffffff13, "(-237) Property Already Exists" },
276 { 0xffffff12, "(-238) Object Already Exists" },
277 { 0xffffff11, "(-239) Illegal Name" },
278 { 0xffffff10, "(-240) Illegal Wildcard" },
279 { 0xffffff0f, "(-241) Bindery Security" },
280 { 0xffffff0e, "(-242) No Object Read Rights" },
281 { 0xffffff0d, "(-243) No Object Rename Rights" },
282 { 0xffffff0c, "(-244) No Object Delete Rights" },
283 { 0xffffff0b, "(-245) No Object Create Rights" },
284 { 0xffffff0a, "(-246) No Property Delete Rights" },
285 { 0xffffff09, "(-247) No Property Create Rigths" },
286 { 0xffffff08, "(-248) No Property Write Rights" },
287 { 0xffffff07, "(-249) No Propery Read Rights" },
288 { 0xffffff06, "(-250) Temp Remap" },
289 { 0xffffff05, "(-251) Unknown Request/No Such Property" },
290 { 0xffffff04, "(-252) Message Queue Full/Target Already Has Message/No Such Object" },
291 { 0xffffff03, "(-253) Bad Station Number" },
292 { 0xffffff02, "(-254) Bindery Locked/Directory Locked/Spool Delete/Trustee not Found/Timeout" },
293 { 0xffffff01, "(-255) Hard Failure" },
294 { 0xfffffed3, "(-301) Not Enough Memory" },
295 { 0xfffffed2, "(-302) Bad Key" },
296 { 0xfffffed1, "(-303) Bad Context" },
297 { 0xfffffed0, "(-304) Buffer Full" },
298 { 0xfffffecf, "(-305) List Empty" },
299 { 0xfffffece, "(-306) Bad Syntax" },
300 { 0xfffffecd, "(-307) Buffer Empty" },
301 { 0xfffffecc, "(-308) Bad Verb" },
302 { 0xfffffecb, "(-309) Expected Identifier" },
303 { 0xfffffeca, "(-310) Expected Equals" },
304 { 0xfffffec9, "(-311) Attribute Type Expected" },
305 { 0xfffffec8, "(-312) Attribute Type Not Expected" },
306 { 0xfffffec7, "(-313) Filter Tree Empty" },
307 { 0xfffffec6, "(-314) Invalid Object Name" },
308 { 0xfffffec5, "(-315) Expected RDN Delimiter" },
309 { 0xfffffec4, "(-316) Too Many Tokens" },
310 { 0xfffffec3, "(-317) Inconsistent MultiAVA" },
311 { 0xfffffec2, "(-318) Country Name Too Long" },
312 { 0xfffffec1, "(-319) Internal Error" },
313 { 0xfffffec0, "(-320) Can't Add Root" },
314 { 0xfffffebf, "(-321) Unable to Attach" },
315 { 0xfffffebe, "(-322) Invalid Iteration Handle" },
316 { 0xfffffebd, "(-323) Buffer Zero Length" },
317 { 0xfffffebc, "(-324) Invalid Replica Type" },
318 { 0xfffffebb, "(-325) Invalid Attribute Syntax" },
319 { 0xfffffeba, "(-326) Invalid Filter Syntax" },
320 { 0xfffffeb8, "(-328) Unicode Error during Context Creation" },
321 { 0xfffffeb7, "(-329) Invalid Union Tag" },
322 { 0xfffffeb6, "(-330) Invalid Server Response" },
323 { 0xfffffeb5, "(-331) Null Pointer" },
324 { 0xfffffeb4, "(-332) No Server Found" },
325 { 0xfffffeb3, "(-333) No Connection" },
326 { 0xfffffeb2, "(-334) RDN Too Long" },
327 { 0xfffffeb1, "(-335) Duplicate Type" },
328 { 0xfffffeb0, "(-336) Data Store Failure" },
329 { 0xfffffeaf, "(-337) Not Logged In" },
330 { 0xfffffeae, "(-338) Invalid Password Characters" },
331 { 0xfffffead, "(-339) Failed Server Authentication" },
332 { 0xfffffeac, "(-340) Transport Failed" },
333 { 0xfffffeab, "(-341) No Such Syntax" },
334 { 0xfffffeaa, "(-342) Invalid DS Name" },
335 { 0xfffffea9, "(-343) Attribute Name Too Long" },
336 { 0xfffffea8, "(-344) Invalid TDS" },
337 { 0xfffffea7, "(-345) Invalid DS Version" },
338 { 0xfffffea6, "(-346) Unicode Translation" },
339 { 0xfffffea5, "(-347) Schema Name Too Long" },
340 { 0xfffffea4, "(-348) Unicode File Not Found" },
341 { 0xfffffea3, "(-349) Unicode Already Loaded" },
342 { 0xfffffea2, "(-350) Not Context Owner" },
343 { 0xfffffea1, "(-351) Attempt to Authenticate" },
344 { 0xfffffea0, "(-352) No Writable Replicas" },
345 { 0xfffffe9f, "(-353) DN Too Long" },
346 { 0xfffffe9e, "(-354) Rename Not Allowed" },
347 { 0xfffffe9d, "(-355) Not NDS for NT" },
348 { 0xfffffe9c, "(-356) NDS for NT - No Domain" },
349 { 0xfffffe9b, "(-357) NDS for NT - Sync Disabled" },
350 { 0xfffffe9a, "(-358) Iterator Invalid Handle" },
351 { 0xfffffe99, "(-359) Iterator Invalid Position" },
352 { 0xfffffe98, "(-360) Iterator Invalid Search Data" },
353 { 0xfffffe97, "(-361) Iterator Invalid Scope" },
354 { 0xfffffda7, "(-601) No Such Entry" },
355 { 0xfffffda6, "(-602) No Such Value" },
356 { 0xfffffda5, "(-603) No Such Attribute" },
357 { 0xfffffda4, "(-604) No Such Class" },
358 { 0xfffffda3, "(-605) No Such Partition" },
359 { 0xfffffda2, "(-606) Entry Already Exists" },
360 { 0xfffffda1, "(-607) Not Effective Class" },
361 { 0xfffffda0, "(-608) Illegal Attribute" },
362 { 0xfffffd9f, "(-609) Missing Mandatory" },
363 { 0xfffffd9e, "(-610) Illegal DS Name" },
364 { 0xfffffd9d, "(-611) Illegal Containment" },
365 { 0xfffffd9c, "(-612) Can't Have Multiple Values" },
366 { 0xfffffd9b, "(-613) Syntax Violation" },
367 { 0xfffffd9a, "(-614) Duplicate Value" },
368 { 0xfffffd99, "(-615) Attribute Already Exists" },
369 { 0xfffffd98, "(-616) Maximum Entries Exist" },
370 { 0xfffffd97, "(-617) Database Format" },
371 { 0xfffffd96, "(-618) Inconsistent Database" },
372 { 0xfffffd95, "(-619) Invalid Comparison" },
373 { 0xfffffd94, "(-620) Comparison Failed" },
374 { 0xfffffd93, "(-621) Transaction Tracking Disabled" },
375 { 0xfffffd92, "(-622) Invalid Transport" },
376 { 0xfffffd91, "(-623) Syntax Invalid in Name" },
377 { 0xfffffd90, "(-624) Replica Already Exists" },
378 { 0xfffffd8f, "(-625) Transport Failure" },
379 { 0xfffffd8e, "(-626) All Referrals Failed" },
380 { 0xfffffd8d, "(-627) Can't Remove Naming Value" },
381 { 0xfffffd8c, "(-628) Object Class Violation" },
382 { 0xfffffd8b, "(-629) Entry is Not Leaf" },
383 { 0xfffffd8a, "(-630) Different Tree" },
384 { 0xfffffd89, "(-631) Illegal Replica Type" },
385 { 0xfffffd88, "(-632) System Failure" },
386 { 0xfffffd87, "(-633) Invalid Entry for Root" },
387 { 0xfffffd86, "(-634) No Referrals" },
388 { 0xfffffd85, "(-635) Remote Failure" },
389 { 0xfffffd84, "(-636) Unreachable Server" },
390 { 0xfffffd83, "(-637) Previous Move in Progress" },
391 { 0xfffffd82, "(-638) No Character Mapping" },
392 { 0xfffffd81, "(-639) Incomplete Authentication" },
393 { 0xfffffd80, "(-640) Invalid Certificate" },
394 { 0xfffffd7f, "(-641) Invalid Request" },
395 { 0xfffffd7e, "(-642) Invalid Iteration" },
396 { 0xfffffd7d, "(-643) Schema is Non-removable" },
397 { 0xfffffd7c, "(-644) Schema is in Use" },
398 { 0xfffffd7b, "(-645) Class Already Exists" },
399 { 0xfffffd7a, "(-646) Bad Naming Attributes" },
400 { 0xfffffd79, "(-647) Not Root Partition" },
401 { 0xfffffd78, "(-648) Insufficient Stack" },
402 { 0xfffffd77, "(-649) Insufficient Buffer" },
403 { 0xfffffd76, "(-650) Ambiguous Containment" },
404 { 0xfffffd75, "(-651) Ambiguous Naming" },
405 { 0xfffffd74, "(-652) Duplicate Mandatory" },
406 { 0xfffffd73, "(-653) Duplicate Optional" },
407 { 0xfffffd72, "(-654) Partition Busy" },
408 { 0xfffffd71, "(-655) Multiple Replicas" },
409 { 0xfffffd70, "(-656) Crucial Replica" },
410 { 0xfffffd6f, "(-657) Schema Sync in Progress" },
411 { 0xfffffd6e, "(-658) Skulk in Progress" },
412 { 0xfffffd6d, "(-659) Time Not Synchronized" },
413 { 0xfffffd6c, "(-660) Record in Use" },
414 { 0xfffffd6b, "(-661) DS Volume Not Mounted" },
415 { 0xfffffd6a, "(-662) DS Volume IO Failure" },
416 { 0xfffffd69, "(-663) DS Locked" },
417 { 0xfffffd68, "(-664) Old Epoch" },
418 { 0xfffffd67, "(-665) New Epoch" },
419 { 0xfffffd66, "(-666) Incompatible DS Version" },
420 { 0xfffffd65, "(-667) Partition Root" },
421 { 0xfffffd64, "(-668) Entry Not Container" },
422 { 0xfffffd63, "(-669) Failed Authentication" },
423 { 0xfffffd62, "(-670) Invalid Context" },
424 { 0xfffffd61, "(-671) No Such Parent" },
425 { 0xfffffd60, "(-672) No Access" },
426 { 0xfffffd5f, "(-673) Replica Not On" },
427 { 0xfffffd5e, "(-674) Invalid Name Service" },
428 { 0xfffffd5d, "(-675) Invalid Task" },
429 { 0xfffffd5c, "(-676) Invalide Connection Handle" },
430 { 0xfffffd5b, "(-677) Invalid Identity" },
431 { 0xfffffd5a, "(-678) Duplicate ACL" },
432 { 0xfffffd59, "(-679) Partition Already Exists" },
433 { 0xfffffd58, "(-680) Transport Modified" },
434 { 0xfffffd57, "(-681) Alias of an Alias" },
435 { 0xfffffd56, "(-682) Auditing Failed" },
436 { 0xfffffd55, "(-683) Invalid API Version" },
437 { 0xfffffd54, "(-684) Secure NCP Violation" },
438 { 0xfffffd53, "(-685) Move in Progress" },
439 { 0xfffffd52, "(-686) Not a Leaf Partition" },
440 { 0xfffffd51, "(-687) Cannot Abort" },
441 { 0xfffffd50, "(-688) Cache Overflow" },
442 { 0xfffffd4f, "(-689) Invalid Subordinate Count" },
443 { 0xfffffd4e, "(-690) Invalid RDN" },
444 { 0xfffffd4d, "(-691) Modification Time Not Current" },
445 { 0xfffffd4c, "(-692) Incorrect Base Class" },
446 { 0xfffffd4b, "(-693) Missing Reference" },
447 { 0xfffffd4a, "(-694) Lost Entry" },
448 { 0xfffffd49, "(-695) Agent Already Registered" },
449 { 0xfffffd48, "(-696) DS Loader Busy" },
450 { 0xfffffd47, "(-697) DS Cannot Reload" },
451 { 0xfffffd46, "(-698) Replica in Skulk" },
452 { 0xfffffd45, "(-699) Fatal" },
453 { 0xfffffd44, "(-700) Obsolete API" },
454 { 0xfffffd43, "(-701) Synchronization Disabled" },
455 { 0xfffffd42, "(-702) Invalid Parameter" },
456 { 0xfffffd41, "(-703) Duplicate Template" },
457 { 0xfffffd40, "(-704) No Master Replica" },
458 { 0xfffffd3f, "(-705) Duplicate Containment" },
459 { 0xfffffd3e, "(-706) Not a Sibling" },
460 { 0xfffffd3d, "(-707) Invalid Signature" },
461 { 0xfffffd3c, "(-708) Invalid Response" },
462 { 0xfffffd3b, "(-709) Insufficient Sockets" },
463 { 0xfffffd3a, "(-710) Database Read Fail" },
464 { 0xfffffd39, "(-711) Invalid Code Page" },
465 { 0xfffffd38, "(-712) Invalid Escape Character" },
466 { 0xfffffd37, "(-713) Invalide Delimiters" },
467 { 0xfffffd36, "(-714) Not Implemented" },
468 { 0xfffffd35, "(-715) Checksum Failure" },
469 { 0xfffffd34, "(-716) Checksumming Not Supported" },
470 { 0xfffffd33, "(-717) CRC Failure" },
471 { 0xfffffd32, "(-718) Invalid Entry Handle" },
472 { 0xfffffd31, "(-719) Invalid Value Handle" },
473 { 0xfffffd30, "(-720) Connection Denied" },
474 { 0xfffffd2f, "(-721) No Such Federation Link" },
475 { 0xfffffd2e, "(-722) Operetational Schema Mismatch" },
476 { 0xfffffd2d, "(-723) Stream Not Found" },
477 { 0xfffffd2c, "(-724) DClient Unavailable" },
478 { 0xfffffd2b, "(-725) MASV No Access" },
479 { 0xfffffd2a, "(-726) MASV Invalid Request" },
480 { 0xfffffd29, "(-727) MASV Failure" },
481 { 0xfffffd28, "(-728) MASV Already Exists" },
482 { 0xfffffd27, "(-729) MASV Not Found" },
483 { 0xfffffd26, "(-730) MASV Bad Range" },
484 { 0xfffffd25, "(-731) Value Data" },
485 { 0xfffffd24, "(-732) Database Locked" },
486 { 0xfffffd21, "(-735) Nothing to Abort" },
487 { 0xfffffd20, "(-736) End of Stream" },
488 { 0xfffffd1f, "(-737) No Such Template" },
489 { 0xfffffd1e, "(-738) SAS Locked" },
490 { 0xfffffd1d, "(-739) Invalid SAS Version" },
491 { 0xfffffd1c, "(-740) SAS Already Registered" },
492 { 0xfffffd1b, "(-741) Name Type Not Supported" },
493 { 0xfffffd1a, "(-742) Wrong DS Version" },
494 { 0xfffffd19, "(-743) Invalid Control Function" },
495 { 0xfffffd18, "(-744) Invalid Control State" },
496 { 0xfffffd17, "(-745) Cache in Use" },
497 { 0xfffffd16, "(-746) Zero Creation Time" },
498 { 0xfffffd15, "(-747) Would Block" },
499 { 0xfffffd14, "(-748) Connection Timeout" },
500 { 0xfffffd13, "(-749) Too Many Referrals" },
501 { 0xfffffd12, "(-750) Operation Cancelled" },
502 { 0xfffffd11, "(-751) Unknown Target" },
503 { 0xfffffd10, "(-752) GUID Failure" },
504 { 0xfffffd0f, "(-753) Incompatible OS" },
505 { 0xfffffd0e, "(-754) Callback Cancel" },
506 { 0xfffffd0d, "(-755) Invalid Synchronization Data" },
507 { 0xfffffd0c, "(-756) Stream Exists" },
508 { 0xfffffd0b, "(-757) Auxiliary Has Containment" },
509 { 0xfffffd0a, "(-758) Auxiliary Not Container" },
510 { 0xfffffd09, "(-759) Auxiliary Not Effective" },
511 { 0xfffffd08, "(-760) Auxiliary On Alias" },
512 { 0xfffffd07, "(-761) Have Seen State" },
513 { 0xfffffd06, "(-762) Verb Locked" },
514 { 0xfffffd05, "(-763) Verb Exceeds Table Length" },
515 { 0xfffffd04, "(-764) BOF Hit" },
516 { 0xfffffd03, "(-765) EOF Hit" },
517 { 0xfffffd02, "(-766) Incompatible Replica Version" },
518 { 0xfffffd01, "(-767) Query Timeout" },
519 { 0xfffffd00, "(-768) Query Maximum Count" },
520 { 0xfffffcff, "(-769) Duplicate Naming" },
521 { 0xfffffcfe, "(-770) No Transaction Active" },
522 { 0xfffffcfd, "(-771) Transaction Active" },
523 { 0xfffffcfc, "(-772) Illegal Transaction Operation" },
524 { 0xfffffcfb, "(-773) Iterator Syntax" },
525 { 0xfffffcfa, "(-774) Repairing DIB" },
526 { 0xfffffcf9, "(-775) Invalid OID Format" },
527 { 0xfffffcf8, "(-776) Attempted to perform an NDS operation, and the DS agent on this server is closing" },
528 { 0xfffffcf7, "(-777) Attempted to modify an object's attribute that is not stored on the sparse replica" },
529 { 0xfffffcf6, "(-778) VpVector and VpvUser which must be correlated, are out of sync" },
530 { 0xfffffcf5, "(-779) Error Cannot Go Remote" },
531 { 0xfffffcf4, "(-780) Request not Supported" },
532 { 0xfffffcf3, "(-781) Entry Not Local" },
533 { 0xfffffcf2, "(-782) Root Unreachable" },
534 { 0xfffffcf1, "(-783) VRDIM Not Initialized" },
535 { 0xfffffcf0, "(-784) Wait Timeout" },
536 { 0xfffffcef, "(-785) DIB Error" },
537 { 0xfffffcee, "(-786) DIB IO Failure" },
538 { 0xfffffced, "(-787) Illegal Schema Attribute" },
539 { 0xfffffcec, "(-788) Error Schema Partition" },
540 { 0xfffffceb, "(-789) Invalid Template" },
541 { 0xfffffcea, "(-790) Error Opening File" },
542 { 0xfffffce9, "(-791) Error Direct Opening File" },
543 { 0xfffffce8, "(-792) Error Creating File" },
544 { 0xfffffce7, "(-793) Error Direct Creating File" },
545 { 0xfffffce6, "(-794) Error Reading File" },
546 { 0xfffffce5, "(-795) Error Direct Reading File" },
547 { 0xfffffce4, "(-796) Error Writing File" },
548 { 0xfffffce3, "(-797) Error Direct Writing File" },
549 { 0xfffffce2, "(-798) Error Positioning in File" },
550 { 0xfffffce1, "(-799) Error Getting File Size" },
551 { 0xffffe88f, "(-6001) Error Truncating File" },
552 { 0xffffe88e, "(-6002) Error Parsing File Name" },
553 { 0xffffe88d, "(-6003) Error Closing File" },
554 { 0xffffe88c, "(-6004) Error Getting File Info" },
555 { 0xffffe88b, "(-6005) Error Expanding File" },
556 { 0xffffe88a, "(-6006) Error Getting Free Blocks" },
557 { 0xffffe889, "(-6007) Error Checking File Existence" },
558 { 0xffffe888, "(-6008) Error Deleting File" },
559 { 0xffffe887, "(-6009) Error Renaming File" },
560 { 0xffffe886, "(-6010) Error Initializing IO System" },
561 { 0xffffe885, "(-6011) Error Flushing File" },
562 { 0xffffe884, "(-6012) Error Setting Up for Read" },
563 { 0xffffe883, "(-6013) Error Setting up for Write" },
564 { 0xffffe882, "(-6014) Error Old View" },
565 { 0xffffe881, "(-6015) Server in Skulk" },
566 { 0xffffe880, "(-6016) Error Returning Partial Results" },
567 { 0xffffe87f, "(-6017) No Such Schema" },
568 { 0xffffe87e, "(-6018) Serial Number Mismatch" },
569 { 0xffffe87d, "(-6019) Bad Referal Database Serial Number" },
570 { 0xffffe87c, "(-6020) Bad Referal Serial Number" },
571 { 0xffffe87b, "(-6021) Invalid File Sequence" },
572 { 0xffffe87a, "(-6022) Error Referal Trans Gap" },
573 { 0xffffe879, "(-6023) Bad Referal File Number" },
574 { 0xffffe878, "(-6024) Referal File Not Found" },
575 { 0xffffe877, "(-6025) Error Backup Active" },
576 { 0xffffe876, "(-6026) Referal Device Full" },
577 { 0xffffe875, "(-6027) Unsupported Version" },
578 { 0xffffe874, "(-6028) Error Must Wait Checkpoint" },
579 { 0xffffe873, "(-6029) Attribute Maintenance in Progress" },
580 { 0xffffe872, "(-6030) Error Abort Transaction" },
581 { 0xffff0000, "Ok" },
588 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
589 int *req_cond_results, gboolean really_decode,
590 const ncp_record *ncp_rec);
592 /* NCP packets come in request/reply pairs. The request packets tell the type
593 * of NCP request and give a sequence ID. The response, unfortunately, only
594 * identifies itself via the sequence ID; you have to know what type of NCP
595 * request the request packet contained in order to successfully parse the NCP
596 * response. A global method for doing this does not exist in ethereal yet
597 * (NFS also requires it), so for now the NCP section will keep its own hash
598 * table keeping track of NCP packet types.
600 * We construct a conversation specified by the client and server
601 * addresses and the connection number; the key representing the unique
602 * NCP request then is composed of the pointer to the conversation
603 * structure, cast to a "guint" (which may throw away the upper 32
604 * bits of the pointer on a P64 platform, but the low-order 32 bits
605 * are more likely to differ between conversations than the upper 32 bits),
606 * and the sequence number.
608 * The value stored in the hash table is the ncp_req_hash_value pointer. This
609 * struct tells us the NCP type and gives the ncp2222_record pointer, if
610 * ncp_type == 0x2222.
613 conversation_t *conversation;
620 } ncp_req_eid_hash_key;
623 char object_name[256];
625 } ncp_req_eid_hash_value;
627 static GHashTable *ncp_req_hash = NULL;
628 static GHashTable *ncp_req_eid_hash = NULL;
629 static GMemChunk *ncp_req_eid_hash_keys = NULL;
630 static GMemChunk *ncp_req_eid_hash_values = NULL;
631 static GMemChunk *ncp_req_hash_keys = NULL;
632 static GMemChunk *ncp_req_hash_values = NULL;
636 ncp_equal(gconstpointer v, gconstpointer v2)
638 const ncp_req_hash_key *val1 = (const ncp_req_hash_key*)v;
639 const ncp_req_hash_key *val2 = (const ncp_req_hash_key*)v2;
641 if (val1->conversation == val2->conversation &&
642 val1->nw_sequence == val2->nw_sequence ) {
649 ncp_eid_equal(gconstpointer v, gconstpointer v2)
651 const ncp_req_eid_hash_key *val1 = (const ncp_req_eid_hash_key*)v;
652 const ncp_req_eid_hash_key *val2 = (const ncp_req_eid_hash_key*)v2;
654 if (val1->nw_eid == val2->nw_eid ) {
661 ncp_hash(gconstpointer v)
663 const ncp_req_hash_key *ncp_key = (const ncp_req_hash_key*)v;
664 return GPOINTER_TO_UINT(ncp_key->conversation) + ncp_key->nw_sequence;
668 ncp_eid_hash(gconstpointer v)
670 const ncp_req_eid_hash_key *ncp_eid_key = (const ncp_req_eid_hash_key*)v;
671 return GPOINTER_TO_UINT(ncp_eid_key->nw_eid);
674 /* Frees memory used by the ncp_req_hash_value's */
676 ncp_req_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
678 ncp_req_hash_value *request_value = (ncp_req_hash_value*) value;
680 if (request_value->req_cond_results) {
681 g_free(request_value->req_cond_results);
685 /* Frees memory used by the ncp_req_hash_value's */
687 ncp_req_eid_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
689 ncp_req_eid_hash_value *request_eid_value = (ncp_req_eid_hash_value*) value;
691 if (request_eid_value->object_class) {
692 g_free(request_eid_value->object_name);
696 /* Initializes the hash table and the mem_chunk area each time a new
697 * file is loaded or re-loaded in ethereal */
699 ncp_init_protocol(void)
702 g_hash_table_foreach(ncp_req_hash, ncp_req_hash_cleanup, NULL);
703 g_hash_table_destroy(ncp_req_hash);
705 if (ncp_req_eid_hash) {
706 g_hash_table_foreach(ncp_req_eid_hash, ncp_req_eid_hash_cleanup, NULL);
707 g_hash_table_destroy(ncp_req_eid_hash);
709 if (ncp_req_hash_keys)
710 g_mem_chunk_destroy(ncp_req_hash_keys);
711 if (ncp_req_hash_values)
712 g_mem_chunk_destroy(ncp_req_hash_values);
713 if (ncp_req_eid_hash_keys)
714 g_mem_chunk_destroy(ncp_req_eid_hash_keys);
715 if (ncp_req_eid_hash_values)
716 g_mem_chunk_destroy(ncp_req_eid_hash_values);
718 ncp_req_hash = g_hash_table_new(ncp_hash, ncp_equal);
719 ncp_req_eid_hash = g_hash_table_new(ncp_eid_hash, ncp_eid_equal);
720 ncp_req_hash_keys = g_mem_chunk_new("ncp_req_hash_keys",
721 sizeof(ncp_req_hash_key),
722 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_key),
724 ncp_req_hash_values = g_mem_chunk_new("ncp_req_hash_values",
725 sizeof(ncp_req_hash_value),
726 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_value),
728 ncp_req_eid_hash_keys = g_mem_chunk_new("ncp_req_eid_hash_keys",
729 sizeof(ncp_req_eid_hash_key),
730 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_key),
732 ncp_req_eid_hash_values = g_mem_chunk_new("ncp_req_eid_hash_values",
733 sizeof(ncp_req_eid_hash_value),
734 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_value),
738 /* After the sequential run, we don't need the ncp_request hash and keys
739 * anymore; the lookups have already been done and the vital info
740 * saved in the reply-packets' private_data in the frame_data struct. */
742 ncp_postseq_cleanup(void)
745 /* Destroy the hash, but don't clean up request_condition data. */
746 g_hash_table_destroy(ncp_req_hash);
749 if (ncp_req_hash_keys) {
750 g_mem_chunk_destroy(ncp_req_hash_keys);
751 ncp_req_hash_keys = NULL;
753 /* Don't free the ncp_req_hash_values or EID_hash_table, as they're
754 * needed during random-access processing of the proto_tree.*/
758 ncp_hash_insert(conversation_t *conversation, guint8 nw_sequence,
759 const ncp_record *ncp_rec)
761 ncp_req_hash_key *request_key;
762 ncp_req_hash_value *request_value;
764 /* Now remember the request, so we can find it if we later
766 request_key = g_mem_chunk_alloc(ncp_req_hash_keys);
767 request_key->conversation = conversation;
768 request_key->nw_sequence = nw_sequence;
770 request_value = g_mem_chunk_alloc(ncp_req_hash_values);
771 request_value->ncp_rec = ncp_rec;
772 request_value->req_cond_results = NULL;
773 request_value->req_nds_flags = 0;
774 request_value->nds_request_verb = 0;
775 request_value->nds_version = 0;
776 strcpy(request_value->object_name, " ");
778 g_hash_table_insert(ncp_req_hash, request_key, request_value);
780 return request_value;
783 ncp_req_eid_hash_value*
784 ncp_eid_hash_insert(guint32 nw_eid)
786 ncp_req_eid_hash_key *request_eid_key;
787 ncp_req_eid_hash_value *request_eid_value;
789 /* Now remember the request, so we can find it if we later
791 request_eid_key = g_mem_chunk_alloc(ncp_req_eid_hash_keys);
792 request_eid_key->nw_eid = nw_eid;
794 request_eid_value = g_mem_chunk_alloc(ncp_req_eid_hash_values);
795 strcpy(request_eid_value->object_name, " ");
796 request_eid_value->object_class = NULL;
798 g_hash_table_insert(ncp_req_eid_hash, request_eid_key, request_eid_value);
800 return request_eid_value;
803 /* Returns the ncp_rec*, or NULL if not found. */
805 ncp_hash_lookup(conversation_t *conversation, guint8 nw_sequence)
807 ncp_req_hash_key request_key;
809 request_key.conversation = conversation;
810 request_key.nw_sequence = nw_sequence;
812 return g_hash_table_lookup(ncp_req_hash, &request_key);
815 /* Returns the value_rec* for needed EID, or NULL if not found. */
816 ncp_req_eid_hash_value*
817 ncp_eid_hash_lookup(conversation_t *conversation _U_, guint32 nw_eid)
819 ncp_req_eid_hash_key request_eid_key;
821 request_eid_key.nw_eid = nw_eid;
823 return g_hash_table_lookup(ncp_req_eid_hash, &request_eid_key);
826 /* Does NCP func require a subfunction code? */
828 ncp_requires_subfunc(guint8 func)
830 const guint8 *ncp_func_requirement = ncp_func_requires_subfunc;
832 while (*ncp_func_requirement != 0) {
833 if (*ncp_func_requirement == func) {
836 ncp_func_requirement++;
841 /* Does the NCP func have a length parameter? */
843 ncp_has_length_parameter(guint8 func)
845 const guint8 *ncp_func_requirement = ncp_func_has_no_length_parameter;
847 while (*ncp_func_requirement != 0) {
848 if (*ncp_func_requirement == func) {
851 ncp_func_requirement++;
857 /* Return a ncp_record* based on func and possibly subfunc */
858 static const ncp_record *
859 ncp_record_find(guint8 func, guint8 subfunc)
861 const ncp_record *ncp_rec = ncp_packets;
863 while(ncp_rec->func != 0 || ncp_rec->subfunc != 0 ||
864 ncp_rec->name != NULL ) {
865 if (ncp_rec->func == func) {
866 if (ncp_rec->has_subfunc) {
867 if (ncp_rec->subfunc == subfunc) {
881 /* Given a proto_item*, assume it contains an integer value
882 * and return a guint from it. */
884 get_item_value(proto_item *item)
886 return fvalue_get_integer(PITEM_FINFO(item)->value);
891 get_item_string(proto_item *item)
893 return fvalue_get(PITEM_FINFO(item)->value);
897 get_item_name(proto_item *item)
899 return PITEM_FINFO(item)->hfinfo->name;
903 typedef proto_item* (*padd_func_t)(ptvcursor_t*, const ptvc_record*);
906 * XXX - are these just DOS-format dates and times?
908 * Should we put code to understand various date and time formats (UNIX,
909 * DOS, SMB weird mutant UNIX, NT, Mac, etc. into libethereal, and have
910 * the "display" member of an HF_ABSOLUTE_TIME field specify whether
911 * it's DOS date/DOS time, DOS time/DOS date, NT time, UNIX time_t,
912 * UNIX "struct timeval", NFSv3/NFSv4 seconds/nanoseconds, Mac, etc.?
914 * What about hijacking the "bitmask" field to specify the precision of
915 * the time stamp, or putting a combination of precision and format
916 * into the "display" member?
918 * What about relative times? Should they have units (seconds, milliseconds,
919 * microseconds, nanoseconds, etc.), precision, and format in there?
937 #define VTYPE_NONE 0 /* no value */
938 #define VTYPE_UINT8 1
939 #define VTYPE_UINT16 2
940 #define VTYPE_UINT32 3
941 #define VTYPE_STRING 4
942 #define VTYPE_BITFIELD 5
943 #define VTYPE_MULTIVALUE_UINT32 6
944 #define VTYPE_BYTES 7
945 #define VTYPE_BOOLEAN 8
947 #define MVTYPE_ATTR_REQUEST 1
948 #define MVTYPE_ATTR_REPLY 2
949 #define MVTYPE_ATTR_REQUEST2 3 /* XXX - how does this differ from 1? */
950 #define MVTYPE_READ_CLASS_REQ 4
951 #define MVTYPE_READ_REPLICAS 5
952 #define MVTYPE_MODIFY_ATTR_REQUEST 6
953 #define MVTYPE_ADDR_REFERRAL_REQUEST 7
954 #define MVTYPE_ADDR_REFERRAL_REPLY 8
955 #define MVTYPE_LOC_ADDR_REFERRAL_REPLY 9
956 #define MVTYPE_PROC_ENTRY_SPECIFIERS 10
957 #define MVTYPE_PRINT_TIMESTAMP 11
958 #define MVTYPE_LIST_PARTITIONS 12
959 #define MVTYPE_CLASS_NAMES 13
960 #define MVTYPE_MODIFY_CLASS 14
961 #define MVTYPE_ADD_ATTR_REQUEST 15
1000 guint32 bit15hfname;
1002 guint32 bit16hfname;
1005 guint32 nds_version;
1009 /* Given an integer, fill in a nw_date_t struct. */
1011 uint_to_nwdate(guint data, nw_date_t *nwdate)
1013 nwdate->day = data & 0x001f;
1014 nwdate->month = (data & 0x01e0) >> 5;
1015 nwdate->year = ((data & 0xfe00) >> 9) + 1980;
1018 /* Given an integer, fill in a nw_time_t struct. */
1020 uint_to_nwtime(guint data, nw_time_t *nwtime)
1022 /* 2-second resolution */
1023 nwtime->second = (data & 0x001f) * 2;
1024 nwtime->minute = ((data & 0x07e0) >> 5);
1025 nwtime->hour = ((data & 0xf800) >> 11);
1029 unicode_to_string(char * data, guint32 length)
1036 if (data[1] == 0x00){
1038 for (i = 0; i < length; i++) {
1039 character = data[offset];
1040 buffer[i] = character & 0xff;
1052 padd_normal(ptvcursor_t *ptvc, const ptvc_record *rec)
1055 ptvcursor_add(ptvc, *rec->hf_ptr,
1056 rec->length, rec->endianness);
1061 padd_date(ptvcursor_t *ptvc, const ptvc_record *rec)
1067 offset = ptvcursor_current_offset(ptvc);
1069 item = ptvcursor_add(ptvc, *rec->hf_ptr,
1070 rec->length, rec->endianness);
1072 uint_to_nwdate(get_item_value(item), &nw_date);
1074 proto_item_set_text(item, get_item_name(item));
1075 proto_item_append_text(item, ": %04u/%02u/%02u",
1076 nw_date.year, nw_date.month, nw_date.day);
1081 padd_time(ptvcursor_t *ptvc, const ptvc_record *rec)
1087 offset = ptvcursor_current_offset(ptvc);
1089 item = ptvcursor_add(ptvc, *rec->hf_ptr,
1090 rec->length, rec->endianness);
1092 uint_to_nwtime(get_item_value(item), &nw_time);
1094 proto_item_set_text(item, get_item_name(item));
1095 proto_item_append_text(item, ": %02u:%02u:%02u",
1096 nw_time.hour, nw_time.minute, nw_time.second);
1101 /* Convert a string from little-endian unicode to ascii. At the moment we
1102 fake it by taking every odd byte. )-: The caller must free the
1105 padd_uni(ptvcursor_t *ptvc, const ptvc_record *rec)
1111 strcpy(nw_uni.buffer, "");
1112 offset = ptvcursor_current_offset(ptvc);
1114 item = ptvcursor_add(ptvc, *rec->hf_ptr,
1115 rec->length, rec->endianness);
1117 proto_item_set_text(item, get_item_name(item));
1118 proto_item_append_text(item, " %s",
1124 /* Add a value for a ptvc_record, and process the sub-ptvc_record
1125 * that it points to. */
1127 process_bitfield_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1128 gboolean really_decode)
1131 proto_tree *sub_tree;
1132 const ptvc_record *sub_rec;
1135 ptvcursor_t *sub_ptvc;
1137 if (really_decode) {
1138 /* Save the current offset */
1139 current_offset = ptvcursor_current_offset(ptvc);
1142 item = ptvcursor_add(ptvc, *rec->hf_ptr, rec->length,
1145 ett = *rec->sub_ptvc_rec->ett;
1147 /* Make a new protocol sub-tree */
1148 sub_tree = proto_item_add_subtree(item, ett);
1150 /* Make a new ptvcursor */
1151 sub_ptvc = ptvcursor_new(sub_tree, ptvcursor_tvbuff(ptvc),
1155 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
1156 while(sub_rec->hf_ptr != NULL) {
1157 g_assert(!sub_rec->sub_ptvc_rec);
1158 ptvcursor_add_no_advance(sub_ptvc, *sub_rec->hf_ptr,
1159 sub_rec->length, sub_rec->endianness);
1164 ptvcursor_free(sub_ptvc);
1167 ptvcursor_advance(ptvc, rec->length);
1171 /* Process a sub-ptvc_record that points to a "struct" ptvc_record. */
1173 process_struct_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1174 int *req_cond_results, gboolean really_decode,
1175 const ncp_record *ncp_rec)
1177 const ptvc_record *sub_rec;
1179 proto_tree *old_tree=NULL, *new_tree;
1180 proto_item *item=NULL;
1183 /* Create a sub-proto_tree? */
1184 if (rec->sub_ptvc_rec->descr) {
1185 ett = *rec->sub_ptvc_rec->ett;
1186 old_tree = ptvcursor_tree(ptvc);
1187 offset = ptvcursor_current_offset(ptvc);
1188 item = proto_tree_add_text(old_tree, ptvcursor_tvbuff(ptvc),
1189 offset, PROTO_LENGTH_UNTIL_END,
1190 rec->sub_ptvc_rec->descr);
1191 new_tree = proto_item_add_subtree(item, ett);
1192 ptvcursor_set_tree(ptvc, new_tree);
1195 /* Get the ptvc_record for the struct and call our caller
1197 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
1198 process_ptvc_record(ptvc, sub_rec, req_cond_results, really_decode, ncp_rec);
1200 /* Re-set the tree */
1201 if (rec->sub_ptvc_rec->descr) {
1202 proto_item_set_len(item, ptvcursor_current_offset(ptvc) - offset);
1203 ptvcursor_set_tree(ptvc, old_tree);
1207 /* Run through the table of ptvc_record's and add info to the tree. This
1208 * is the work-horse of process_ptvc_record(). */
1210 _process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1211 int *req_cond_results, gboolean really_decode,
1212 const ncp_record *ncp_rec)
1215 guint i, repeat_count;
1216 padd_func_t func = NULL;
1218 if (rec->sub_ptvc_rec) {
1220 if (rec->repeat_index == NO_REPEAT) {
1221 if (rec->hf_ptr == PTVC_STRUCT) {
1222 process_struct_sub_ptvc_record(ptvc, rec,
1223 req_cond_results, really_decode,
1227 process_bitfield_sub_ptvc_record(ptvc, rec,
1232 repeat_count = repeat_vars[rec->repeat_index];
1233 for (i = 0; i < repeat_count; i++ ) {
1234 if (rec->hf_ptr == PTVC_STRUCT) {
1235 process_struct_sub_ptvc_record(ptvc, rec,
1236 req_cond_results, really_decode,
1240 process_bitfield_sub_ptvc_record(ptvc, rec,
1247 /* If we can't repeat this field, we might use it
1248 * to set a 'var'. */
1249 if (rec->repeat_index == NO_REPEAT) {
1250 if (really_decode) {
1251 /* Handle any special formatting. */
1252 switch(rec->special_fmt) {
1256 case NCP_FMT_NW_DATE:
1259 case NCP_FMT_NW_TIME:
1262 case NCP_FMT_UNICODE:
1266 g_assert_not_reached();
1268 item = func(ptvc, rec);
1270 /* Set the value as a 'var' ? */
1271 if (rec->var_index != NO_VAR) {
1272 repeat_vars[rec->var_index] = get_item_value(item);
1276 /* If we don't decode the field, we
1277 * better not use the value to set a var.
1278 * Actually, we could, as long as we don't
1279 * *use* that var; for now keep this assert in
1281 g_assert(rec->var_index == NO_VAR);
1282 ptvcursor_advance(ptvc, rec->length);
1286 /* We do repeat this field. */
1287 repeat_count = repeat_vars[rec->repeat_index];
1288 if (really_decode) {
1289 /* Handle any special formatting. */
1290 switch(rec->special_fmt) {
1294 case NCP_FMT_NW_DATE:
1297 case NCP_FMT_NW_TIME:
1300 case NCP_FMT_UNICODE:
1304 g_assert_not_reached();
1306 for (i = 0; i < repeat_count; i++ ) {
1311 for (i = 0; i < repeat_count; i++ ) {
1312 ptvcursor_advance(ptvc, rec->length);
1319 /* Run through the table of ptvc_record's and add info to the tree.
1320 * Honor a request condition result. */
1322 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1323 int *req_cond_results, gboolean really_decode,
1324 const ncp_record *ncp_rec)
1328 while(rec->hf_ptr != NULL) {
1329 decode = really_decode;
1330 /* If we're supposed to decode, check the request condition
1331 * results to see if we should override this and *not* decode. */
1332 if (decode && req_cond_results) {
1333 if (rec->req_cond_index != NO_REQ_COND) {
1334 if (req_cond_results[rec->req_cond_index] == FALSE) {
1339 if (decode || ncp_rec->req_cond_size_type == REQ_COND_SIZE_CONSTANT) {
1340 _process_ptvc_record(ptvc, rec, req_cond_results, decode, ncp_rec);
1348 /* Clear the repeat_vars array. */
1350 clear_repeat_vars(void)
1354 for (i = 0 ; i < NUM_REPEAT_VARS; i++ ) {
1360 /* Given an error_equivalency table and a completion code, return
1361 * the string representing the error. */
1363 ncp_error_string(const error_equivalency *errors, guint8 completion_code)
1365 while (errors->ncp_error_index != -1) {
1366 if (errors->error_in_packet == completion_code) {
1367 return ncp_errors[errors->ncp_error_index];
1372 return "Unknown Error Code";
1375 static const ncp_record ncp1111_request =
1376 { 0x01, 0x00, NO_SUBFUNC, "Create Connection Service", NCP_GROUP_CONNECTION,
1377 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1379 static const ncp_record ncp5555_request =
1380 { 0x01, 0x00, NO_SUBFUNC, "Destroy Connection Service", NCP_GROUP_CONNECTION,
1381 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1383 static const ncp_record ncpbbbb_request =
1384 { 0x01, 0x00, NO_SUBFUNC, "Server Broadcast Message", NCP_GROUP_CONNECTION,
1385 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1387 static const ncp_record ncplip_echo =
1388 { 0x01, 0x00, NO_SUBFUNC, "LIP Echo Packet", NCP_GROUP_CONNECTION,
1389 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1391 /* Wrapper around proto_tree_free() */
1392 void free_proto_tree(void *tree)
1395 proto_tree_free((proto_tree*) tree);
1400 align_4(tvbuff_t *tvb, guint32 aoffset)
1402 if(tvb_length_remaining(tvb, aoffset) > 4 )
1410 * These routines process both ASCII and Unicode strings, although
1411 * they handle only Unicode strings that have only ISO 8859-1
1412 * characters, as they recognize Unicode characters by the 0
1416 get_string(tvbuff_t* tvb, guint offset, guint str_length, char *dest_buf)
1420 guint32 length_remaining = 0;
1422 length_remaining = tvb_length_remaining(tvb, offset);
1423 if(str_length > length_remaining || str_length > 1024)
1425 strcpy(dest_buf, "String too long to process");
1433 for ( i = 0; i < str_length; i++ )
1435 c_char = tvb_get_guint8(tvb, offset );
1436 if (c_char<0x20 || c_char>0x7e)
1441 dest_buf[i] = c_char & 0xff;
1451 dest_buf[i] = c_char & 0xff;
1456 if(length_remaining==1)
1458 dest_buf[i+1] = '\0';
1467 uni_to_string(char * data, guint32 str_length, char *dest_buf)
1471 guint32 length_remaining = 0;
1473 length_remaining = str_length;
1479 for ( i = 0; i < str_length; i++ )
1482 if (c_char<0x20 || c_char>0x7e)
1487 dest_buf[i] = c_char & 0xff;
1497 dest_buf[i] = c_char & 0xff;
1501 if(length_remaining==0)
1503 dest_buf[i+1] = '\0';
1511 /*************************************
1512 * Return based on % format in request
1513 * %d = integer in decimal format = 0
1514 * %x = integer in hex format = 1
1516 **************************************/
1518 get_info_type(const gchar* check_string)
1524 length = strlen(check_string);
1526 for (i = 0 ; i < length-1 ; i++ ) {
1527 char_val = check_string[i+1];
1528 if (check_string[i] == 0x25 && check_string[i+1] == 0x64) { /* %d Digits*/
1531 if ( check_string[i] == 0x78 && check_string[i+1] == 0x25 && check_string[i+2] == 0x73) { /* x%s Bytes*/
1535 return 2; /* Normal String */
1539 process_bitfield(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
1541 gchar flags_str[512];
1544 proto_tree *flags_tree;
1548 bvalue = 0x00000001;
1551 for (i = 0 ; i < (values->vlength*8); i++ ) {
1552 if (values->vvalue & bvalue)
1554 strcat(flags_str, sep);
1557 strcat(flags_str, values->bit1);
1560 strcat(flags_str, values->bit2);
1563 strcat(flags_str, values->bit3);
1566 strcat(flags_str, values->bit4);
1569 strcat(flags_str, values->bit5);
1572 strcat(flags_str, values->bit6);
1575 strcat(flags_str, values->bit7);
1578 strcat(flags_str, values->bit8);
1581 strcat(flags_str, values->bit9);
1584 strcat(flags_str, values->bit10);
1587 strcat(flags_str, values->bit11);
1590 strcat(flags_str, values->bit12);
1593 strcat(flags_str, values->bit13);
1596 strcat(flags_str, values->bit14);
1599 strcat(flags_str, values->bit15);
1602 strcat(flags_str, values->bit16);
1611 if(values->vlength==4)
1613 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
1614 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%08x",
1615 values->vdesc, values->vvalue);
1619 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
1620 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%04x",
1621 values->vdesc, values->vvalue);
1623 if (flags_str[0] != '\0')
1624 proto_item_append_text(tinew, " - (%s)", flags_str);
1626 flags_tree = proto_item_add_subtree(tinew, ett_nds);
1628 bvalue = 0x00000001;
1630 for (i = 0 ; i < (values->vlength*8); i++ ) {
1631 if (values->vvalue & bvalue)
1636 proto_tree_add_item(flags_tree, values->bit1hfname, tvb, values->voffset, values->vlength, TRUE);
1639 proto_tree_add_item(flags_tree, values->bit2hfname, tvb, values->voffset, values->vlength, TRUE);
1642 proto_tree_add_item(flags_tree, values->bit3hfname, tvb, values->voffset, values->vlength, TRUE);
1645 proto_tree_add_item(flags_tree, values->bit4hfname, tvb, values->voffset, values->vlength, TRUE);
1648 proto_tree_add_item(flags_tree, values->bit5hfname, tvb, values->voffset, values->vlength, TRUE);
1651 proto_tree_add_item(flags_tree, values->bit6hfname, tvb, values->voffset, values->vlength, TRUE);
1654 proto_tree_add_item(flags_tree, values->bit7hfname, tvb, values->voffset, values->vlength, TRUE);
1657 proto_tree_add_item(flags_tree, values->bit8hfname, tvb, values->voffset, values->vlength, TRUE);
1660 proto_tree_add_item(flags_tree, values->bit9hfname, tvb, values->voffset, values->vlength, TRUE);
1663 proto_tree_add_item(flags_tree, values->bit10hfname, tvb, values->voffset, values->vlength, TRUE);
1666 proto_tree_add_item(flags_tree, values->bit11hfname, tvb, values->voffset, values->vlength, TRUE);
1669 proto_tree_add_item(flags_tree, values->bit12hfname, tvb, values->voffset, values->vlength, TRUE);
1672 proto_tree_add_item(flags_tree, values->bit13hfname, tvb, values->voffset, values->vlength, TRUE);
1675 proto_tree_add_item(flags_tree, values->bit14hfname, tvb, values->voffset, values->vlength, TRUE);
1678 proto_tree_add_item(flags_tree, values->bit15hfname, tvb, values->voffset, values->vlength, TRUE);
1681 proto_tree_add_item(flags_tree, values->bit16hfname, tvb, values->voffset, values->vlength, TRUE);
1693 print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val *vvalues)
1701 guint32 voffset = 0;
1703 guint32 number_of_values = 0;
1704 guint32 number_of_items = 0;
1710 char *valuestr = NULL;
1716 voffset = vvalues->voffset;
1717 if(tvb_get_guint8(tvb, voffset) == 0x00)
1719 voffset = voffset+2;
1722 number_of_values = tvb_get_letohl(tvb, voffset);
1724 vitem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset,
1725 4, number_of_values, "Number of Values: %u", number_of_values);
1727 nvtree = proto_item_add_subtree(vitem, ett_nds);
1729 voffset = voffset + 4;
1731 for (icounter = 1 ; icounter <= number_of_values; icounter++ )
1735 case 0x00000006: /* Case Insensitive List */
1736 case 0x0000000d: /* Binary String List */
1737 case 0x00000012: /* Postal Address */
1738 voffset += align_4(tvb, voffset);
1739 voffset = voffset+4;
1740 number_of_items = tvb_get_letohl(tvb, voffset);
1741 voffset = voffset+4;
1742 for (r=1; r<=number_of_items; r++)
1744 value1 = tvb_get_letohl(tvb, voffset);
1745 voffset = voffset + 4;
1746 get_string(tvb, voffset, value1, vvalues->vstring);
1747 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1748 value1, vvalues->vstring);
1749 voffset = voffset + value1;
1750 voffset += align_4(tvb, voffset);
1753 case 0x00000007: /* Boolean */
1754 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1757 vvalues->vstring = "False";
1761 vvalues->vstring = "True";
1763 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1764 value1, vvalues->vstring);
1767 case 0x00000009: /* Binary String */
1768 case 0x00000015: /* Stream */
1769 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1770 if(value1 > tvb_length_remaining(tvb, voffset))
1775 proto_tree_add_bytes(nvtree, hf_value_bytes, tvb, voffset, value1, tvb_get_ptr(tvb, voffset, value1));
1777 voffset += (value1%2);
1779 case 0x00000008: /* Signed Integer */
1780 case 0x00000016: /* Counter */
1781 case 0x00000018: /* Time */
1782 case 0x0000001b: /* Interval */
1783 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1784 voffset = voffset+4;
1785 value2 = tvb_get_letohl(tvb, voffset); /* Value */
1786 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1787 value1, value2, "Value %d", value2);
1788 voffset = voffset+4;
1790 case 0x0000000b: /* Fax Number */
1791 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1792 voffset = voffset+4;
1793 get_string(tvb, voffset, value1, vvalues->vstring);
1794 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1795 value1, vvalues->vstring);
1796 voffset = voffset + value1;
1797 voffset += align_4(tvb, voffset);
1798 value2 = tvb_get_letohl(tvb, voffset); /* Bit Count */
1800 value3 = tvb_get_letohl(tvb, voffset); /* Bit length */
1801 voffset = voffset+4;
1802 get_string(tvb, voffset, value3, vvalues->vstring);
1803 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1804 value3, vvalues->vstring);
1805 voffset = voffset+value3;
1806 voffset += align_4(tvb, voffset);
1808 case 0x0000000c: /* Network Address */
1809 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1810 voffset = voffset + 4;
1811 value2 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
1812 valuestr = match_strval(value2, nds_protocol_type);
1813 if (valuestr == NULL)
1815 valuestr="(Undefined Protocol)";
1817 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1818 value1, value2, valuestr, value2);
1819 voffset = voffset+4;
1820 value3 = tvb_get_letohl(tvb, voffset); /* length of address */
1821 voffset = voffset+4;
1825 proto_tree_add_item(nvtree, hf_nds_net, tvb, voffset, 4, FALSE);
1826 proto_tree_add_item(nvtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
1827 proto_tree_add_item(nvtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
1830 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1831 value4 = tvb_get_letohl(tvb, voffset+2);
1832 proto_tree_add_ipv4(nvtree, hf_add_ref_udp, tvb, voffset+2, 4, value4);
1835 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1836 value4 = tvb_get_letohl(tvb, voffset+2);
1837 proto_tree_add_ipv4(nvtree, hf_add_ref_tcp, tvb, voffset+2, 4, value4);
1840 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1841 value4 = tvb_get_letohl(tvb, voffset+2);
1842 proto_tree_add_ipv4(nvtree, hf_add_ref_ip, tvb, voffset+2, 4, value4);
1845 get_string(tvb, voffset, value3, vvalues->vstring);
1846 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1847 value3, vvalues->vstring);
1852 voffset = voffset + value3;
1853 voffset += align_4(tvb, voffset);
1855 case 0x0000000f: /* File System Path */
1856 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1857 voffset = voffset + 4;
1858 value2 = tvb_get_letohl(tvb, voffset); /* Name Space */
1859 valuestr = match_strval(value2, name_space_type);
1860 if (valuestr == NULL)
1862 valuestr = "Unknown Name Space";
1864 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1866 voffset = voffset+4;
1867 value3 = tvb_get_letohl(tvb, voffset); /* Length of Volume name */
1868 voffset = voffset+4;
1869 get_string(tvb, voffset, value3, vvalues->vstring);
1870 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1871 value3, vvalues->vstring);
1872 voffset = voffset+value3;
1873 voffset += align_4(tvb, voffset);
1874 value4 = tvb_get_letohl(tvb, voffset); /* Length of Path name */
1875 voffset = voffset+4;
1876 get_string(tvb, voffset, value4, vvalues->vstring);
1877 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1878 value4, vvalues->vstring);
1879 voffset = voffset+value4;
1880 voffset += align_4(tvb, voffset);
1882 case 0x00000010: /* Replica Pointer */
1883 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1884 voffset = voffset + 4;
1885 value2 = tvb_get_letohl(tvb, voffset); /* Length of Server name */
1886 voffset = voffset+4;
1887 get_string(tvb, voffset, value2, vvalues->vstring);
1888 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1889 value2, vvalues->vstring);
1890 voffset = voffset+value2;
1891 voffset += align_4(tvb, voffset);
1892 rtype = tvb_get_letohs(tvb, voffset); /* replica type */
1893 valuestr = match_strval(rtype, nds_replica_type);
1894 if (valuestr == NULL)
1896 valuestr="(Unknown Replica Type)";
1898 proto_tree_add_string(nvtree, hf_replica_type, tvb, voffset,
1900 voffset = voffset+2;
1901 rstate = tvb_get_letohs(tvb, voffset); /* replica state */
1902 valuestr = match_strval(rstate, nds_replica_state);
1903 if (valuestr == NULL)
1905 valuestr="(Unknown Replica State)";
1907 proto_tree_add_string(nvtree, hf_replica_state, tvb, voffset,
1909 voffset = voffset+2;
1910 value3 = tvb_get_letohl(tvb, voffset); /* Replica number */
1911 proto_tree_add_uint_format(nvtree, hf_replica_number, tvb, voffset,
1912 4, value3, "Replica Number %d", value3);
1913 voffset = voffset+4;
1914 if(vvalues->nds_version == 0xfe)
1918 number_of_items = tvb_get_letohl(tvb, voffset); /* Number of Addresses */
1919 aditem = proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1920 4, number_of_items, "Number of Addresses: %u", number_of_items);
1922 adtree = proto_item_add_subtree(aditem, ett_nds);
1923 voffset = voffset+4;
1924 for (r=1; r <= number_of_items; r++)
1926 voffset += align_4(tvb, voffset);
1927 value4 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
1928 valuestr = match_strval(value4, nds_protocol_type);
1929 if (valuestr == NULL)
1931 valuestr="(Undefined Protocol)";
1933 proto_tree_add_uint_format(adtree, hf_nds_uint32value, tvb, voffset,
1934 4, value4, valuestr, value4);
1935 voffset = voffset+4;
1936 value5 = tvb_get_letohl(tvb, voffset); /* length of address */
1937 voffset = voffset+4;
1941 proto_tree_add_item(adtree, hf_nds_net, tvb, voffset, 4, FALSE);
1942 proto_tree_add_item(adtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
1943 proto_tree_add_item(adtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
1946 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1947 value6 = tvb_get_letohl(tvb, voffset+2);
1948 proto_tree_add_ipv4(adtree, hf_add_ref_ip, tvb, voffset+2, 4, value6);
1951 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1952 value6 = tvb_get_letohl(tvb, voffset+2);
1953 proto_tree_add_ipv4(adtree, hf_add_ref_udp, tvb, voffset+2, 4, value6);
1956 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1957 value6 = tvb_get_letohl(tvb, voffset+2);
1958 proto_tree_add_ipv4(adtree, hf_add_ref_tcp, tvb, voffset+2, 4, value6);
1961 get_string(tvb, voffset, value5, vvalues->vstring);
1962 proto_tree_add_string(adtree, hf_value_string, tvb, voffset,
1963 value5, vvalues->vstring);
1968 voffset = voffset + value5;
1970 voffset += align_4(tvb, voffset);
1972 case 0x00000011: /* Object ACL */
1973 value1 = tvb_get_letohl(tvb, voffset); /* Length of Field */
1974 voffset = voffset + 4;
1975 value2 = tvb_get_letohl(tvb, voffset);
1976 voffset = voffset + 4;
1977 get_string(tvb, voffset, value2, vvalues->vstring); /* Unicode String */
1978 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1979 value2, vvalues->vstring);
1980 voffset = voffset + value2;
1981 voffset += align_4(tvb, voffset);
1982 value3 = tvb_get_letohl(tvb, voffset);
1983 voffset = voffset + 4;
1984 get_string(tvb, voffset, value3, vvalues->vstring); /* Unicode Subject Name */
1985 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1986 value3, vvalues->vstring);
1987 voffset = voffset + value3;
1988 voffset += align_4(tvb, voffset);
1989 value4 = tvb_get_letohl(tvb, voffset); /* Privileges */
1990 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1991 4, value4, "Privileges %8x", value4);
1992 voffset = voffset+4;
1993 voffset += align_4(tvb, voffset);
1995 case 0x00000013: /* Time Stamp */
1996 value1 = tvb_get_letohl(tvb, voffset); /* Seconds */
1997 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1998 4, value1, "Lenght of Record: %d", value1);
1999 voffset = voffset+4;
2000 value2 = tvb_get_letohl(tvb, voffset);
2001 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2002 4, value2, "Seconds: %d", value2);
2003 voffset = voffset + 4;
2004 rnum = tvb_get_letohs(tvb, voffset); /* replica number */
2005 proto_tree_add_uint_format(nvtree, hf_nds_rnum, tvb, voffset,
2006 2, rnum, "Replica Number: %d", rnum);
2007 voffset = voffset+2;
2008 revent = tvb_get_letohs(tvb, voffset); /* Event */
2009 proto_tree_add_uint_format(nvtree, hf_nds_revent, tvb, voffset,
2010 2, revent, "Event: %d", revent);
2011 voffset = voffset+14;
2012 voffset += align_4(tvb, voffset);
2014 case 0x00000017: /* Back Link */
2015 value1 = tvb_get_letohl(tvb, voffset); /* Length */
2016 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2017 4, value1, "Length of Record %08x", value1);
2018 voffset = voffset+4;
2019 value2 = tvb_get_letohl(tvb, voffset); /* Remote ID */
2020 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2021 4, value2, "Remote ID %08x", value2);
2022 voffset = voffset+4;
2023 value3 = tvb_get_letohl(tvb, voffset); /* Length of string */
2024 voffset = voffset+4;
2025 get_string(tvb, voffset, value3, vvalues->vstring);
2026 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
2027 value3, vvalues->vstring,
2028 "Server Distinguished Name - %s", vvalues->vstring);
2029 voffset = voffset+value3;
2030 voffset += align_4(tvb, voffset);
2032 case 0x00000019: /* Typed Name */
2033 value1 = tvb_get_letohl(tvb, voffset); /* Length */
2034 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2035 4, value1, "Length of Record %08x", value1);
2036 voffset = voffset+4;
2037 value2 = tvb_get_letohl(tvb, voffset); /* Level */
2038 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2039 4, value2, "Level %d", value2);
2040 voffset = voffset+4;
2041 value3 = tvb_get_letohl(tvb, voffset); /* Interval */
2042 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2043 4, value3, "Interval %d", value3);
2044 voffset = voffset+4;
2045 value4 = tvb_get_letohl(tvb, voffset); /* Distinguished Name */
2046 voffset = voffset+4;
2047 get_string(tvb, voffset, value4, vvalues->vstring);
2048 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
2049 value4, vvalues->vstring,
2050 "Distinguished Name - %s", vvalues->vstring);
2051 voffset = voffset+value4;
2052 voffset += align_4(tvb, voffset);
2054 case 0x0000001a: /* Hold */
2055 value1 = tvb_get_letohl(tvb, voffset); /* Length */
2056 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2057 4, value1, "Length of Record %08x", value1);
2058 voffset = voffset+4;
2059 value2 = tvb_get_letohl(tvb, voffset); /* Amount */
2060 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
2061 4, value2, "Amount %d", value2);
2062 voffset = voffset+4;
2063 value3 = tvb_get_letohl(tvb, voffset); /* Subject */
2064 voffset = voffset+4;
2065 get_string(tvb, voffset, value3, vvalues->vstring);
2066 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
2067 value3, vvalues->vstring,
2068 "Subject - %s", vvalues->vstring);
2069 voffset = voffset+value3;
2070 voffset += align_4(tvb, voffset);
2072 case 0x00000001: /* Distinguished Name */
2073 case 0x00000002: /* Case Sensitive Unicode String */
2074 case 0x00000003: /* Non Case Sensitive Unicode String */
2075 case 0x00000004: /* Printable String */
2076 case 0x00000005: /* Numeric String */
2077 case 0x0000000a: /* Telephone Number */
2078 case 0x0000000e: /* Email Address */
2079 case 0x00000014: /* Class Name */
2081 value1 = tvb_get_letohl(tvb, voffset);
2082 voffset = voffset + 4;
2083 get_string(tvb, voffset, value1, vvalues->vstring);
2084 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
2085 value1, vvalues->vstring);
2086 voffset = voffset + value1;
2087 voffset += align_4(tvb, voffset);
2090 voffset += align_4(tvb, voffset);
2092 vvalues->voffset=voffset;
2097 print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, guint32 ioffset)
2104 guint32 number_of_referrals;
2107 guint16 replica_num;
2110 proto_tree *nestree;
2111 proto_item *nesitem;
2116 strcpy(mval_buf.buffer, "");
2120 case 0: /* No Specifier Type */
2121 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2122 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2124 ioffset = ioffset + 4;
2126 case 1: /* Unicode String */
2127 value1 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2128 ioffset = ioffset + 4;
2129 get_string(tvb, ioffset, value1, mval_buf.buffer);
2130 values->vstring = mval_buf.buffer;
2131 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2132 value1, values->vstring, "Delimeter ->%s", values->vstring);
2133 ioffset=ioffset + value1;
2134 ioffset += align_4(tvb, ioffset);
2135 value2 = tvb_get_letohl(tvb, ioffset);
2136 ioffset = ioffset + 4;
2137 get_string(tvb, ioffset, value2, mval_buf.buffer);
2138 values->vstring = mval_buf.buffer;
2139 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2140 value2, values->vstring);
2141 values->voffset=ioffset + value2;
2142 ioffset = values->voffset;
2143 ioffset += align_4(tvb, ioffset);
2146 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2147 vstring = match_strval(value1, es_type);
2148 if (vstring == NULL)
2150 vstring = "No ES Type Found";
2152 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2153 4, vstring, "Base Context Type - %s", vstring);
2154 nestree = proto_item_add_subtree(nesitem, ett_nds);
2155 ioffset = ioffset + 4;
2158 case 0: /* No Specifier Type */
2159 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2160 proto_tree_add_item(nestree, hf_es_value, tvb, ioffset,
2162 ioffset = ioffset + 4;
2164 case 1: /* Unicode String */
2165 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2166 ioffset = ioffset + 4;
2167 get_string(tvb, ioffset, value2, mval_buf.buffer);
2168 values->vstring = mval_buf.buffer;
2169 proto_tree_add_string_format(nestree, hf_mv_string, tvb, ioffset,
2170 value2, values->vstring, "Delimeter ->%s", values->vstring);
2171 ioffset=ioffset + value2;
2172 ioffset += align_4(tvb, ioffset);
2173 value3 = tvb_get_letohl(tvb, ioffset);
2174 ioffset = ioffset + 4;
2175 get_string(tvb, ioffset, value3, mval_buf.buffer);
2176 values->vstring = mval_buf.buffer;
2177 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
2178 value3, values->vstring);
2179 values->voffset=ioffset + value3;
2180 ioffset = values->voffset;
2181 ioffset += align_4(tvb, ioffset);
2185 case 3: /* Hinted */
2188 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2189 proto_tree_add_item(nestree, hf_es_rdn_count, tvb, ioffset,
2191 ioffset = ioffset + 4;
2192 for (r = 1 ; r <= value2; r++ )
2194 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2195 proto_tree_add_item(nestree, hf_es_seconds, tvb, ioffset,
2197 ioffset = ioffset + 4;
2198 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2199 proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset,
2201 ioffset = ioffset + 2;
2202 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2203 proto_tree_add_item(nestree, hf_nds_event_num, tvb, ioffset,
2205 ioffset = ioffset + 2;
2207 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2208 ioffset = ioffset + 4;
2209 get_string(tvb, ioffset, value4, mval_buf.buffer);
2210 values->vstring = mval_buf.buffer;
2211 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
2212 value4, values->vstring);
2213 ioffset=ioffset + value4;
2214 ioffset += align_4(tvb, ioffset);
2215 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2216 ioffset = ioffset + 4;
2217 get_string(tvb, ioffset, value5, mval_buf.buffer);
2218 values->vstring = mval_buf.buffer;
2219 proto_tree_add_string(nestree, hf_rdn_string, tvb, ioffset,
2220 value5, values->vstring);
2221 ioffset=ioffset + value5;
2222 ioffset += align_4(tvb, ioffset);
2228 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2229 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2231 ioffset = ioffset + 4;
2234 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2235 vstring = match_strval(value1, es_type);
2236 if (vstring == NULL)
2238 vstring = "No ES Type Found";
2240 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2241 4, vstring, "Object Name Type - %s", vstring);
2242 nestree = proto_item_add_subtree(nesitem, ett_nds);
2243 ioffset = ioffset + 4;
2246 case 0: /* No Specifier Type */
2247 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2248 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2250 ioffset = ioffset + 4;
2252 case 1: /* Unicode String */
2253 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2254 ioffset = ioffset + 4;
2255 get_string(tvb, ioffset, value2, mval_buf.buffer);
2256 values->vstring = mval_buf.buffer;
2257 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2258 value2, values->vstring, "Delimeter ->%s", values->vstring);
2259 ioffset=ioffset + value2;
2260 ioffset += align_4(tvb, ioffset);
2261 value3 = tvb_get_letohl(tvb, ioffset);
2262 ioffset = ioffset + 4;
2263 get_string(tvb, ioffset, value3, mval_buf.buffer);
2264 values->vstring = mval_buf.buffer;
2265 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2266 value3, values->vstring);
2267 values->voffset=ioffset + value3;
2268 ioffset = values->voffset;
2269 ioffset += align_4(tvb, ioffset);
2273 case 3: /* Hinted */
2276 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2277 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2279 ioffset = ioffset + 4;
2280 for (r = 1 ; r <= value2; r++ )
2282 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2283 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2285 ioffset = ioffset + 4;
2286 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2287 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2289 ioffset = ioffset + 2;
2290 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2291 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2293 ioffset = ioffset + 2;
2295 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2296 ioffset = ioffset + 4;
2297 get_string(tvb, ioffset, value4, mval_buf.buffer);
2298 values->vstring = mval_buf.buffer;
2299 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2300 value4, values->vstring);
2301 ioffset=ioffset + value4;
2302 ioffset += align_4(tvb, ioffset);
2303 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2304 ioffset = ioffset + 4;
2305 get_string(tvb, ioffset, value5, mval_buf.buffer);
2306 values->vstring = mval_buf.buffer;
2307 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2308 value5, values->vstring);
2309 ioffset=ioffset + value5;
2310 ioffset += align_4(tvb, ioffset);
2316 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2317 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2319 ioffset = ioffset + 4;
2323 case 3: /* Hinted */
2324 number_of_referrals = tvb_get_letohl(tvb, ioffset);
2326 for (r = 1 ; r <= number_of_referrals; r++ )
2328 aitem = proto_tree_add_uint_format(estree, hf_referral_record, tvb, 6, 0,
2329 r, "NDS Referral Record #%u", r);
2330 atree = proto_item_add_subtree(aitem, ett_nds);
2332 value1 = tvb_get_letohl(tvb, ioffset);
2334 proto_tree_add_uint_format(atree, hf_referral_addcount, tvb, ioffset, 4,
2335 value1, "Number of Addresses in Referral - %d", value1);
2337 ioffset = ioffset + 4;
2338 for (i = 1 ; i <= value1; i++ )
2340 value2 = tvb_get_letohl(tvb, ioffset);
2341 values->vstring = match_strval(value2, nds_protocol_type);
2342 if (values->vstring == NULL)
2344 values->vstring="(Undefined Protocol)";
2346 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
2347 4, value2, vstring, value2);
2348 ioffset = ioffset+4;
2349 value3 = tvb_get_letohl(tvb, ioffset);
2350 ioffset = ioffset+4;
2354 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
2355 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
2356 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
2359 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2360 value4 = tvb_get_letohl(tvb, ioffset+2);
2361 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4);
2364 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2365 value4 = tvb_get_letohl(tvb, ioffset+2);
2366 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4);
2369 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2370 value4 = tvb_get_letohl(tvb, ioffset+2);
2371 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4);
2374 get_string(tvb, ioffset, value3, values->vstring);
2375 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
2376 value3, values->vstring);
2381 ioffset = ioffset + value3;
2382 ioffset += align_4(tvb, ioffset);
2386 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2387 vstring = match_strval(value1, es_type);
2388 if (vstring == NULL)
2390 vstring = "No ES Type Found";
2392 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2393 4, vstring, "Object Name Type - %s", vstring);
2394 nestree = proto_item_add_subtree(nesitem, ett_nds);
2395 ioffset = ioffset + 4;
2398 case 0: /* No Specifier Type */
2399 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2400 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2402 ioffset = ioffset + 4;
2404 case 1: /* Unicode String */
2405 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2406 ioffset = ioffset + 4;
2407 get_string(tvb, ioffset, value2, mval_buf.buffer);
2408 values->vstring = mval_buf.buffer;
2409 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2410 value2, values->vstring, "Delimeter ->%s", values->vstring);
2411 ioffset=ioffset + value2;
2412 ioffset += align_4(tvb, ioffset);
2413 value3 = tvb_get_letohl(tvb, ioffset);
2414 ioffset = ioffset + 4;
2415 get_string(tvb, ioffset, value3, mval_buf.buffer);
2416 values->vstring = mval_buf.buffer;
2417 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2418 value3, values->vstring);
2419 values->voffset=ioffset + value3;
2420 ioffset = values->voffset;
2421 ioffset += align_4(tvb, ioffset);
2425 case 3: /* Hinted */
2428 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2429 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2431 ioffset = ioffset + 4;
2432 for (r = 1 ; r <= value2; r++ )
2434 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2435 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2437 ioffset = ioffset + 4;
2438 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2439 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2441 ioffset = ioffset + 2;
2442 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2443 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2445 ioffset = ioffset + 2;
2447 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2448 ioffset = ioffset + 4;
2449 get_string(tvb, ioffset, value4, mval_buf.buffer);
2450 values->vstring = mval_buf.buffer;
2451 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2452 value4, values->vstring);
2453 ioffset=ioffset + value4;
2454 ioffset += align_4(tvb, ioffset);
2455 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2456 ioffset = ioffset + 4;
2457 get_string(tvb, ioffset, value5, mval_buf.buffer);
2458 values->vstring = mval_buf.buffer;
2459 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2460 value5, values->vstring);
2461 ioffset=ioffset + value5;
2462 ioffset += align_4(tvb, ioffset);
2468 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2469 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2471 ioffset = ioffset + 4;
2476 value1 = tvb_get_letohl(tvb, ioffset); /* Count */
2477 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2479 ioffset = ioffset + 4;
2480 for (r = 1 ; r <= value1; r++ )
2482 value2 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2483 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2485 ioffset = ioffset + 4;
2486 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2487 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2489 ioffset = ioffset + 2;
2490 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2491 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2493 ioffset = ioffset + 2;
2495 value3 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2496 ioffset = ioffset + 4;
2497 get_string(tvb, ioffset, value3, mval_buf.buffer);
2498 values->vstring = mval_buf.buffer;
2499 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2500 value3, values->vstring);
2501 ioffset=ioffset + value3;
2502 ioffset += align_4(tvb, ioffset);
2503 value4 = tvb_get_letohl(tvb, ioffset); /* RDN */
2504 ioffset = ioffset + 4;
2505 get_string(tvb, ioffset, value4, mval_buf.buffer);
2506 values->vstring = mval_buf.buffer;
2507 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2508 value4, values->vstring);
2509 ioffset=ioffset + value4;
2510 ioffset += align_4(tvb, ioffset);
2516 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2517 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2519 ioffset = ioffset + 4;
2526 process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
2530 guint32 ioffset = 0;
2538 char * valuestr = "";
2543 guint32 number_of_referrals = 0;
2547 guint16 replica_num = 0;
2548 guint16 event_num = 0;
2550 nds_val temp_values;
2551 proto_tree *sub1tree;
2552 proto_item *sub1item;
2553 proto_tree *sub2tree;
2554 proto_item *sub2item;
2556 strcpy(mval_buf.buffer, "");
2558 if(values->mvtype != MVTYPE_LIST_PARTITIONS)
2560 nitem = proto_tree_add_uint_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
2561 values->vlength, values->vvalue, values->vdesc, values->vvalue);
2565 nitem = proto_tree_add_string_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
2566 values->vlength, values->vdesc, "%s", values->vdesc);
2568 ioffset = (values->voffset+4);
2570 ntree = proto_item_add_subtree(nitem, ett_nds);
2572 switch (values->mvtype)
2574 case MVTYPE_ATTR_REQUEST: /* Attribute Request */
2575 for (i = 1 ; i <= values->vvalue; i++ )
2577 ioffset += align_4(tvb, ioffset);
2578 value1 = tvb_get_letohl(tvb, ioffset);
2579 ioffset = ioffset + 4;
2580 get_string(tvb, ioffset, value1, mval_buf.buffer);
2581 values->vstring = mval_buf.buffer;
2582 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2583 value1, values->vstring);
2584 ioffset = ioffset + value1;
2588 case MVTYPE_ATTR_REPLY: /* Attribute Reply */
2589 switch(values->vflags)
2592 for (i = 1 ; i <= values->vvalue; i++ )
2594 ioffset += align_4(tvb, ioffset);
2595 value1 = tvb_get_letohl(tvb, ioffset);
2596 ioffset = ioffset + 4;
2597 get_string(tvb, ioffset, value1, mval_buf.buffer);
2598 values->vstring = mval_buf.buffer;
2599 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2600 value1, values->vstring);
2601 ioffset = ioffset + value1;
2605 for (i = 1 ; i <= values->vvalue; i++ )
2607 value1 = tvb_get_letohl(tvb, ioffset);
2608 values->vstring = match_strval(value1, nds_syntax);
2609 if (values->vstring == NULL)
2611 values->vstring = "No Syntax Found";
2613 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2614 4, values->vstring);
2615 ioffset = ioffset + 4;
2616 value2 = tvb_get_letohl(tvb, ioffset);
2617 ioffset = ioffset + 4;
2618 get_string(tvb, ioffset, value2, mval_buf.buffer);
2619 values->vstring = mval_buf.buffer;
2620 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2621 value2, values->vstring);
2623 ioffset += align_4(tvb, ioffset);
2624 values->voffset = ioffset;
2626 print_nds_values(ntree, tvb, value1, values);
2627 ioffset = values->voffset;
2631 for (i = 1 ; i <= values->vvalue; i++ )
2633 value1 = tvb_get_letohl(tvb, ioffset);
2634 values->vstring = match_strval(value1, nds_syntax);
2635 if (values->vstring == NULL)
2637 values->vstring = "No Syntax Found";
2639 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2640 4, values->vstring);
2641 ioffset = ioffset + 4;
2642 value2 = tvb_get_letohl(tvb, ioffset);
2643 ioffset = ioffset + 4;
2644 get_string(tvb, ioffset, value2, mval_buf.buffer);
2645 values->vstring = mval_buf.buffer;
2646 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2647 value2, values->vstring);
2648 values->voffset=ioffset + value2;
2650 ioffset += align_4(tvb, ioffset);
2651 value3 = tvb_get_letohl(tvb, ioffset);
2653 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2654 value1, "Number of Values - %d", value1);
2656 ioffset = ioffset + 4;
2657 for (r = 1 ; r <= value3; r++ )
2659 ioffset += 4; /* Length = 4 */
2660 value4 = tvb_get_letohl(tvb, ioffset);
2661 proto_tree_add_uint(ntree, hf_nds_privileges, tvb, ioffset,
2662 values->vlength, value4);
2663 ioffset = ioffset+4;
2668 for (i = 1 ; i <= values->vvalue; i++ )
2670 value1 = tvb_get_letohl(tvb, ioffset);
2671 values->vstring = match_strval(value1, nds_syntax);
2672 if (values->vstring == NULL)
2674 values->vstring = "No Syntax Found";
2676 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2677 4, values->vstring);
2678 ioffset = ioffset + 4;
2679 value2 = tvb_get_letohl(tvb, ioffset);
2680 ioffset = ioffset + 4;
2681 get_string(tvb, ioffset, value2, mval_buf.buffer);
2682 values->vstring = mval_buf.buffer;
2683 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2684 value2, values->vstring);
2685 ioffset = ioffset + value2;
2686 ioffset += align_4(tvb, ioffset);
2687 value3 = tvb_get_letohl(tvb, ioffset);
2689 aitem = proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2690 value3, "Number of Values - %d", value3);
2692 atree = proto_item_add_subtree(aitem, ett_nds);
2694 ioffset = ioffset + 4;
2695 for (r = 1 ; r <= value3; r++ )
2697 ioffset += align_4(tvb, ioffset);
2698 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2699 temp_values.vlength = 2;
2700 temp_values.hfname = hf_nds_vflags;
2701 temp_values.voffset = ioffset;
2702 temp_values.vdesc = "Value Flags";
2703 temp_values.bit1 = "Naming";
2704 temp_values.bit1hfname = hf_bit1vflags;
2705 temp_values.bit2 = "Base Class";
2706 temp_values.bit2hfname = hf_bit2vflags;
2707 temp_values.bit3 = "Present";
2708 temp_values.bit3hfname = hf_bit3vflags;
2709 temp_values.bit4 = "Value Damaged";
2710 temp_values.bit4hfname = hf_bit4vflags;
2711 temp_values.bit5 = "Not Defined";
2712 temp_values.bit5hfname = hf_bit5vflags;
2713 temp_values.bit6 = "Not Defined";
2714 temp_values.bit6hfname = hf_bit6vflags;
2715 temp_values.bit7 = "Not Defined";
2716 temp_values.bit7hfname = hf_bit7vflags;
2717 temp_values.bit8 = "Not Defined";
2718 temp_values.bit8hfname = hf_bit8vflags;
2719 temp_values.bit9 = "Not Defined";
2720 temp_values.bit9hfname = hf_bit9vflags;
2721 temp_values.bit10 = "Not Defined";
2722 temp_values.bit10hfname = hf_bit10vflags;
2723 temp_values.bit11 = "Not Defined";
2724 temp_values.bit11hfname = hf_bit11vflags;
2725 temp_values.bit12 = "Not Defined";
2726 temp_values.bit12hfname = hf_bit12vflags;
2727 temp_values.bit13 = "Not Defined";
2728 temp_values.bit13hfname = hf_bit13vflags;
2729 temp_values.bit14 = "Not Defined";
2730 temp_values.bit14hfname = hf_bit14vflags;
2731 temp_values.bit15 = "Not Defined";
2732 temp_values.bit15hfname = hf_bit15vflags;
2733 temp_values.bit16 = "Not Defined";
2734 temp_values.bit16hfname = hf_bit16vflags;
2735 process_bitfield(atree, tvb, &temp_values);
2736 ioffset = ioffset + 4;
2737 value4 = tvb_get_letohl(tvb, ioffset);
2738 proto_tree_add_uint_format(atree, hf_es_seconds, tvb, ioffset,
2739 4, value4, "Seconds %d", value4);
2740 ioffset = ioffset + 4;
2741 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2742 proto_tree_add_item(atree, hf_nds_replica_num, tvb, ioffset,
2744 ioffset = ioffset + 2;
2745 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2746 proto_tree_add_item(atree, hf_nds_event_num, tvb, ioffset,
2748 ioffset = ioffset + 2;
2749 value5 = tvb_get_letohl(tvb, ioffset); /* length of field */
2750 if(value5 > tvb_length_remaining(tvb, ioffset))
2755 proto_tree_add_bytes(atree, hf_value_bytes, tvb, ioffset, value5, tvb_get_ptr(tvb, ioffset, value5));
2757 ioffset += (value5%2);
2762 for (i = 1 ; i <= values->vvalue; i++ )
2764 value1 = tvb_get_letohl(tvb, ioffset);
2765 values->vstring = match_strval(value1, nds_syntax);
2766 if (values->vstring == NULL)
2768 values->vstring = "No Syntax Found";
2770 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2771 4, values->vstring);
2772 ioffset = ioffset + 4;
2773 value2 = tvb_get_letohl(tvb, ioffset);
2774 ioffset = ioffset + 4;
2775 get_string(tvb, ioffset, value2, mval_buf.buffer);
2776 values->vstring = mval_buf.buffer;
2777 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2778 value2, values->vstring);
2779 ioffset = ioffset + value2;
2780 value3 = tvb_get_letohl(tvb, ioffset);
2782 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2783 value3, "Number of Values - %d", value3);
2785 ioffset = ioffset + 4;
2786 for (r = 1 ; r <= value3; r++ )
2788 ioffset += align_4(tvb, ioffset);
2789 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2790 temp_values.vlength = 2;
2791 temp_values.hfname = hf_nds_vflags;
2792 temp_values.voffset = ioffset;
2793 temp_values.vdesc = "Value Flags";
2794 temp_values.bit1 = "Naming";
2795 temp_values.bit1hfname = hf_bit1vflags;
2796 temp_values.bit2 = "Base Class";
2797 temp_values.bit2hfname = hf_bit2vflags;
2798 temp_values.bit3 = "Present";
2799 temp_values.bit3hfname = hf_bit3vflags;
2800 temp_values.bit4 = "Value Damaged";
2801 temp_values.bit4hfname = hf_bit4vflags;
2802 temp_values.bit5 = "Not Defined";
2803 temp_values.bit5hfname = hf_bit5vflags;
2804 temp_values.bit6 = "Not Defined";
2805 temp_values.bit6hfname = hf_bit6vflags;
2806 temp_values.bit7 = "Not Defined";
2807 temp_values.bit7hfname = hf_bit7vflags;
2808 temp_values.bit8 = "Not Defined";
2809 temp_values.bit8hfname = hf_bit8vflags;
2810 temp_values.bit9 = "Not Defined";
2811 temp_values.bit9hfname = hf_bit9vflags;
2812 temp_values.bit10 = "Not Defined";
2813 temp_values.bit10hfname = hf_bit10vflags;
2814 temp_values.bit11 = "Not Defined";
2815 temp_values.bit11hfname = hf_bit11vflags;
2816 temp_values.bit12 = "Not Defined";
2817 temp_values.bit12hfname = hf_bit12vflags;
2818 temp_values.bit13 = "Not Defined";
2819 temp_values.bit13hfname = hf_bit13vflags;
2820 temp_values.bit14 = "Not Defined";
2821 temp_values.bit14hfname = hf_bit14vflags;
2822 temp_values.bit15 = "Not Defined";
2823 temp_values.bit15hfname = hf_bit15vflags;
2824 temp_values.bit16 = "Not Defined";
2825 temp_values.bit16hfname = hf_bit16vflags;
2826 process_bitfield(ntree, tvb, &temp_values);
2827 ioffset = ioffset + 4;
2828 value1 = tvb_get_letohl(tvb, ioffset);
2829 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
2830 4, value1, "Seconds %d", value1);
2831 ioffset = ioffset + 4;
2832 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2833 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
2835 ioffset = ioffset + 2;
2836 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2837 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
2839 ioffset = ioffset + 2;
2840 value1 = tvb_get_letohl(tvb, ioffset);
2841 proto_tree_add_uint(ntree, hf_nds_value_len, tvb, ioffset,
2843 ioffset = ioffset + 4;
2852 case MVTYPE_ATTR_REQUEST2: /* Attribute Request */
2853 for (i = 1 ; i <= values->vvalue; i++ )
2855 ioffset += align_4(tvb, ioffset);
2856 value1 = tvb_get_letohl(tvb, ioffset);
2857 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
2858 4, value1, "Value %d", value1);
2859 ioffset = ioffset + value1;
2863 case MVTYPE_ADD_ATTR_REQUEST: /* Add Attribute Request */
2864 for (i = 1 ; i <= values->vvalue; i++ )
2866 value1 = tvb_get_letohl(tvb, ioffset);
2867 ioffset = ioffset + 4;
2868 get_string(tvb, ioffset, value1, mval_buf.buffer);
2869 values->vstring = mval_buf.buffer;
2870 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2871 value1, values->vstring);
2872 ioffset = ioffset + value1;
2873 ioffset += align_4(tvb, ioffset);
2874 values->voffset = ioffset;
2875 print_nds_values(ntree, tvb, 9, values);
2876 ioffset = values->voffset;
2880 case MVTYPE_READ_CLASS_REQ: /* Read Class Request */
2881 for (i = 1 ; i <= values->vvalue; i++ )
2883 ioffset += align_4(tvb, ioffset);
2884 value1 = tvb_get_letohl(tvb, ioffset);
2885 ioffset = ioffset + 4;
2886 get_string(tvb, ioffset, value1, mval_buf.buffer);
2887 values->vstring = mval_buf.buffer;
2888 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
2889 value1, values->vstring);
2891 ioffset = ioffset + value1;
2895 case MVTYPE_READ_REPLICAS: /* Read Replicas */
2896 for (i = 1 ; i <= values->vvalue; i++ )
2899 bvalue = 0x00000001;
2901 for (r = 0 ; r < 9; r++ )
2904 if (values->vflags & bvalue)
2908 case 0x00000001: /*p3values.bit1 = "Output Flags"*/
2909 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2910 temp_values.vlength = 2;
2911 temp_values.hfname = hf_nds_rflags;
2912 temp_values.voffset = ioffset;
2913 temp_values.vdesc = "Output Flags";
2914 temp_values.bit1 = values->bit1;
2915 temp_values.bit1hfname = hf_bit1outflags;
2916 temp_values.bit2 = values->bit2;
2917 temp_values.bit2hfname = hf_bit2outflags;
2918 temp_values.bit3 = values->bit3;
2919 temp_values.bit3hfname = hf_bit3outflags;
2920 temp_values.bit4 = values->bit4;
2921 temp_values.bit4hfname = hf_bit4outflags;
2922 temp_values.bit5 = values->bit5;
2923 temp_values.bit5hfname = hf_bit5outflags;
2924 temp_values.bit6 = values->bit6;
2925 temp_values.bit6hfname = hf_bit6outflags;
2926 temp_values.bit7 = values->bit7;
2927 temp_values.bit7hfname = hf_bit7outflags;
2928 temp_values.bit8 = values->bit8;
2929 temp_values.bit8hfname = hf_bit8outflags;
2930 temp_values.bit9 = values->bit9;
2931 temp_values.bit9hfname = hf_bit9outflags;
2932 temp_values.bit10 = "Not Defined";
2933 temp_values.bit10hfname = hf_bit10outflags;
2934 temp_values.bit11 = "Not Defined";
2935 temp_values.bit11hfname = hf_bit11outflags;
2936 temp_values.bit12 = "Not Defined";
2937 temp_values.bit12hfname = hf_bit12outflags;
2938 temp_values.bit13 = "Not Defined";
2939 temp_values.bit13hfname = hf_bit13outflags;
2940 temp_values.bit14 = "Not Defined";
2941 temp_values.bit14hfname = hf_bit14outflags;
2942 temp_values.bit15 = "Not Defined";
2943 temp_values.bit15hfname = hf_bit15outflags;
2944 temp_values.bit16 = "Not Defined";
2945 temp_values.bit16hfname = hf_bit16outflags;
2946 process_bitfield(ntree, tvb, &temp_values);
2947 ioffset = ioffset + 4;
2949 case 0x00000002: /*p3values.bit2 = "Entry ID"*/
2950 value1 = tvb_get_letohl(tvb, ioffset);
2951 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
2952 4, value1, "Entry ID %08x", value1);
2953 ioffset = ioffset + 4;
2955 case 0x00000004: /*p3values.bit3 = "Replica State"*/
2956 value1 = tvb_get_letohl(tvb, ioffset);
2957 temp_values.vstring = match_strval(value1, nds_replica_state);
2958 if (temp_values.vstring == NULL)
2960 temp_values.vstring = "No Replica State Found";
2962 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
2963 4, temp_values.vstring);
2964 ioffset = ioffset + 4;
2966 case 0x0000008: /*p3values.bit4 = "Modification Timestamp"*/
2967 value1 = tvb_get_letohl(tvb, ioffset);
2968 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
2969 4, value1, "Seconds %d", value1);
2970 ioffset = ioffset + 4;
2971 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2972 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
2974 ioffset = ioffset + 2;
2975 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2976 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
2978 ioffset = ioffset + 2;
2980 case 0x00000010: /*p3values.bit5 = "Purge Time"*/
2981 value1 = tvb_get_letohl(tvb, ioffset);
2982 proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset,
2983 4, value1, "Purge Time %d", value1);
2984 ioffset = ioffset + 4;
2986 case 0x00000020: /*p3values.bit6 = "Local Partition ID"*/
2987 value1 = tvb_get_letohl(tvb, ioffset);
2988 proto_tree_add_uint_format(ntree, hf_nds_local_partition, tvb, ioffset,
2989 4, value1, "Local Partition ID %08x", value1);
2990 ioffset = ioffset + 4;
2992 case 0x00000040: /*p3values.bit7 = "Distinguished Name"*/
2993 value1 = tvb_get_letohl(tvb, ioffset);
2994 ioffset = ioffset + 4;
2995 get_string(tvb, ioffset, value1, mval_buf.buffer);
2996 temp_values.vstring = mval_buf.buffer;
2997 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
2998 value1, temp_values.vstring);
2999 ioffset = ioffset + value1;
3001 case 0x00000080: /*p3values.bit8 = "Replica Type & State"*/
3002 value1 = tvb_get_letohl(tvb, ioffset);
3003 value2 = value1 & 0x00ff;
3004 temp_values.vstring = match_strval(value2, nds_replica_type);
3005 if (temp_values.vstring == NULL)
3007 temp_values.vstring = "No Replica Type Found";
3009 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
3010 4, temp_values.vstring);
3011 value3 = value1 & 0xff00;
3012 temp_values.vstring = match_strval(value3, nds_replica_state);
3013 if (temp_values.vstring == NULL)
3015 temp_values.vstring = "No Replica State Found";
3017 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
3018 4, temp_values.vstring);
3019 ioffset = ioffset + 4;
3021 case 0x00000100: /*p3values.bit9 = "Partition Busy"*/
3022 value1 = tvb_get_letohs(tvb, ioffset);
3023 proto_tree_add_boolean(ntree, hf_partition_busy, tvb, ioffset, 4, value1);
3032 ioffset += align_4(tvb, ioffset);
3033 if(tvb_length_remaining(tvb, ioffset) < 4 )
3038 if(tvb_length_remaining(tvb, ioffset) < 4 )
3045 case MVTYPE_MODIFY_ATTR_REQUEST: /* Modify Attribute Request */
3046 for (i = 0 ; i < values->vvalue; i++ )
3048 ioffset += align_4(tvb, ioffset);
3049 value1 = tvb_get_letohl(tvb, ioffset);
3050 valuestr = match_strval(value1, nds_kind_of_changes);
3051 if (valuestr == NULL)
3053 valuestr="(Kind Change Not Found)";
3055 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
3056 values->vlength, value1, valuestr, value1);
3057 ioffset = ioffset+4;
3058 value2 = tvb_get_letohl(tvb, ioffset);
3059 ioffset = ioffset + 4;
3060 get_string(tvb, ioffset, value2, mval_buf.buffer); /* Name of Attribute */
3061 temp_values.vstring = mval_buf.buffer;
3062 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
3063 value2, temp_values.vstring);
3064 ioffset = ioffset + value2;
3065 ioffset += align_4(tvb, ioffset);
3066 if(value1 != 1 && value1 != 6)
3068 values->voffset = ioffset;
3069 print_nds_values(ntree, tvb, 9, values);
3070 ioffset = values->voffset;
3075 case MVTYPE_ADDR_REFERRAL_REQUEST: /* Address Referral Request */
3076 for (i = 0 ; i < values->vvalue; i++ )
3079 value1 = tvb_get_letohl(tvb, ioffset);
3080 valuestr = match_strval(value1, nds_protocol_type);
3081 if (valuestr == NULL)
3083 valuestr="(Undefined Protocol)";
3085 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
3086 values->vlength, value1, valuestr, value1);
3087 ioffset = ioffset+4;
3091 case MVTYPE_ADDR_REFERRAL_REPLY: /* Address Referral Reply */
3092 number_of_referrals = values->vvalue;
3094 for (r = 1 ; r <= number_of_referrals; r++ )
3096 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, 6, 0,
3097 r, "NDS Referral Record #%u", r);
3098 atree = proto_item_add_subtree(aitem, ett_nds);
3100 value1 = tvb_get_letohl(tvb, ioffset);
3102 proto_tree_add_uint_format(atree, hf_referral_addcount, tvb, ioffset, 4,
3103 value1, "Number of Addresses in Referral - %d", value1);
3105 ioffset = ioffset + 4;
3106 for (i = 1 ; i <= value1; i++ )
3108 value2 = tvb_get_letohl(tvb, ioffset);
3109 valuestr = match_strval(value2, nds_protocol_type);
3110 if (valuestr == NULL)
3112 valuestr="(Undefined Protocol)";
3114 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
3115 values->vlength, value2, valuestr, value2);
3116 ioffset = ioffset+4;
3117 value3 = tvb_get_letohl(tvb, ioffset);
3118 ioffset = ioffset+4;
3122 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
3123 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
3124 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
3127 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3128 value4 = tvb_get_letohl(tvb, ioffset+2);
3129 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4);
3132 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3133 value4 = tvb_get_letohl(tvb, ioffset+2);
3134 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4);
3137 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3138 value4 = tvb_get_letohl(tvb, ioffset+2);
3139 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4);
3142 get_string(tvb, ioffset, value3, values->vstring);
3143 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
3144 value3, values->vstring);
3149 ioffset = ioffset + value3;
3150 ioffset += align_4(tvb, ioffset);
3156 case MVTYPE_LOC_ADDR_REFERRAL_REPLY: /* Local Address Referral Reply */
3157 number_of_referrals = values->vvalue;
3159 for (r = 1 ; r <= number_of_referrals; r++ )
3161 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, 6, 0,
3162 r, "NDS Referral Record #%u", r);
3163 atree = proto_item_add_subtree(aitem, ett_nds);
3165 value2 = tvb_get_letohl(tvb, ioffset);
3166 valuestr = match_strval(value2, nds_protocol_type);
3167 if (valuestr == NULL)
3169 valuestr="(Undefined Protocol)";
3171 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
3172 values->vlength, value2, valuestr, value2);
3173 ioffset = ioffset+4;
3174 value3 = tvb_get_letohl(tvb, ioffset);
3175 ioffset = ioffset+4;
3180 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
3181 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
3182 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
3185 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3187 value4 = tvb_get_letohl(tvb, ioffset);
3188 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset, 4, value4);
3191 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3193 value4 = tvb_get_letohl(tvb, ioffset);
3194 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset, 4, value4);
3197 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3199 value4 = tvb_get_letohl(tvb, ioffset);
3200 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset, 4, value4);
3203 get_string(tvb, ioffset, value3, values->vstring);
3204 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
3205 value3, values->vstring);
3210 ioffset = ioffset + value3;
3211 ioffset += align_4(tvb, ioffset);
3215 case MVTYPE_PROC_ENTRY_SPECIFIERS: /* Process Entry Specifiers */
3216 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3217 values->vstring = match_strval(value2, es_type);
3218 if (values->vstring == NULL)
3220 values->vstring = "No ES Type Found";
3222 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
3223 4, values->vstring, "Output Entry Specifier - %s", values->vstring);
3224 estree = proto_item_add_subtree(esitem, ett_nds);
3225 ioffset = ioffset + 4;
3226 ioffset = print_es_type(estree, tvb, values, value2, ioffset);
3227 value3 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3228 values->vstring = match_strval(value3, es_type);
3229 if (values->vstring == NULL)
3231 values->vstring = "No ES Type Found";
3233 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
3234 4, values->vstring, "Input Entry Specifier - %s", values->vstring);
3235 estree = proto_item_add_subtree(esitem, ett_nds);
3236 ioffset = ioffset + 4;
3237 ioffset = print_es_type(estree, tvb, values, value3, ioffset);
3238 value4 = tvb_get_letohl(tvb, ioffset);
3239 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, ioffset, 4,
3240 value4, "Referral Protocols - %d", value4);
3241 atree = proto_item_add_subtree(aitem, ett_nds);
3243 for (i = 0 ; i < value4; i++ )
3245 value5 = tvb_get_letohl(tvb, ioffset);
3246 valuestr = match_strval(value5, nds_protocol_type);
3247 if (valuestr == NULL)
3249 valuestr="(Undefined Protocol)";
3251 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
3252 4, valuestr, "Protocol -> %s", valuestr);
3253 ioffset = ioffset+4;
3255 value6 = tvb_get_letohl(tvb, ioffset);
3256 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, ioffset, 4,
3257 value6, "Tree Walking Protocols - %d", value6);
3258 atree = proto_item_add_subtree(aitem, ett_nds);
3260 for (i = 0 ; i < value6; i++ )
3262 value7 = tvb_get_letohl(tvb, ioffset);
3263 valuestr = match_strval(value7, nds_protocol_type);
3264 if (valuestr == NULL)
3266 valuestr="(Undefined Protocol)";
3268 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
3269 4, valuestr, "Protocol -> %s", valuestr);
3270 ioffset = ioffset+4;
3274 case MVTYPE_PRINT_TIMESTAMP: /* Print Timestamp */
3275 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3276 proto_tree_add_item(ncp_tree, hf_nds_replica_num, tvb, ioffset,
3278 ioffset = ioffset + 2;
3279 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3280 proto_tree_add_item(ncp_tree, hf_nds_event_num, tvb, ioffset,
3282 ioffset = ioffset + 2;
3285 case MVTYPE_LIST_PARTITIONS: /* List Partitions */
3286 number_of_referrals = values->vvalue;
3287 for (i = 0; i < number_of_referrals; i++)
3289 bvalue = 0x00000001;
3291 for (r = 0 ; r < 32; r++ )
3293 if (values->vflags & bvalue)
3297 case 0x00000001: /* Information Flags */
3298 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
3299 temp_values.vtype = VTYPE_BITFIELD;
3300 temp_values.vstring = mval_buf.buffer;
3301 temp_values.vdesc = "Information Flags (low) Byte:";
3302 temp_values.vlength = 2;
3303 temp_values.hfname= hf_nds_rflags;
3304 temp_values.voffset = ioffset;
3305 temp_values.bit1 = "Output Flags";
3306 temp_values.bit1hfname = hf_bit1infoflagsl;
3307 temp_values.bit2 = "Entry ID";
3308 temp_values.bit2hfname = hf_bit2infoflagsl;
3309 temp_values.bit3 = "Entry Flags";
3310 temp_values.bit3hfname = hf_bit3infoflagsl;
3311 temp_values.bit4 = "Subordinate Count";
3312 temp_values.bit4hfname = hf_bit4infoflagsl;
3313 temp_values.bit5 = "Modification Time";
3314 temp_values.bit5hfname = hf_bit5infoflagsl;
3315 temp_values.bit6 = "Modification Timestamp";
3316 temp_values.bit6hfname = hf_bit6infoflagsl;
3317 temp_values.bit7 = "Creation Timestamp";
3318 temp_values.bit7hfname = hf_bit7infoflagsl;
3319 temp_values.bit8 = "Partition Root ID";
3320 temp_values.bit8hfname = hf_bit8infoflagsl;
3321 temp_values.bit9 = "Parent ID";
3322 temp_values.bit9hfname = hf_bit9infoflagsl;
3323 temp_values.bit10 = "Revision Count";
3324 temp_values.bit10hfname = hf_bit10infoflagsl;
3325 temp_values.bit11 = "Replica Type";
3326 temp_values.bit11hfname = hf_bit11infoflagsl;
3327 temp_values.bit12 = "Base Class";
3328 temp_values.bit12hfname = hf_bit12infoflagsl;
3329 temp_values.bit13 = "Relative Distinguished Name";
3330 temp_values.bit13hfname = hf_bit13infoflagsl;
3331 temp_values.bit14 = "Distinguished Name";
3332 temp_values.bit14hfname = hf_bit14infoflagsl;
3333 temp_values.bit15 = "Root Distinguished Name";
3334 temp_values.bit15hfname = hf_bit15infoflagsl;
3335 temp_values.bit16 = "Parent Distinguished Name";
3336 temp_values.bit16hfname = hf_bit16infoflagsl;
3337 process_bitfield(ntree, tvb, &temp_values);
3338 ioffset = ioffset+2;
3339 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
3340 temp_values.vtype = VTYPE_BITFIELD;
3341 temp_values.vstring = mval_buf.buffer;
3342 temp_values.vdesc = "Information Flags (high) Byte:";
3343 temp_values.vlength = 2;
3344 temp_values.hfname= hf_nds_rflags;
3345 temp_values.voffset = ioffset;
3346 temp_values.bit1 = "Purge Time";
3347 temp_values.bit1hfname = hf_bit1infoflagsh;
3348 temp_values.bit2 = "Dereference Base Class";
3349 temp_values.bit2hfname = hf_bit2infoflagsh;
3350 temp_values.bit3 = "Not Defined";
3351 temp_values.bit3hfname = hf_bit3infoflagsh;
3352 temp_values.bit4 = "Not Defined";
3353 temp_values.bit4hfname = hf_bit4infoflagsh;
3354 temp_values.bit5 = "Not Defined";
3355 temp_values.bit5hfname = hf_bit5infoflagsh;
3356 temp_values.bit6 = "Not Defined";
3357 temp_values.bit6hfname = hf_bit6infoflagsh;
3358 temp_values.bit7 = "Not Defined";
3359 temp_values.bit7hfname = hf_bit7infoflagsh;
3360 temp_values.bit8 = "Not Defined";
3361 temp_values.bit8hfname = hf_bit8infoflagsh;
3362 temp_values.bit9 = "Not Defined";
3363 temp_values.bit9hfname = hf_bit9infoflagsh;
3364 temp_values.bit10 = "Not Defined";
3365 temp_values.bit10hfname = hf_bit10infoflagsh;
3366 temp_values.bit11 = "Not Defined";
3367 temp_values.bit11hfname = hf_bit11infoflagsh;
3368 temp_values.bit12 = "Not Defined";
3369 temp_values.bit12hfname = hf_bit12infoflagsh;
3370 temp_values.bit13 = "Not Defined";
3371 temp_values.bit13hfname = hf_bit13infoflagsh;
3372 temp_values.bit14 = "Not Defined";
3373 temp_values.bit14hfname = hf_bit14infoflagsh;
3374 temp_values.bit15 = "Not Defined";
3375 temp_values.bit15hfname = hf_bit15infoflagsh;
3376 temp_values.bit16 = "Not Defined";
3377 temp_values.bit16hfname = hf_bit16infoflagsh;
3378 process_bitfield(ntree, tvb, &temp_values);
3379 ioffset = ioffset+2;
3381 case 0x00000002: /* Entry ID */
3382 value1 = tvb_get_letohl(tvb, ioffset);
3383 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
3384 4, value1, "Entry ID %08x", value1);
3385 ioffset = ioffset + 4;
3387 case 0x00000004: /* Entry Flags */
3388 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
3389 temp_values.vtype = VTYPE_BITFIELD;
3390 temp_values.vstring = mval_buf.buffer;
3391 temp_values.vdesc = "Entry Flags:";
3392 temp_values.vlength = 2;
3393 temp_values.hfname= hf_nds_eflags;
3394 temp_values.voffset = ioffset;
3395 temp_values.bit1 = "Alias Entry";
3396 temp_values.bit1hfname = hf_bit1eflags;
3397 temp_values.bit2 = "Partition Root";
3398 temp_values.bit2hfname = hf_bit2eflags;
3399 temp_values.bit3 = "Container Entry";
3400 temp_values.bit3hfname = hf_bit3eflags;
3401 temp_values.bit4 = "Container Alias";
3402 temp_values.bit4hfname = hf_bit4eflags;
3403 temp_values.bit5 = "Matches List Filter";
3404 temp_values.bit5hfname = hf_bit5eflags;
3405 temp_values.bit6 = "Reference Entry";
3406 temp_values.bit6hfname = hf_bit6eflags;
3407 temp_values.bit7 = "40x Reference Entry";
3408 temp_values.bit7hfname = hf_bit7eflags;
3409 temp_values.bit8 = "Back Linked";
3410 temp_values.bit8hfname = hf_bit8eflags;
3411 temp_values.bit9 = "New Entry";
3412 temp_values.bit9hfname = hf_bit9eflags;
3413 temp_values.bit10 = "Temporary Reference";
3414 temp_values.bit10hfname = hf_bit10eflags;
3415 temp_values.bit11 = "Audited";
3416 temp_values.bit11hfname = hf_bit11eflags;
3417 temp_values.bit12 = "Entry Not Present";
3418 temp_values.bit12hfname = hf_bit12eflags;
3419 temp_values.bit13 = "Entry Verify CTS";
3420 temp_values.bit13hfname = hf_bit13eflags;
3421 temp_values.bit14 = "Entry Damaged";
3422 temp_values.bit14hfname = hf_bit14eflags;
3423 temp_values.bit15 = "Not Defined";
3424 temp_values.bit15hfname = hf_bit15eflags;
3425 temp_values.bit16 = "Not Defined";
3426 temp_values.bit16hfname = hf_bit16eflags;
3427 process_bitfield(ntree, tvb, &temp_values);
3428 ioffset = ioffset+4;
3430 case 0x0000008: /* Subordinate Count */
3431 value1 = tvb_get_letohl(tvb, ioffset);
3432 proto_tree_add_uint_format(ntree, hf_sub_count, tvb, ioffset,
3433 4, value1, "Subordinate Count %d", value1);
3434 ioffset = ioffset + 4;
3436 case 0x0000010: /* Modification Time */
3437 value1 = tvb_get_letohl(tvb, ioffset);
3438 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3439 4, value1, "Modification Time in Seconds %d", value1);
3440 ioffset = ioffset + 4;
3442 case 0x0000020: /* Modification Timestamp */
3443 value1 = tvb_get_letohl(tvb, ioffset);
3444 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3445 4, value1, "Modification Timestamp Seconds %d", value1);
3446 ioffset = ioffset + 4;
3447 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3448 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
3450 ioffset = ioffset + 2;
3451 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3452 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
3454 ioffset = ioffset + 2;
3456 case 0x0000040: /* Creation Timestamp */
3457 value1 = tvb_get_letohl(tvb, ioffset);
3458 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3459 4, value1, "Creation Timestamp Seconds %d", value1);
3460 ioffset = ioffset + 4;
3461 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3462 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
3464 ioffset = ioffset + 2;
3465 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3466 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
3468 ioffset = ioffset + 2;
3470 case 0x00000080: /* Partition Root ID */
3471 value1 = tvb_get_letohl(tvb, ioffset);
3472 proto_tree_add_uint_format(ntree, hf_nds_partition_root_id, tvb, ioffset,
3473 4, value1, "Partition Root ID %08x", value1);
3474 ioffset = ioffset + 4;
3476 case 0x00000100: /* Parent ID */
3477 value1 = tvb_get_letohl(tvb, ioffset);
3478 proto_tree_add_uint_format(ntree, hf_nds_parent, tvb, ioffset,
3479 4, value1, "Parent ID %08x", value1);
3480 ioffset = ioffset + 4;
3482 case 0x00000200: /* Revision Count */
3483 value1 = tvb_get_letohl(tvb, ioffset);
3484 proto_tree_add_uint_format(ntree, hf_nds_revision, tvb, ioffset,
3485 4, value1, "Revision Count %d", value1);
3486 ioffset = ioffset + 4;
3488 case 0x00000400: /* Replica Type & State */
3489 value1 = tvb_get_letohl(tvb, ioffset);
3490 value2 = value1 & 0x00ff;
3491 temp_values.vstring = match_strval(value2, nds_replica_type);
3492 if (temp_values.vstring == NULL)
3494 temp_values.vstring = "No Replica Type Found";
3496 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
3497 4, temp_values.vstring);
3498 value3 = value1 & 0xff00;
3499 temp_values.vstring = match_strval(value3, nds_replica_state);
3500 if (temp_values.vstring == NULL)
3502 temp_values.vstring = "No Replica State Found";
3504 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
3505 4, temp_values.vstring);
3506 ioffset = ioffset + 4;
3508 case 0x00000800: /* Base Class */
3509 value1 = tvb_get_letohl(tvb, ioffset);
3510 ioffset = ioffset + 4;
3511 get_string(tvb, ioffset, value1, mval_buf.buffer);
3512 temp_values.vstring = mval_buf.buffer;
3513 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
3514 value1, temp_values.vstring);
3515 ioffset = ioffset + value1;
3517 case 0x00001000: /* Relative Distinguished Name */
3518 value1 = tvb_get_letohl(tvb, ioffset);
3519 ioffset = ioffset + 4;
3520 get_string(tvb, ioffset, value1, mval_buf.buffer);
3521 temp_values.vstring = mval_buf.buffer;
3522 proto_tree_add_string(ntree, hf_nds_relative_dn, tvb, ioffset,
3523 value1, temp_values.vstring);
3524 ioffset = ioffset + value1;
3526 case 0x00002000: /* Distinguished Name */
3527 value1 = tvb_get_letohl(tvb, ioffset);
3528 ioffset = ioffset + 4;
3529 get_string(tvb, ioffset, value1, mval_buf.buffer);
3530 temp_values.vstring = mval_buf.buffer;
3531 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3532 value1, temp_values.vstring);
3533 ioffset = ioffset + value1;
3535 case 0x00004000: /* Root Distinguished Name */
3536 value1 = tvb_get_letohl(tvb, ioffset);
3537 ioffset = ioffset + 4;
3538 get_string(tvb, ioffset, value1, mval_buf.buffer);
3539 temp_values.vstring = mval_buf.buffer;
3540 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3541 value1, temp_values.vstring);
3542 ioffset = ioffset + value1;
3544 case 0x00008000: /* Parent Distinguished Name */
3545 value1 = tvb_get_letohl(tvb, ioffset);
3546 ioffset = ioffset + 4;
3547 get_string(tvb, ioffset, value1, mval_buf.buffer);
3548 temp_values.vstring = mval_buf.buffer;
3549 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3550 value1, temp_values.vstring);
3551 ioffset = ioffset + value1;
3553 case 0x00010000: /* Purge Time */
3554 value1 = tvb_get_letohl(tvb, ioffset);
3555 proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset,
3556 4, value1, "Purge Time %d", value1);
3557 ioffset = ioffset + 4;
3559 case 0x00020000: /* Dereference Base Class */
3560 value1 = tvb_get_letohl(tvb, ioffset);
3561 ioffset = ioffset + 4;
3562 get_string(tvb, ioffset, value1, mval_buf.buffer);
3563 temp_values.vstring = mval_buf.buffer;
3564 proto_tree_add_string(ntree, hf_deref_base, tvb, ioffset,
3565 value1, temp_values.vstring);
3566 ioffset = ioffset + value1;
3572 ioffset += align_4(tvb, ioffset);
3575 if(tvb_length_remaining(tvb, ioffset) < 4 )
3580 if(tvb_length_remaining(tvb, ioffset) < 4 )
3587 case MVTYPE_CLASS_NAMES: /* Class Names */
3588 number_of_referrals = values->vvalue;
3589 for (i = 0; i < number_of_referrals; i++)
3591 ioffset += align_4(tvb, ioffset);
3592 value1 = tvb_get_letohl(tvb, ioffset);
3593 ioffset = ioffset + 4;
3594 get_string(tvb, ioffset, value1, mval_buf.buffer);
3595 temp_values.vstring = mval_buf.buffer;
3596 sub1item = proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset,
3597 value1, temp_values.vstring);
3598 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
3599 ioffset = ioffset + value1;
3600 ioffset += align_4(tvb, ioffset);
3601 if(values->vflags != 0)
3603 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
3604 temp_values.vtype = VTYPE_BITFIELD;
3605 temp_values.vstring = mval_buf.buffer;
3606 temp_values.vdesc = "Class Flags:";
3607 temp_values.vlength = 2;
3608 temp_values.hfname= hf_nds_cflags;
3609 temp_values.voffset = ioffset;
3610 temp_values.bit1 = "Ambiguous Containment";
3611 temp_values.bit1hfname = hf_bit1cflags;
3612 temp_values.bit2 = "Ambiguous Naming";
3613 temp_values.bit2hfname = hf_bit2cflags;
3614 temp_values.bit3 = "Class Definition Cannot be Removed";
3615 temp_values.bit3hfname = hf_bit3cflags;
3616 temp_values.bit4 = "Effective Class";
3617 temp_values.bit4hfname = hf_bit4cflags;
3618 temp_values.bit5 = "Container Class";
3619 temp_values.bit5hfname = hf_bit5cflags;
3620 temp_values.bit6 = "Not Defined";
3621 temp_values.bit6hfname = hf_bit6cflags;
3622 temp_values.bit7 = "Not Defined";
3623 temp_values.bit7hfname = hf_bit7cflags;
3624 temp_values.bit8 = "Not Defined";
3625 temp_values.bit8hfname = hf_bit8cflags;
3626 temp_values.bit9 = "Not Defined";
3627 temp_values.bit9hfname = hf_bit9cflags;
3628 temp_values.bit10 = "Not Defined";
3629 temp_values.bit10hfname = hf_bit10cflags;
3630 temp_values.bit11 = "Not Defined";
3631 temp_values.bit11hfname = hf_bit11cflags;
3632 temp_values.bit12 = "Not Defined";
3633 temp_values.bit12hfname = hf_bit12cflags;
3634 temp_values.bit13 = "Not Defined";
3635 temp_values.bit13hfname = hf_bit13cflags;
3636 temp_values.bit14 = "Not Defined";
3637 temp_values.bit14hfname = hf_bit14cflags;
3638 temp_values.bit15 = "Not Defined";
3639 temp_values.bit15hfname = hf_bit15cflags;
3640 temp_values.bit16 = "Not Defined";
3641 temp_values.bit16hfname = hf_bit16cflags;
3642 process_bitfield(sub1tree, tvb, &temp_values);
3643 ioffset = ioffset+4;
3644 if(values->vflags != 5)
3646 value1 = tvb_get_letohl(tvb, ioffset); /* length of field */
3647 if(value1 > tvb_length_remaining(tvb, ioffset))
3652 proto_tree_add_bytes(sub1tree, hf_nds_asn1, tvb, ioffset, value1, tvb_get_ptr(tvb, ioffset, value1));
3654 ioffset += (value1%2);
3656 if(values->vflags == 1 || values->vflags == 2 || values->vflags == 4)
3658 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
3659 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3660 4, value1, "Super Classes %d", value1);
3661 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3662 ioffset = ioffset + 4;
3663 for (r = 0; r < value1; r++)
3665 value2 = tvb_get_letohl(tvb, ioffset);
3666 ioffset = ioffset + 4;
3667 get_string(tvb, ioffset, value2, mval_buf.buffer);
3668 temp_values.vstring = mval_buf.buffer;
3669 proto_tree_add_string(sub2tree, hf_nds_super, tvb, ioffset,
3670 value2, temp_values.vstring);
3671 ioffset = ioffset + value2;
3672 ioffset += align_4(tvb, ioffset);
3674 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3675 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3676 4, value1, "Containment Classes %d", value1);
3677 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3678 ioffset = ioffset + 4;
3679 for (r = 0; r < value1; r++)
3681 value2 = tvb_get_letohl(tvb, ioffset);
3682 ioffset = ioffset + 4;
3683 get_string(tvb, ioffset, value2, mval_buf.buffer);
3684 temp_values.vstring = mval_buf.buffer;
3685 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3686 value2, temp_values.vstring);
3687 ioffset = ioffset + value2;
3688 ioffset += align_4(tvb, ioffset);
3690 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3691 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3692 4, value1, "Naming Attributes %d", value1);
3693 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3694 ioffset = ioffset + 4;
3695 for (r = 0; r < value1; r++)
3697 value2 = tvb_get_letohl(tvb, ioffset);
3698 ioffset = ioffset + 4;
3699 get_string(tvb, ioffset, value2, mval_buf.buffer);
3700 temp_values.vstring = mval_buf.buffer;
3701 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3702 value2, temp_values.vstring);
3703 ioffset = ioffset + value2;
3704 ioffset += align_4(tvb, ioffset);
3706 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3707 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3708 4, value1, "Mandatory Attributes %d", value1);
3709 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3710 ioffset = ioffset + 4;
3711 for (r = 0; r < value1; r++)
3713 value2 = tvb_get_letohl(tvb, ioffset);
3714 ioffset = ioffset + 4;
3715 get_string(tvb, ioffset, value2, mval_buf.buffer);
3716 temp_values.vstring = mval_buf.buffer;
3717 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3718 value2, temp_values.vstring);
3719 ioffset = ioffset + value2;
3720 ioffset += align_4(tvb, ioffset);
3722 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3723 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3724 4, value1, "Optional Attributes %d", value1);
3725 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3726 ioffset = ioffset + 4;
3727 for (r = 0; r < value1; r++)
3729 ioffset += align_4(tvb, ioffset);
3730 value2 = tvb_get_letohl(tvb, ioffset);
3731 ioffset = ioffset + 4;
3732 get_string(tvb, ioffset, value2, mval_buf.buffer);
3733 temp_values.vstring = mval_buf.buffer;
3734 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3735 value2, temp_values.vstring);
3736 ioffset = ioffset + value2;
3737 if(tvb_length_remaining(tvb, ioffset) < 4 )
3743 /*if(values->vflags == 2 || values->vflags == 4)*/ /* Class Definitions of Super Classes */
3744 if(values->vflags == 4) /* Class Definitions of Super Classes */
3746 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3747 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3748 4, value1, "Containment Classes %d", value1);
3749 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3750 ioffset = ioffset + 4;
3751 for (r = 0; r < value1; r++)
3753 value2 = tvb_get_letohl(tvb, ioffset);
3754 ioffset = ioffset + 4;
3755 get_string(tvb, ioffset, value2, mval_buf.buffer);
3756 temp_values.vstring = mval_buf.buffer;
3757 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3758 value2, temp_values.vstring);
3759 ioffset = ioffset + value2;
3760 ioffset += align_4(tvb, ioffset);
3762 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3763 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3764 4, value1, "Naming Attributes %d", value1);
3765 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3766 ioffset = ioffset + 4;
3767 for (r = 0; r < value1; r++)
3769 value2 = tvb_get_letohl(tvb, ioffset);
3770 ioffset = ioffset + 4;
3771 get_string(tvb, ioffset, value2, mval_buf.buffer);
3772 temp_values.vstring = mval_buf.buffer;
3773 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3774 value2, temp_values.vstring);
3775 ioffset = ioffset + value2;
3776 ioffset += align_4(tvb, ioffset);
3778 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3779 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3780 4, value1, "Mandatory Attributes %d", value1);
3781 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3782 ioffset = ioffset + 4;
3783 for (r = 0; r < value1; r++)
3785 value2 = tvb_get_letohl(tvb, ioffset);
3786 ioffset = ioffset + 4;
3787 get_string(tvb, ioffset, value2, mval_buf.buffer);
3788 temp_values.vstring = mval_buf.buffer;
3789 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3790 value2, temp_values.vstring);
3791 ioffset = ioffset + value2;
3792 ioffset += align_4(tvb, ioffset);
3794 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3795 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3796 4, value1, "Optional Attributes %d", value1);
3797 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3798 ioffset = ioffset + 4;
3799 for (r = 0; r < value1; r++)
3801 value2 = tvb_get_letohl(tvb, ioffset);
3802 ioffset = ioffset + 4;
3803 get_string(tvb, ioffset, value2, mval_buf.buffer);
3804 temp_values.vstring = mval_buf.buffer;
3805 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3806 value2, temp_values.vstring);
3807 ioffset = ioffset + value2;
3808 ioffset += align_4(tvb, ioffset);
3810 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
3811 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
3812 4, value1, "Default ACL %08x", value1);
3813 ioffset = ioffset + 4;
3814 if(tvb_length_remaining(tvb, ioffset) < 4 )
3819 if(values->vflags == 5) /* Base Class Definitions */
3821 value1 = tvb_get_letohl(tvb, ioffset); /* Creation Timestamp */
3822 proto_tree_add_uint_format(sub1tree, hf_es_seconds, tvb, ioffset,
3823 4, value1, "Creation Timestamp Seconds %d", value1);
3824 ioffset = ioffset + 4;
3825 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3826 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
3828 ioffset = ioffset + 2;
3829 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3830 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
3832 ioffset = ioffset + 2;
3833 value1 = tvb_get_letohl(tvb, ioffset); /* Modification Timestamp */
3834 proto_tree_add_uint_format(sub1tree, hf_es_seconds, tvb, ioffset,
3835 4, value1, "Modification Timestamp Seconds %d", value1);
3836 ioffset = ioffset + 4;
3837 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3838 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
3840 ioffset = ioffset + 2;
3841 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3842 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
3844 ioffset = ioffset + 2;
3845 /* Class Definition */
3846 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
3847 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3848 4, value1, "Super Classes %d", value1);
3849 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3850 ioffset = ioffset + 4;
3851 for (r = 0; r < value1; r++)
3853 value2 = tvb_get_letohl(tvb, ioffset);
3854 ioffset = ioffset + 4;
3855 get_string(tvb, ioffset, value2, mval_buf.buffer);
3856 temp_values.vstring = mval_buf.buffer;
3857 proto_tree_add_string(sub2tree, hf_nds_super, tvb, ioffset,
3858 value2, temp_values.vstring);
3859 ioffset = ioffset + value2;
3860 ioffset += align_4(tvb, ioffset);
3862 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3863 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3864 4, value1, "Containment Classes %d", value1);
3865 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3866 ioffset = ioffset + 4;
3867 for (r = 0; r < value1; r++)
3869 value2 = tvb_get_letohl(tvb, ioffset);
3870 ioffset = ioffset + 4;
3871 get_string(tvb, ioffset, value2, mval_buf.buffer);
3872 temp_values.vstring = mval_buf.buffer;
3873 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3874 value2, temp_values.vstring);
3875 ioffset = ioffset + value2;
3876 ioffset += align_4(tvb, ioffset);
3878 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3879 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3880 4, value1, "Naming Attributes %d", value1);
3881 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3882 ioffset = ioffset + 4;
3883 for (r = 0; r < value1; r++)
3885 value2 = tvb_get_letohl(tvb, ioffset);
3886 ioffset = ioffset + 4;
3887 get_string(tvb, ioffset, value2, mval_buf.buffer);
3888 temp_values.vstring = mval_buf.buffer;
3889 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3890 value2, temp_values.vstring);
3891 ioffset = ioffset + value2;
3892 ioffset += align_4(tvb, ioffset);
3894 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3895 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3896 4, value1, "Mandatory Attributes %d", value1);
3897 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3898 ioffset = ioffset + 4;
3899 for (r = 0; r < value1; r++)
3901 value2 = tvb_get_letohl(tvb, ioffset);
3902 ioffset = ioffset + 4;
3903 get_string(tvb, ioffset, value2, mval_buf.buffer);
3904 temp_values.vstring = mval_buf.buffer;
3905 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3906 value2, temp_values.vstring);
3907 ioffset = ioffset + value2;
3908 ioffset += align_4(tvb, ioffset);
3910 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3911 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3912 4, value1, "Optional Attributes %d", value1);
3913 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3914 ioffset = ioffset + 4;
3915 for (r = 0; r < value1; r++)
3917 value2 = tvb_get_letohl(tvb, ioffset);
3918 ioffset = ioffset + 4;
3919 get_string(tvb, ioffset, value2, mval_buf.buffer);
3920 temp_values.vstring = mval_buf.buffer;
3921 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3922 value2, temp_values.vstring);
3923 ioffset = ioffset + value2;
3924 ioffset += align_4(tvb, ioffset);
3926 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
3927 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
3928 4, value1, "Default ACL %08x", value1);
3929 ioffset = ioffset + 4;
3930 if(tvb_length_remaining(tvb, ioffset) < 4 )
3939 case MVTYPE_MODIFY_CLASS: /* Modify Class */
3940 for (i = 1 ; i <= values->vvalue; i++ ) /* Attribute Names to add*/
3942 ioffset += align_4(tvb, ioffset);
3943 value1 = tvb_get_letohl(tvb, ioffset);
3944 ioffset = ioffset + 4;
3945 get_string(tvb, ioffset, value1, mval_buf.buffer);
3946 values->vstring = mval_buf.buffer;
3947 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
3948 value1, values->vstring);
3949 ioffset = ioffset + value1;
3951 if(tvb_length_remaining(tvb, ioffset) < 4 )
3955 ioffset += align_4(tvb, ioffset);
3956 value1 = tvb_get_letohl(tvb, ioffset);
3957 proto_tree_add_uint_format(ntree, hf_nds_att_del, tvb, ioffset,
3958 4, value1, "Attribute Names to Delete %d", value1);
3959 ioffset = ioffset + 4;
3960 for (i = 1 ; i <= value1; i++ ) /* Attribute Names to delete*/
3962 ioffset += align_4(tvb, ioffset);
3963 value2 = tvb_get_letohl(tvb, ioffset);
3964 ioffset = ioffset + 4;
3965 get_string(tvb, ioffset, value2, mval_buf.buffer);
3966 values->vstring = mval_buf.buffer;
3967 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
3968 value2, values->vstring);
3969 ioffset = ioffset + value2;
3971 if(tvb_length_remaining(tvb, ioffset) < 4 )
3975 ioffset += align_4(tvb, ioffset);
3976 value1 = tvb_get_letohl(tvb, ioffset);
3977 proto_tree_add_uint_format(ntree, hf_nds_acl_add, tvb, ioffset,
3978 4, value1, "ACL Templates to Add %d", value1);
3979 ioffset = ioffset + 4;
3980 for (i = 1 ; i <= value1; i++ ) /* ACL templates to add*/
3982 ioffset += align_4(tvb, ioffset);
3983 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
3984 ioffset = ioffset + 4;
3985 get_string(tvb, ioffset, value2, mval_buf.buffer);
3986 values->vstring = mval_buf.buffer;
3987 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
3988 value2, values->vstring);
3989 ioffset = ioffset + value2;
3990 ioffset += align_4(tvb, ioffset);
3991 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
3992 ioffset = ioffset + 4;
3993 get_string(tvb, ioffset, value2, mval_buf.buffer);
3994 values->vstring = mval_buf.buffer;
3995 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
3996 value2, values->vstring);
3997 ioffset = ioffset + value2;
3998 ioffset += align_4(tvb, ioffset);
3999 value1 = tvb_get_letohl(tvb, ioffset);
4000 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
4001 4, value1, "Priviledges 0x%08x", value1);
4002 ioffset = ioffset + 4;
4004 if(tvb_length_remaining(tvb, ioffset) < 4 )
4008 ioffset += align_4(tvb, ioffset);
4009 value1 = tvb_get_letohl(tvb, ioffset);
4010 proto_tree_add_uint_format(ntree, hf_nds_acl_del, tvb, ioffset,
4011 4, value1, "ACL Templates to Delete %d", value1);
4012 ioffset = ioffset + 4;
4013 for (i = 1 ; i <= value1; i++ ) /* ACL templates to delete*/
4015 ioffset += align_4(tvb, ioffset);
4016 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
4017 ioffset = ioffset + 4;
4018 get_string(tvb, ioffset, value2, mval_buf.buffer);
4019 values->vstring = mval_buf.buffer;
4020 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
4021 value2, values->vstring);
4022 ioffset = ioffset + value2;
4023 ioffset += align_4(tvb, ioffset);
4024 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
4025 ioffset = ioffset + 4;
4026 get_string(tvb, ioffset, value2, mval_buf.buffer);
4027 values->vstring = mval_buf.buffer;
4028 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
4029 value2, values->vstring);
4030 ioffset = ioffset + value2;
4031 ioffset += align_4(tvb, ioffset);
4032 value1 = tvb_get_letohl(tvb, ioffset); /* Priviledges */
4033 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
4034 4, value1, "Priviledges 0x%08x", value1);
4035 ioffset = ioffset + 4;
4044 dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
4045 guint16 nw_connection, guint8 sequence,
4046 guint16 type, proto_tree *ncp_tree)
4048 guint8 func, subfunc = 0;
4049 gboolean requires_subfunc;
4050 gboolean has_length = TRUE;
4051 ncp_req_hash_value *request_value = NULL;
4052 const ncp_record *ncp_rec = NULL;
4053 conversation_t *conversation;
4054 ptvcursor_t *ptvc = NULL;
4055 proto_tree *temp_tree = NULL;
4056 gboolean run_req_cond = FALSE;
4057 gboolean run_info_str = FALSE;
4058 guint32 length_remaining;
4061 func = tvb_get_guint8(tvb, 6);
4063 requires_subfunc = ncp_requires_subfunc(func);
4064 has_length = ncp_has_length_parameter(func);
4065 if (requires_subfunc) {
4067 subfunc = tvb_get_guint8(tvb, 9);
4070 subfunc = tvb_get_guint8(tvb, 7);
4074 /* Determine which ncp_record to use. */
4076 case NCP_ALLOCATE_SLOT:
4077 length_remaining = tvb_length_remaining(tvb, 4);
4078 if (length_remaining > 4)
4080 testvar = tvb_get_ntohl(tvb, 4);
4081 if( testvar == 0x4c495020)
4083 ncp_rec = &ncplip_echo;
4087 ncp_rec = &ncp1111_request;
4092 ncp_rec = &ncp1111_request;
4095 case NCP_SERVICE_REQUEST:
4096 ncp_rec = ncp_record_find(func, subfunc);
4098 case NCP_DEALLOCATE_SLOT:
4099 ncp_rec = &ncp5555_request;
4101 case NCP_BROADCAST_SLOT:
4102 ncp_rec = &ncpbbbb_request;
4105 ncp_rec = &ncplip_echo;
4111 /* Fill in the INFO column. */
4112 if (check_col(pinfo->cinfo, COL_INFO)) {
4114 col_add_fstr(pinfo->cinfo, COL_INFO, "C %s", ncp_rec->name);
4117 if (requires_subfunc) {
4118 col_add_fstr(pinfo->cinfo, COL_INFO,
4119 "C Unknown Function %u %u (0x%02X/0x%02x)",
4120 func, subfunc, func, subfunc);
4123 col_add_fstr(pinfo->cinfo, COL_INFO,
4124 "C Unknown Function %u (0x%02x)",
4130 if (!pinfo->fd->flags.visited) {
4131 /* This is the first time we've looked at this packet.
4132 Keep track of the address and connection whence the request
4133 came, and the address and connection to which the request
4134 is being sent, so that we can match up calls with replies.
4135 (We don't include the sequence number, as we may want
4136 to have all packets over the same connection treated
4137 as being part of a single conversation so that we can
4138 let the user select that conversation to be displayed.) */
4139 conversation = find_conversation(&pinfo->src, &pinfo->dst,
4140 PT_NCP, nw_connection, nw_connection, 0);
4142 if (conversation == NULL) {
4143 /* It's not part of any conversation - create a new one. */
4144 conversation = conversation_new(&pinfo->src, &pinfo->dst,
4145 PT_NCP, nw_connection, nw_connection, 0);
4147 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
4148 request_value->req_frame_num = pinfo->fd->num;
4149 request_value->req_frame_time.secs=pinfo->fd->abs_secs;
4150 request_value->req_frame_time.nsecs=pinfo->fd->abs_usecs*1000;
4152 /* If this is the first time we're examining the packet,
4153 * check to see if this NCP type uses a "request condition".
4154 * If so, we have to build a proto_tree because request conditions
4155 * use display filters to work, and without a proto_tree,
4156 * display filters can't possibly work. If we already have
4157 * a proto_tree, then wonderful. If we don't, we need to build
4160 if (ncp_rec->req_cond_indexes) {
4161 run_req_cond = TRUE;
4163 /* Only create info string if COL_INFO is available. */
4164 if (ncp_rec->req_info_str && check_col(pinfo->cinfo, COL_INFO)) {
4165 run_info_str = TRUE;
4167 /* We also have to use a tree if we have to construct an info_str */
4168 if ((run_info_str || run_req_cond) && !ncp_tree) {
4171 temp_tree = proto_tree_create_root();
4172 proto_tree_set_visible(temp_tree, FALSE);
4173 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
4174 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
4180 /* If the dissection throws an exception, be sure to free
4181 * the temporary proto_tree that was created. Because of the
4182 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
4183 * block; it has to be in the same scope as the terminating
4184 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
4185 * call CLEANUP_POP and friends, but the value of temp_tree is
4186 * NULL if no cleanup is needed, and non-null if cleanup is needed. */
4187 CLEANUP_PUSH(free_proto_tree, temp_tree);
4189 /* Before the dissection, if we're saving data for a request
4190 * condition, we have to prime the proto tree using the
4191 * dfilter information */
4196 needed = ncp_rec->req_cond_indexes;
4198 while (*needed != -1) {
4199 dfilter = req_conds[*needed].dfilter;
4200 /* Prime the proto_tree with "interesting fields". */
4201 dfilter_prime_proto_tree(dfilter, ncp_tree);
4206 /* Before the dissection, if we need a field for the info_str,
4207 * prime the tree. */
4209 proto_tree_prime_hfid(ncp_tree, *ncp_rec->req_info_str->hf_ptr);
4212 conversation = find_conversation(&pinfo->src, &pinfo->dst,
4213 PT_NCP, nw_connection, nw_connection, 0);
4216 case NCP_BROADCAST_SLOT:
4220 case NCP_SERVICE_REQUEST:
4221 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
4222 func, "Function: %u (0x%02X), %s",
4223 func, func, ncp_rec ? ncp_rec->name : "Unknown");
4231 if (requires_subfunc) {
4233 proto_tree_add_item(ncp_tree, hf_ncp_length, tvb, 7,
4235 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 9, 1,
4236 subfunc, "SubFunction: %u (0x%02x)",
4238 ptvc = ptvcursor_new(ncp_tree, tvb, 10);
4241 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
4242 subfunc, "SubFunction: %u (0x%02x)",
4244 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
4248 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
4251 /* The group is not part of the packet, but it's useful
4252 * information to display anyway. */
4254 proto_tree_add_text(ncp_tree, tvb, 6, 1, "Group: %s",
4255 ncp_groups[ncp_rec->group]);
4258 if (ncp_rec && ncp_rec->request_ptvc) {
4259 clear_repeat_vars();
4260 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
4262 ptvcursor_free(ptvc);
4264 /* Now that the dissection is done, do we need to run
4265 * some display filters on the resulting tree in order
4266 * to save results for "request conditions" ? */
4272 results = g_new0(gboolean, NUM_REQ_CONDS);
4273 needed = ncp_rec->req_cond_indexes;
4275 while (*needed != -1) {
4276 /* ncp_tree is not a root proto_tree, but
4277 * dfilters will still work on it. */
4278 dfilter = req_conds[*needed].dfilter;
4279 results[*needed] = dfilter_apply(dfilter, ncp_tree);
4283 /* Save the results so the reply packet dissection
4285 request_value->req_cond_results = results;
4288 /* Construct the info string if necessary */
4292 char non_uni_string[1024];
4297 parray = proto_get_finfo_ptr_array(ncp_tree,
4298 *ncp_rec->req_info_str->hf_ptr);
4299 len = g_ptr_array_len(parray);
4303 col_set_str(pinfo->cinfo, COL_INFO, "C ");
4305 finfo = g_ptr_array_index(parray, 0);
4307 info_type = get_info_type((const gchar*) ncp_rec->req_info_str->first_string);
4309 if (info_type != 0) { /* Is this a string or not? */
4311 if (info_type == 1) { /* Is this bytes? */
4312 byte_string = bytes_to_str(fvalue_get(finfo->value), fvalue_length(finfo->value));
4313 col_append_fstr(pinfo->cinfo, COL_INFO,
4314 (const gchar*) ncp_rec->req_info_str->first_string,
4319 if (info_type == 2) { /* Is this a String? */
4320 uni_to_string(fvalue_get(finfo->value), fvalue_length(finfo->value), non_uni_string);
4321 col_append_fstr(pinfo->cinfo, COL_INFO,
4322 (const gchar*) ncp_rec->req_info_str->first_string,
4327 col_append_fstr(pinfo->cinfo, COL_INFO,
4328 (const gchar*) ncp_rec->req_info_str->first_string,
4329 fvalue_get(finfo->value));
4335 col_append_fstr(pinfo->cinfo, COL_INFO,
4336 (const gchar*) ncp_rec->req_info_str->first_string,
4337 fvalue_get_integer(finfo->value));
4341 for (i = 1; i < len; i++) {
4342 non_uni_string[0]='\0';
4343 finfo = g_ptr_array_index(parray, i);
4344 info_type = get_info_type((const gchar*) ncp_rec->req_info_str->repeat_string);
4346 if (info_type != 0) { /* Is this a string or not? */
4348 { /* Is this bytes? */
4349 byte_string = bytes_to_str(fvalue_get(finfo->value), fvalue_length(finfo->value));
4350 col_append_fstr(pinfo->cinfo, COL_INFO,
4351 (const gchar*) ncp_rec->req_info_str->repeat_string,
4356 if (info_type == 2) { /* Is this a String? */
4357 uni_to_string(fvalue_get(finfo->value), fvalue_length(finfo->value), non_uni_string);
4358 col_append_fstr(pinfo->cinfo, COL_INFO,
4359 (const gchar*) ncp_rec->req_info_str->repeat_string,
4364 col_append_fstr(pinfo->cinfo, COL_INFO,
4365 (const gchar*) ncp_rec->req_info_str->repeat_string,
4366 fvalue_get(finfo->value));
4372 col_append_fstr(pinfo->cinfo, COL_INFO,
4373 (const gchar*) ncp_rec->req_info_str->repeat_string,
4374 fvalue_get_integer(finfo->value));
4381 /* Free the temporary proto_tree */
4382 CLEANUP_CALL_AND_POP;
4388 dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
4389 guint16 nw_connection, guint8 sequence, guint16 type,
4390 proto_tree *ncp_tree)
4392 conversation_t *conversation = NULL;
4393 ncp_req_hash_value *request_value = NULL;
4394 ncp_req_eid_hash_value *request_eid_value = NULL;
4395 const ncp_record *ncp_rec = NULL;
4396 int *req_cond_results;
4397 guint8 completion_code=0;
4399 ptvcursor_t *ptvc = NULL;
4400 const char *error_string;
4401 guint32 nds_string_len = 0;
4402 guint8 ping_version = 0;
4403 guint32 nds_flags = 0;
4404 guint32 nds_offset = 0;
4405 nw_uni_t reply_buffer;
4406 char * verb_string="";
4407 guint32 nds_error_code = 0;
4408 guint32 nds_reply_buffer = 0;
4409 char * nds_error_string = NULL;
4412 char string_buffer[9][1024];
4413 gboolean resolve_eid=FALSE;
4414 guint32 global_eid=0;
4415 gboolean add_eid = FALSE;
4416 char global_object_name[256];
4420 strcpy(reply_buffer.buffer, "");
4421 strcpy(global_object_name, "");
4423 if (!pinfo->fd->flags.visited) {
4424 /* Find the conversation whence the request would have come. */
4425 conversation = find_conversation(&pinfo->src, &pinfo->dst,
4426 PT_NCP, nw_connection, nw_connection, 0);
4427 if (conversation != NULL) {
4428 /* find the record telling us the request made that caused
4430 request_value = ncp_hash_lookup(conversation, sequence);
4431 if (request_value) {
4432 ncp_rec = request_value->ncp_rec;
4434 p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
4436 /* else... we haven't seen an NCP Request for that conversation and sequence. */
4439 request_value = p_get_proto_data(pinfo->fd, proto_ncp);
4440 if (request_value) {
4441 ncp_rec = request_value->ncp_rec;
4445 if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
4446 if (ncp_rec && ncp_rec->func==0x68 &&
4447 (ncp_rec->subfunc==0x02 || ncp_rec->subfunc==0x01)) {
4448 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
4452 /* A completion code of 0 always means OK. Non-zero means failure,
4453 * but each non-zero value has a different meaning. And the same value
4454 * can have different meanings, depending on the ncp.func (and ncp.subfunc)
4456 completion_code = tvb_get_guint8(tvb, 6);
4457 if (completion_code == 0) {
4458 if(type == NCP_POSITIVE_ACK)
4460 error_string = "Server Busy, Request Being Processed";
4464 error_string = "OK";
4467 if (ncp_rec && ncp_rec->errors) {
4468 error_string = ncp_error_string(ncp_rec->errors, completion_code);
4471 error_string = "Not OK";
4474 if (type == NCP_SERVICE_REPLY && ncp_rec && ncp_rec->func==0x68 &&
4475 ncp_rec->subfunc==0x02)
4478 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
4480 nds_frag = tvb_get_letohl(tvb, nds_offset);
4481 if (nds_reply_buffer > 7)
4484 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4485 nds_error_string = match_strval(nds_error_code, nds_reply_errors);
4486 if (nds_error_string == NULL)
4489 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4490 nds_error_string = match_strval(nds_error_code, nds_reply_errors);*/
4491 nds_error_string = "NDS Error - No Definition Found";
4493 if (nds_error_string == NULL || nds_error_code == 0x00000000)
4495 if (nds_frag != 0xffffffff)
4497 nds_error_string = "NDS Fragment";
4501 nds_error_string = "Ok";
4507 if (check_col(pinfo->cinfo, COL_INFO)) {
4508 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
4509 type == NCP_SERVICE_REPLY ? "R" : "ACK",
4510 nds_error_string ? nds_error_string : error_string);
4514 if (request_value) {
4517 proto_tree_add_uint(ncp_tree, hf_ncp_req_frame_num, tvb, 0, 0,
4518 request_value->req_frame_num);
4519 ns.secs=pinfo->fd->abs_secs-request_value->req_frame_time.secs;
4520 ns.nsecs=pinfo->fd->abs_usecs*1000-request_value->req_frame_time.nsecs;
4522 ns.nsecs+=1000000000;
4525 proto_tree_add_time(ncp_tree, hf_ncp_req_frame_time, tvb, 0, 0, &ns);
4529 /* Put the func (and maybe subfunc) from the request packet
4530 * in the proto tree, but hidden. That way filters on ncp.func
4531 * or ncp.subfunc will find both the requests and the replies.
4534 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 0,
4535 ncp_rec->func, "Function: %u (0x%02X), %s",
4536 ncp_rec->func, ncp_rec->func, ncp_rec->name);
4537 if (ncp_requires_subfunc(ncp_rec->func)) {
4538 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 6, 0,
4539 ncp_rec->subfunc, "SubFunction: %u (0x%02x)",
4540 ncp_rec->subfunc, ncp_rec->subfunc);
4544 proto_tree_add_uint_format(ncp_tree, hf_ncp_completion_code, tvb, 6, 1,
4545 completion_code, "Completion Code: %d (0x%02x), %s",
4546 completion_code, completion_code, error_string);
4548 proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb, 7, 1, FALSE);
4551 * Unless this is a reply, that's all there is to parse.
4553 if (type != NCP_SERVICE_REPLY)
4556 /* Decode NDS Reply packets */
4558 if ((ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x01) && completion_code == 0) {
4559 ping_version = tvb_get_guint8(tvb, 8);
4560 proto_tree_add_item(ncp_tree, hf_ping_version, tvb, 8, 1, TRUE);
4561 if (ping_version == 9) {
4562 nds_string_len = tvb_get_ntohl(tvb, 9);
4563 nds_offset = nds_string_len+16;
4564 proto_tree_add_item(ncp_tree, hf_nds_tree_name, tvb, 16, nds_string_len, FALSE);
4565 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, FALSE);
4566 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, (nds_offset+4), 4, FALSE);
4567 proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, (nds_offset+8), 4, TRUE);
4571 nds_flags = request_value->req_nds_flags;
4572 bvalue = 0x00000001;
4574 for (i = 0 ; i < 32; i++ ) {
4575 if (nds_flags & bvalue)
4579 case 0x00000001: /* Supported Fields */
4580 pvalues[0].vvalue = tvb_get_letohs(tvb, nds_offset);
4581 pvalues[0].vtype = VTYPE_BITFIELD;
4582 pvalues[0].vstring = "";
4583 pvalues[0].vdesc = "Ping (low) Supported Fields:";
4584 pvalues[0].vlength = 2;
4585 pvalues[0].hfname= hf_nds_rflags;
4586 pvalues[0].voffset = nds_offset;
4587 pvalues[0].bit1 = "Supported Fields";
4588 pvalues[0].bit1hfname = hf_bit1pingflags1;
4589 pvalues[0].bit2 = "Depth";
4590 pvalues[0].bit2hfname = hf_bit2pingflags1;
4591 pvalues[0].bit3 = "Revision";
4592 pvalues[0].bit3hfname = hf_bit3pingflags1;
4593 pvalues[0].bit4 = "Flags";
4594 pvalues[0].bit4hfname = hf_bit4pingflags1;
4595 pvalues[0].bit5 = "Verification Flags";
4596 pvalues[0].bit5hfname = hf_bit5pingflags1;
4597 pvalues[0].bit6 = "Letter Version";
4598 pvalues[0].bit6hfname = hf_bit6pingflags1;
4599 pvalues[0].bit7 = "OS Version";
4600 pvalues[0].bit7hfname = hf_bit7pingflags1;
4601 pvalues[0].bit8 = "License Flags";
4602 pvalues[0].bit8hfname = hf_bit8pingflags1;
4603 pvalues[0].bit9 = "DS Time";
4604 pvalues[0].bit9hfname = hf_bit9pingflags1;
4605 pvalues[0].bit10 = "Not Defined";
4606 pvalues[0].bit10hfname = hf_bit10pingflags1;
4607 pvalues[0].bit11 = "Not Defined";
4608 pvalues[0].bit11hfname = hf_bit11pingflags1;
4609 pvalues[0].bit12 = "Not Defined";
4610 pvalues[0].bit12hfname = hf_bit12pingflags1;
4611 pvalues[0].bit13 = "Not Defined";
4612 pvalues[0].bit13hfname = hf_bit13pingflags1;
4613 pvalues[0].bit14 = "Not Defined";
4614 pvalues[0].bit14hfname = hf_bit14pingflags1;
4615 pvalues[0].bit15 = "Not Defined";
4616 pvalues[0].bit15hfname = hf_bit15pingflags1;
4617 pvalues[0].bit16 = "Not Defined";
4618 pvalues[0].bit16hfname = hf_bit16pingflags1;
4620 process_bitfield(ncp_tree, tvb, &pvalues[0]);
4623 pvalues[0].vvalue = tvb_get_letohs(tvb, nds_offset);
4624 pvalues[0].vtype = VTYPE_BITFIELD;
4625 pvalues[0].vstring = "";
4626 pvalues[0].vdesc = "Ping (high) Supported Fields:";
4627 pvalues[0].vlength = 2;
4628 pvalues[0].hfname= hf_nds_rflags;
4629 pvalues[0].voffset = nds_offset;
4630 pvalues[0].bit1 = "Sap Name";
4631 pvalues[0].bit1hfname = hf_bit1pingflags2;
4632 pvalues[0].bit2 = "Tree Name";
4633 pvalues[0].bit2hfname = hf_bit2pingflags2;
4634 pvalues[0].bit3 = "OS Name";
4635 pvalues[0].bit3hfname = hf_bit3pingflags2;
4636 pvalues[0].bit4 = "Hardware Name";
4637 pvalues[0].bit4hfname = hf_bit4pingflags2;
4638 pvalues[0].bit5 = "Vendor Name";
4639 pvalues[0].bit5hfname = hf_bit5pingflags2;
4640 pvalues[0].bit6 = "Not Defined";
4641 pvalues[0].bit6hfname = hf_bit6pingflags2;
4642 pvalues[0].bit7 = "Not Defined";
4643 pvalues[0].bit7hfname = hf_bit7pingflags2;
4644 pvalues[0].bit8 = "Not Defined";
4645 pvalues[0].bit8hfname = hf_bit8pingflags2;
4646 pvalues[0].bit9 = "Not Defined";
4647 pvalues[0].bit9hfname = hf_bit9pingflags2;
4648 pvalues[0].bit10 = "Not Defined";
4649 pvalues[0].bit10hfname = hf_bit10pingflags2;
4650 pvalues[0].bit11 = "Not Defined";
4651 pvalues[0].bit11hfname = hf_bit11pingflags2;
4652 pvalues[0].bit12 = "Not Defined";
4653 pvalues[0].bit12hfname = hf_bit12pingflags2;
4654 pvalues[0].bit13 = "Not Defined";
4655 pvalues[0].bit13hfname = hf_bit13pingflags2;
4656 pvalues[0].bit14 = "Not Defined";
4657 pvalues[0].bit14hfname = hf_bit14pingflags2;
4658 pvalues[0].bit15 = "Not Defined";
4659 pvalues[0].bit15hfname = hf_bit15pingflags2;
4660 pvalues[0].bit16 = "Not Defined";
4661 pvalues[0].bit16hfname = hf_bit16pingflags2;
4663 process_bitfield(ncp_tree, tvb, &pvalues[0]);
4667 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, TRUE);
4671 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, nds_offset, 4, TRUE);
4675 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
4676 pvalues[0].vtype = VTYPE_BITFIELD;
4677 pvalues[0].vstring = "";
4678 pvalues[0].vdesc = "Ping Flags:";
4679 pvalues[0].vlength = 4;
4680 pvalues[0].hfname= hf_nds_rflags;
4681 pvalues[0].voffset = nds_offset;
4682 pvalues[0].bit1 = "Root Most Master Replica";
4683 pvalues[0].bit1hfname = hf_bit1pingpflags1;
4684 pvalues[0].bit2 = "Time Synchronized";
4685 pvalues[0].bit2hfname = hf_bit2pingpflags1;
4686 pvalues[0].bit3 = "Not Defined";
4687 pvalues[0].bit3hfname = hf_bit3pingpflags1;
4688 pvalues[0].bit4 = "Not Defined";
4689 pvalues[0].bit4hfname = hf_bit4pingpflags1;
4690 pvalues[0].bit5 = "Not Defined";
4691 pvalues[0].bit5hfname = hf_bit5pingpflags1;
4692 pvalues[0].bit6 = "Not Defined";
4693 pvalues[0].bit6hfname = hf_bit6pingpflags1;
4694 pvalues[0].bit7 = "Not Defined";
4695 pvalues[0].bit7hfname = hf_bit7pingpflags1;
4696 pvalues[0].bit8 = "Not Defined";
4697 pvalues[0].bit8hfname = hf_bit8pingpflags1;
4698 pvalues[0].bit9 = "Not Defined";
4699 pvalues[0].bit9hfname = hf_bit9pingpflags1;
4700 pvalues[0].bit10 = "Not Defined";
4701 pvalues[0].bit10hfname = hf_bit10pingpflags1;
4702 pvalues[0].bit11 = "Not Defined";
4703 pvalues[0].bit11hfname = hf_bit11pingpflags1;
4704 pvalues[0].bit12 = "Not Defined";
4705 pvalues[0].bit12hfname = hf_bit12pingpflags1;
4706 pvalues[0].bit13 = "Not Defined";
4707 pvalues[0].bit13hfname = hf_bit13pingpflags1;
4708 pvalues[0].bit14 = "Not Defined";
4709 pvalues[0].bit14hfname = hf_bit14pingpflags1;
4710 pvalues[0].bit15 = "Not Defined";
4711 pvalues[0].bit15hfname = hf_bit15pingpflags1;
4712 pvalues[0].bit16 = "Not Defined";
4713 pvalues[0].bit16hfname = hf_bit16pingpflags1;
4715 process_bitfield(ncp_tree, tvb, &pvalues[0]);
4719 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
4720 pvalues[0].vtype = VTYPE_BITFIELD;
4721 pvalues[0].vstring = "";
4722 pvalues[0].vdesc = "Verification Flags:";
4723 pvalues[0].vlength = 4;
4724 pvalues[0].hfname= hf_nds_rflags;
4725 pvalues[0].voffset = nds_offset;
4726 pvalues[0].bit1 = "Checksum";
4727 pvalues[0].bit1hfname = hf_bit1pingvflags1;
4728 pvalues[0].bit2 = "CRC32";
4729 pvalues[0].bit2hfname = hf_bit2pingvflags1;
4730 pvalues[0].bit3 = "Not Defined";
4731 pvalues[0].bit3hfname = hf_bit3pingvflags1;
4732 pvalues[0].bit4 = "Not Defined";
4733 pvalues[0].bit4hfname = hf_bit4pingvflags1;
4734 pvalues[0].bit5 = "Not Defined";
4735 pvalues[0].bit5hfname = hf_bit5pingvflags1;
4736 pvalues[0].bit6 = "Not Defined";
4737 pvalues[0].bit6hfname = hf_bit6pingvflags1;
4738 pvalues[0].bit7 = "Not Defined";
4739 pvalues[0].bit7hfname = hf_bit7pingvflags1;
4740 pvalues[0].bit8 = "Not Defined";
4741 pvalues[0].bit8hfname = hf_bit8pingvflags1;
4742 pvalues[0].bit9 = "Not Defined";
4743 pvalues[0].bit9hfname = hf_bit9pingvflags1;
4744 pvalues[0].bit10 = "Not Defined";
4745 pvalues[0].bit10hfname = hf_bit10pingvflags1;
4746 pvalues[0].bit11 = "Not Defined";
4747 pvalues[0].bit11hfname = hf_bit11pingvflags1;
4748 pvalues[0].bit12 = "Not Defined";
4749 pvalues[0].bit12hfname = hf_bit12pingvflags1;
4750 pvalues[0].bit13 = "Not Defined";
4751 pvalues[0].bit13hfname = hf_bit13pingvflags1;
4752 pvalues[0].bit14 = "Not Defined";
4753 pvalues[0].bit14hfname = hf_bit14pingvflags1;
4754 pvalues[0].bit15 = "Not Defined";
4755 pvalues[0].bit15hfname = hf_bit15pingvflags1;
4756 pvalues[0].bit16 = "Not Defined";
4757 pvalues[0].bit16hfname = hf_bit16pingvflags1;
4759 process_bitfield(ncp_tree, tvb, &pvalues[0]);
4763 proto_tree_add_item(ncp_tree, hf_nds_letter_ver, tvb, nds_offset, 4, TRUE);
4767 proto_tree_add_item(ncp_tree, hf_nds_os_ver, tvb, nds_offset, 4, TRUE);
4771 proto_tree_add_item(ncp_tree, hf_nds_lic_flags, tvb, nds_offset, 4, TRUE);
4775 proto_tree_add_item(ncp_tree, hf_nds_ds_time, tvb, nds_offset, 4, TRUE);
4779 nds_string_len = tvb_get_letohl(tvb, nds_offset);
4781 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
4782 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "SAP Name: %s", reply_buffer.buffer);
4783 nds_offset += nds_string_len;
4784 nds_offset += align_4(tvb, nds_offset);
4788 nds_string_len = tvb_get_letohl(tvb, nds_offset);
4790 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
4791 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "NDS Tree Name: %s", reply_buffer.buffer);
4792 nds_offset += nds_string_len;
4793 nds_offset += align_4(tvb, nds_offset);
4796 nds_string_len = tvb_get_letohl(tvb, nds_offset);
4798 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
4799 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "OS Name: %s", reply_buffer.buffer);
4800 nds_offset += nds_string_len;
4801 nds_offset += align_4(tvb, nds_offset);
4804 nds_string_len = tvb_get_letohl(tvb, nds_offset);
4806 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
4807 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "Hardware Name: %s", reply_buffer.buffer);
4808 nds_offset += nds_string_len;
4809 nds_offset += align_4(tvb, nds_offset);
4812 nds_string_len = tvb_get_letohl(tvb, nds_offset);
4814 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
4815 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "Vendor Name: %s", reply_buffer.buffer);
4816 nds_offset += nds_string_len;
4817 nds_offset += align_4(tvb, nds_offset);
4863 if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x02)
4867 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
4868 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_size, tvb, nds_offset,
4869 4, nds_reply_buffer);
4871 nds_frag = tvb_get_letohl(tvb, nds_offset);
4872 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, nds_offset,
4875 if (nds_reply_buffer > 7)
4878 * XXX - is this present in
4879 * replies to continuation
4880 * messages? It doesn't appear to
4883 proto_tree_add_uint_format(ncp_tree, hf_nds_reply_error, tvb, nds_offset,
4884 4, nds_error_code, "NDS Completion Code: 0x%08x, %s",
4885 nds_error_code, nds_error_string);
4887 if (request_value && nds_error_code == 0x00000000 && nds_frag == 0xffffffff)
4890 for (i = 0; i < 9; i++) {
4891 pvalues[i].vtype = 0;
4892 pvalues[i].vvalue = 0;
4893 pvalues[i].vlength = 0;
4894 pvalues[i].voffset = 0;
4895 pvalues[i].hfname = 0;
4896 pvalues[i].vdesc = "";
4897 string_buffer[i][0] = '\0';
4898 pvalues[i].vstring = string_buffer[i];
4899 pvalues[i].mvtype = 0;
4901 switch (request_value->nds_request_verb)
4904 verb_string = "Resolve Name";
4905 if(request_value->nds_version == 0)
4907 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
4908 pvalues[0].vstring = match_strval(pvalues[0].vvalue, nds_tags);
4909 if(pvalues[0].vstring == NULL)
4911 pvalues[0].vstring = "No Tags Set";
4913 pvalues[0].vtype = VTYPE_STRING;
4914 pvalues[0].vdesc = "Tag: %s";
4915 pvalues[0].vlength = 4;
4916 pvalues[0].voffset = nds_offset;
4917 pvalues[0].hfname = hf_nds_tag_string;
4918 nds_offset = nds_offset+pvalues[0].vlength;
4919 switch(pvalues[0].vvalue)
4921 case 0: /* No Such Entry */
4923 case 1: /* Local Entry */
4924 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
4925 pvalues[1].vtype = VTYPE_UINT32;
4926 pvalues[1].vdesc = "Entry ID: 0x%08x";
4928 strcpy(global_object_name, request_value->object_name);
4929 global_eid = pvalues[1].vvalue;
4930 pvalues[1].vlength = 4;
4931 pvalues[1].voffset = nds_offset;
4932 pvalues[1].hfname = hf_nds_eid;
4933 nds_offset = nds_offset+pvalues[1].vlength;
4934 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
4935 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
4936 pvalues[2].vdesc = "Referral Records: %u";
4937 pvalues[2].vlength = 4;
4938 pvalues[2].voffset = nds_offset;
4939 pvalues[2].hfname = hf_nds_referrals;
4940 pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
4942 case 2: /* Remote Entry */
4943 nds_offset += 4; /* GUINT32 reserved field */
4944 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
4945 pvalues[1].vtype = VTYPE_UINT32;
4946 pvalues[1].vdesc = "Entry ID: 0x%08x";
4948 global_eid = pvalues[1].vvalue;
4949 strcpy(global_object_name, request_value->object_name);
4950 pvalues[1].vlength = 4;
4951 pvalues[1].voffset = nds_offset;
4952 pvalues[1].hfname = hf_nds_eid;
4953 nds_offset = nds_offset+pvalues[1].vlength;
4954 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
4955 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
4956 pvalues[2].vdesc = "Referral Records: %u";
4957 pvalues[2].vlength = 4;
4958 pvalues[2].voffset = nds_offset;
4959 pvalues[2].hfname = hf_nds_referrals;
4960 pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
4962 case 3: /* Alias Entry */
4963 pvalues[1].vtype = VTYPE_STRING;
4964 pvalues[1].vdesc = "Alias Name: %s";
4965 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
4966 pvalues[1].vvalue = 0;
4967 pvalues[1].vlength = 256;
4968 pvalues[1].vlength = tvb_get_letohl(tvb, nds_offset);
4969 if (pvalues[1].vlength == 0x00)
4971 pvalues[1].vtype = VTYPE_NONE;
4974 pvalues[1].voffset = nds_offset+4;
4976 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, pvalues[1].vstring);
4977 nds_offset += pvalues[1].vlength;
4978 nds_offset += align_4(tvb, nds_offset);
4979 pvalues[1].hfname= hf_nds_name;
4981 case 4: /* Referral Information */
4982 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
4983 pvalues[1].vtype = VTYPE_UINT32;
4984 pvalues[1].vdesc = "Distance Object is From Root: 0x%08x";
4985 pvalues[1].vlength = 4;
4986 pvalues[1].voffset = nds_offset;
4987 pvalues[1].hfname = hf_nds_eid;
4988 nds_offset = nds_offset+pvalues[1].vlength;
4989 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
4990 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
4991 pvalues[2].vdesc = "Referral Records: %u";
4992 pvalues[2].vlength = 4;
4993 pvalues[2].voffset = nds_offset;
4994 pvalues[2].hfname = hf_nds_depth;
4995 pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
4997 case 6: /* Entry and Referrals */
4998 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
4999 pvalues[1].vtype = VTYPE_UINT32;
5000 pvalues[1].vdesc = "Result Flags: 0x%08x";
5001 pvalues[1].vlength = 4;
5002 pvalues[1].voffset = nds_offset;
5003 pvalues[1].hfname = hf_nds_result_flags;
5004 nds_offset = nds_offset+pvalues[1].vlength;
5005 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5006 pvalues[2].vtype = VTYPE_UINT32;
5007 pvalues[2].vdesc = "Entry ID: 0x%08x";
5009 global_eid = pvalues[2].vvalue;
5010 strcpy(global_object_name, request_value->object_name);
5011 pvalues[2].vlength = 4;
5012 pvalues[2].voffset = nds_offset;
5013 pvalues[2].hfname = hf_nds_eid;
5014 nds_offset = nds_offset+pvalues[2].vlength;
5015 pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
5016 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
5017 pvalues[3].vdesc = "Referral Records: %u";
5018 pvalues[3].vlength = 4;
5019 pvalues[3].voffset = nds_offset;
5020 pvalues[3].mvtype = MVTYPE_ADDR_REFERRAL_REPLY;
5021 pvalues[3].hfname = hf_nds_referrals;
5029 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5030 pvalues[0].vtype = VTYPE_UINT32;
5031 pvalues[0].vdesc = "CRC: 0x%08x";
5032 pvalues[0].vlength = 4;
5033 pvalues[0].voffset = nds_offset;
5034 pvalues[0].hfname = hf_nds_crc;
5035 nds_offset = nds_offset+pvalues[0].vlength;
5036 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5037 pvalues[1].vstring = match_strval(pvalues[1].vvalue, nds_tags);
5038 if(pvalues[1].vstring == NULL)
5040 pvalues[1].vstring = "No Tags Set";
5042 pvalues[1].vtype = VTYPE_STRING;
5043 pvalues[1].vdesc = "Tag: %s";
5044 pvalues[1].vlength = 4;
5045 pvalues[1].voffset = nds_offset;
5046 nds_offset = nds_offset+pvalues[1].vlength;
5047 pvalues[1].hfname = hf_nds_tag_string;
5048 switch(pvalues[1].vvalue)
5050 case 0: /* No Such Entry */
5052 case 1: /* Local Entry */
5053 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5054 pvalues[2].vtype = VTYPE_UINT32;
5055 pvalues[2].vdesc = "Entry ID: 0x%08x";
5057 global_eid = pvalues[2].vvalue;
5058 strcpy(global_object_name, request_value->object_name);
5059 pvalues[2].vlength = 4;
5060 pvalues[2].voffset = nds_offset;
5061 pvalues[2].hfname = hf_nds_eid;
5062 nds_offset = nds_offset+pvalues[2].vlength;
5063 pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
5064 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
5065 pvalues[3].vdesc = "Referral Records: %u";
5066 pvalues[3].vlength = 4;
5067 pvalues[3].voffset = nds_offset;
5068 pvalues[3].hfname = hf_nds_referrals;
5069 pvalues[3].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
5071 case 2: /* Remote Entry */
5072 nds_offset += 4; /* GUINT32 reserved field */
5073 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5075 global_eid = pvalues[2].vvalue;
5076 strcpy(global_object_name, request_value->object_name);
5077 pvalues[2].vtype = VTYPE_UINT32;
5078 pvalues[2].vdesc = "Entry ID: 0x%08x";
5079 pvalues[2].vlength = 4;
5080 pvalues[2].voffset = nds_offset;
5081 pvalues[2].hfname = hf_nds_eid;
5082 nds_offset = nds_offset+pvalues[2].vlength;
5083 pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
5084 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
5085 pvalues[3].vdesc = "Referral Records: %u";
5086 pvalues[3].vlength = 4;
5087 pvalues[3].voffset = nds_offset;
5088 pvalues[3].hfname = hf_nds_referrals;
5089 pvalues[3].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
5091 case 3: /* Alias Entry */
5092 pvalues[2].vtype = VTYPE_STRING;
5093 pvalues[2].vdesc = "Alias Name: %s";
5094 pvalues[2].mvtype = MVTYPE_ATTR_REQUEST;
5095 pvalues[2].vvalue = 0;
5096 pvalues[2].vlength = 256;
5097 pvalues[2].vlength = tvb_get_letohl(tvb, nds_offset);
5098 if (pvalues[2].vlength == 0x00)
5100 pvalues[2].vtype = VTYPE_NONE;
5103 pvalues[2].voffset = nds_offset+4;
5105 get_string(tvb, pvalues[2].voffset, pvalues[2].vlength, pvalues[2].vstring);
5106 nds_offset += pvalues[2].vlength;
5107 nds_offset += align_4(tvb, nds_offset);
5108 pvalues[2].hfname= hf_nds_name;
5110 case 4: /* Referral Information */
5111 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5112 pvalues[2].vtype = VTYPE_UINT32;
5113 pvalues[2].vdesc = "Distance Object is From Root: 0x%08x";
5114 pvalues[2].vlength = 4;
5115 pvalues[2].voffset = nds_offset;
5116 pvalues[2].hfname = hf_nds_eid;
5117 nds_offset = nds_offset+pvalues[2].vlength;
5118 pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
5119 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
5120 pvalues[3].vdesc = "Referral Records: %u";
5121 pvalues[3].vlength = 4;
5122 pvalues[3].voffset = nds_offset;
5123 pvalues[3].hfname = hf_nds_depth;
5124 pvalues[3].mvtype = MVTYPE_ADDR_REFERRAL_REPLY;
5126 case 6: /* Entry and Referrals */
5127 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5128 pvalues[2].vtype = VTYPE_UINT32;
5129 pvalues[2].vdesc = "Result Flags: 0x%08x";
5130 pvalues[2].vlength = 4;
5131 pvalues[2].voffset = nds_offset;
5132 pvalues[2].hfname = hf_nds_result_flags;
5133 nds_offset = nds_offset+pvalues[2].vlength;
5134 pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
5135 pvalues[3].vtype = VTYPE_UINT32;
5136 pvalues[3].vdesc = "Entry ID: 0x%08x";
5138 strcpy(global_object_name, request_value->object_name);
5139 global_eid = pvalues[3].vvalue;
5140 pvalues[3].vlength = 4;
5141 pvalues[3].voffset = nds_offset;
5142 pvalues[3].hfname = hf_nds_eid;
5143 nds_offset = nds_offset+pvalues[3].vlength;
5144 pvalues[4].vvalue = tvb_get_letohl(tvb, nds_offset);
5145 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
5146 pvalues[4].vdesc = "Referral Records: %u";
5147 pvalues[4].vlength = 4;
5148 pvalues[4].voffset = nds_offset;
5149 pvalues[4].mvtype = MVTYPE_ADDR_REFERRAL_REPLY;
5150 pvalues[4].hfname = hf_nds_referrals;
5159 verb_string = "Read Entry Information";
5160 if(request_value->nds_version != 0x000000fe)
5162 pvalues[0].vvalue = 1;
5163 pvalues[0].vtype = VTYPE_MULTIVALUE_UINT32;
5164 pvalues[0].vdesc = "Entry Information";
5165 pvalues[0].vlength = 0;
5166 pvalues[0].voffset = nds_offset-4;
5167 pvalues[0].hfname = hf_nds_name;
5168 pvalues[0].mvtype = MVTYPE_LIST_PARTITIONS;
5169 pvalues[0].vflags = request_value->req_nds_flags;
5173 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5174 pvalues[0].vtype = VTYPE_UINT32;
5175 pvalues[0].vdesc = "CRC: 0x%08x";
5176 pvalues[0].vlength = 4;
5177 pvalues[0].voffset = nds_offset;
5178 pvalues[0].hfname = hf_nds_crc;
5179 nds_offset = nds_offset+pvalues[0].vlength;
5180 pvalues[1].vvalue = 1;
5181 pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
5182 pvalues[1].vdesc = "Entry Information";
5183 pvalues[1].vlength = 0;
5184 pvalues[1].voffset = nds_offset-4;
5185 pvalues[1].hfname = hf_nds_name;
5186 pvalues[1].mvtype = MVTYPE_LIST_PARTITIONS;
5187 pvalues[1].vflags = request_value->req_nds_flags;
5191 verb_string = "Read";
5192 if(request_value->nds_version != 0x000000fe)
5194 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5195 pvalues[0].vtype = VTYPE_UINT32;
5196 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
5197 pvalues[0].vlength = 4;
5198 pvalues[0].voffset = nds_offset;
5199 pvalues[0].hfname = hf_nds_iteration;
5200 nds_offset = nds_offset+pvalues[0].vlength;
5201 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5202 pvalues[1].vstring = match_strval(pvalues[1].vvalue, nds_info_type);
5203 if(pvalues[1].vstring == NULL)
5205 pvalues[1].vstring = "No Info Type Set";
5207 pvalues[1].vtype = VTYPE_STRING;
5208 pvalues[1].vdesc = "Info Type: %s";
5209 pvalues[1].vlength = 4;
5210 pvalues[1].voffset = nds_offset;
5211 pvalues[1].hfname = hf_nds_info_type;
5212 nds_offset = nds_offset+pvalues[1].vlength;
5213 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5214 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
5215 pvalues[2].vdesc = "Number of Attributes: %u";
5216 pvalues[2].vlength = 4;
5217 pvalues[2].voffset = nds_offset;
5218 pvalues[2].hfname = hf_nds_attr;
5219 pvalues[2].mvtype = MVTYPE_ATTR_REPLY;
5220 pvalues[2].vflags = request_value->req_nds_flags;
5221 pvalues[2].nds_version = request_value->nds_version;
5225 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5226 pvalues[0].vtype = VTYPE_UINT32;
5227 pvalues[0].vdesc = "CRC: 0x%08x";
5228 pvalues[0].vlength = 4;
5229 pvalues[0].voffset = nds_offset;
5230 pvalues[0].hfname = hf_nds_crc;
5231 nds_offset = nds_offset+pvalues[0].vlength;
5232 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5233 pvalues[1].vtype = VTYPE_UINT32;
5234 pvalues[1].vdesc = "Iteration Handle: 0x%08x";
5235 pvalues[1].vlength = 4;
5236 pvalues[1].voffset = nds_offset;
5237 pvalues[1].hfname = hf_nds_iteration;
5238 nds_offset = nds_offset+pvalues[1].vlength;
5239 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5240 pvalues[2].vstring = match_strval(pvalues[2].vvalue, nds_info_type);
5241 if(pvalues[2].vstring == NULL)
5243 pvalues[2].vstring = "No Info Type Set";
5245 pvalues[2].vtype = VTYPE_STRING;
5246 pvalues[2].vdesc = "Info Type: %s";
5247 pvalues[2].vlength = 4;
5248 pvalues[2].voffset = nds_offset;
5249 pvalues[2].hfname = hf_nds_info_type;
5250 nds_offset = nds_offset+pvalues[2].vlength;
5251 pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
5252 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
5253 pvalues[3].vdesc = "Number of Attributes: %u";
5254 pvalues[3].vlength = 4;
5255 pvalues[3].voffset = nds_offset;
5256 pvalues[3].hfname = hf_nds_attr;
5257 pvalues[3].mvtype = MVTYPE_ATTR_REPLY;
5258 pvalues[3].vflags = request_value->req_nds_flags;
5259 pvalues[3].nds_version = request_value->nds_version;
5263 verb_string = "Compare";
5264 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5265 if (pvalues[0].vvalue == 0x00000000)
5267 pvalues[0].vstring = "Did Not Match";
5271 pvalues[0].vstring = "Matched";
5273 pvalues[0].vtype = VTYPE_STRING;
5274 pvalues[0].vdesc = "Compare Values Returned - %s";
5275 pvalues[0].vlength = 4;
5276 pvalues[0].voffset = nds_offset;
5277 pvalues[0].mvtype = 0;
5278 pvalues[0].hfname= hf_nds_compare_results;
5279 nds_offset += pvalues[0].vlength;
5282 verb_string = "List";
5283 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5284 pvalues[0].vtype = VTYPE_UINT32;
5285 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
5286 pvalues[0].vlength = 4;
5287 pvalues[0].voffset = nds_offset;
5288 pvalues[0].hfname = hf_nds_iteration;
5289 nds_offset = nds_offset+pvalues[0].vlength;
5290 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5291 pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
5292 pvalues[1].vdesc = "Entry Information";
5293 pvalues[1].vlength = 0;
5294 pvalues[1].voffset = nds_offset;
5295 pvalues[1].hfname = hf_nds_name;
5296 pvalues[1].mvtype = MVTYPE_LIST_PARTITIONS;
5297 pvalues[1].vflags = request_value->req_nds_flags;
5300 verb_string = "Search Entries";
5303 verb_string = "Add Entry";
5306 verb_string = "Remove Entry";
5309 verb_string = "Modify Entry";
5312 verb_string = "Modify RDN";
5315 verb_string = "Define Attribute";
5318 verb_string = "Read Attribute Definition";
5321 verb_string = "Remove Attribute Definition";
5324 verb_string = "Define Class";
5327 verb_string = "Read Class Definition";
5328 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5329 pvalues[0].vtype = VTYPE_UINT32;
5330 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
5331 pvalues[0].vlength = 4;
5332 pvalues[0].voffset = nds_offset;
5333 pvalues[0].hfname = hf_nds_iteration;
5334 nds_offset = nds_offset+pvalues[0].vlength;
5335 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5336 pvalues[1].vstring = match_strval(pvalues[1].vvalue, class_def_type);
5337 if(pvalues[1].vstring == NULL)
5339 pvalues[1].vstring = "No Class Definition Type Set";
5341 pvalues[1].vtype = VTYPE_STRING;
5342 pvalues[1].vdesc = "Class Definition Type: %s";
5343 pvalues[1].vlength = 4;
5344 pvalues[1].voffset = nds_offset;
5345 pvalues[1].mvtype = 0;
5346 pvalues[1].hfname= hf_nds_class_def_type;
5347 nds_offset = nds_offset + pvalues[1].vlength;
5348 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);;
5349 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
5350 pvalues[2].vdesc = "Class Definitions %u";
5351 pvalues[2].vlength = 0;
5352 pvalues[2].voffset = nds_offset;
5353 pvalues[2].hfname = hf_nds_classes;
5354 pvalues[2].mvtype = MVTYPE_CLASS_NAMES;
5355 pvalues[2].vflags = request_value->req_nds_flags;
5358 verb_string = "Modify Class Definition";
5361 verb_string = "Remove Class Definition";
5364 verb_string = "List Containable Classes";
5365 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5366 pvalues[0].vtype = VTYPE_UINT32;
5367 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
5368 pvalues[0].vlength = 4;
5369 pvalues[0].voffset = nds_offset;
5370 pvalues[0].hfname = hf_nds_iteration;
5371 nds_offset = nds_offset+pvalues[0].vlength;
5372 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5373 pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
5374 pvalues[1].vdesc = "Classes: %u";
5375 pvalues[1].vlength = 4;
5376 pvalues[1].voffset = nds_offset;
5377 pvalues[1].mvtype = MVTYPE_READ_CLASS_REQ;
5378 pvalues[1].hfname= hf_nds_classes;
5381 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5382 pvalues[0].vtype = VTYPE_UINT32;
5383 pvalues[0].vdesc = "Privileges: 0x%08x";
5384 pvalues[0].vlength = 4;
5385 pvalues[0].voffset = nds_offset;
5386 pvalues[0].hfname = hf_nds_privileges;
5387 nds_offset = nds_offset+pvalues[0].vlength;
5390 verb_string = "Add Partition";
5393 verb_string = "Remove Partition";
5396 verb_string = "List Partitions";
5397 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5398 pvalues[0].vtype = VTYPE_UINT32;
5399 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
5400 pvalues[0].vlength = 4;
5401 pvalues[0].voffset = nds_offset;
5402 pvalues[0].hfname = hf_nds_iteration;
5403 nds_offset = nds_offset+pvalues[0].vlength;
5404 pvalues[1].vtype = VTYPE_STRING;
5405 pvalues[1].vdesc = "Server Distinguished Name: %s";
5406 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
5407 pvalues[1].vvalue = 0;
5408 pvalues[1].vlength = 256;
5409 pvalues[1].vlength = tvb_get_letohl(tvb, nds_offset);
5410 if (pvalues[1].vlength == 0x00)
5412 pvalues[1].vtype = VTYPE_NONE;
5415 pvalues[1].voffset = nds_offset+4;
5417 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, pvalues[1].vstring);
5418 nds_offset += pvalues[1].vlength;
5419 nds_offset += align_4(tvb, nds_offset);
5420 pvalues[1].hfname= hf_nds_name;
5421 nds_offset += align_4(tvb, nds_offset);
5422 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5423 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
5424 pvalues[2].vdesc = "Replicas: %u";
5425 pvalues[2].vlength = 4;
5426 pvalues[2].voffset = nds_offset;
5427 pvalues[2].hfname = hf_nds_replicas;
5428 pvalues[2].mvtype = MVTYPE_READ_REPLICAS;
5429 pvalues[2].bit1 = "Output Flags";
5430 pvalues[2].bit2 = "Entry ID";
5431 pvalues[2].bit3 = "Replica State";
5432 pvalues[2].bit4 = "Modification Timestamp";
5433 pvalues[2].bit5 = "Purge Time";
5434 pvalues[2].bit6 = "Local Partition ID";
5435 pvalues[2].bit7 = "Distinguished Name";
5436 pvalues[2].bit8 = "Replica Type";
5437 pvalues[2].bit9 = "Partition Busy";
5438 pvalues[2].vflags = request_value->req_nds_flags;
5441 verb_string = "Split Partition";
5444 verb_string = "Join Partitions";
5447 verb_string = "Add Replica";
5450 verb_string = "Remove Replica";
5453 verb_string = "Open Stream";
5454 pvalues[0].vvalue = tvb_get_ntohl(tvb, nds_offset);
5455 pvalues[0].vtype = VTYPE_UINT32;
5456 pvalues[0].vdesc = "File Handle: 0x%08x";
5457 pvalues[0].vlength = 4;
5458 pvalues[0].voffset = nds_offset;
5459 pvalues[0].hfname = hf_nds_file_handle;
5460 nds_offset = nds_offset+pvalues[0].vlength;
5461 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5462 pvalues[1].vtype = VTYPE_UINT32;
5463 pvalues[1].vdesc = "File Size: %u";
5464 pvalues[1].vlength = 4;
5465 pvalues[1].voffset = nds_offset;
5466 pvalues[1].hfname = hf_nds_file_size;
5467 nds_offset = nds_offset+pvalues[1].vlength;
5470 verb_string = "Search Filter";
5473 verb_string = "Create Subordinate Reference";
5476 verb_string = "Link Replica";
5479 verb_string = "Change Replica Type";
5482 verb_string = "Start Update Schema";
5485 verb_string = "End Update Schema";
5488 verb_string = "Update Schema";
5491 verb_string = "Start Update Replica";
5494 verb_string = "End Update Replica";
5497 verb_string = "Update Replica";
5500 verb_string = "Synchronize Partition";
5503 verb_string = "Synchronize Schema";
5506 verb_string = "Read Syntaxes";
5509 verb_string = "Get Replica Root ID";
5512 verb_string = "Begin Move Entry";
5515 verb_string = "Finish Move Entry";
5518 verb_string = "Release Moved Entry";
5521 verb_string = "Backup Entry";
5524 verb_string = "Restore Entry";
5527 verb_string = "Save DIB";
5530 verb_string = "Control";
5533 verb_string = "Remove Backlink";
5536 verb_string = "Close Iteration";
5539 verb_string = "Mutate Entry";
5542 verb_string = "Audit Skulking";
5545 verb_string = "Get Server Address";
5546 if(request_value->nds_version != 0x000000fe)
5548 pvalues[0].vtype = VTYPE_STRING;
5549 pvalues[0].vdesc = "Distinguished Name: %s";
5550 pvalues[0].mvtype = MVTYPE_ATTR_REQUEST;
5551 pvalues[0].vvalue = 0;
5552 pvalues[0].vlength = 256;
5553 pvalues[0].vlength = tvb_get_letohl(tvb, nds_offset);
5554 if (pvalues[0].vlength == 0x00)
5556 pvalues[0].vtype = VTYPE_NONE;
5559 pvalues[0].voffset = nds_offset+4;
5561 get_string(tvb, pvalues[0].voffset, pvalues[0].vlength, pvalues[0].vstring);
5562 nds_offset += pvalues[0].vlength;
5563 nds_offset += align_4(tvb, nds_offset);
5564 pvalues[0].hfname= hf_nds_name;
5565 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
5566 pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
5567 pvalues[1].vdesc = "Referral Records: %u";
5568 pvalues[1].vlength = 4;
5569 pvalues[1].voffset = nds_offset;
5570 pvalues[1].hfname = hf_nds_referrals;
5571 pvalues[1].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
5575 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
5576 pvalues[0].vtype = VTYPE_UINT32;
5577 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
5578 pvalues[0].vlength = 4;
5579 pvalues[0].voffset = nds_offset;
5580 pvalues[0].hfname = hf_nds_iteration;
5581 nds_offset = nds_offset+pvalues[0].vlength;
5582 pvalues[1].vtype = VTYPE_STRING;
5583 pvalues[1].vdesc = "Distinguished Name: %s";
5584 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
5585 pvalues[1].vvalue = 0;
5586 pvalues[1].vlength = 256;
5587 pvalues[1].vlength = tvb_get_letohl(tvb, nds_offset);
5588 if (pvalues[1].vlength == 0x00)
5590 pvalues[1].vtype = VTYPE_NONE;
5593 pvalues[1].voffset = nds_offset+4;
5595 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, pvalues[1].vstring);
5596 nds_offset += pvalues[1].vlength;
5597 nds_offset += align_4(tvb, nds_offset);
5598 pvalues[1].hfname= hf_nds_name;
5599 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
5600 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
5601 pvalues[2].vdesc = "Referral Records: %u";
5602 pvalues[2].vlength = 4;
5603 pvalues[2].voffset = nds_offset;
5604 pvalues[2].hfname = hf_nds_referrals;
5605 pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
5609 verb_string = "Set Keys";
5612 verb_string = "Change Password";
5615 verb_string = "Verify Password";
5618 verb_string = "Begin Login";
5621 verb_string = "Finish Login";
5624 verb_string = "Begin Authentication";
5627 verb_string = "Finish Authentication";
5630 verb_string = "Logout";
5633 verb_string = "Repair Ring";
5636 verb_string = "Repair Timestamps";
5639 verb_string = "Create Back Link";
5642 verb_string = "Delete External Reference";
5645 verb_string = "Rename External Reference";
5648 verb_string = "Create Directory Entry";
5651 verb_string = "Remove Directory Entry";
5654 verb_string = "Designate New Master";
5657 verb_string = "Change Tree Name";
5660 verb_string = "Partition Entry Count";
5663 verb_string = "Check Login Restrictions";
5666 verb_string = "Start Join";
5669 verb_string = "Low Level Split";
5672 verb_string = "Low Level Join";
5675 verb_string = "Abort Low Level Join";
5678 verb_string = "Get All Servers";
5681 verb_string = "NDS Continuation Fragment";
5684 if(request_value->nds_request_verb != 0)
5686 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 6, 0,
5687 request_value->nds_request_verb, "NDS Verb: %d, %s",
5688 request_value->nds_request_verb, verb_string);
5690 /* NDS Entry ID's (EID) is identified in the reply packet of an NDS
5691 * resolve name. We need to store this EID and it's associated
5692 * name into our hash so that we can resolve the name for
5693 * other NDS requests. */
5694 if (!pinfo->fd->flags.visited) {
5697 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
5698 if (!request_eid_value) {
5699 request_eid_value = ncp_eid_hash_insert(global_eid);
5700 strcpy(request_eid_value->object_name, global_object_name);
5704 /* For NDS requests with just an EID, resolve name from hash table. */
5707 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
5708 if (request_eid_value) {
5709 strcpy(global_object_name, request_eid_value->object_name);
5710 proto_tree_add_string_format(ncp_tree, hf_nds_name, tvb, 6, 0,
5711 global_object_name, "NDS Name for EID - %s",
5712 global_object_name);
5715 for (i = 0; i < 9; i++) {
5716 switch (pvalues[i].vtype) {
5718 case VTYPE_NONE: /* no value */
5722 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
5723 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
5728 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
5729 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
5734 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
5735 pvalues[i].vlength, pvalues[i].vvalue, pvalues[i].vdesc,
5740 proto_tree_add_string_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
5741 pvalues[i].vlength, pvalues[i].vstring, pvalues[i].vdesc,
5742 pvalues[i].vstring);
5745 case VTYPE_BITFIELD:
5746 process_bitfield(ncp_tree, tvb, &pvalues[i]);
5749 case VTYPE_MULTIVALUE_UINT32:
5750 process_multivalues(ncp_tree, tvb, &pvalues[i]);
5754 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, pvalues[i].voffset,
5755 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
5764 length = tvb_length(tvb);
5765 if (!ncp_rec && length > 8) {
5766 proto_tree_add_text(ncp_tree, tvb, 8, length - 8,
5767 "No request record found. Parsing is impossible.");
5769 else if (ncp_rec && ncp_rec->reply_ptvc) {
5770 /* If a non-zero completion code was found, it is
5771 * legal to not have any fields, even if the packet
5772 * type is defined as having fields. */
5773 if (completion_code != 0 && tvb_length(tvb) == 8) {
5776 /*printf("func=0x%x subfunc=0x%x\n", ncp_rec->func, ncp_rec->subfunc);*/
5778 /* Any request condition results? */
5779 if (request_value) {
5780 req_cond_results = request_value->req_cond_results;
5783 req_cond_results = NULL;
5786 clear_repeat_vars();
5787 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
5788 process_ptvc_record(ptvc, ncp_rec->reply_ptvc, req_cond_results,
5790 ptvcursor_free(ptvc);
5796 dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
5797 guint16 nw_connection, guint8 sequence,
5798 guint16 type, proto_tree *ncp_tree)
5800 guint8 func, subfunc = 0;
5801 ncp_req_hash_value *request_value = NULL;
5802 ncp_req_eid_hash_value *request_eid_value = NULL;
5803 const ncp_record *ncp_rec = NULL;
5804 conversation_t *conversation;
5805 ptvcursor_t *ptvc = NULL;
5806 proto_tree *temp_tree = NULL;
5807 guint8 nds_verb = 0;
5808 char * verb_string = "";
5809 guint32 nds_frag = 0;
5811 char string_buffer[9][1024];
5812 guint8 nds_version = 0;
5813 guint32 foffset = 0;
5814 guint32 nds_reply_buffer;
5815 nw_uni_t req_buffer;
5816 char global_object_name[256];
5817 guint32 global_eid=0;
5818 gboolean resolve_eid=FALSE;
5819 guint32 global_flags=0;
5822 for (i = 0; i < 9; i++) {
5823 pvalues[i].vtype = 0;
5824 pvalues[i].vvalue = 0;
5825 pvalues[i].vlength = 0;
5826 pvalues[i].voffset = 0;
5827 pvalues[i].hfname = 0;
5828 pvalues[i].vdesc = "";
5829 string_buffer[i][0] = '\0';
5830 pvalues[i].vstring = string_buffer[i];
5831 pvalues[i].mvtype = 0;
5834 strcpy(req_buffer.buffer, "");
5835 strcpy(global_object_name, "");
5837 func = tvb_get_guint8(tvb, 6);
5838 subfunc = tvb_get_guint8(tvb, 7);
5840 ncp_rec = ncp_record_find(func, subfunc);
5842 /* Check to see if this is a fragment packet */
5843 nds_frag = tvb_get_letohl(tvb, 8);
5846 if (nds_frag == 0xffffffff) {
5847 nds_verb = tvb_get_guint8(tvb, 24);
5848 if (nds_verb == 0xfe)
5850 nds_version = nds_verb;
5851 nds_verb = tvb_get_guint8(tvb, 32);
5859 nds_reply_buffer = tvb_get_letohl(tvb, foffset);
5860 proto_tree_add_uint(ncp_tree, hf_nds_buffer_size, tvb, foffset,
5861 4, nds_reply_buffer);
5862 foffset = foffset+4;
5866 verb_string = "Resolve Name -> ";
5867 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
5868 nds_version = pvalues[0].vvalue;
5869 pvalues[0].vtype = VTYPE_UINT32;
5870 pvalues[0].vdesc = "Version: %u";
5871 pvalues[0].vlength = 4;
5872 pvalues[0].hfname = hf_nds_ver;
5873 pvalues[0].voffset = foffset;
5874 foffset = foffset+pvalues[0].vlength;
5875 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
5876 pvalues[1].vtype = VTYPE_BITFIELD;
5877 pvalues[1].vdesc = "Flags:";
5878 pvalues[1].vlength = 2;
5879 pvalues[1].hfname= hf_nds_nflags;
5880 pvalues[1].voffset = foffset;
5881 pvalues[1].bit1 = "Entry ID";
5882 pvalues[1].bit1hfname = hf_bit1nflags;
5883 pvalues[1].bit2 = "Readable";
5884 pvalues[1].bit2hfname = hf_bit2nflags;
5885 pvalues[1].bit3 = "Writeable";
5886 pvalues[1].bit3hfname = hf_bit3nflags;
5887 pvalues[1].bit4 = "Master";
5888 pvalues[1].bit4hfname = hf_bit4nflags;
5889 pvalues[1].bit5 = "Create ID";
5890 pvalues[1].bit5hfname = hf_bit5nflags;
5891 pvalues[1].bit6 = "Walk Tree";
5892 pvalues[1].bit6hfname = hf_bit6nflags;
5893 pvalues[1].bit7 = "Dereference Alias";
5894 pvalues[1].bit7hfname = hf_bit7nflags;
5895 pvalues[1].bit8 = "Not Defined";
5896 pvalues[1].bit8hfname = hf_bit8nflags;
5897 pvalues[1].bit9 = "Not Defined";
5898 pvalues[1].bit9hfname = hf_bit9nflags;
5899 pvalues[1].bit10 = "Not Defined";
5900 pvalues[1].bit10hfname = hf_bit10nflags;
5901 pvalues[1].bit11= "Not Defined";
5902 pvalues[1].bit11hfname = hf_bit11nflags;
5903 pvalues[1].bit12 = "Not Defined";
5904 pvalues[1].bit12hfname = hf_bit12nflags;
5905 pvalues[1].bit13 = "Not Defined";
5906 pvalues[1].bit13hfname = hf_bit13nflags;
5907 pvalues[1].bit14 = "Prefer Referrals";
5908 pvalues[1].bit14hfname = hf_bit14nflags;
5909 pvalues[1].bit15 = "Prefer Only Referrals";
5910 pvalues[1].bit15hfname = hf_bit15nflags;
5911 pvalues[1].bit16 = "Not Defined";
5912 pvalues[1].bit16hfname = hf_bit16nflags;
5913 foffset = foffset+4;
5914 if (pvalues[0].vvalue == 0 || pvalues[0].vvalue == 1)
5916 pvalues[2].vtype = VTYPE_UINT32;
5917 pvalues[2].vdesc = "Scope: %u";
5918 pvalues[2].vlength = 4;
5919 pvalues[2].voffset = foffset;
5920 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
5921 pvalues[2].hfname= hf_nds_scope;
5922 foffset = foffset+pvalues[2].vlength;
5923 pvalues[3].vtype = VTYPE_STRING;
5924 pvalues[3].vdesc = "Name: %s";
5925 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
5926 pvalues[3].vvalue = 0;
5927 pvalues[3].vlength = 256;
5928 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
5929 if (pvalues[3].vlength == 0x00)
5931 pvalues[3].vtype = VTYPE_NONE;
5934 pvalues[3].voffset = foffset+4;
5935 foffset = foffset + 4;
5936 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, req_buffer.buffer);
5937 pvalues[3].vstring = req_buffer.buffer;
5938 strcpy(global_object_name, req_buffer.buffer);
5939 pvalues[3].hfname= hf_nds_name;
5940 foffset = foffset+pvalues[3].vlength;
5941 foffset += align_4(tvb, foffset);
5942 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
5943 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
5944 pvalues[4].vdesc = "Communications Transports: %u";
5945 pvalues[4].vlength = 4;
5946 pvalues[4].hfname= hf_nds_comm_trans;
5947 pvalues[4].voffset = foffset;
5948 pvalues[4].mvtype = MVTYPE_ADDR_REFERRAL_REQUEST;
5949 foffset = foffset + (pvalues[4].vvalue * 4) + 4;
5950 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
5951 pvalues[5].vtype = VTYPE_MULTIVALUE_UINT32;
5952 pvalues[5].vdesc = "Tree Walker Transport Type: %u";
5953 pvalues[5].vlength = 4;
5954 pvalues[5].mvtype = MVTYPE_ADDR_REFERRAL_REQUEST;
5955 pvalues[5].hfname= hf_nds_tree_trans;
5956 pvalues[5].voffset = foffset;
5960 pvalues[2].vtype = VTYPE_UINT32;
5961 pvalues[2].vdesc = "Minimum DS Version: %u";
5962 pvalues[2].vlength = 4;
5963 pvalues[2].voffset = foffset;
5964 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
5965 pvalues[2].hfname= hf_min_nds_ver;
5966 foffset = foffset+pvalues[2].vlength;
5967 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
5968 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
5969 pvalues[3].vdesc = "Number of Versions to Include: %u";
5970 pvalues[3].vlength = 4;
5971 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST2;
5972 pvalues[3].voffset = foffset;
5973 pvalues[3].hfname= hf_nds_ver_include;
5974 foffset += (pvalues[3].vvalue * 4) + 4;
5975 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
5976 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
5977 pvalues[4].vdesc = "Number of Versions to Exclude: %u";
5978 pvalues[4].vlength = 4;
5979 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST2;
5980 pvalues[4].hfname= hf_nds_ver_exclude;
5981 pvalues[4].voffset = foffset;
5983 pvalues[5].vtype = VTYPE_UINT32;
5984 pvalues[5].vdesc = "DN Output Type: %u";
5985 pvalues[5].vlength = 4;
5986 pvalues[5].voffset = foffset;
5987 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
5988 pvalues[5].hfname= hf_nds_dn_output_type;
5989 foffset = foffset+pvalues[5].vlength;
5990 pvalues[6].vtype = VTYPE_UINT32;
5991 pvalues[6].vdesc = "Nested Output Type: %u";
5992 pvalues[6].vlength = 4;
5993 pvalues[6].voffset = foffset;
5994 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset);
5995 pvalues[6].hfname= hf_nds_nested_output_type;
5996 foffset = foffset+pvalues[6].vlength;
5997 pvalues[7].vtype = VTYPE_STRING;
5998 pvalues[7].vdesc = "Output Delimiter: %s";
5999 pvalues[7].mvtype = MVTYPE_ATTR_REQUEST;
6000 pvalues[7].vvalue = 0;
6001 pvalues[7].vlength = 256;
6002 pvalues[7].vlength = tvb_get_letohl(tvb, foffset);
6003 pvalues[7].voffset = foffset+4;
6004 foffset = foffset + 4;
6005 get_string(tvb, pvalues[7].voffset, pvalues[7].vlength, req_buffer.buffer);
6006 pvalues[7].vstring = req_buffer.buffer;
6007 pvalues[7].hfname= hf_nds_output_delimiter;
6008 foffset = foffset+pvalues[7].vlength;
6009 foffset += align_4(tvb, foffset);
6010 pvalues[8].vvalue = tvb_get_letohl(tvb, foffset);
6011 pvalues[8].vtype = VTYPE_MULTIVALUE_UINT32;
6012 pvalues[8].vdesc = "Size of Entry Specifier: %u";
6013 pvalues[8].vlength = 4;
6014 pvalues[8].mvtype = MVTYPE_PROC_ENTRY_SPECIFIERS;
6015 pvalues[8].hfname= hf_nds_output_entry_specifier;
6016 pvalues[8].voffset = foffset;
6020 verb_string = "Read Entry Information";
6021 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6022 pvalues[0].vtype = VTYPE_UINT32;
6023 pvalues[0].vdesc = "Version: %u";
6024 pvalues[0].vlength = 4;
6025 pvalues[0].voffset = foffset;
6026 pvalues[0].hfname= hf_nds_ver;
6027 foffset = foffset+pvalues[0].vlength;
6028 switch(pvalues[0].vvalue)
6031 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6032 pvalues[1].vtype = VTYPE_UINT32;
6033 pvalues[1].vdesc = "Entry ID: 0x%08x";
6034 pvalues[1].vlength = 4;
6036 global_eid = pvalues[1].vvalue;
6037 pvalues[1].voffset = foffset;
6038 pvalues[1].hfname = hf_nds_eid;
6039 foffset = foffset+pvalues[1].vlength;
6042 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6043 pvalues[1].vtype = VTYPE_BITFIELD;
6044 pvalues[1].vdesc = "Request Flags:";
6045 pvalues[1].vlength = 2;
6046 pvalues[1].hfname= hf_nds_rflags;
6047 pvalues[1].voffset = foffset;
6048 pvalues[1].bit1 = "Typeless";
6049 pvalues[1].bit1hfname = hf_bit1rflags;
6050 pvalues[1].bit2 = "Slashed";
6051 pvalues[1].bit2hfname = hf_bit2rflags;
6052 pvalues[1].bit3 = "Dotted";
6053 pvalues[1].bit3hfname = hf_bit3rflags;
6054 pvalues[1].bit4 = "Tuned";
6055 pvalues[1].bit4hfname = hf_bit4rflags;
6056 pvalues[1].bit5 = "Not Defined";
6057 pvalues[1].bit5hfname = hf_bit5rflags;
6058 pvalues[1].bit6 = "Not Defined";
6059 pvalues[1].bit6hfname = hf_bit6rflags;
6060 pvalues[1].bit7 = "Not Defined";
6061 pvalues[1].bit7hfname = hf_bit7rflags;
6062 pvalues[1].bit8 = "Not Defined";
6063 pvalues[1].bit8hfname = hf_bit8rflags;
6064 pvalues[1].bit9 = "Not Defined";
6065 pvalues[1].bit9hfname = hf_bit9rflags;
6066 pvalues[1].bit10 = "Not Defined";
6067 pvalues[1].bit10hfname = hf_bit10rflags;
6068 pvalues[1].bit11 = "Not Defined";
6069 pvalues[1].bit11hfname = hf_bit11rflags;
6070 pvalues[1].bit12 = "Not Defined";
6071 pvalues[1].bit12hfname = hf_bit12rflags;
6072 pvalues[1].bit13 = "Not Defined";
6073 pvalues[1].bit13hfname = hf_bit13rflags;
6074 pvalues[1].bit14 = "Not Defined";
6075 pvalues[1].bit14hfname = hf_bit14rflags;
6076 pvalues[1].bit15 = "Not Defined";
6077 pvalues[1].bit15hfname = hf_bit15rflags;
6078 pvalues[1].bit16 = "Not Defined";
6079 pvalues[1].bit16hfname = hf_bit16rflags;
6080 if((pvalues[1].vvalue&&0xf000) == 0xc000)
6082 pvalues[2].vtype = VTYPE_STRING;
6083 pvalues[2].vdesc = "Name Type: %s";
6084 pvalues[2].vstring = "Partial";
6085 pvalues[2].mvtype = 0;
6086 pvalues[2].vvalue = 0;
6087 pvalues[2].vlength = 0;
6088 pvalues[2].voffset = 0;
6089 pvalues[2].hfname= hf_nds_name_type;
6093 pvalues[2].vtype = VTYPE_STRING;
6094 pvalues[2].vdesc = "Name Type: %s";
6095 pvalues[2].vstring = "Full";
6096 pvalues[2].vvalue = 0;
6097 pvalues[2].mvtype = 0;
6098 pvalues[2].vlength = 0;
6099 pvalues[2].voffset = 0;
6100 pvalues[2].hfname= hf_nds_name_type;
6102 foffset = foffset+4;
6103 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6104 pvalues[3].vtype = VTYPE_UINT32;
6105 pvalues[3].vdesc = "Entry ID: 0x%08x";
6106 pvalues[3].vlength = 4;
6107 pvalues[3].voffset = foffset;
6109 global_eid = pvalues[3].vvalue;
6110 pvalues[3].hfname = hf_nds_eid;
6111 foffset = foffset+pvalues[3].vlength;
6114 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6115 pvalues[1].vtype = VTYPE_BITFIELD;
6116 pvalues[1].vdesc = "Request Flags:";
6117 pvalues[1].vlength = 2;
6118 pvalues[1].hfname= hf_nds_rflags;
6119 pvalues[1].voffset = foffset;
6120 pvalues[1].bit1 = "Typeless";
6121 pvalues[1].bit1hfname = hf_bit1rflags;
6122 pvalues[1].bit2 = "Slashed";
6123 pvalues[1].bit2hfname = hf_bit2rflags;
6124 pvalues[1].bit3 = "Dotted";
6125 pvalues[1].bit3hfname = hf_bit3rflags;
6126 pvalues[1].bit4 = "Tuned";
6127 pvalues[1].bit4hfname = hf_bit4rflags;
6128 pvalues[1].bit5 = "Not Defined";
6129 pvalues[1].bit5hfname = hf_bit5rflags;
6130 pvalues[1].bit6 = "Not Defined";
6131 pvalues[1].bit6hfname = hf_bit6rflags;
6132 pvalues[1].bit7 = "Not Defined";
6133 pvalues[1].bit7hfname = hf_bit7rflags;
6134 pvalues[1].bit8 = "Not Defined";
6135 pvalues[1].bit8hfname = hf_bit8rflags;
6136 pvalues[1].bit9 = "Not Defined";
6137 pvalues[1].bit9hfname = hf_bit9rflags;
6138 pvalues[1].bit10 = "Not Defined";
6139 pvalues[1].bit10hfname = hf_bit10rflags;
6140 pvalues[1].bit11 = "Not Defined";
6141 pvalues[1].bit11hfname = hf_bit11rflags;
6142 pvalues[1].bit12 = "Not Defined";
6143 pvalues[1].bit12hfname = hf_bit12rflags;
6144 pvalues[1].bit13 = "Not Defined";
6145 pvalues[1].bit13hfname = hf_bit13rflags;
6146 pvalues[1].bit14 = "Not Defined";
6147 pvalues[1].bit14hfname = hf_bit14rflags;
6148 pvalues[1].bit15 = "Not Defined";
6149 pvalues[1].bit15hfname = hf_bit15rflags;
6150 pvalues[1].bit16 = "Not Defined";
6151 pvalues[1].bit16hfname = hf_bit16rflags;
6152 if((pvalues[1].vvalue&&0xf000) == 0xc000)
6154 pvalues[2].vtype = VTYPE_STRING;
6155 pvalues[2].vdesc = "Name Type: %s";
6156 pvalues[2].vstring = "Return Partion Name";
6157 pvalues[2].vvalue = 0;
6158 pvalues[2].vlength = 4;
6159 pvalues[2].voffset = pvalues[1].voffset;
6160 pvalues[2].mvtype = 0;
6161 pvalues[2].hfname= hf_nds_name_type;
6165 pvalues[2].vtype = VTYPE_STRING;
6166 pvalues[2].vdesc = "Name Type: %s";
6167 pvalues[2].vstring = "Return Full Name";
6168 pvalues[2].vvalue = 0;
6169 pvalues[2].vlength = 4;
6170 pvalues[2].mvtype = 0;
6171 pvalues[2].voffset = pvalues[1].voffset;
6172 pvalues[2].hfname= hf_nds_name_type;
6174 foffset = foffset+4;
6175 pvalues[3].vvalue = tvb_get_letohs(tvb, foffset);
6176 global_flags = tvb_get_letohl(tvb, foffset);
6177 pvalues[3].vtype = VTYPE_BITFIELD;
6178 pvalues[3].vdesc = "Information Flags (low) Byte:";
6179 pvalues[3].vlength = 2;
6180 pvalues[3].hfname= hf_nds_rflags;
6181 pvalues[3].voffset = foffset;
6182 pvalues[3].bit1 = "Output Flags";
6183 pvalues[3].bit1hfname = hf_bit1infoflagsl;
6184 pvalues[3].bit2 = "Entry ID";
6185 pvalues[3].bit2hfname = hf_bit2infoflagsl;
6186 pvalues[3].bit3 = "Entry Flags";
6187 pvalues[3].bit3hfname = hf_bit3infoflagsl;
6188 pvalues[3].bit4 = "Subordinate Count";
6189 pvalues[3].bit4hfname = hf_bit4infoflagsl;
6190 pvalues[3].bit5 = "Modification Time";
6191 pvalues[3].bit5hfname = hf_bit5infoflagsl;
6192 pvalues[3].bit6 = "Modification Timestamp";
6193 pvalues[3].bit6hfname = hf_bit6infoflagsl;
6194 pvalues[3].bit7 = "Creation Timestamp";
6195 pvalues[3].bit7hfname = hf_bit7infoflagsl;
6196 pvalues[3].bit8 = "Partition Root ID";
6197 pvalues[3].bit8hfname = hf_bit8infoflagsl;
6198 pvalues[3].bit9 = "Parent ID";
6199 pvalues[3].bit9hfname = hf_bit9infoflagsl;
6200 pvalues[3].bit10 = "Revision Count";
6201 pvalues[3].bit10hfname = hf_bit10infoflagsl;
6202 pvalues[3].bit11 = "Replica Type";
6203 pvalues[3].bit11hfname = hf_bit11infoflagsl;
6204 pvalues[3].bit12 = "Base Class";
6205 pvalues[3].bit12hfname = hf_bit12infoflagsl;
6206 pvalues[3].bit13 = "Relative Distinguished Name";
6207 pvalues[3].bit13hfname = hf_bit13infoflagsl;
6208 pvalues[3].bit14 = "Distinguished Name";
6209 pvalues[3].bit14hfname = hf_bit14infoflagsl;
6210 pvalues[3].bit15 = "Root Distinguished Name";
6211 pvalues[3].bit15hfname = hf_bit15infoflagsl;
6212 pvalues[3].bit16 = "Parent Distinguished Name";
6213 pvalues[3].bit16hfname = hf_bit16infoflagsl;
6214 foffset = foffset+2;
6215 pvalues[4].vvalue = tvb_get_letohs(tvb, foffset);
6216 pvalues[4].vtype = VTYPE_BITFIELD;
6217 pvalues[4].vdesc = "Information Flags (high) Byte:";
6218 pvalues[4].vlength = 2;
6219 pvalues[4].hfname= hf_nds_rflags;
6220 pvalues[4].voffset = foffset;
6221 pvalues[4].bit1 = "Purge Time";
6222 pvalues[4].bit1hfname = hf_bit1infoflagsh;
6223 pvalues[4].bit2 = "Dereference Base Class";
6224 pvalues[4].bit2hfname = hf_bit2infoflagsh;
6225 pvalues[4].bit3 = "Not Defined";
6226 pvalues[4].bit3hfname = hf_bit3infoflagsh;
6227 pvalues[4].bit4 = "Not Defined";
6228 pvalues[4].bit4hfname = hf_bit4infoflagsh;
6229 pvalues[4].bit5 = "Not Defined";
6230 pvalues[4].bit5hfname = hf_bit5infoflagsh;
6231 pvalues[4].bit6 = "Not Defined";
6232 pvalues[4].bit6hfname = hf_bit6infoflagsh;
6233 pvalues[4].bit7 = "Not Defined";
6234 pvalues[4].bit7hfname = hf_bit7infoflagsh;
6235 pvalues[4].bit8 = "Not Defined";
6236 pvalues[4].bit8hfname = hf_bit8infoflagsh;
6237 pvalues[4].bit9 = "Not Defined";
6238 pvalues[4].bit9hfname = hf_bit9infoflagsh;
6239 pvalues[4].bit10 = "Not Defined";
6240 pvalues[4].bit10hfname = hf_bit10infoflagsh;
6241 pvalues[4].bit11 = "Not Defined";
6242 pvalues[4].bit11hfname = hf_bit11infoflagsh;
6243 pvalues[4].bit12 = "Not Defined";
6244 pvalues[4].bit12hfname = hf_bit12infoflagsh;
6245 pvalues[4].bit13 = "Not Defined";
6246 pvalues[4].bit13hfname = hf_bit13infoflagsh;
6247 pvalues[4].bit14 = "Not Defined";
6248 pvalues[4].bit14hfname = hf_bit14infoflagsh;
6249 pvalues[4].bit15 = "Not Defined";
6250 pvalues[4].bit15hfname = hf_bit15infoflagsh;
6251 pvalues[4].bit16 = "Not Defined";
6252 pvalues[4].bit16hfname = hf_bit16infoflagsh;
6253 foffset = foffset+2;
6254 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
6255 pvalues[5].vtype = VTYPE_UINT32;
6256 pvalues[5].vdesc = "Entry ID: 0x%08x";
6257 pvalues[5].vlength = 4;
6258 pvalues[5].voffset = foffset;
6260 global_eid = pvalues[5].vvalue;
6261 pvalues[5].hfname = hf_nds_eid;
6262 foffset = foffset+pvalues[5].vlength;
6270 verb_string = "Read -> ";
6271 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6272 pvalues[0].vtype = VTYPE_UINT32;
6273 pvalues[0].vdesc = "Version: %u";
6274 pvalues[0].vlength = 4;
6275 pvalues[0].voffset = foffset;
6276 pvalues[0].hfname= hf_nds_ver;
6277 foffset = foffset+pvalues[0].vlength;
6278 if(pvalues[0].vvalue == 0)
6280 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6281 pvalues[1].vtype = VTYPE_UINT32;
6282 pvalues[1].vdesc = "Iteration Handle: 0x%08x";
6283 pvalues[1].vlength = 4;
6284 pvalues[1].voffset = foffset;
6285 pvalues[1].hfname= hf_nds_iteration;
6286 foffset = foffset+pvalues[1].vlength;
6287 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6288 pvalues[2].vtype = VTYPE_UINT32;
6289 pvalues[2].vdesc = "Entry ID: 0x%08x";
6290 pvalues[2].vlength = 4;
6292 global_eid = pvalues[2].vvalue;
6293 pvalues[2].voffset = foffset;
6294 pvalues[2].hfname= hf_nds_eid;
6295 foffset = foffset+pvalues[2].vlength;
6296 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6297 pvalues[3].vstring = match_strval(pvalues[3].vvalue, nds_info_type);
6298 global_flags = pvalues[3].vvalue;
6299 if(pvalues[3].vstring == NULL)
6301 pvalues[3].vstring = "No Info Type Set";
6303 pvalues[3].vtype = VTYPE_STRING;
6304 pvalues[3].vdesc = "Info Type: %s";
6305 pvalues[3].vlength = 4;
6306 pvalues[3].voffset = foffset;
6307 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
6308 pvalues[3].hfname= hf_nds_info_type;
6309 foffset = foffset + pvalues[3].vlength;
6310 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
6311 pvalues[4].vtype = VTYPE_UINT32;
6312 pvalues[4].vdesc = "All Attributes: %u";
6313 pvalues[4].vlength = 4;
6314 pvalues[4].voffset = foffset;
6315 pvalues[4].hfname= hf_nds_all_attr;
6316 foffset = foffset+pvalues[4].vlength;
6317 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
6318 pvalues[5].vtype = VTYPE_MULTIVALUE_UINT32;
6319 pvalues[5].vdesc = "Attributes: %u";
6320 pvalues[5].vlength = 4;
6321 pvalues[5].voffset = foffset;
6322 pvalues[5].mvtype = MVTYPE_ATTR_REQUEST;
6323 pvalues[5].hfname= hf_nds_attr;
6327 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6328 pvalues[1].vtype = VTYPE_UINT32;
6329 pvalues[1].vdesc = "Request Flags: 0x%08x";
6330 pvalues[1].vlength = 4;
6331 pvalues[1].voffset = foffset;
6332 pvalues[1].hfname= hf_nds_req_flags;
6333 foffset = foffset+pvalues[1].vlength;
6334 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6335 pvalues[2].vtype = VTYPE_UINT32;
6336 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
6337 pvalues[2].vlength = 4;
6338 pvalues[2].voffset = foffset;
6339 pvalues[2].hfname= hf_nds_iteration;
6340 foffset = foffset+pvalues[2].vlength;
6341 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6342 pvalues[3].vtype = VTYPE_UINT32;
6343 pvalues[3].vdesc = "Entry ID: 0x%08x";
6344 pvalues[3].vlength = 4;
6346 global_eid = pvalues[3].vvalue;
6347 pvalues[3].voffset = foffset;
6348 pvalues[3].hfname= hf_nds_eid;
6349 foffset = foffset+pvalues[3].vlength;
6350 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
6351 pvalues[4].vstring = match_strval(pvalues[4].vvalue, nds_info_type);
6352 global_flags = pvalues[4].vvalue;
6353 if(pvalues[4].vstring == NULL)
6355 pvalues[4].vstring = "No Info Type Set";
6357 pvalues[4].vtype = VTYPE_STRING;
6358 pvalues[4].vdesc = "Info Type: %s";
6359 pvalues[4].vlength = 4;
6360 pvalues[4].voffset = foffset;
6361 pvalues[4].hfname= hf_nds_info_type;
6362 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST;
6363 foffset = foffset+pvalues[4].vlength;
6364 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
6365 pvalues[5].vtype = VTYPE_UINT32;
6366 pvalues[5].vdesc = "All Attributes: %u";
6367 pvalues[5].vlength = 4;
6368 pvalues[5].voffset = foffset;
6369 pvalues[5].hfname= hf_nds_all_attr;
6370 foffset = foffset+pvalues[5].vlength;
6371 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset);
6372 pvalues[6].vtype = VTYPE_MULTIVALUE_UINT32;
6373 pvalues[6].vdesc = "Attributes: %u";
6374 pvalues[6].vlength = 4;
6375 pvalues[6].voffset = foffset;
6376 pvalues[6].mvtype = MVTYPE_ATTR_REQUEST;
6377 pvalues[6].hfname= hf_nds_attr;
6381 verb_string = "Compare";
6382 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6383 pvalues[0].vtype = VTYPE_UINT32;
6384 pvalues[0].vdesc = "Version: %u";
6385 pvalues[0].vlength = 4;
6386 pvalues[0].voffset = foffset;
6387 pvalues[0].hfname= hf_nds_ver;
6388 foffset = foffset+pvalues[0].vlength;
6389 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6390 pvalues[1].vtype = VTYPE_UINT32;
6391 pvalues[1].vdesc = "Entry ID: 0x%08x";
6392 pvalues[1].vlength = 4;
6394 global_eid = pvalues[1].vvalue;
6395 pvalues[1].voffset = foffset;
6396 pvalues[1].hfname = hf_nds_eid;
6397 foffset = foffset+pvalues[1].vlength;
6398 foffset += 4; /* Attribute Count = 1 */
6399 pvalues[2].vtype = VTYPE_STRING;
6400 pvalues[2].vdesc = "Attribute Name Being Compared: %s";
6401 pvalues[2].mvtype = MVTYPE_ATTR_REQUEST;
6402 pvalues[2].vvalue = 0;
6403 pvalues[2].vlength = 256;
6404 pvalues[2].vlength = tvb_get_letohl(tvb, foffset);
6405 if (pvalues[2].vlength == 0x00)
6407 pvalues[2].vtype = VTYPE_NONE;
6410 pvalues[2].voffset = foffset+4;
6411 foffset = foffset + 4;
6412 get_string(tvb, pvalues[2].voffset, pvalues[2].vlength, req_buffer.buffer);
6413 pvalues[2].vstring = req_buffer.buffer;
6414 strcpy(global_object_name, req_buffer.buffer);
6415 pvalues[2].hfname= hf_nds_name;
6416 foffset = foffset+pvalues[2].vlength;
6417 foffset += align_4(tvb, foffset);
6418 foffset += 4; /* Attribute Value Count = 1 */
6420 * Need Trace file to test. Will have to create a
6421 * new mvtype to call print_nds_values.
6425 verb_string = "List -> ";
6426 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6427 pvalues[0].vtype = VTYPE_UINT32;
6428 pvalues[0].vdesc = "Version: %u";
6429 pvalues[0].vlength = 4;
6430 pvalues[0].voffset = foffset;
6431 pvalues[0].hfname= hf_nds_ver;
6432 foffset = foffset+pvalues[0].vlength;
6433 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6434 pvalues[1].vtype = VTYPE_BITFIELD;
6435 pvalues[1].vdesc = "Request Flags:";
6436 pvalues[1].vlength = 2;
6437 pvalues[1].hfname= hf_nds_rflags;
6438 pvalues[1].voffset = foffset;
6439 pvalues[1].bit1 = "List Typeless";
6440 pvalues[1].bit1hfname = hf_bit1lflags;
6441 pvalues[1].bit2 = "List Containers";
6442 pvalues[1].bit2hfname = hf_bit2lflags;
6443 pvalues[1].bit3 = "List Slashed";
6444 pvalues[1].bit3hfname = hf_bit3lflags;
6445 pvalues[1].bit4 = "List Dotted";
6446 pvalues[1].bit4hfname = hf_bit4lflags;
6447 pvalues[1].bit5 = "Dereference Alias";
6448 pvalues[1].bit5hfname = hf_bit5lflags;
6449 pvalues[1].bit6 = "List All Containers";
6450 pvalues[1].bit6hfname = hf_bit6lflags;
6451 pvalues[1].bit7 = "List Obsolete";
6452 pvalues[1].bit7hfname = hf_bit7lflags;
6453 pvalues[1].bit8 = "List Tuned Output";
6454 pvalues[1].bit8hfname = hf_bit8lflags;
6455 pvalues[1].bit9 = "List External Reference";
6456 pvalues[1].bit9hfname = hf_bit9lflags;
6457 pvalues[1].bit10 = "Not Defined";
6458 pvalues[1].bit10hfname = hf_bit10lflags;
6459 pvalues[1].bit11 = "Not Defined";
6460 pvalues[1].bit11hfname = hf_bit11lflags;
6461 pvalues[1].bit12 = "Not Defined";
6462 pvalues[1].bit12hfname = hf_bit12lflags;
6463 pvalues[1].bit13 = "Not Defined";
6464 pvalues[1].bit13hfname = hf_bit13lflags;
6465 pvalues[1].bit14 = "Not Defined";
6466 pvalues[1].bit14hfname = hf_bit14lflags;
6467 pvalues[1].bit15 = "Not Defined";
6468 pvalues[1].bit15hfname = hf_bit15lflags;
6469 pvalues[1].bit16 = "Not Defined";
6470 pvalues[1].bit16hfname = hf_bit16lflags;
6471 foffset = foffset+pvalues[1].vlength;
6473 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6474 pvalues[2].vtype = VTYPE_UINT32;
6475 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
6476 pvalues[2].vlength = 4;
6477 pvalues[2].voffset = foffset;
6478 pvalues[2].hfname= hf_nds_iteration;
6479 foffset = foffset+pvalues[2].vlength;
6480 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6481 pvalues[3].vtype = VTYPE_UINT32;
6482 pvalues[3].vdesc = "Parent ID: 0x%08x";
6483 pvalues[3].vlength = 4;
6484 pvalues[3].voffset = foffset;
6485 pvalues[3].hfname= hf_nds_parent;
6486 foffset = foffset+pvalues[3].vlength;
6487 pvalues[4].vvalue = tvb_get_letohs(tvb, foffset);
6488 global_flags = tvb_get_letohl(tvb, foffset);
6489 pvalues[4].vtype = VTYPE_BITFIELD;
6490 pvalues[4].vdesc = "Information Flags (low) Byte:";
6491 pvalues[4].vlength = 2;
6492 pvalues[4].hfname= hf_nds_rflags;
6493 pvalues[4].voffset = foffset;
6494 pvalues[4].bit1 = "Output Flags";
6495 pvalues[4].bit1hfname = hf_bit1infoflagsl;
6496 pvalues[4].bit2 = "Entry ID";
6497 pvalues[4].bit2hfname = hf_bit2infoflagsl;
6498 pvalues[4].bit3 = "Entry Flags";
6499 pvalues[4].bit3hfname = hf_bit3infoflagsl;
6500 pvalues[4].bit4 = "Subordinate Count";
6501 pvalues[4].bit4hfname = hf_bit4infoflagsl;
6502 pvalues[4].bit5 = "Modification Time";
6503 pvalues[4].bit5hfname = hf_bit5infoflagsl;
6504 pvalues[4].bit6 = "Modification Timestamp";
6505 pvalues[4].bit6hfname = hf_bit6infoflagsl;
6506 pvalues[4].bit7 = "Creation Timestamp";
6507 pvalues[4].bit7hfname = hf_bit7infoflagsl;
6508 pvalues[4].bit8 = "Partition Root ID";
6509 pvalues[4].bit8hfname = hf_bit8infoflagsl;
6510 pvalues[4].bit9 = "Parent ID";
6511 pvalues[4].bit9hfname = hf_bit9infoflagsl;
6512 pvalues[4].bit10 = "Revision Count";
6513 pvalues[4].bit10hfname = hf_bit10infoflagsl;
6514 pvalues[4].bit11 = "Replica Type";
6515 pvalues[4].bit11hfname = hf_bit11infoflagsl;
6516 pvalues[4].bit12 = "Base Class";
6517 pvalues[4].bit12hfname = hf_bit12infoflagsl;
6518 pvalues[4].bit13 = "Relative Distinguished Name";
6519 pvalues[4].bit13hfname = hf_bit13infoflagsl;
6520 pvalues[4].bit14 = "Distinguished Name";
6521 pvalues[4].bit14hfname = hf_bit14infoflagsl;
6522 pvalues[4].bit15 = "Root Distinguished Name";
6523 pvalues[4].bit15hfname = hf_bit15infoflagsl;
6524 pvalues[4].bit16 = "Parent Distinguished Name";
6525 pvalues[4].bit16hfname = hf_bit16infoflagsl;
6526 foffset = foffset+2;
6527 pvalues[5].vvalue = tvb_get_letohs(tvb, foffset);
6528 pvalues[5].vtype = VTYPE_BITFIELD;
6529 pvalues[5].vdesc = "Information Flags (high) Byte:";
6530 pvalues[5].vlength = 2;
6531 pvalues[5].hfname= hf_nds_rflags;
6532 pvalues[5].voffset = foffset;
6533 pvalues[5].bit1 = "Purge Time";
6534 pvalues[5].bit1hfname = hf_bit1infoflagsh;
6535 pvalues[5].bit2 = "Dereference Base Class";
6536 pvalues[5].bit2hfname = hf_bit2infoflagsh;
6537 pvalues[5].bit3 = "Not Defined";
6538 pvalues[5].bit3hfname = hf_bit3infoflagsh;
6539 pvalues[5].bit4 = "Not Defined";
6540 pvalues[5].bit4hfname = hf_bit4infoflagsh;
6541 pvalues[5].bit5 = "Not Defined";
6542 pvalues[5].bit5hfname = hf_bit5infoflagsh;
6543 pvalues[5].bit6 = "Not Defined";
6544 pvalues[5].bit6hfname = hf_bit6infoflagsh;
6545 pvalues[5].bit7 = "Not Defined";
6546 pvalues[5].bit7hfname = hf_bit7infoflagsh;
6547 pvalues[5].bit8 = "Not Defined";
6548 pvalues[5].bit8hfname = hf_bit8infoflagsh;
6549 pvalues[5].bit9 = "Not Defined";
6550 pvalues[5].bit9hfname = hf_bit9infoflagsh;
6551 pvalues[5].bit10 = "Not Defined";
6552 pvalues[5].bit10hfname = hf_bit10infoflagsh;
6553 pvalues[5].bit11 = "Not Defined";
6554 pvalues[5].bit11hfname = hf_bit11infoflagsh;
6555 pvalues[5].bit12 = "Not Defined";
6556 pvalues[5].bit12hfname = hf_bit12infoflagsh;
6557 pvalues[5].bit13 = "Not Defined";
6558 pvalues[5].bit13hfname = hf_bit13infoflagsh;
6559 pvalues[5].bit14 = "Not Defined";
6560 pvalues[5].bit14hfname = hf_bit14infoflagsh;
6561 pvalues[5].bit15 = "Not Defined";
6562 pvalues[5].bit15hfname = hf_bit15infoflagsh;
6563 pvalues[5].bit16 = "Not Defined";
6564 pvalues[5].bit16hfname = hf_bit16infoflagsh;
6565 foffset = foffset+2;
6566 pvalues[6].vtype = VTYPE_STRING;
6567 pvalues[6].vdesc = "Name Filter: %s";
6568 pvalues[6].mvtype = MVTYPE_ATTR_REQUEST;
6569 pvalues[6].vvalue = 0;
6570 pvalues[6].vlength = 256;
6571 pvalues[6].vlength = tvb_get_letohl(tvb, foffset);
6572 pvalues[6].voffset = foffset+4;
6573 foffset = foffset + 4;
6574 get_string(tvb, pvalues[6].voffset, pvalues[6].vlength, pvalues[6].vstring);
6575 pvalues[6].hfname= hf_nds_name_filter;
6576 foffset = foffset+pvalues[6].vlength;
6577 if(pvalues[0].vvalue == 0)
6581 foffset += align_4(tvb, foffset);
6582 pvalues[7].vtype = VTYPE_STRING;
6583 pvalues[7].vdesc = "Class Filter: %s";
6584 pvalues[7].mvtype = MVTYPE_ATTR_REQUEST;
6585 pvalues[7].vvalue = 0;
6586 pvalues[7].vlength = 256;
6587 pvalues[7].vlength = tvb_get_letohl(tvb, foffset);
6588 pvalues[7].voffset = foffset+4;
6589 foffset = foffset + 4;
6590 get_string(tvb, pvalues[7].voffset, pvalues[7].vlength, pvalues[7].vstring);
6591 pvalues[7].hfname= hf_nds_class_filter;
6592 foffset = foffset+pvalues[7].vlength;
6593 if(pvalues[0].vvalue == 1)
6597 foffset += align_4(tvb, foffset);
6598 pvalues[8].vvalue = tvb_get_letohl(tvb, foffset);
6599 pvalues[8].vtype = VTYPE_MULTIVALUE_UINT32;
6600 pvalues[8].vdesc = "Seconds: %u";
6601 pvalues[8].vlength = 4;
6602 pvalues[8].mvtype = MVTYPE_PRINT_TIMESTAMP;
6603 pvalues[8].hfname= hf_nds_time_filter;
6604 pvalues[8].voffset = foffset;
6607 verb_string = "Search Entries";
6608 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6609 pvalues[0].vstring = "";
6610 pvalues[0].vtype = VTYPE_UINT32;
6611 pvalues[0].vdesc = "Version: %u";
6612 pvalues[0].vlength = 4;
6613 pvalues[0].voffset = foffset;
6614 pvalues[0].hfname= hf_nds_ver;
6615 foffset = foffset+pvalues[0].vlength;
6616 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6617 pvalues[1].vtype = VTYPE_UINT32;
6618 pvalues[1].vstring = "";
6619 pvalues[1].vdesc = "Request Flags: 0x%08x";
6620 pvalues[1].vlength = 4;
6621 pvalues[1].hfname= hf_nds_rflags;
6622 pvalues[1].voffset = foffset;
6623 foffset = foffset+4;
6624 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6625 pvalues[2].vtype = VTYPE_UINT32;
6626 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
6627 pvalues[2].vlength = 4;
6628 pvalues[2].voffset = foffset;
6629 pvalues[2].hfname= hf_nds_iteration;
6630 foffset = foffset+pvalues[2].vlength;
6631 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6632 pvalues[3].vstring = "";
6633 pvalues[3].vtype = VTYPE_UINT32;
6634 pvalues[3].vdesc = "Base Entry ID: 0x%08x";
6635 pvalues[3].vlength = 4;
6636 resolve_eid = FALSE;
6637 global_eid = pvalues[3].vvalue;
6638 pvalues[3].voffset = foffset;
6639 pvalues[3].hfname= hf_nds_eid;
6640 foffset = foffset+pvalues[3].vlength;
6641 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
6642 pvalues[4].vstring = match_strval(pvalues[4].vvalue, nds_search_scope);
6643 if(pvalues[4].vstring == NULL)
6645 pvalues[4].vstring = "No Search Scope Defined";
6647 pvalues[4].vtype = VTYPE_STRING;
6648 pvalues[4].vdesc = "Replica Type: %s";
6649 pvalues[4].vlength = 4;
6650 pvalues[4].voffset = foffset;
6651 pvalues[4].mvtype = 0;
6652 pvalues[4].hfname= hf_nds_search_scope;
6653 foffset = foffset + pvalues[4].vlength;
6654 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
6655 pvalues[5].vtype = VTYPE_UINT32;
6656 pvalues[5].vdesc = "Number of Objects to Search: 0x%08x";
6657 pvalues[5].vlength = 4;
6658 pvalues[5].voffset = foffset;
6659 pvalues[5].hfname= hf_nds_num_objects;
6660 foffset = foffset+pvalues[5].vlength;
6661 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset);
6662 pvalues[6].vtype = VTYPE_BITFIELD;
6663 pvalues[6].vdesc = "Information Types:";
6664 pvalues[6].vlength = 2;
6665 pvalues[6].hfname= hf_nds_nflags;
6666 pvalues[6].voffset = foffset;
6667 pvalues[6].bit1 = "Names";
6668 pvalues[6].bit1hfname = hf_bit1siflags;
6669 pvalues[6].bit2 = "Names and Values";
6670 pvalues[6].bit2hfname = hf_bit2siflags;
6671 pvalues[6].bit3 = "Effective Privileges";
6672 pvalues[6].bit3hfname = hf_bit3siflags;
6673 pvalues[6].bit4 = "Value Info";
6674 pvalues[6].bit4hfname = hf_bit4siflags;
6675 pvalues[6].bit5 = "Abbreviated Value";
6676 pvalues[6].bit5hfname = hf_bit5siflags;
6677 pvalues[6].bit6 = "Not Defined";
6678 pvalues[6].bit6hfname = hf_bit6siflags;
6679 pvalues[6].bit7 = "Not Defined";
6680 pvalues[6].bit7hfname = hf_bit7siflags;
6681 pvalues[6].bit8 = "Not Defined";
6682 pvalues[6].bit8hfname = hf_bit8siflags;
6683 pvalues[6].bit9 = "Expanded Class";
6684 pvalues[6].bit9hfname = hf_bit9siflags;
6685 pvalues[6].bit10 = "Not Defined";
6686 pvalues[6].bit10hfname = hf_bit10siflags;
6687 pvalues[6].bit11= "Not Defined";
6688 pvalues[6].bit11hfname = hf_bit11siflags;
6689 pvalues[6].bit12 = "Not Defined";
6690 pvalues[6].bit12hfname = hf_bit12siflags;
6691 pvalues[6].bit13 = "Not Defined";
6692 pvalues[6].bit13hfname = hf_bit13siflags;
6693 pvalues[6].bit14 = "Not Defined";
6694 pvalues[6].bit14hfname = hf_bit14siflags;
6695 pvalues[6].bit15 = "Not Defined";
6696 pvalues[6].bit15hfname = hf_bit15siflags;
6697 pvalues[6].bit16 = "Not Defined";
6698 pvalues[6].bit16hfname = hf_bit16siflags;
6699 foffset = foffset+4;
6700 if(pvalues[0].vvalue != 2)
6702 pvalues[7].vvalue = tvb_get_letohs(tvb, foffset);
6703 global_flags = tvb_get_letohl(tvb, foffset);
6704 pvalues[7].vtype = VTYPE_BITFIELD;
6705 pvalues[7].vdesc = "Information Flags (low) Byte:";
6706 pvalues[7].vlength = 2;
6707 pvalues[7].hfname= hf_nds_rflags;
6708 pvalues[7].voffset = foffset;
6709 pvalues[7].bit1 = "Output Flags";
6710 pvalues[7].bit1hfname = hf_bit1infoflagsl;
6711 pvalues[7].bit2 = "Entry ID";
6712 pvalues[7].bit2hfname = hf_bit2infoflagsl;
6713 pvalues[7].bit3 = "Entry Flags";
6714 pvalues[7].bit3hfname = hf_bit3infoflagsl;
6715 pvalues[7].bit4 = "Subordinate Count";
6716 pvalues[7].bit4hfname = hf_bit4infoflagsl;
6717 pvalues[7].bit5 = "Modification Time";
6718 pvalues[7].bit5hfname = hf_bit5infoflagsl;
6719 pvalues[7].bit6 = "Modification Timestamp";
6720 pvalues[7].bit6hfname = hf_bit6infoflagsl;
6721 pvalues[7].bit7 = "Creation Timestamp";
6722 pvalues[7].bit7hfname = hf_bit7infoflagsl;
6723 pvalues[7].bit8 = "Partition Root ID";
6724 pvalues[7].bit8hfname = hf_bit8infoflagsl;
6725 pvalues[7].bit9 = "Parent ID";
6726 pvalues[7].bit9hfname = hf_bit9infoflagsl;
6727 pvalues[7].bit10 = "Revision Count";
6728 pvalues[7].bit10hfname = hf_bit10infoflagsl;
6729 pvalues[7].bit11 = "Replica Type";
6730 pvalues[7].bit11hfname = hf_bit11infoflagsl;
6731 pvalues[7].bit12 = "Base Class";
6732 pvalues[7].bit12hfname = hf_bit12infoflagsl;
6733 pvalues[7].bit13 = "Relative Distinguished Name";
6734 pvalues[7].bit13hfname = hf_bit13infoflagsl;
6735 pvalues[7].bit14 = "Distinguished Name";
6736 pvalues[7].bit14hfname = hf_bit14infoflagsl;
6737 pvalues[7].bit15 = "Root Distinguished Name";
6738 pvalues[7].bit15hfname = hf_bit15infoflagsl;
6739 pvalues[7].bit16 = "Parent Distinguished Name";
6740 pvalues[7].bit16hfname = hf_bit16infoflagsl;
6741 foffset = foffset+2;
6742 pvalues[8].vvalue = tvb_get_letohs(tvb, foffset);
6743 pvalues[8].vtype = VTYPE_BITFIELD;
6744 pvalues[8].vdesc = "Information Flags (high) Byte:";
6745 pvalues[8].vlength = 2;
6746 pvalues[8].hfname= hf_nds_rflags;
6747 pvalues[8].voffset = foffset;
6748 pvalues[8].bit1 = "Purge Time";
6749 pvalues[8].bit1hfname = hf_bit1infoflagsh;
6750 pvalues[8].bit2 = "Dereference Base Class";
6751 pvalues[8].bit2hfname = hf_bit2infoflagsh;
6752 pvalues[8].bit3 = "Not Defined";
6753 pvalues[8].bit3hfname = hf_bit3infoflagsh;
6754 pvalues[8].bit4 = "Not Defined";
6755 pvalues[8].bit4hfname = hf_bit4infoflagsh;
6756 pvalues[8].bit5 = "Not Defined";
6757 pvalues[8].bit5hfname = hf_bit5infoflagsh;
6758 pvalues[8].bit6 = "Not Defined";
6759 pvalues[8].bit6hfname = hf_bit6infoflagsh;
6760 pvalues[8].bit7 = "Not Defined";
6761 pvalues[8].bit7hfname = hf_bit7infoflagsh;
6762 pvalues[8].bit8 = "Not Defined";
6763 pvalues[8].bit8hfname = hf_bit8infoflagsh;
6764 pvalues[8].bit9 = "Not Defined";
6765 pvalues[8].bit9hfname = hf_bit9infoflagsh;
6766 pvalues[8].bit10 = "Not Defined";
6767 pvalues[8].bit10hfname = hf_bit10infoflagsh;
6768 pvalues[8].bit11 = "Not Defined";
6769 pvalues[8].bit11hfname = hf_bit11infoflagsh;
6770 pvalues[8].bit12 = "Not Defined";
6771 pvalues[8].bit12hfname = hf_bit12infoflagsh;
6772 pvalues[8].bit13 = "Not Defined";
6773 pvalues[8].bit13hfname = hf_bit13infoflagsh;
6774 pvalues[8].bit14 = "Not Defined";
6775 pvalues[8].bit14hfname = hf_bit14infoflagsh;
6776 pvalues[8].bit15 = "Not Defined";
6777 pvalues[8].bit15hfname = hf_bit15infoflagsh;
6778 pvalues[8].bit16 = "Not Defined";
6779 pvalues[8].bit16hfname = hf_bit16infoflagsh;
6780 foffset = foffset+2;
6784 verb_string = "Add Entry ->";
6785 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6786 pvalues[0].vstring = "";
6787 pvalues[0].vtype = VTYPE_UINT32;
6788 pvalues[0].vdesc = "Version: %u";
6789 pvalues[0].vlength = 4;
6790 pvalues[0].voffset = foffset;
6791 pvalues[0].hfname= hf_nds_ver;
6792 foffset = foffset+pvalues[0].vlength;
6793 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6794 pvalues[1].vtype = VTYPE_UINT32;
6795 pvalues[1].vstring = "";
6796 pvalues[1].vdesc = "Request Flags: 0x%08x";
6797 pvalues[1].vlength = 4;
6798 pvalues[1].hfname= hf_nds_rflags;
6799 pvalues[1].voffset = foffset;
6800 foffset = foffset+4;
6801 if(pvalues[0].vvalue == 0)
6803 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6804 pvalues[2].vstring = "";
6805 pvalues[2].vtype = VTYPE_UINT32;
6806 pvalues[2].vdesc = "Parent Entry ID: 0x%08x";
6807 pvalues[2].vlength = 4;
6808 resolve_eid = FALSE;
6809 global_eid = pvalues[2].vvalue;
6810 pvalues[2].voffset = foffset;
6811 pvalues[2].hfname= hf_nds_eid;
6812 foffset = foffset+pvalues[2].vlength;
6813 pvalues[3].vtype = VTYPE_STRING;
6814 pvalues[3].vdesc = "Relative Distinguished Name: %s";
6815 pvalues[3].vstring = "";
6816 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
6817 pvalues[3].vvalue = 0;
6818 pvalues[3].vlength = 256;
6819 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
6820 if (pvalues[3].vlength == 0x00)
6822 pvalues[3].vtype = VTYPE_NONE;
6825 pvalues[3].voffset = foffset+4;
6826 foffset = foffset + 4;
6827 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, req_buffer.buffer);
6828 pvalues[3].vstring = req_buffer.buffer;
6829 strcpy(global_object_name, req_buffer.buffer);
6830 pvalues[3].hfname= hf_nds_relative_dn;
6831 foffset = foffset+pvalues[3].vlength;
6832 foffset += align_4(tvb, foffset);
6833 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
6834 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
6835 pvalues[4].vstring = "";
6836 pvalues[4].vdesc = "Attributes: %u";
6837 pvalues[4].vlength = 4;
6838 pvalues[4].voffset = foffset;
6839 pvalues[4].mvtype = MVTYPE_ADD_ATTR_REQUEST;
6840 pvalues[4].hfname= hf_nds_attr;
6844 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6845 pvalues[2].vstring = "";
6846 pvalues[2].vtype = VTYPE_UINT32;
6847 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
6848 pvalues[2].vlength = 4;
6849 pvalues[2].voffset = foffset;
6850 pvalues[2].hfname= hf_nds_iteration;
6851 foffset = foffset+pvalues[2].vlength;
6852 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6853 pvalues[3].vstring = "";
6854 pvalues[3].vtype = VTYPE_UINT32;
6855 pvalues[3].vdesc = "Parent Entry ID: 0x%08x";
6856 pvalues[3].vlength = 4;
6857 resolve_eid = FALSE;
6858 global_eid = pvalues[3].vvalue;
6859 pvalues[3].voffset = foffset;
6860 pvalues[3].hfname= hf_nds_eid;
6861 foffset = foffset+pvalues[3].vlength;
6862 pvalues[4].vtype = VTYPE_STRING;
6863 pvalues[4].vdesc = "Relative Distinguished Name: %s";
6864 pvalues[4].vstring = "";
6865 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST;
6866 pvalues[4].vvalue = 0;
6867 pvalues[4].vlength = 256;
6868 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
6869 if (pvalues[4].vlength == 0x00)
6871 pvalues[4].vtype = VTYPE_NONE;
6874 pvalues[4].voffset = foffset+4;
6875 foffset = foffset + 4;
6876 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, req_buffer.buffer);
6877 pvalues[4].vstring = req_buffer.buffer;
6878 strcpy(global_object_name, req_buffer.buffer);
6879 pvalues[4].hfname= hf_nds_relative_dn;
6880 foffset = foffset+pvalues[4].vlength;
6881 foffset += align_4(tvb, foffset);
6882 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
6883 pvalues[5].vtype = VTYPE_MULTIVALUE_UINT32;
6884 pvalues[5].vstring = "";
6885 pvalues[5].vdesc = "Attributes: %u";
6886 pvalues[5].vlength = 4;
6887 pvalues[5].voffset = foffset;
6888 pvalues[5].mvtype = MVTYPE_ADD_ATTR_REQUEST;
6889 pvalues[5].hfname= hf_nds_attr;
6893 verb_string = "Remove Entry";
6894 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6895 pvalues[0].vtype = VTYPE_UINT32;
6896 pvalues[0].vdesc = "Version: %u";
6897 pvalues[0].vlength = 4;
6898 pvalues[0].voffset = foffset;
6899 pvalues[0].hfname= hf_nds_ver;
6900 foffset = foffset+pvalues[0].vlength;
6901 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6902 pvalues[1].vtype = VTYPE_UINT32;
6903 pvalues[1].vdesc = "Entry ID: 0x%08x";
6904 pvalues[1].vlength = 4;
6906 global_eid = pvalues[1].vvalue;
6907 pvalues[1].voffset = foffset;
6908 pvalues[1].hfname= hf_nds_eid;
6909 foffset = foffset+pvalues[1].vlength;
6912 verb_string = "Modify Entry";
6913 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6914 pvalues[0].vtype = VTYPE_UINT32;
6915 pvalues[0].vdesc = "Version: %u";
6916 pvalues[0].vlength = 4;
6917 pvalues[0].voffset = foffset;
6918 pvalues[0].hfname= hf_nds_ver;
6919 foffset = foffset+pvalues[0].vlength;
6920 if(pvalues[0].vvalue == 0)
6922 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6923 pvalues[1].vtype = VTYPE_UINT32;
6924 pvalues[1].vstring = "";
6925 pvalues[1].vdesc = "Iteration Handle: 0x%08x"; /* always 0 */
6926 pvalues[1].vlength = 4;
6927 pvalues[1].hfname= hf_nds_iteration;
6928 pvalues[1].voffset = foffset;
6929 foffset = foffset+4;
6930 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6931 pvalues[2].vstring = "";
6932 pvalues[2].vtype = VTYPE_UINT32;
6933 pvalues[2].vdesc = "Entry ID: 0x%08x";
6934 pvalues[2].vlength = 4;
6935 pvalues[2].voffset = foffset;
6937 global_eid = pvalues[2].vvalue;
6938 pvalues[2].hfname = hf_nds_eid;
6939 foffset = foffset+pvalues[2].vlength;
6940 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6941 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
6942 pvalues[3].vstring = "";
6943 pvalues[3].vdesc = "Number of Attributes to Change %u";
6944 pvalues[3].vlength = 4;
6945 pvalues[3].mvtype = MVTYPE_MODIFY_ATTR_REQUEST;
6946 pvalues[3].hfname= hf_nds_number_of_changes;
6947 pvalues[3].voffset = foffset;
6951 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6952 pvalues[1].vtype = VTYPE_UINT32;
6953 pvalues[1].vstring = "";
6954 pvalues[1].vdesc = "Request Flags: 0x%08x"; /* always 0 */
6955 pvalues[1].vlength = 4;
6956 pvalues[1].hfname= hf_nds_rflags;
6957 pvalues[1].voffset = foffset;
6958 foffset = foffset+4;
6959 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
6960 pvalues[2].vtype = VTYPE_UINT32;
6961 pvalues[2].vstring = "";
6962 pvalues[2].vdesc = "Iteration Handle: 0x%08x"; /* always 0 */
6963 pvalues[2].vlength = 4;
6964 pvalues[2].hfname= hf_nds_iteration;
6965 pvalues[2].voffset = foffset;
6966 foffset = foffset+4;
6967 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
6968 pvalues[3].vstring = "";
6969 pvalues[3].vtype = VTYPE_UINT32;
6970 pvalues[3].vdesc = "Entry ID: 0x%08x";
6971 pvalues[3].vlength = 4;
6972 pvalues[3].voffset = foffset;
6974 global_eid = pvalues[3].vvalue;
6975 pvalues[3].hfname = hf_nds_eid;
6976 foffset = foffset+pvalues[3].vlength;
6977 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
6978 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
6979 pvalues[4].vstring = "";
6980 pvalues[4].vdesc = "Number of Attributes to Change %u";
6981 pvalues[4].vlength = 4;
6982 pvalues[4].mvtype = MVTYPE_MODIFY_ATTR_REQUEST;
6983 pvalues[4].hfname= hf_nds_number_of_changes;
6984 pvalues[4].voffset = foffset;
6988 verb_string = "Modify RDN";
6989 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
6990 pvalues[0].vtype = VTYPE_UINT32;
6991 pvalues[0].vdesc = "Version: %u";
6992 pvalues[0].vlength = 4;
6993 pvalues[0].voffset = foffset;
6994 pvalues[0].hfname= hf_nds_ver;
6995 foffset = foffset+pvalues[0].vlength;
6996 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
6997 pvalues[1].vtype = VTYPE_UINT32;
6998 pvalues[1].vdesc = "Entry ID: 0x%08x";
6999 pvalues[1].vlength = 4;
7001 global_eid = pvalues[1].vvalue;
7002 pvalues[1].voffset = foffset;
7003 pvalues[1].hfname = hf_nds_eid;
7004 foffset = foffset+pvalues[1].vlength;
7005 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7006 pvalues[2].vtype = VTYPE_BOOLEAN;
7007 pvalues[2].vdesc = "Keep Original RDN: %s";
7008 pvalues[2].vlength = 4;
7009 pvalues[2].voffset = foffset;
7010 pvalues[2].mvtype = 0;
7011 pvalues[2].hfname= hf_nds_keep;
7012 foffset = foffset+4;
7013 foffset += align_4(tvb, foffset);
7014 pvalues[3].vtype = VTYPE_STRING;
7015 pvalues[3].vdesc = "New RDN: %s";
7016 pvalues[3].mvtype = 0;
7017 pvalues[3].vvalue = 0;
7018 pvalues[3].vlength = 256;
7019 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
7020 pvalues[3].voffset = foffset+4;
7021 foffset = foffset + 4;
7022 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
7023 pvalues[3].hfname= hf_nds_new_rdn;
7024 foffset = foffset+pvalues[3].vlength;
7027 verb_string = "Define Attribute ->";
7028 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7029 pvalues[0].vtype = VTYPE_UINT32;
7030 pvalues[0].vdesc = "Version: %u";
7031 pvalues[0].vlength = 4;
7032 pvalues[0].voffset = foffset;
7033 pvalues[0].hfname= hf_nds_ver;
7034 foffset = foffset+pvalues[0].vlength;
7035 pvalues[1].vvalue = tvb_get_letohs(tvb, foffset);
7036 global_flags = tvb_get_letohl(tvb, foffset);
7037 pvalues[1].vtype = VTYPE_BITFIELD;
7038 pvalues[1].vdesc = "Attribute Constraints:";
7039 pvalues[1].vlength = 2;
7040 pvalues[1].hfname= hf_nds_acflags;
7041 pvalues[1].voffset = foffset;
7042 pvalues[1].bit1 = "Single Valued";
7043 pvalues[1].bit1hfname = hf_bit1acflags;
7044 pvalues[1].bit2 = "Sized";
7045 pvalues[1].bit2hfname = hf_bit2acflags;
7046 pvalues[1].bit3 = "Non-Removable";
7047 pvalues[1].bit3hfname = hf_bit3acflags;
7048 pvalues[1].bit4 = "Read Only";
7049 pvalues[1].bit4hfname = hf_bit4acflags;
7050 pvalues[1].bit5 = "Hidden";
7051 pvalues[1].bit5hfname = hf_bit5acflags;
7052 pvalues[1].bit6 = "String";
7053 pvalues[1].bit6hfname = hf_bit6acflags;
7054 pvalues[1].bit7 = "Synchronize Immediate";
7055 pvalues[1].bit7hfname = hf_bit7acflags;
7056 pvalues[1].bit8 = "Public Read";
7057 pvalues[1].bit8hfname = hf_bit8acflags;
7058 pvalues[1].bit9 = "Server Read";
7059 pvalues[1].bit9hfname = hf_bit9acflags;
7060 pvalues[1].bit10 = "Write Managed";
7061 pvalues[1].bit10hfname = hf_bit10acflags;
7062 pvalues[1].bit11 = "Per Replica";
7063 pvalues[1].bit11hfname = hf_bit11acflags;
7064 pvalues[1].bit12 = "Never Schedule Synchronization";
7065 pvalues[1].bit12hfname = hf_bit12acflags;
7066 pvalues[1].bit13 = "Operational";
7067 pvalues[1].bit13hfname = hf_bit13acflags;
7068 pvalues[1].bit14 = "Not Defined";
7069 pvalues[1].bit14hfname = hf_bit14acflags;
7070 pvalues[1].bit15 = "Not Defined";
7071 pvalues[1].bit15hfname = hf_bit15acflags;
7072 pvalues[1].bit16 = "Not Defined";
7073 pvalues[1].bit16hfname = hf_bit16acflags;
7074 foffset = foffset+4;
7075 pvalues[2].vtype = VTYPE_STRING;
7076 pvalues[2].vdesc = "Attribute Name: %s";
7077 pvalues[2].mvtype = MVTYPE_ATTR_REQUEST;
7078 pvalues[2].vvalue = 0;
7079 pvalues[2].vlength = 256;
7080 pvalues[2].vlength = tvb_get_letohl(tvb, foffset);
7081 if (pvalues[2].vlength == 0x00)
7083 pvalues[2].vtype = VTYPE_NONE;
7086 pvalues[2].voffset = foffset+4;
7087 foffset = foffset + 4;
7088 get_string(tvb, pvalues[2].voffset, pvalues[2].vlength, req_buffer.buffer);
7089 pvalues[2].vstring = req_buffer.buffer;
7090 strcpy(global_object_name, req_buffer.buffer);
7091 pvalues[2].hfname= hf_nds_name;
7092 foffset = foffset+pvalues[2].vlength;
7093 foffset += align_4(tvb, foffset);
7094 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
7095 pvalues[3].vstring = match_strval(pvalues[3].vvalue, nds_syntax);
7096 if(pvalues[3].vstring == NULL)
7098 pvalues[3].vstring = "No Syntax Found";
7100 pvalues[3].vtype = VTYPE_STRING;
7101 pvalues[3].vdesc = "Syntax: %s";
7102 pvalues[3].vlength = 4;
7103 pvalues[3].voffset = foffset;
7104 pvalues[3].hfname= hf_nds_syntax;
7105 pvalues[3].mvtype = 0;
7106 foffset = foffset+pvalues[3].vlength;
7107 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
7108 pvalues[4].vtype = VTYPE_UINT32;
7109 pvalues[4].vdesc = "Lower Limit Value %u";
7110 pvalues[4].vlength = 4;
7111 pvalues[4].voffset = foffset;
7112 pvalues[4].hfname = hf_nds_lower;
7114 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
7115 pvalues[5].vtype = VTYPE_UINT32;
7116 pvalues[5].vdesc = "Upper Limit Value %u";
7117 pvalues[5].vlength = 4;
7118 pvalues[5].voffset = foffset;
7119 pvalues[5].hfname = hf_nds_upper;
7120 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset); /* Length of bytes field */
7122 pvalues[6].vtype = VTYPE_BYTES;
7123 pvalues[6].vdesc = "ASN.1 ID";
7124 pvalues[6].vlength = pvalues[6].vvalue;
7125 pvalues[6].voffset = foffset;
7126 pvalues[6].hfname = hf_nds_asn1;
7129 verb_string = "Read Attribute Definition";
7130 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7133 verb_string = "Remove Attribute Definition";
7134 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7135 pvalues[0].vtype = VTYPE_UINT32;
7136 pvalues[0].vdesc = "Version: %u";
7137 pvalues[0].vlength = 4;
7138 pvalues[0].voffset = foffset;
7139 pvalues[0].hfname= hf_nds_ver;
7140 foffset = foffset+pvalues[0].vlength;
7141 pvalues[1].vtype = VTYPE_STRING;
7142 pvalues[1].vdesc = "Attribute Name: %s";
7143 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
7144 pvalues[1].vvalue = 0;
7145 pvalues[1].vlength = 256;
7146 pvalues[1].vlength = tvb_get_letohl(tvb, foffset);
7147 if (pvalues[1].vlength == 0x00)
7149 pvalues[1].vtype = VTYPE_NONE;
7152 pvalues[1].voffset = foffset+4;
7153 foffset = foffset + 4;
7154 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, req_buffer.buffer);
7155 pvalues[1].vstring = req_buffer.buffer;
7156 strcpy(global_object_name, req_buffer.buffer);
7157 pvalues[1].hfname= hf_nds_attribute_dn;
7160 verb_string = "Define Class";
7161 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7164 verb_string = "Read Class Definition ->";
7165 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7166 pvalues[0].vtype = VTYPE_UINT32;
7167 pvalues[0].vdesc = "Version: %u";
7168 pvalues[0].vlength = 4;
7169 pvalues[0].voffset = foffset;
7170 pvalues[0].hfname= hf_nds_ver;
7171 foffset = foffset+pvalues[0].vlength;
7172 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7173 pvalues[1].vtype = VTYPE_UINT32;
7174 pvalues[1].vdesc = "Iteration Handle: 0x%08x";
7175 pvalues[1].vlength = 4;
7176 pvalues[1].voffset = foffset;
7177 pvalues[1].hfname= hf_nds_iteration;
7178 foffset = foffset+pvalues[1].vlength;
7179 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7180 global_flags = pvalues[2].vvalue;
7181 pvalues[2].vstring = match_strval(pvalues[2].vvalue, class_def_type);
7182 if(pvalues[2].vstring == NULL)
7184 pvalues[2].vstring = "No Class Definition Type Set";
7186 pvalues[2].vtype = VTYPE_STRING;
7187 pvalues[2].vdesc = "Class Definition Type: %s";
7188 pvalues[2].vlength = 4;
7189 pvalues[2].voffset = foffset;
7190 pvalues[2].mvtype = 0;
7191 pvalues[2].hfname= hf_nds_class_def_type;
7192 foffset = foffset + pvalues[2].vlength;
7193 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
7194 if (pvalues[3].vvalue == 0x00000000)
7196 pvalues[3].vstring = "Do Not Return All Classes";
7197 pvalues[3].mvtype = 0;
7201 pvalues[3].vstring = "Return All Classes";
7202 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
7204 pvalues[3].vtype = VTYPE_STRING;
7205 pvalues[3].vdesc = "%s";
7206 pvalues[3].vlength = 4;
7207 pvalues[3].voffset = foffset;
7208 pvalues[3].hfname= hf_nds_return_all_classes;
7209 foffset = foffset + pvalues[3].vlength;
7210 foffset += align_4(tvb, foffset);
7211 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
7212 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
7213 pvalues[4].vdesc = "Classes: %d";
7214 pvalues[4].vlength = 4;
7215 pvalues[4].voffset = foffset;
7216 pvalues[4].mvtype = MVTYPE_READ_CLASS_REQ;
7217 pvalues[4].hfname= hf_nds_classes;
7220 verb_string = "Modify Class Definition -> ";
7221 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7222 pvalues[0].vtype = VTYPE_UINT32;
7223 pvalues[0].vdesc = "Version: %u";
7224 pvalues[0].vlength = 4;
7225 pvalues[0].voffset = foffset;
7226 pvalues[0].hfname= hf_nds_ver;
7227 foffset = foffset+pvalues[0].vlength;
7228 pvalues[1].vtype = VTYPE_STRING;
7229 pvalues[1].vdesc = "Class Name: %s";
7230 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
7231 pvalues[1].vvalue = 0;
7232 pvalues[1].vlength = 256;
7233 pvalues[1].vlength = tvb_get_letohl(tvb, foffset);
7234 if (pvalues[1].vlength == 0x00)
7236 pvalues[1].vtype = VTYPE_NONE;
7239 pvalues[1].voffset = foffset+4;
7240 foffset = foffset + 4;
7241 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, req_buffer.buffer);
7242 pvalues[1].vstring = req_buffer.buffer;
7243 strcpy(global_object_name, req_buffer.buffer);
7244 pvalues[1].hfname= hf_nds_base_class;
7245 foffset = foffset+pvalues[1].vlength;
7246 foffset += align_4(tvb, foffset);
7247 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7248 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
7249 pvalues[2].vdesc = "Number of Attributes to Add: %u";
7250 pvalues[2].vlength = 4;
7251 pvalues[2].voffset = foffset;
7252 pvalues[2].mvtype = MVTYPE_MODIFY_CLASS;
7253 pvalues[2].hfname= hf_nds_att_add;
7256 verb_string = "Remove Class Definition";
7257 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7258 pvalues[0].vtype = VTYPE_UINT32;
7259 pvalues[0].vdesc = "Version: %u";
7260 pvalues[0].vlength = 4;
7261 pvalues[0].voffset = foffset;
7262 pvalues[0].hfname= hf_nds_ver;
7263 foffset = foffset+pvalues[0].vlength;
7264 pvalues[1].vtype = VTYPE_STRING;
7265 pvalues[1].vdesc = "Class Name: %s";
7266 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
7267 pvalues[1].vvalue = 0;
7268 pvalues[1].vlength = 256;
7269 pvalues[1].vlength = tvb_get_letohl(tvb, foffset);
7270 if (pvalues[1].vlength == 0x00)
7272 pvalues[1].vtype = VTYPE_NONE;
7275 pvalues[1].voffset = foffset+4;
7276 foffset = foffset + 4;
7277 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, req_buffer.buffer);
7278 pvalues[1].vstring = req_buffer.buffer;
7279 strcpy(global_object_name, req_buffer.buffer);
7280 pvalues[1].hfname= hf_nds_base;
7283 verb_string = "List Containable Classes";
7284 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7285 pvalues[0].vtype = VTYPE_UINT32;
7286 pvalues[0].vdesc = "Version: %u";
7287 pvalues[0].vlength = 4;
7288 pvalues[0].voffset = foffset;
7289 pvalues[0].hfname= hf_nds_ver;
7290 foffset = foffset+pvalues[0].vlength;
7291 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7292 pvalues[1].vtype = VTYPE_UINT32;
7293 pvalues[1].vdesc = "Iteration Handle: 0x%08x";
7294 pvalues[1].vlength = 4;
7295 pvalues[1].voffset = foffset;
7296 pvalues[1].hfname= hf_nds_iteration;
7297 foffset = foffset+pvalues[1].vlength;
7298 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7299 pvalues[2].vtype = VTYPE_UINT32;
7300 pvalues[2].vdesc = "Entry ID: 0x%08x";
7301 pvalues[2].vlength = 4;
7303 global_eid = pvalues[2].vvalue;
7304 pvalues[2].voffset = foffset;
7305 pvalues[2].hfname= hf_nds_eid;
7306 foffset = foffset+pvalues[2].vlength;
7309 verb_string = "Get Effective Rights -> ";
7310 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7311 pvalues[0].vtype = VTYPE_UINT32;
7312 pvalues[0].vdesc = "Version: %u";
7313 pvalues[0].vlength = 4;
7314 pvalues[0].voffset = foffset;
7315 pvalues[0].hfname= hf_nds_ver;
7316 foffset = foffset+pvalues[0].vlength;
7317 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7318 pvalues[1].vtype = VTYPE_UINT32;
7319 pvalues[1].vdesc = "Entry ID: 0x%08x";
7320 pvalues[1].vlength = 4;
7322 global_eid = pvalues[1].vvalue;
7323 pvalues[1].voffset = foffset;
7324 pvalues[1].hfname= hf_nds_eid;
7325 foffset = foffset+pvalues[1].vlength;
7326 pvalues[2].vtype = VTYPE_STRING;
7327 pvalues[2].vdesc = "Trustee Name: %s";
7328 pvalues[2].mvtype = MVTYPE_ATTR_REQUEST;
7329 pvalues[2].vvalue = 0;
7330 pvalues[2].vlength = 256;
7331 pvalues[2].vlength = tvb_get_letohl(tvb, foffset);
7332 if (pvalues[2].vlength == 0x00)
7334 pvalues[2].vtype = VTYPE_NONE;
7337 pvalues[2].voffset = foffset+4;
7338 foffset = foffset + 4;
7339 get_string(tvb, pvalues[2].voffset, pvalues[2].vlength, req_buffer.buffer);
7340 pvalues[2].vstring = req_buffer.buffer;
7341 pvalues[2].hfname= hf_nds_name;
7342 foffset = foffset+pvalues[2].vlength;
7343 foffset += align_4(tvb, foffset);
7344 pvalues[3].vtype = VTYPE_STRING;
7345 pvalues[3].vdesc = "Attribute to be Checked: %s";
7346 pvalues[3].mvtype = 0;
7347 pvalues[3].vvalue = 0;
7348 pvalues[3].vlength = 256;
7349 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
7350 if (pvalues[3].vlength == 0x00)
7352 pvalues[3].vtype = VTYPE_NONE;
7355 pvalues[3].voffset = foffset+4;
7356 foffset = foffset + 4;
7357 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
7358 pvalues[3].hfname= hf_nds_name;
7359 foffset = foffset+pvalues[3].vlength;
7360 foffset += align_4(tvb, foffset);
7361 if(pvalues[0].vvalue != 0)
7363 pvalues[4].vtype = VTYPE_STRING;
7364 pvalues[4].vdesc = "Security Equivalence: %s";
7365 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST;
7366 pvalues[4].vvalue = 0;
7367 pvalues[4].vlength = 256;
7368 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
7369 if (pvalues[4].vlength == 0x00)
7371 pvalues[4].vtype = VTYPE_NONE;
7374 pvalues[4].voffset = foffset+4;
7375 foffset = foffset + 4;
7376 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, pvalues[4].vstring);
7377 pvalues[4].hfname= hf_nds_name;
7378 foffset = foffset+pvalues[4].vlength;
7379 foffset += align_4(tvb, foffset);
7383 verb_string = "Add Partition";
7384 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7387 verb_string = "Remove Partition";
7388 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7391 verb_string = "List Partitions";
7392 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7393 pvalues[0].vtype = VTYPE_UINT32;
7394 pvalues[0].vdesc = "Version: %u";
7395 pvalues[0].vlength = 4;
7396 pvalues[0].voffset = foffset;
7397 pvalues[0].hfname= hf_nds_ver;
7398 foffset = foffset+pvalues[0].vlength;
7399 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7400 pvalues[1].vtype = VTYPE_BITFIELD;
7401 pvalues[1].vdesc = "Request Flags:";
7402 pvalues[1].vlength = 2;
7403 pvalues[1].hfname= hf_nds_rflags;
7404 pvalues[1].voffset = foffset;
7405 pvalues[1].bit1 = "Typeless";
7406 pvalues[1].bit1hfname = hf_nds_bit1;
7407 pvalues[1].bit2 = "All Containers";
7408 pvalues[1].bit2hfname = hf_nds_bit2;
7409 pvalues[1].bit3 = "Slashed";
7410 pvalues[1].bit3hfname = hf_nds_bit3;
7411 pvalues[1].bit4 = "Dotted";
7412 pvalues[1].bit4hfname = hf_nds_bit4;
7413 pvalues[1].bit5 = "Tuned";
7414 pvalues[1].bit5hfname = hf_nds_bit5;
7415 pvalues[1].bit6 = "Not Defined";
7416 pvalues[1].bit6hfname = hf_nds_bit6;
7417 pvalues[1].bit7 = "Not Defined";
7418 pvalues[1].bit7hfname = hf_nds_bit7;
7419 pvalues[1].bit8 = "Not Defined";
7420 pvalues[1].bit8hfname = hf_nds_bit8;
7421 pvalues[1].bit9 = "Not Defined";
7422 pvalues[1].bit9hfname = hf_nds_bit9;
7423 pvalues[1].bit10 = "Not Defined";
7424 pvalues[1].bit10hfname = hf_nds_bit10;
7425 pvalues[1].bit11 = "Not Defined";
7426 pvalues[1].bit11hfname = hf_nds_bit11;
7427 pvalues[1].bit12 = "Not Defined";
7428 pvalues[1].bit12hfname = hf_nds_bit12;
7429 pvalues[1].bit13 = "Not Defined";
7430 pvalues[1].bit13hfname = hf_nds_bit13;
7431 pvalues[1].bit14 = "Not Defined";
7432 pvalues[1].bit14hfname = hf_nds_bit14;
7433 pvalues[1].bit15 = "Not Defined";
7434 pvalues[1].bit15hfname = hf_nds_bit15;
7435 pvalues[1].bit16 = "Not Defined";
7436 pvalues[1].bit16hfname = hf_nds_bit16;
7437 foffset = foffset+pvalues[1].vlength;
7438 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7439 pvalues[2].vtype = VTYPE_UINT32;
7440 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
7441 pvalues[2].vlength = 4;
7442 pvalues[2].voffset = foffset;
7443 pvalues[2].hfname= hf_nds_iteration;
7444 foffset = foffset+pvalues[2].vlength;
7445 if(pvalues[0].vvalue == 0)
7447 global_flags = 0x000000c0;
7450 pvalues[3].vvalue = tvb_get_letohs(tvb, foffset);
7451 pvalues[3].vtype = VTYPE_BITFIELD;
7452 pvalues[3].vdesc = "Information Flags (low) Byte:";
7453 pvalues[3].vlength = 2;
7454 pvalues[3].hfname= hf_nds_rflags;
7455 pvalues[3].voffset = foffset;
7456 pvalues[3].bit1 = "Output Flags";
7457 pvalues[3].bit1hfname = hf_bit1l1flagsl;
7458 pvalues[3].bit2 = "Entry ID";
7459 pvalues[3].bit2hfname = hf_bit2l1flagsl;
7460 pvalues[3].bit3 = "Replica State";
7461 pvalues[3].bit3hfname = hf_bit3l1flagsl;
7462 pvalues[3].bit4 = "Modification Timestamp";
7463 pvalues[3].bit4hfname = hf_bit4l1flagsl;
7464 pvalues[3].bit5 = "Purge Time";
7465 pvalues[3].bit5hfname = hf_bit5l1flagsl;
7466 pvalues[3].bit6 = "Local Partition ID";
7467 pvalues[3].bit6hfname = hf_bit6l1flagsl;
7468 pvalues[3].bit7 = "Distinguished Name";
7469 pvalues[3].bit7hfname = hf_bit7l1flagsl;
7470 pvalues[3].bit8 = "Replica Type";
7471 pvalues[3].bit8hfname = hf_bit8l1flagsl;
7472 pvalues[3].bit9 = "Partition Busy";
7473 pvalues[3].bit9hfname = hf_bit9l1flagsl;
7474 pvalues[3].bit10 = "Not Defined";
7475 pvalues[3].bit10hfname = hf_bit10l1flagsl;
7476 pvalues[3].bit11 = "Not Defined";
7477 pvalues[3].bit11hfname = hf_bit11l1flagsl;
7478 pvalues[3].bit12 = "Not Defined";
7479 pvalues[3].bit12hfname = hf_bit12l1flagsl;
7480 pvalues[3].bit13 = "Not Defined";
7481 pvalues[3].bit13hfname = hf_bit13l1flagsl;
7482 pvalues[3].bit14 = "Not Defined";
7483 pvalues[3].bit14hfname = hf_bit14l1flagsl;
7484 pvalues[3].bit15 = "Not Defined";
7485 pvalues[3].bit15hfname = hf_bit15l1flagsl;
7486 pvalues[3].bit16 = "Not Defined";
7487 pvalues[3].bit16hfname = hf_bit16l1flagsl;
7488 global_flags = pvalues[3].vvalue;
7489 foffset = foffset+2;
7490 pvalues[4].vvalue = tvb_get_letohs(tvb, foffset);
7491 pvalues[4].vtype = VTYPE_BITFIELD;
7492 pvalues[4].vdesc = "Information Flags (high) Byte:";
7493 pvalues[4].vlength = 2;
7494 pvalues[4].hfname= hf_nds_rflags;
7495 pvalues[4].voffset = foffset;
7496 pvalues[4].bit1 = "Not Defined";
7497 pvalues[4].bit1hfname = hf_bit1l1flagsl;
7498 pvalues[4].bit2 = "Not Defined";
7499 pvalues[4].bit2hfname = hf_bit2l1flagsl;
7500 pvalues[4].bit3 = "Not Defined";
7501 pvalues[4].bit3hfname = hf_bit3l1flagsl;
7502 pvalues[4].bit4 = "Not Defined";
7503 pvalues[4].bit4hfname = hf_bit4l1flagsl;
7504 pvalues[4].bit5 = "Not Defined";
7505 pvalues[4].bit5hfname = hf_bit5l1flagsl;
7506 pvalues[4].bit6 = "Not Defined";
7507 pvalues[4].bit6hfname = hf_bit6l1flagsl;
7508 pvalues[4].bit7 = "Not Defined";
7509 pvalues[4].bit7hfname = hf_bit7l1flagsl;
7510 pvalues[4].bit8 = "Not Defined";
7511 pvalues[4].bit8hfname = hf_bit8l1flagsl;
7512 pvalues[4].bit9 = "Not Defined";
7513 pvalues[4].bit9hfname = hf_bit9l1flagsl;
7514 pvalues[4].bit10 = "Not Defined";
7515 pvalues[4].bit10hfname = hf_bit10l1flagsl;
7516 pvalues[4].bit11 = "Not Defined";
7517 pvalues[4].bit11hfname = hf_bit11l1flagsl;
7518 pvalues[4].bit12 = "Not Defined";
7519 pvalues[4].bit12hfname = hf_bit12l1flagsl;
7520 pvalues[4].bit13 = "Not Defined";
7521 pvalues[4].bit13hfname = hf_bit13l1flagsl;
7522 pvalues[4].bit14 = "Not Defined";
7523 pvalues[4].bit14hfname = hf_bit14l1flagsl;
7524 pvalues[4].bit15 = "Not Defined";
7525 pvalues[4].bit15hfname = hf_bit15l1flagsl;
7526 pvalues[4].bit16 = "Not Defined";
7527 pvalues[4].bit16hfname = hf_bit16l1flagsl;
7528 foffset = foffset+2;
7529 if(pvalues[0].vvalue == 1)
7533 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
7534 pvalues[5].vtype = VTYPE_UINT32;
7535 pvalues[5].vdesc = "Partition Root ID: 0x%08x";
7536 pvalues[5].vlength = 4;
7537 pvalues[5].voffset = foffset;
7538 pvalues[5].hfname= hf_nds_partition_root_id;
7539 foffset = foffset+pvalues[5].vlength;
7542 verb_string = "Split Partition";
7543 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7544 nds_version = pvalues[0].vvalue;
7545 pvalues[0].vtype = VTYPE_UINT32;
7546 pvalues[0].vdesc = "Version: %u";
7547 pvalues[0].vlength = 4;
7548 pvalues[0].hfname = hf_nds_ver;
7549 pvalues[0].voffset = foffset;
7550 foffset = foffset+pvalues[0].vlength;
7551 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7552 nds_version = pvalues[1].vvalue;
7553 pvalues[1].vtype = VTYPE_UINT32;
7554 pvalues[1].vdesc = "Flags: 0x%08x";
7555 pvalues[1].vlength = 4;
7556 pvalues[1].hfname = hf_nds_req_flags;
7557 pvalues[1].voffset = foffset;
7558 foffset = foffset+pvalues[1].vlength;
7559 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7560 pvalues[2].vtype = VTYPE_UINT32;
7561 pvalues[2].vdesc = "New Partition Root ID: 0x%08x";
7562 pvalues[2].vlength = 4;
7563 pvalues[2].voffset = foffset;
7564 pvalues[2].hfname= hf_nds_new_part_id;
7565 foffset = foffset+pvalues[2].vlength;
7568 verb_string = "Join Partitions";
7569 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7570 nds_version = pvalues[0].vvalue;
7571 pvalues[0].vtype = VTYPE_UINT32;
7572 pvalues[0].vdesc = "Version: %u";
7573 pvalues[0].vlength = 4;
7574 pvalues[0].hfname = hf_nds_ver;
7575 pvalues[0].voffset = foffset;
7576 foffset = foffset+pvalues[0].vlength;
7577 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7578 nds_version = pvalues[1].vvalue;
7579 pvalues[1].vtype = VTYPE_UINT32;
7580 pvalues[1].vdesc = "Flags: 0x%08x";
7581 pvalues[1].vlength = 4;
7582 pvalues[1].hfname = hf_nds_req_flags;
7583 pvalues[1].voffset = foffset;
7584 foffset = foffset+pvalues[1].vlength;
7585 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7586 pvalues[2].vtype = VTYPE_UINT32;
7587 pvalues[2].vdesc = "Child Partition Root ID: 0x%08x";
7588 pvalues[2].vlength = 4;
7589 pvalues[2].voffset = foffset;
7590 pvalues[2].hfname= hf_nds_child_part_id;
7591 foffset = foffset+pvalues[2].vlength;
7594 verb_string = "Add Replica";
7595 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7596 nds_version = pvalues[0].vvalue;
7597 pvalues[0].vtype = VTYPE_UINT32;
7598 pvalues[0].vdesc = "Version: %u";
7599 pvalues[0].vlength = 4;
7600 pvalues[0].hfname = hf_nds_ver;
7601 pvalues[0].voffset = foffset;
7602 foffset = foffset+pvalues[0].vlength;
7603 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7604 nds_version = pvalues[1].vvalue;
7605 pvalues[1].vtype = VTYPE_UINT32;
7606 pvalues[1].vdesc = "Flags: 0x%08x";
7607 pvalues[1].vlength = 4;
7608 pvalues[1].hfname = hf_nds_req_flags;
7609 pvalues[1].voffset = foffset;
7610 foffset = foffset+pvalues[1].vlength;
7611 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7612 pvalues[2].vtype = VTYPE_UINT32;
7613 pvalues[2].vdesc = "Master Partition Root ID: 0x%08x";
7614 pvalues[2].vlength = 4;
7615 pvalues[2].voffset = foffset;
7616 pvalues[2].hfname= hf_nds_master_part_id;
7617 foffset = foffset+pvalues[2].vlength;
7618 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
7619 pvalues[3].vstring = match_strval(pvalues[3].vvalue, nds_replica_type);
7620 if(pvalues[3].vstring == NULL)
7622 pvalues[3].vstring = "No Replica Type Found";
7624 pvalues[3].vtype = VTYPE_STRING;
7625 pvalues[3].vdesc = "Replica Type: %s";
7626 pvalues[3].vlength = 4;
7627 pvalues[3].voffset = foffset;
7628 pvalues[3].mvtype = 0;
7629 pvalues[3].hfname= hf_replica_type;
7630 foffset = foffset + pvalues[3].vlength;
7631 pvalues[4].vtype = VTYPE_STRING;
7632 pvalues[4].vdesc = "Target Server Name: %s";
7633 pvalues[4].mvtype = 0;
7634 pvalues[4].vvalue = 0;
7635 pvalues[4].vlength = 256;
7636 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
7637 if (pvalues[4].vlength == 0x00)
7639 pvalues[4].vtype = VTYPE_NONE;
7642 pvalues[4].voffset = foffset+4;
7643 foffset = foffset + 4;
7644 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, pvalues[4].vstring);
7645 pvalues[4].hfname= hf_nds_target_name;
7648 verb_string = "Remove Replica";
7649 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7652 verb_string = "Open Stream -> ";
7653 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7654 nds_version = pvalues[0].vvalue;
7655 pvalues[0].vtype = VTYPE_UINT32;
7656 pvalues[0].vdesc = "Version: %u";
7657 pvalues[0].vlength = 4;
7658 pvalues[0].hfname = hf_nds_ver;
7659 pvalues[0].voffset = foffset;
7660 foffset = foffset+pvalues[0].vlength;
7661 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7662 nds_version = pvalues[1].vvalue;
7663 pvalues[1].vtype = VTYPE_UINT32;
7664 pvalues[1].vdesc = "Streams Flags: 0x%08x";
7665 pvalues[1].vlength = 4;
7666 pvalues[1].hfname = hf_nds_stream_flags;
7667 pvalues[1].voffset = foffset;
7668 foffset = foffset+pvalues[1].vlength;
7669 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7670 pvalues[2].vtype = VTYPE_UINT32;
7671 pvalues[2].vdesc = "Entry ID: 0x%08x";
7672 pvalues[2].vlength = 4;
7674 global_eid = pvalues[2].vvalue;
7675 pvalues[2].voffset = foffset;
7676 pvalues[2].hfname= hf_nds_eid;
7677 foffset = foffset+pvalues[2].vlength;
7678 pvalues[3].vtype = VTYPE_STRING;
7679 pvalues[3].vdesc = "Stream Name: %s";
7680 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
7681 pvalues[3].vvalue = 0;
7682 pvalues[3].vlength = 256;
7683 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
7684 if (pvalues[3].vlength == 0x00)
7686 pvalues[3].vtype = VTYPE_NONE;
7689 pvalues[3].voffset = foffset+4;
7691 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
7692 foffset += pvalues[3].vlength;
7693 foffset += align_4(tvb, foffset);
7694 pvalues[3].hfname= hf_nds_stream_name;
7697 verb_string = "Search Filter";
7698 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7701 verb_string = "Create Subordinate Reference";
7702 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7705 verb_string = "Link Replica";
7706 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7709 verb_string = "Change Replica Type";
7710 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7713 verb_string = "Start Update Schema";
7714 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7717 verb_string = "End Update Schema";
7718 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7721 verb_string = "Update Schema";
7722 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7725 verb_string = "Start Update Replica";
7726 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7729 verb_string = "End Update Replica";
7730 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7733 verb_string = "Update Replica";
7734 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7737 verb_string = "Synchronize Partition";
7738 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7739 nds_version = pvalues[0].vvalue;
7740 pvalues[0].vtype = VTYPE_UINT32;
7741 pvalues[0].vdesc = "Version: %u";
7742 pvalues[0].vlength = 4;
7743 pvalues[0].hfname = hf_nds_ver;
7744 pvalues[0].voffset = foffset;
7745 foffset = foffset+pvalues[0].vlength;
7746 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7747 nds_version = pvalues[1].vvalue;
7748 pvalues[1].vtype = VTYPE_UINT32;
7749 pvalues[1].vdesc = "Flags: 0x%08x";
7750 pvalues[1].vlength = 4;
7751 pvalues[1].hfname = hf_nds_req_flags;
7752 pvalues[1].voffset = foffset;
7753 foffset = foffset+pvalues[1].vlength;
7754 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7755 pvalues[2].vtype = VTYPE_UINT32;
7756 pvalues[2].vdesc = "Time Delay in Seconds: %u";
7757 pvalues[2].vlength = 4;
7758 pvalues[2].voffset = foffset;
7759 pvalues[2].hfname= hf_nds_time_delay;
7760 foffset = foffset+pvalues[2].vlength;
7761 if(pvalues[0].vvalue == 0)
7763 pvalues[3].vtype = VTYPE_STRING;
7764 pvalues[3].vdesc = "Root Most Object Name: %s";
7765 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
7766 pvalues[3].vvalue = 0;
7767 pvalues[3].vlength = 256;
7768 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
7769 if (pvalues[3].vlength == 0x00)
7771 pvalues[3].vtype = VTYPE_NONE;
7774 pvalues[3].voffset = foffset+4;
7776 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
7777 foffset += pvalues[3].vlength;
7778 foffset += align_4(tvb, foffset);
7779 pvalues[3].hfname= hf_nds_root_name;
7783 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
7784 pvalues[3].vtype = VTYPE_UINT32;
7785 pvalues[3].vdesc = "Entry ID: 0x%08x";
7786 pvalues[3].vlength = 4;
7788 global_eid = pvalues[3].vvalue;
7789 pvalues[3].voffset = foffset;
7790 pvalues[3].hfname= hf_nds_eid;
7791 foffset = foffset+pvalues[3].vlength;
7793 global_eid = pvalues[3].vvalue;
7797 verb_string = "Synchronize Schema";
7798 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7801 verb_string = "Read Syntaxes";
7802 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7805 verb_string = "Get Replica Root ID";
7806 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7809 verb_string = "Begin Move Entry";
7810 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7813 verb_string = "Finish Move Entry";
7814 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7817 verb_string = "Release Moved Entry";
7818 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7821 verb_string = "Backup Entry";
7822 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7825 verb_string = "Restore Entry";
7826 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7829 verb_string = "Save DIB";
7830 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7833 verb_string = "Control";
7834 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7837 verb_string = "Remove Backlink";
7838 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7841 verb_string = "Close Iteration";
7842 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7845 verb_string = "Mutate Entry";
7846 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7849 verb_string = "Audit Skulking";
7850 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7853 verb_string = "Get Server Address";
7854 pvalues[0].vvalue = 0;
7857 verb_string = "Set Keys";
7858 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7861 verb_string = "Change Password";
7862 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7865 verb_string = "Verify Password";
7866 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7869 verb_string = "Begin Login";
7870 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7871 pvalues[0].vtype = VTYPE_UINT32;
7872 pvalues[0].vdesc = "Version: %u";
7873 pvalues[0].vlength = 4;
7874 pvalues[0].voffset = foffset;
7875 pvalues[0].hfname= hf_nds_ver;
7876 foffset = foffset+pvalues[0].vlength;
7877 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7878 pvalues[1].vtype = VTYPE_UINT32;
7879 pvalues[1].vdesc = "Entry ID: 0x%08x";
7880 pvalues[1].vlength = 4;
7882 global_eid = pvalues[1].vvalue;
7883 pvalues[1].voffset = foffset;
7884 pvalues[1].hfname= hf_nds_eid;
7885 foffset = foffset+pvalues[1].vlength;
7888 verb_string = "Finish Login";
7889 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7890 pvalues[0].vtype = VTYPE_UINT32;
7891 pvalues[0].vdesc = "Reply Buffer Size: %u";
7892 pvalues[0].vlength = 4;
7893 pvalues[0].voffset = foffset;
7894 pvalues[0].hfname= hf_nds_buffer_size;
7895 foffset = foffset+pvalues[0].vlength;
7896 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7897 pvalues[1].vtype = VTYPE_UINT32;
7898 pvalues[1].vdesc = "Version: %u";
7899 pvalues[1].vlength = 4;
7900 pvalues[1].voffset = foffset;
7901 pvalues[1].hfname= hf_nds_ver;
7902 foffset = foffset+pvalues[1].vlength;
7903 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
7904 pvalues[2].vtype = VTYPE_UINT32;
7905 pvalues[2].vdesc = "Entry ID: 0x%08x";
7906 pvalues[2].vlength = 4;
7908 global_eid = pvalues[2].vvalue;
7909 pvalues[2].voffset = foffset;
7910 pvalues[2].hfname= hf_nds_eid;
7911 foffset = foffset+pvalues[2].vlength;
7914 verb_string = "Begin Authentication";
7915 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
7916 pvalues[0].vtype = VTYPE_UINT32;
7917 pvalues[0].vdesc = "Version: %u";
7918 pvalues[0].vlength = 4;
7919 pvalues[0].voffset = foffset;
7920 pvalues[0].hfname= hf_nds_ver;
7921 foffset = foffset+pvalues[0].vlength;
7922 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
7923 pvalues[1].vtype = VTYPE_UINT32;
7924 pvalues[1].vdesc = "Entry ID: 0x%08x";
7925 pvalues[1].vlength = 4;
7927 global_eid = pvalues[1].vvalue;
7928 pvalues[1].voffset = foffset;
7929 pvalues[1].hfname= hf_nds_eid;
7930 foffset = foffset+pvalues[1].vlength;
7933 verb_string = "Finish Authentication";
7936 verb_string = "Logout";
7937 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7940 verb_string = "Repair Ring";
7941 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7944 verb_string = "Repair Timestamps";
7945 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7948 verb_string = "Create Back Link";
7949 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7952 verb_string = "Delete External Reference";
7953 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7956 verb_string = "Rename External Reference";
7957 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7960 verb_string = "Create Directory Entry";
7961 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7964 verb_string = "Remove Directory Entry";
7965 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7968 verb_string = "Designate New Master";
7969 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7972 verb_string = "Change Tree Name";
7973 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7976 verb_string = "Partition Entry Count";
7977 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7980 verb_string = "Check Login Restrictions";
7981 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7984 verb_string = "Start Join";
7985 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7988 verb_string = "Low Level Split";
7989 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7992 verb_string = "Low Level Join";
7993 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
7996 verb_string = "Abort Low Level Join";
7997 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
8000 verb_string = "Get All Servers";
8001 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
8004 verb_string = "Continuation Fragment";
8005 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
8008 /* Fill in the INFO column. */
8009 if (check_col(pinfo->cinfo, COL_INFO)) {
8012 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
8013 if (nds_frag != 0xffffffff) {
8014 col_add_fstr(pinfo->cinfo, COL_INFO, "C Continue NDS Fragment %08x", nds_frag);
8017 col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string);
8021 col_add_fstr(pinfo->cinfo, COL_INFO,
8022 "C Unknown Function %d (0x%02x)",
8027 if (!pinfo->fd->flags.visited) {
8029 /* This is the first time we've looked at this packet.
8030 Keep track of the address and connection whence the request
8031 came, and the address and connection to which the request
8032 is being sent, so that we can match up calls with replies.
8033 (We don't include the sequence number, as we may want
8034 to have all packets over the same connection treated
8035 as being part of a single conversation so that we can
8036 let the user select that conversation to be displayed.) */
8038 conversation = find_conversation(&pinfo->src, &pinfo->dst,
8039 PT_NCP, nw_connection, nw_connection, 0);
8041 if (conversation == NULL) {
8042 /* It's not part of any conversation - create a new one. */
8043 conversation = conversation_new(&pinfo->src, &pinfo->dst,
8044 PT_NCP, nw_connection, nw_connection, 0);
8047 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
8048 request_value->req_frame_num = pinfo->fd->num;
8049 request_value->req_frame_time.secs=pinfo->fd->abs_secs;
8050 request_value->req_frame_time.nsecs=pinfo->fd->abs_usecs*1000;
8052 /* If this is the first time we're examining the packet,
8053 * check to see if this NCP type uses a "request condition".
8054 * If so, we have to build a proto_tree because request conditions
8055 * use display filters to work, and without a proto_tree,
8056 * display filters can't possibly work. If we already have
8057 * a proto_tree, then wonderful. If we don't, we need to build
8059 if (ncp_rec && !ncp_tree) {
8062 temp_tree = proto_tree_create_root();
8063 proto_tree_set_visible(temp_tree, FALSE);
8064 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
8065 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
8070 /* If the dissection throws an exception, be sure to free
8071 * the temporary proto_tree that was created. Because of the
8072 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
8073 * block; it has to be in the same scope as the terminating
8074 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
8075 * call CLEANUP_POP and friends, but the value of temp_tree is
8076 * NULL if no cleanup is needed, and non-null if cleanup is needed.
8079 CLEANUP_PUSH(free_proto_tree, temp_tree);
8081 conversation = find_conversation(&pinfo->src, &pinfo->dst,
8082 PT_NCP, nw_connection, nw_connection, 0);
8087 case NCP_BROADCAST_SLOT:
8091 case NCP_SERVICE_REQUEST:
8093 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
8094 if (ncp_rec && ncp_rec->request_ptvc)
8096 clear_repeat_vars();
8097 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
8099 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
8100 func, "Function: %d (0x%02X), %s",
8101 func, func, ncp_rec ? ncp_rec->name : "Unknown");
8103 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
8104 subfunc, "SubFunction: %d (0x%02x)",
8107 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, 8, 4,
8110 if (nds_frag == 0xffffffff) {
8112 proto_tree_add_item(ncp_tree, hf_ncp_fragment_size, tvb, 12, 4, TRUE);
8114 proto_tree_add_item(ncp_tree, hf_ncp_message_size, tvb, 16, 4, TRUE);
8116 proto_tree_add_item(ncp_tree, hf_ncp_nds_flag, tvb, 20, 4, FALSE);
8118 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 24, 4,
8119 nds_verb, "NDS Verb: %d, (0x%02x), %s",
8120 nds_verb, nds_verb, verb_string);
8121 for (i = 0; i < 9; i++) {
8122 switch (pvalues[i].vtype) {
8124 case VTYPE_NONE: /* no value */
8128 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8129 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %d",
8134 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8135 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %d",
8140 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8141 pvalues[i].vlength, pvalues[i].vvalue, pvalues[i].vdesc,
8146 proto_tree_add_string_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8147 pvalues[i].vlength, pvalues[i].vstring, pvalues[i].vdesc, pvalues[i].vstring);
8148 if (pvalues[i].mvtype == MVTYPE_ATTR_REQUEST) {
8150 * The "vstring" value is set to the input ES type
8151 * for MVTYPE_PROC_ENTRY_SPECIFIERS,
8152 * to add string to columninfo
8154 if (check_col(pinfo->cinfo, COL_INFO))
8155 col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
8159 case VTYPE_BITFIELD:
8160 process_bitfield(ncp_tree, tvb, &pvalues[i]);
8163 case VTYPE_MULTIVALUE_UINT32:
8164 process_multivalues(ncp_tree, tvb, &pvalues[i]);
8165 if (pvalues[i].mvtype == MVTYPE_PROC_ENTRY_SPECIFIERS) {
8167 * The "vstring" value is set to the input ES type
8168 * by "process_multivalues()".
8170 strcpy(global_object_name, pvalues[i].vstring);
8172 if (pvalues[i].mvtype == MVTYPE_ATTR_REQUEST || pvalues[i].mvtype == MVTYPE_PROC_ENTRY_SPECIFIERS) {
8174 * The "vstring" value is set to the input ES type
8175 * for MVTYPE_PROC_ENTRY_SPECIFIERS,
8176 * and the last string for MVTYPE_ATTR_REQUEST,
8177 * by "process_multivalues()".
8179 if (check_col(pinfo->cinfo, COL_INFO))
8180 col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
8185 proto_tree_add_bytes(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8186 pvalues[i].vlength, tvb_get_ptr(tvb, pvalues[i].voffset, pvalues[i].vvalue));
8190 proto_tree_add_item(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset, pvalues[i].vlength, TRUE);
8194 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, pvalues[i].voffset,
8195 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
8199 /* For NDS requests with just an EID, resolve name from hash table. */
8201 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
8203 if (request_eid_value) {
8204 strcpy(global_object_name, request_eid_value->object_name);
8205 if (check_col(pinfo->cinfo, COL_INFO))
8207 col_append_str(pinfo->cinfo, COL_INFO, ", Object Name - ");
8208 col_append_str(pinfo->cinfo, COL_INFO, global_object_name);
8210 /*resolve_eid = FALSE;*/
8215 request_value->nds_request_verb = nds_verb;
8216 request_value->nds_version = nds_version;
8217 strcpy(request_value->object_name, global_object_name);
8218 request_value->req_nds_flags = global_flags;
8227 ptvcursor_free(ptvc);
8229 /* Free the temporary proto_tree */
8230 CLEANUP_CALL_AND_POP;
8235 * XXX - this duplicates stuff in "dissect_ncp_request()"; could
8236 * "dissect_ncp_request()" not just call "dissect_ping_req()" if
8237 * the operation is an NCP ping, and "dissect_ping_req()" just dissect
8241 dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
8242 guint16 nw_connection, guint8 sequence,
8243 guint16 type, proto_tree *ncp_tree)
8245 guint8 func, subfunc = 0;
8246 ncp_req_hash_value *request_value = NULL;
8247 const ncp_record *ncp_rec = NULL;
8248 conversation_t *conversation;
8249 ptvcursor_t *ptvc = NULL;
8250 proto_tree *temp_tree = NULL;
8251 gint length_remaining = 0;
8253 guint32 ping_version;
8255 char string_buffer[1024];
8262 string_buffer[0] = '\0';
8263 pvalue.vstring = string_buffer;
8266 func = tvb_get_guint8(tvb, 6);
8267 subfunc = tvb_get_guint8(tvb, 7);
8269 ncp_rec = ncp_record_find(func, subfunc);
8271 /* Fill in the INFO column. */
8272 if (check_col(pinfo->cinfo, COL_INFO))
8277 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
8278 col_add_fstr(pinfo->cinfo, COL_INFO, "C Ping for NDS");
8282 if (!pinfo->fd->flags.visited)
8285 /* This is the first time we've looked at this packet.
8286 Keep track of the address and connection whence the request
8287 came, and the address and connection to which the request
8288 is being sent, so that we can match up calls with replies.
8289 (We don't include the sequence number, as we may want
8290 to have all packets over the same connection treated
8291 as being part of a single conversation so that we can
8292 let the user select that conversation to be displayed.) */
8294 conversation = find_conversation(&pinfo->src, &pinfo->dst,
8295 PT_NCP, nw_connection, nw_connection, 0);
8297 if (conversation == NULL)
8299 /* It's not part of any conversation - create a new one. */
8300 conversation = conversation_new(&pinfo->src, &pinfo->dst,
8301 PT_NCP, nw_connection, nw_connection, 0);
8304 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
8305 request_value->req_frame_num = pinfo->fd->num;
8306 request_value->req_frame_time.secs=pinfo->fd->abs_secs;
8307 request_value->req_frame_time.nsecs=pinfo->fd->abs_usecs*1000;
8309 /* If this is the first time we're examining the packet,
8310 * check to see if this NCP type uses a "request condition".
8311 * If so, we have to build a proto_tree because request conditions
8312 * use display filters to work, and without a proto_tree,
8313 * display filters can't possibly work. If we already have
8314 * a proto_tree, then wonderful. If we don't, we need to build
8316 if (ncp_rec && !ncp_tree) {
8319 temp_tree = proto_tree_create_root();
8320 proto_tree_set_visible(temp_tree, FALSE);
8321 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
8322 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
8327 /* If the dissection throws an exception, be sure to free
8328 * the temporary proto_tree that was created. Because of the
8329 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
8330 * block; it has to be in the same scope as the terminating
8331 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
8332 * call CLEANUP_POP and friends, but the value of temp_tree is
8333 * NULL if no cleanup is needed, and non-null if cleanup is needed.
8335 CLEANUP_PUSH(free_proto_tree, temp_tree);
8339 case NCP_BROADCAST_SLOT:
8343 case NCP_SERVICE_REQUEST:
8344 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
8345 func, "Function: %u (0x%02X), %s",
8346 func, func, ncp_rec ? ncp_rec->name : "Unknown");
8348 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
8349 subfunc, "SubFunction: %u (0x%02x)",
8352 length_remaining = tvb_reported_length_remaining(tvb, 8);
8353 if (length_remaining >= 8) {
8354 ping_version = tvb_get_letohl(tvb, 8);
8355 proto_tree_add_uint(ncp_tree, hf_nds_ping_version, tvb, 8,
8357 nds_flags = tvb_get_letohl(tvb, 12);
8359 request_value->req_nds_flags = nds_flags;
8362 pvalue.vvalue = tvb_get_letohs(tvb, 12);
8363 pvalue.vtype = VTYPE_BITFIELD;
8364 pvalue.vstring = "";
8365 pvalue.vdesc = "Ping (low) Request Flags:";
8367 pvalue.hfname= hf_nds_rflags;
8368 pvalue.voffset = 12;
8369 pvalue.bit1 = "Supported Fields";
8370 pvalue.bit1hfname = hf_bit1pingflags1;
8371 pvalue.bit2 = "Depth";
8372 pvalue.bit2hfname = hf_bit2pingflags1;
8373 pvalue.bit3 = "Revision";
8374 pvalue.bit3hfname = hf_bit3pingflags1;
8375 pvalue.bit4 = "Flags";
8376 pvalue.bit4hfname = hf_bit4pingflags1;
8377 pvalue.bit5 = "Verification Flags";
8378 pvalue.bit5hfname = hf_bit5pingflags1;
8379 pvalue.bit6 = "Letter Version";
8380 pvalue.bit6hfname = hf_bit6pingflags1;
8381 pvalue.bit7 = "OS Version";
8382 pvalue.bit7hfname = hf_bit7pingflags1;
8383 pvalue.bit8 = "License Flags";
8384 pvalue.bit8hfname = hf_bit8pingflags1;
8385 pvalue.bit9 = "DS Time";
8386 pvalue.bit9hfname = hf_bit9pingflags1;
8387 pvalue.bit10 = "Not Defined";
8388 pvalue.bit10hfname = hf_bit10pingflags1;
8389 pvalue.bit11 = "Not Defined";
8390 pvalue.bit11hfname = hf_bit11pingflags1;
8391 pvalue.bit12 = "Not Defined";
8392 pvalue.bit12hfname = hf_bit12pingflags1;
8393 pvalue.bit13 = "Not Defined";
8394 pvalue.bit13hfname = hf_bit13pingflags1;
8395 pvalue.bit14 = "Not Defined";
8396 pvalue.bit14hfname = hf_bit14pingflags1;
8397 pvalue.bit15 = "Not Defined";
8398 pvalue.bit15hfname = hf_bit15pingflags1;
8399 pvalue.bit16 = "Not Defined";
8400 pvalue.bit16hfname = hf_bit16pingflags1;
8402 process_bitfield(ncp_tree, tvb, &pvalue);
8404 pvalue.vvalue = tvb_get_letohs(tvb, 14);
8405 pvalue.vtype = VTYPE_BITFIELD;
8406 pvalue.vstring = "";
8407 pvalue.vdesc = "Ping (high) Request Flags:";
8409 pvalue.hfname= hf_nds_rflags;
8410 pvalue.voffset = 14;
8411 pvalue.bit1 = "Sap Name";
8412 pvalue.bit1hfname = hf_bit1pingflags2;
8413 pvalue.bit2 = "Tree Name";
8414 pvalue.bit2hfname = hf_bit2pingflags2;
8415 pvalue.bit3 = "OS Name";
8416 pvalue.bit3hfname = hf_bit3pingflags2;
8417 pvalue.bit4 = "Hardware Name";
8418 pvalue.bit4hfname = hf_bit4pingflags2;
8419 pvalue.bit5 = "Vendor Name";
8420 pvalue.bit5hfname = hf_bit5pingflags2;
8421 pvalue.bit6 = "Not Defined";
8422 pvalue.bit6hfname = hf_bit6pingflags2;
8423 pvalue.bit7 = "Not Defined";
8424 pvalue.bit7hfname = hf_bit7pingflags2;
8425 pvalue.bit8 = "Not Defined";
8426 pvalue.bit8hfname = hf_bit8pingflags2;
8427 pvalue.bit9 = "Not Defined";
8428 pvalue.bit9hfname = hf_bit9pingflags2;
8429 pvalue.bit10 = "Not Defined";
8430 pvalue.bit10hfname = hf_bit10pingflags2;
8431 pvalue.bit11 = "Not Defined";
8432 pvalue.bit11hfname = hf_bit11pingflags2;
8433 pvalue.bit12 = "Not Defined";
8434 pvalue.bit12hfname = hf_bit12pingflags2;
8435 pvalue.bit13 = "Not Defined";
8436 pvalue.bit13hfname = hf_bit13pingflags2;
8437 pvalue.bit14 = "Not Defined";
8438 pvalue.bit14hfname = hf_bit14pingflags2;
8439 pvalue.bit15 = "Not Defined";
8440 pvalue.bit15hfname = hf_bit15pingflags2;
8441 pvalue.bit16 = "Not Defined";
8442 pvalue.bit16hfname = hf_bit16pingflags2;
8444 process_bitfield(ncp_tree, tvb, &pvalue);
8452 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
8453 if (ncp_rec && ncp_rec->request_ptvc) {
8454 clear_repeat_vars();
8455 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
8457 ptvcursor_free(ptvc);
8459 /* Free the temporary proto_tree */
8460 CLEANUP_CALL_AND_POP;