3 * Routines for NetWare Core Protocol. This C code gets #include'd
4 * into packet-ncp2222.c, which is generated from ncp2222.py. It's
5 * #include'd instead of being in a separate compilation unit so
6 * that all the data tables in packet-ncp2222.c can remain static.
8 * Gilbert Ramirez <gram@alumni.rice.edu>
9 * Modified to decode NDS packets by Greg Morris <gmorris@novell.com>
11 * $Id: packet-ncp2222.inc,v 1.30 2002/10/10 23:32:00 guy Exp $
13 * Ethereal - Network traffic analyzer
14 * By Gerald Combs <gerald@ethereal.com>
15 * Copyright 2000 Gerald Combs
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #define NCP_PACKET_INIT_COUNT 200
33 #define PROTO_LENGTH_UNTIL_END -1
35 static const value_string nds_tags[] = {
36 { 0x00000000, "No Such Entry" },
37 { 0x00000001, "Local Entry" },
38 { 0x00000002, "Remote Entry" },
39 { 0x00000003, "Alias Entry" },
40 { 0x00000004, "Referral Information" },
41 { 0x00000006, "Entry and Referrals" },
45 static const value_string nds_info_type[] = {
46 { 0x00000000, "Attribute Names Only / " },
47 { 0x00000001, "Attribute Name & Value / " },
48 { 0x00000002, "Effective Privileges / " },
49 { 0x00000003, "Value Information / " },
50 { 0x00000004, "Abreviated Value / " },
54 static const value_string nds_kind_of_changes[] = {
55 { 0x00000000, "Add Attribute" },
56 { 0x00000001, "Remove Attribute" },
57 { 0x00000002, "Add Value" },
58 { 0x00000003, "Remove Value" },
59 { 0x00000004, "Add Additional Value" },
60 { 0x00000005, "Overwrite Value" },
61 { 0x00000006, "Clear Attribute" },
62 { 0x00000007, "Clear Value" },
66 static const value_string es_type[] = {
67 { 0x00000000, "No type is specified" },
68 { 0x00000001, "Unicode string" },
69 { 0x00000002, "Partial name" },
70 { 0x00000003, "Referrals" },
71 { 0x00000004, "Tuned name" },
72 { 0x00000005, "GUID attribute" },
73 { 0x00000006, "Local entry ID" },
74 { 0x00000007, "Number of defined entry specifiers" },
78 static const value_string nds_protocol_type[] = {
79 { 0x00000000, "(IPX Protocol)" },
80 { 0x00000001, "(IP Protocol)" },
81 { 0x00000002, "(SDLC Protocol)" },
82 { 0x00000003, "(TokenRing on Ethernet Protocol)" },
83 { 0x00000004, "(OSI Protocol)" },
84 { 0x00000005, "(AppleTalk Protocol)" },
85 { 0x00000006, "(NetBEUI Protocol)" },
86 { 0x00000007, "(Socket Address Protocol)" },
87 { 0x00000008, "(UDP Protocol)" },
88 { 0x00000009, "(TCP Protocol)" },
89 { 0x0000000a, "(UDP v6 Protocol)" },
90 { 0x0000000b, "(TCP v6 Protocol)" },
91 { 0x0000000c, "(Internal Protocol)" },
92 { 0x0000000d, "(URL Protocol)" },
97 static const value_string nds_syntax[] = {
98 { 0x00000000, "Unknown Syntax" },
99 { 0x00000001, "Distinguished Name" },
100 { 0x00000002, "Case Sensitive Unicode String" },
101 { 0x00000003, "Non Case Sensitive Unicode String" },
102 { 0x00000004, "Printable String" },
103 { 0x00000005, "Numeric String" },
104 { 0x00000006, "Case Insensitive List" },
105 { 0x00000007, "Boolean" },
106 { 0x00000008, "Signed Integer" },
107 { 0x00000009, "Binary String" },
108 { 0x0000000a, "Telephone Number" },
109 { 0x0000000b, "Fax Number" },
110 { 0x0000000c, "Network Address" },
111 { 0x0000000d, "Binary String List" },
112 { 0x0000000e, "Email Address" },
113 { 0x0000000f, "File System Path" },
114 { 0x00000010, "Replica Pointer" },
115 { 0x00000011, "Object ACL" },
116 { 0x00000012, "Postal Address" },
117 { 0x00000013, "Time Stamp" },
118 { 0x00000014, "Class Name" },
119 { 0x00000015, "Stream" },
120 { 0x00000016, "Counter" },
121 { 0x00000017, "Back Link" },
122 { 0x00000018, "Time" },
123 { 0x00000019, "Typed Name" },
124 { 0x0000001a, "Hold" },
125 { 0x0000001b, "Interval" },
129 static const value_string name_space_type[] = {
130 { 0x00000000, "DOS Name Space" },
131 { 0x00000001, "MAC Name Space" },
132 { 0x00000002, "NFS Name Space" },
133 { 0x00000003, "FTAM Name Space" },
134 { 0x00000004, "OS/2, Long Name Space" },
139 static const value_string nds_replica_state[] = {
143 { 0x0003, "Locked" },
144 { 0x0004, "Create Master State 0" },
145 { 0x0005, "Create Master State 1" },
146 { 0x0006, "Transition On" },
147 { 0x0007, "Dead Replica" },
148 { 0x0008, "Begin Add" },
149 { 0x000b, "Master Start" },
150 { 0x000c, "Master Done" },
151 { 0x0017, "Federated" },
152 { 0x0030, "Split State 0" },
153 { 0x0031, "Split State 1" },
154 { 0x0040, "Join State 0" },
155 { 0x0041, "Join State 1" },
156 { 0x0042, "Join State 2" },
157 { 0x0050, "Move Subtree State 0" },
158 { 0x0051, "Move Subtree State 1" },
162 static const value_string nds_replica_type[] = {
163 { 0x0000, "Master" },
164 { 0x0001, "Secondary" },
165 { 0x0002, "Read Only" },
166 { 0x0003, "Sub Ref" },
170 static const value_string class_def_type[] = {
171 { 0x0000, "Return Class Name" },
172 { 0x0001, "Return Class Name, Flag, and Definition" },
173 { 0x0002, "Return Class Name, Flag, Definition, and Super Class" },
174 { 0x0003, "Return Class Name, Flag, and ASN.1 identifier" },
175 { 0x0004, "Return Class Name, Flag, Definition, Super Class, and ACL" },
176 { 0x0005, "Return Class Name, Flag, Creation Timestamp, Modification Timestamp, Definition, and ACL" },
180 static const value_string nds_reply_errors[] = {
181 { 0xffffffff, "(-1) Insufficient Space" },
182 { 0xffffff89, "(-119) Buffer too Small" },
183 { 0xffffff88, "(-120) RR Volume Flag Not Set" },
184 { 0xffffff87, "(-121) No Items Found" },
185 { 0xffffff86, "(-122) Connection Already Temporary" },
186 { 0xffffff85, "(-123) Connection Already Logged In" },
187 { 0xffffff84, "(-124) Connection Not Authenticated" },
188 { 0xffffff83, "(-125) Connection Not Logged In" },
189 { 0xffffff82, "(-126) NCP Boundary Check Failed" },
190 { 0xffffff81, "(-127) Lock Waiting" },
191 { 0xffffff80, "(-128) Lock Fail" },
192 { 0xffffff7f, "(-129) Out of Handles" },
193 { 0xffffff7e, "(-130) No Open Privilege" },
194 { 0xffffff7d, "(-131) Hard IO Error" },
195 { 0xffffff7c, "(-132) No Create Privilege" },
196 { 0xffffff7b, "(-133) No Create Delete Privilege" },
197 { 0xffffff7a, "(-134) Create Duplicate When Read Only" },
198 { 0xffffff79, "(-135) Create File with Invalid Name" },
199 { 0xffffff78, "(-136) Invalid File Handle" },
200 { 0xffffff77, "(-137) No Search Privilege" },
201 { 0xffffff76, "(-138) No Delete Privilege" },
202 { 0xffffff75, "(-139) No Rename Privilege" },
203 { 0xffffff74, "(-140) No Set Privilege" },
204 { 0xffffff73, "(-141) Some File in Use" },
205 { 0xffffff72, "(-142) All File in Use" },
206 { 0xffffff71, "(-143) Some Read Only" },
207 { 0xffffff70, "(-144) All Read Only" },
208 { 0xffffff6f, "(-145) Some names Exist" },
209 { 0xffffff6e, "(-146) All Names Exist" },
210 { 0xffffff6d, "(-147) No Read Privilege" },
211 { 0xffffff6c, "(-148) No Write Privilege" },
212 { 0xffffff6b, "(-149) File Detached" },
213 { 0xffffff6a, "(-150) No Alloc Space/Target Not a Subdirectory/Insuffficient Memory" },
214 { 0xffffff69, "(-151) No Spool Space" },
215 { 0xffffff68, "(-152) Invalid Volume" },
216 { 0xffffff67, "(-153) Directory Full" },
217 { 0xffffff66, "(-154) Rename Across Volume" },
218 { 0xffffff65, "(-155) Bad Directory Handle" },
219 { 0xffffff64, "(-156) Invalid Path/No Such Extension" },
220 { 0xffffff63, "(-157) No Directory Handles" },
221 { 0xffffff62, "(-158) Bad File Name" },
222 { 0xffffff61, "(-159) Directory Active" },
223 { 0xffffff60, "(-160) Directory Not Empty" },
224 { 0xffffff5f, "(-161) Directory IO Error" },
225 { 0xffffff5e, "(-162) IO Locked" },
226 { 0xffffff5d, "(-163) Transaction Restarted" },
227 { 0xffffff5c, "(-164) Rename Directory Invalid" },
228 { 0xffffff5b, "(-165) Invalid Open/Create Mode" },
229 { 0xffffff5a, "(-166) Already in Use" },
230 { 0xffffff59, "(-167) Invalid Resource Tag" },
231 { 0xffffff58, "(-168) Access Denied" },
232 { 0xffffff44, "(-188) Login Signing Required" },
233 { 0xffffff43, "(-189) Login Encryption Required" },
234 { 0xffffff42, "(-190) Invalid Data Stream" },
235 { 0xffffff41, "(-191) Invalid Name Space" },
236 { 0xffffff40, "(-192) No Accounting Privileges" },
237 { 0xffffff3f, "(-193) No Account Balance" },
238 { 0xffffff3e, "(-194) Credit Limit Exceeded" },
239 { 0xffffff3d, "(-195) Too Many Holds" },
240 { 0xffffff3c, "(-196) Accounting Disabled" },
241 { 0xffffff3b, "(-197) Intruder Login Lockout" },
242 { 0xffffff3a, "(-198) No Console Rights" },
243 { 0xffffff30, "(-208) Queue IO Failure" },
244 { 0xffffff2f, "(-209) No Queue" },
245 { 0xffffff2e, "(-210) No Queue Server" },
246 { 0xffffff2d, "(-211) No Queue Rights" },
247 { 0xffffff2c, "(-212) Queue Full" },
248 { 0xffffff2b, "(-213) No Queue Job" },
249 { 0xffffff2a, "(-214) No Queue Job Rights/Unencrypted Not Allowed" },
250 { 0xffffff29, "(-215) Queue In Service/Duplicate Password" },
251 { 0xffffff28, "(-216) Queue Not Active/Password Too Short" },
252 { 0xffffff27, "(-217) Queue Station Not Server/Maximum Logins Exceeded" },
253 { 0xffffff26, "(-218) Queue Halted/Bad Login Time" },
254 { 0xffffff25, "(-219) Queue Maximum Servers/Node Address Violation" },
255 { 0xffffff24, "(-220) Login Account Expired" },
256 { 0xffffff22, "(-222) Bad Password" },
257 { 0xffffff21, "(-223) Password Expired" },
258 { 0xffffff20, "(-224) No Login Connection Available" },
259 { 0xffffff18, "(-232) Write to Group Property" },
260 { 0xffffff17, "(-233) Member Already Exists" },
261 { 0xffffff16, "(-234) No Such Member" },
262 { 0xffffff15, "(-235) Property Not Group" },
263 { 0xffffff14, "(-236) No Such Value Set" },
264 { 0xffffff13, "(-237) Property Already Exists" },
265 { 0xffffff12, "(-238) Object Already Exists" },
266 { 0xffffff11, "(-239) Illegal Name" },
267 { 0xffffff10, "(-240) Illegal Wildcard" },
268 { 0xffffff0f, "(-241) Bindery Security" },
269 { 0xffffff0e, "(-242) No Object Read Rights" },
270 { 0xffffff0d, "(-243) No Object Rename Rights" },
271 { 0xffffff0c, "(-244) No Object Delete Rights" },
272 { 0xffffff0b, "(-245) No Object Create Rights" },
273 { 0xffffff0a, "(-246) No Property Delete Rights" },
274 { 0xffffff09, "(-247) No Property Create Rigths" },
275 { 0xffffff08, "(-248) No Property Write Rights" },
276 { 0xffffff07, "(-249) No Propery Read Rights" },
277 { 0xffffff06, "(-250) Temp Remap" },
278 { 0xffffff05, "(-251) Unknown Request/No Such Property" },
279 { 0xffffff04, "(-252) Message Queue Full/Target Already Has Message/No Such Object" },
280 { 0xffffff03, "(-253) Bad Station Number" },
281 { 0xffffff02, "(-254) Bindery Locked/Directory Locked/Spool Delete/Trustee not Found/Timeout" },
282 { 0xffffff01, "(-255) Hard Failure" },
283 { 0xfffffed3, "(-301) Not Enough Memory" },
284 { 0xfffffed2, "(-302) Bad Key" },
285 { 0xfffffed1, "(-303) Bad Context" },
286 { 0xfffffed0, "(-304) Buffer Full" },
287 { 0xfffffecf, "(-305) List Empty" },
288 { 0xfffffece, "(-306) Bad Syntax" },
289 { 0xfffffecd, "(-307) Buffer Empty" },
290 { 0xfffffecc, "(-308) Bad Verb" },
291 { 0xfffffecb, "(-309) Expected Identifier" },
292 { 0xfffffeca, "(-310) Expected Equals" },
293 { 0xfffffec9, "(-311) Attribute Type Expected" },
294 { 0xfffffec8, "(-312) Attribute Type Not Expected" },
295 { 0xfffffec7, "(-313) Filter Tree Empty" },
296 { 0xfffffec6, "(-314) Invalid Object Name" },
297 { 0xfffffec5, "(-315) Expected RDN Delimiter" },
298 { 0xfffffec4, "(-316) Too Many Tokens" },
299 { 0xfffffec3, "(-317) Inconsistent MultiAVA" },
300 { 0xfffffec2, "(-318) Country Name Too Long" },
301 { 0xfffffec1, "(-319) Internal Error" },
302 { 0xfffffec0, "(-320) Can't Add Root" },
303 { 0xfffffebf, "(-321) Unable to Attach" },
304 { 0xfffffebe, "(-322) Invalid Iteration Handle" },
305 { 0xfffffebd, "(-323) Buffer Zero Length" },
306 { 0xfffffebc, "(-324) Invalid Replica Type" },
307 { 0xfffffebb, "(-325) Invalid Attribute Syntax" },
308 { 0xfffffeba, "(-326) Invalid Filter Syntax" },
309 { 0xfffffeb8, "(-328) Unicode Error during Context Creation" },
310 { 0xfffffeb7, "(-329) Invalid Union Tag" },
311 { 0xfffffeb6, "(-330) Invalid Server Response" },
312 { 0xfffffeb5, "(-331) Null Pointer" },
313 { 0xfffffeb4, "(-332) No Server Found" },
314 { 0xfffffeb3, "(-333) No Connection" },
315 { 0xfffffeb2, "(-334) RDN Too Long" },
316 { 0xfffffeb1, "(-335) Duplicate Type" },
317 { 0xfffffeb0, "(-336) Data Store Failure" },
318 { 0xfffffeaf, "(-337) Not Logged In" },
319 { 0xfffffeae, "(-338) Invalid Password Characters" },
320 { 0xfffffead, "(-339) Failed Server Authentication" },
321 { 0xfffffeac, "(-340) Transport Failed" },
322 { 0xfffffeab, "(-341) No Such Syntax" },
323 { 0xfffffeaa, "(-342) Invalid DS Name" },
324 { 0xfffffea9, "(-343) Attribute Name Too Long" },
325 { 0xfffffea8, "(-344) Invalid TDS" },
326 { 0xfffffea7, "(-345) Invalid DS Version" },
327 { 0xfffffea6, "(-346) Unicode Translation" },
328 { 0xfffffea5, "(-347) Schema Name Too Long" },
329 { 0xfffffea4, "(-348) Unicode File Not Found" },
330 { 0xfffffea3, "(-349) Unicode Already Loaded" },
331 { 0xfffffea2, "(-350) Not Context Owner" },
332 { 0xfffffea1, "(-351) Attempt to Authenticate" },
333 { 0xfffffea0, "(-352) No Writable Replicas" },
334 { 0xfffffe9f, "(-353) DN Too Long" },
335 { 0xfffffe9e, "(-354) Rename Not Allowed" },
336 { 0xfffffe9d, "(-355) Not NDS for NT" },
337 { 0xfffffe9c, "(-356) NDS for NT - No Domain" },
338 { 0xfffffe9b, "(-357) NDS for NT - Sync Disabled" },
339 { 0xfffffe9a, "(-358) Iterator Invalid Handle" },
340 { 0xfffffe99, "(-359) Iterator Invalid Position" },
341 { 0xfffffe98, "(-360) Iterator Invalid Search Data" },
342 { 0xfffffe97, "(-361) Iterator Invalid Scope" },
343 { 0xfffffda7, "(-601) No Such Entry" },
344 { 0xfffffda6, "(-602) No Such Value" },
345 { 0xfffffda5, "(-603) No Such Attribute" },
346 { 0xfffffda4, "(-604) No Such Class" },
347 { 0xfffffda3, "(-605) No Such Partition" },
348 { 0xfffffda2, "(-606) Entry Already Exists" },
349 { 0xfffffda1, "(-607) Not Effective Class" },
350 { 0xfffffda0, "(-608) Illegal Attribute" },
351 { 0xfffffd9f, "(-609) Missing Mandatory" },
352 { 0xfffffd9e, "(-610) Illegal DS Name" },
353 { 0xfffffd9d, "(-611) Illegal Containment" },
354 { 0xfffffd9c, "(-612) Can't Have Multiple Values" },
355 { 0xfffffd9b, "(-613) Syntax Violation" },
356 { 0xfffffd9a, "(-614) Duplicate Value" },
357 { 0xfffffd99, "(-615) Attribute Already Exists" },
358 { 0xfffffd98, "(-616) Maximum Entries Exist" },
359 { 0xfffffd97, "(-617) Database Format" },
360 { 0xfffffd96, "(-618) Inconsistent Database" },
361 { 0xfffffd95, "(-619) Invalid Comparison" },
362 { 0xfffffd94, "(-620) Comparison Failed" },
363 { 0xfffffd93, "(-621) Transaction Tracking Disabled" },
364 { 0xfffffd92, "(-622) Invalid Transport" },
365 { 0xfffffd91, "(-623) Syntax Invalid in Name" },
366 { 0xfffffd90, "(-624) Replica Already Exists" },
367 { 0xfffffd8f, "(-625) Transport Failure" },
368 { 0xfffffd8e, "(-626) All Referrals Failed" },
369 { 0xfffffd8d, "(-627) Can't Remove Naming Value" },
370 { 0xfffffd8c, "(-628) Object Class Violation" },
371 { 0xfffffd8b, "(-629) Entry is Not Leaf" },
372 { 0xfffffd8a, "(-630) Different Tree" },
373 { 0xfffffd89, "(-631) Illegal Replica Type" },
374 { 0xfffffd88, "(-632) System Failure" },
375 { 0xfffffd87, "(-633) Invalid Entry for Root" },
376 { 0xfffffd86, "(-634) No Referrals" },
377 { 0xfffffd85, "(-635) Remote Failure" },
378 { 0xfffffd84, "(-636) Unreachable Server" },
379 { 0xfffffd83, "(-637) Previous Move in Progress" },
380 { 0xfffffd82, "(-638) No Character Mapping" },
381 { 0xfffffd81, "(-639) Incomplete Authentication" },
382 { 0xfffffd80, "(-640) Invalid Certificate" },
383 { 0xfffffd7f, "(-641) Invalid Request" },
384 { 0xfffffd7e, "(-642) Invalid Iteration" },
385 { 0xfffffd7d, "(-643) Schema is Non-removable" },
386 { 0xfffffd7c, "(-644) Schema is in Use" },
387 { 0xfffffd7b, "(-645) Class Already Exists" },
388 { 0xfffffd7a, "(-646) Bad Naming Attributes" },
389 { 0xfffffd79, "(-647) Not Root Partition" },
390 { 0xfffffd78, "(-648) Insufficient Stack" },
391 { 0xfffffd77, "(-649) Insufficient Buffer" },
392 { 0xfffffd76, "(-650) Ambiguous Containment" },
393 { 0xfffffd75, "(-651) Ambiguous Naming" },
394 { 0xfffffd74, "(-652) Duplicate Mandatory" },
395 { 0xfffffd73, "(-653) Duplicate Optional" },
396 { 0xfffffd72, "(-654) Partition Busy" },
397 { 0xfffffd71, "(-655) Multiple Replicas" },
398 { 0xfffffd70, "(-656) Crucial Replica" },
399 { 0xfffffd6f, "(-657) Schema Sync in Progress" },
400 { 0xfffffd6e, "(-658) Skulk in Progress" },
401 { 0xfffffd6d, "(-659) Time Not Synchronized" },
402 { 0xfffffd6c, "(-660) Record in Use" },
403 { 0xfffffd6b, "(-661) DS Volume Not Mounted" },
404 { 0xfffffd6a, "(-662) DS Volume IO Failure" },
405 { 0xfffffd69, "(-663) DS Locked" },
406 { 0xfffffd68, "(-664) Old Epoch" },
407 { 0xfffffd67, "(-665) New Epoch" },
408 { 0xfffffd66, "(-666) Incompatible DS Version" },
409 { 0xfffffd65, "(-667) Partition Root" },
410 { 0xfffffd64, "(-668) Entry Not Container" },
411 { 0xfffffd63, "(-669) Failed Authentication" },
412 { 0xfffffd62, "(-670) Invalid Context" },
413 { 0xfffffd61, "(-671) No Such Parent" },
414 { 0xfffffd60, "(-672) No Access" },
415 { 0xfffffd5f, "(-673) Replica Not On" },
416 { 0xfffffd5e, "(-674) Invalid Name Service" },
417 { 0xfffffd5d, "(-675) Invalid Task" },
418 { 0xfffffd5c, "(-676) Invalide Connection Handle" },
419 { 0xfffffd5b, "(-677) Invalid Identity" },
420 { 0xfffffd5a, "(-678) Duplicate ACL" },
421 { 0xfffffd59, "(-679) Partition Already Exists" },
422 { 0xfffffd58, "(-680) Transport Modified" },
423 { 0xfffffd57, "(-681) Alias of an Alias" },
424 { 0xfffffd56, "(-682) Auditing Failed" },
425 { 0xfffffd55, "(-683) Invalid API Version" },
426 { 0xfffffd54, "(-684) Secure NCP Violation" },
427 { 0xfffffd53, "(-685) Move in Progress" },
428 { 0xfffffd52, "(-686) Not a Leaf Partition" },
429 { 0xfffffd51, "(-687) Cannot Abort" },
430 { 0xfffffd50, "(-688) Cache Overflow" },
431 { 0xfffffd4f, "(-689) Invalid Subordinate Count" },
432 { 0xfffffd4e, "(-690) Invalid RDN" },
433 { 0xfffffd4d, "(-691) Modification Time Not Current" },
434 { 0xfffffd4c, "(-692) Incorrect Base Class" },
435 { 0xfffffd4b, "(-693) Missing Reference" },
436 { 0xfffffd4a, "(-694) Lost Entry" },
437 { 0xfffffd49, "(-695) Agent Already Registered" },
438 { 0xfffffd48, "(-696) DS Loader Busy" },
439 { 0xfffffd47, "(-697) DS Cannot Reload" },
440 { 0xfffffd46, "(-698) Replica in Skulk" },
441 { 0xfffffd45, "(-699) Fatal" },
442 { 0xfffffd44, "(-700) Obsolete API" },
443 { 0xfffffd43, "(-701) Synchronization Disabled" },
444 { 0xfffffd42, "(-702) Invalid Parameter" },
445 { 0xfffffd41, "(-703) Duplicate Template" },
446 { 0xfffffd40, "(-704) No Master Replica" },
447 { 0xfffffd3f, "(-705) Duplicate Containment" },
448 { 0xfffffd3e, "(-706) Not a Sibling" },
449 { 0xfffffd3d, "(-707) Invalid Signature" },
450 { 0xfffffd3c, "(-708) Invalid Response" },
451 { 0xfffffd3b, "(-709) Insufficient Sockets" },
452 { 0xfffffd3a, "(-710) Database Read Fail" },
453 { 0xfffffd39, "(-711) Invalid Code Page" },
454 { 0xfffffd38, "(-712) Invalid Escape Character" },
455 { 0xfffffd37, "(-713) Invalide Delimiters" },
456 { 0xfffffd36, "(-714) Not Implemented" },
457 { 0xfffffd35, "(-715) Checksum Failure" },
458 { 0xfffffd34, "(-716) Checksumming Not Supported" },
459 { 0xfffffd33, "(-717) CRC Failure" },
460 { 0xfffffd32, "(-718) Invalid Entry Handle" },
461 { 0xfffffd31, "(-719) Invalid Value Handle" },
462 { 0xfffffd30, "(-720) Connection Denied" },
463 { 0xfffffd2f, "(-721) No Such Federation Link" },
464 { 0xfffffd2e, "(-722) Operetational Schema Mismatch" },
465 { 0xfffffd2d, "(-723) Stream Not Found" },
466 { 0xfffffd2c, "(-724) DClient Unavailable" },
467 { 0xfffffd2b, "(-725) MASV No Access" },
468 { 0xfffffd2a, "(-726) MASV Invalid Request" },
469 { 0xfffffd29, "(-727) MASV Failure" },
470 { 0xfffffd28, "(-728) MASV Already Exists" },
471 { 0xfffffd27, "(-729) MASV Not Found" },
472 { 0xfffffd26, "(-730) MASV Bad Range" },
473 { 0xfffffd25, "(-731) Value Data" },
474 { 0xfffffd24, "(-732) Database Locked" },
475 { 0xfffffd21, "(-735) Nothing to Abort" },
476 { 0xfffffd20, "(-736) End of Stream" },
477 { 0xfffffd1f, "(-737) No Such Template" },
478 { 0xfffffd1e, "(-738) SAS Locked" },
479 { 0xfffffd1d, "(-739) Invalid SAS Version" },
480 { 0xfffffd1c, "(-740) SAS Already Registered" },
481 { 0xfffffd1b, "(-741) Name Type Not Supported" },
482 { 0xfffffd1a, "(-742) Wrong DS Version" },
483 { 0xfffffd19, "(-743) Invalid Control Function" },
484 { 0xfffffd18, "(-744) Invalid Control State" },
485 { 0xfffffd17, "(-745) Cache in Use" },
486 { 0xfffffd16, "(-746) Zero Creation Time" },
487 { 0xfffffd15, "(-747) Would Block" },
488 { 0xfffffd14, "(-748) Connection Timeout" },
489 { 0xfffffd13, "(-749) Too Many Referrals" },
490 { 0xfffffd12, "(-750) Operation Cancelled" },
491 { 0xfffffd11, "(-751) Unknown Target" },
492 { 0xfffffd10, "(-752) GUID Failure" },
493 { 0xfffffd0f, "(-753) Incompatible OS" },
494 { 0xfffffd0e, "(-754) Callback Cancel" },
495 { 0xfffffd0d, "(-755) Invalid Synchronization Data" },
496 { 0xfffffd0c, "(-756) Stream Exists" },
497 { 0xfffffd0b, "(-757) Auxiliary Has Containment" },
498 { 0xfffffd0a, "(-758) Auxiliary Not Containere" },
499 { 0xfffffd09, "(-759) Auxiliary Not Effective" },
500 { 0xfffffd08, "(-760) Auxiliary On Alias" },
501 { 0xfffffd07, "(-761) Have Seen State" },
502 { 0xfffffd06, "(-762) Verb Locked" },
503 { 0xfffffd05, "(-763) Verb Exceeds Table Length" },
504 { 0xfffffd04, "(-764) BOF Hit" },
505 { 0xfffffd03, "(-765) EOF Hit" },
506 { 0xfffffd02, "(-766) Incompatible Replica Version" },
507 { 0xfffffd01, "(-767) Query Timeout" },
508 { 0xfffffd00, "(-768) Query Maximum Count" },
509 { 0xfffffcff, "(-769) Duplicate Naming" },
510 { 0xfffffcfe, "(-770) No Transaction Active" },
511 { 0xfffffcfd, "(-771) Transaction Active" },
512 { 0xfffffcfc, "(-772) Illegal Transaction Operation" },
513 { 0xfffffcfb, "(-773) Iterator Syntax" },
514 { 0xfffffcfa, "(-774) Repairing DIB" },
515 { 0xfffffcf9, "(-775) Invalid OID Format" },
516 { 0xffff0000, "Ok" },
523 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
524 int *req_cond_results, gboolean really_decode,
525 const ncp_record *ncp_rec);
527 /* NCP packets come in request/reply pairs. The request packets tell the type
528 * of NCP request and give a sequence ID. The response, unfortunately, only
529 * identifies itself via the sequence ID; you have to know what type of NCP
530 * request the request packet contained in order to successfully parse the NCP
531 * response. A global method for doing this does not exist in ethereal yet
532 * (NFS also requires it), so for now the NCP section will keep its own hash
533 * table keeping track of NCP packet types.
535 * We construct a conversation specified by the client and server
536 * addresses and the connection number; the key representing the unique
537 * NCP request then is composed of the pointer to the conversation
538 * structure, cast to a "guint" (which may throw away the upper 32
539 * bits of the pointer on a P64 platform, but the low-order 32 bits
540 * are more likely to differ between conversations than the upper 32 bits),
541 * and the sequence number.
543 * The value stored in the hash table is the ncp_req_hash_value pointer. This
544 * struct tells us the NCP type and gives the ncp2222_record pointer, if
545 * ncp_type == 0x2222.
548 conversation_t *conversation;
555 } ncp_req_eid_hash_key;
558 const ncp_record *ncp_rec;
559 gboolean *req_cond_results;
560 guint32 req_frame_num;
561 guint32 req_nds_flags;
562 guint8 nds_request_verb;
565 } ncp_req_hash_value;
568 char object_name[256];
570 } ncp_req_eid_hash_value;
572 static GHashTable *ncp_req_hash = NULL;
573 static GHashTable *ncp_req_eid_hash = NULL;
574 static GMemChunk *ncp_req_eid_hash_keys = NULL;
575 static GMemChunk *ncp_req_eid_hash_values = NULL;
576 static GMemChunk *ncp_req_hash_keys = NULL;
577 static GMemChunk *ncp_req_hash_values = NULL;
581 ncp_equal(gconstpointer v, gconstpointer v2)
583 ncp_req_hash_key *val1 = (ncp_req_hash_key*)v;
584 ncp_req_hash_key *val2 = (ncp_req_hash_key*)v2;
586 if (val1->conversation == val2->conversation &&
587 val1->nw_sequence == val2->nw_sequence ) {
594 ncp_eid_equal(gconstpointer v, gconstpointer v2)
596 ncp_req_eid_hash_key *val1 = (ncp_req_eid_hash_key*)v;
597 ncp_req_eid_hash_key *val2 = (ncp_req_eid_hash_key*)v2;
599 if (val1->nw_eid == val2->nw_eid ) {
606 ncp_hash(gconstpointer v)
608 ncp_req_hash_key *ncp_key = (ncp_req_hash_key*)v;
609 return GPOINTER_TO_UINT(ncp_key->conversation) + ncp_key->nw_sequence;
613 ncp_eid_hash(gconstpointer v)
615 ncp_req_eid_hash_key *ncp_eid_key = (ncp_req_eid_hash_key*)v;
616 return GPOINTER_TO_UINT(ncp_eid_key->nw_eid);
619 /* Frees memory used by the ncp_req_hash_value's */
621 ncp_req_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
623 ncp_req_hash_value *request_value = (ncp_req_hash_value*) value;
625 if (request_value->req_cond_results) {
626 g_free(request_value->req_cond_results);
630 /* Frees memory used by the ncp_req_hash_value's */
632 ncp_req_eid_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
634 ncp_req_eid_hash_value *request_eid_value = (ncp_req_eid_hash_value*) value;
636 if (request_eid_value->object_class) {
637 g_free(request_eid_value->object_name);
641 /* Initializes the hash table and the mem_chunk area each time a new
642 * file is loaded or re-loaded in ethereal */
644 ncp_init_protocol(void)
647 g_hash_table_foreach(ncp_req_hash, ncp_req_hash_cleanup, NULL);
648 g_hash_table_destroy(ncp_req_hash);
650 if (ncp_req_eid_hash) {
651 g_hash_table_foreach(ncp_req_eid_hash, ncp_req_eid_hash_cleanup, NULL);
652 g_hash_table_destroy(ncp_req_eid_hash);
654 if (ncp_req_hash_keys)
655 g_mem_chunk_destroy(ncp_req_hash_keys);
656 if (ncp_req_hash_values)
657 g_mem_chunk_destroy(ncp_req_hash_values);
658 if (ncp_req_eid_hash_keys)
659 g_mem_chunk_destroy(ncp_req_eid_hash_keys);
660 if (ncp_req_eid_hash_values)
661 g_mem_chunk_destroy(ncp_req_eid_hash_values);
663 ncp_req_hash = g_hash_table_new(ncp_hash, ncp_equal);
664 ncp_req_eid_hash = g_hash_table_new(ncp_eid_hash, ncp_eid_equal);
665 ncp_req_hash_keys = g_mem_chunk_new("ncp_req_hash_keys",
666 sizeof(ncp_req_hash_key),
667 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_key),
669 ncp_req_hash_values = g_mem_chunk_new("ncp_req_hash_values",
670 sizeof(ncp_req_hash_value),
671 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_value),
673 ncp_req_eid_hash_keys = g_mem_chunk_new("ncp_req_eid_hash_keys",
674 sizeof(ncp_req_eid_hash_key),
675 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_key),
677 ncp_req_eid_hash_values = g_mem_chunk_new("ncp_req_eid_hash_values",
678 sizeof(ncp_req_eid_hash_value),
679 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_value),
683 /* After the sequential run, we don't need the ncp_request hash and keys
684 * anymore; the lookups have already been done and the vital info
685 * saved in the reply-packets' private_data in the frame_data struct. */
687 ncp_postseq_cleanup(void)
690 /* Destroy the hash, but don't clean up request_condition data. */
691 g_hash_table_destroy(ncp_req_hash);
694 if (ncp_req_hash_keys) {
695 g_mem_chunk_destroy(ncp_req_hash_keys);
696 ncp_req_hash_keys = NULL;
698 /* Don't free the ncp_req_hash_values, as they're
699 * needed during random-access processing of the proto_tree.*/
700 if (ncp_req_eid_hash) {
701 /* Destroy the hash, but don't clean up request_condition data. */
702 g_hash_table_destroy(ncp_req_eid_hash);
703 ncp_req_eid_hash = NULL;
705 if (ncp_req_eid_hash_keys) {
706 g_mem_chunk_destroy(ncp_req_eid_hash_keys);
707 ncp_req_eid_hash_keys = NULL;
712 ncp_hash_insert(conversation_t *conversation, guint8 nw_sequence,
713 const ncp_record *ncp_rec)
715 ncp_req_hash_key *request_key;
716 ncp_req_hash_value *request_value;
718 /* Now remember the request, so we can find it if we later
720 request_key = g_mem_chunk_alloc(ncp_req_hash_keys);
721 request_key->conversation = conversation;
722 request_key->nw_sequence = nw_sequence;
724 request_value = g_mem_chunk_alloc(ncp_req_hash_values);
725 request_value->ncp_rec = ncp_rec;
726 request_value->req_cond_results = NULL;
727 request_value->req_nds_flags = 0;
729 g_hash_table_insert(ncp_req_hash, request_key, request_value);
731 return request_value;
734 ncp_req_eid_hash_value*
735 ncp_eid_hash_insert(guint32 nw_eid)
737 ncp_req_eid_hash_key *request_eid_key;
738 ncp_req_eid_hash_value *request_eid_value;
740 /* Now remember the request, so we can find it if we later
742 request_eid_key = g_mem_chunk_alloc(ncp_req_eid_hash_keys);
743 request_eid_key->nw_eid = nw_eid;
745 request_eid_value = g_mem_chunk_alloc(ncp_req_eid_hash_values);
746 strcpy(request_eid_value->object_name, " ");
747 request_eid_value->object_class = NULL;
749 g_hash_table_insert(ncp_req_eid_hash, request_eid_key, request_eid_value);
751 return request_eid_value;
754 /* Returns the ncp_rec*, or NULL if not found. */
756 ncp_hash_lookup(conversation_t *conversation, guint8 nw_sequence)
758 ncp_req_hash_key request_key;
760 request_key.conversation = conversation;
761 request_key.nw_sequence = nw_sequence;
763 return g_hash_table_lookup(ncp_req_hash, &request_key);
766 /* Returns the value_rec* for needed EID, or NULL if not found. */
767 ncp_req_eid_hash_value*
768 ncp_eid_hash_lookup(conversation_t *conversation _U_, guint32 nw_eid)
770 ncp_req_eid_hash_key request_eid_key;
772 request_eid_key.nw_eid = nw_eid;
774 return g_hash_table_lookup(ncp_req_eid_hash, &request_eid_key);
777 /* Does NCP func require a subfunction code? */
779 ncp_requires_subfunc(guint8 func)
781 const guint8 *ncp_func_requirement = ncp_func_requires_subfunc;
783 while (*ncp_func_requirement != 0) {
784 if (*ncp_func_requirement == func) {
787 ncp_func_requirement++;
792 /* Does the NCP func have a length parameter? */
794 ncp_has_length_parameter(guint8 func)
796 const guint8 *ncp_func_requirement = ncp_func_has_no_length_parameter;
798 while (*ncp_func_requirement != 0) {
799 if (*ncp_func_requirement == func) {
802 ncp_func_requirement++;
808 /* Return a ncp_record* based on func and possibly subfunc */
809 static const ncp_record *
810 ncp_record_find(guint8 func, guint8 subfunc)
812 const ncp_record *ncp_rec = ncp_packets;
814 while(ncp_rec->func != 0 || ncp_rec->subfunc != 0 ||
815 ncp_rec->name != NULL ) {
816 if (ncp_rec->func == func) {
817 if (ncp_rec->has_subfunc) {
818 if (ncp_rec->subfunc == subfunc) {
832 /* Given a proto_item*, assume it contains an integer value
833 * and return a guint from it. */
835 get_item_value(proto_item *item)
837 return fvalue_get_integer(PITEM_FINFO(item)->value);
842 get_item_string(proto_item *item)
844 return fvalue_get(PITEM_FINFO(item)->value);
848 get_item_name(proto_item *item)
850 return PITEM_FINFO(item)->hfinfo->name;
854 typedef proto_item* (*padd_func_t)(ptvcursor_t*, const ptvc_record*);
857 * XXX - are these just DOS-format dates and times?
859 * Should we put code to understand various date and time formats (UNIX,
860 * DOS, SMB weird mutant UNIX, NT, Mac, etc. into libethereal, and have
861 * the "display" member of an HF_ABSOLUTE_TIME field specify whether
862 * it's DOS date/DOS time, DOS time/DOS date, NT time, UNIX time_t,
863 * UNIX "struct timeval", NFSv3/NFSv4 seconds/nanoseconds, Mac, etc.?
865 * What about hijacking the "bitmask" field to specify the precision of
866 * the time stamp, or putting a combination of precision and format
867 * into the "display" member?
869 * What about relative times? Should they have units (seconds, milliseconds,
870 * microseconds, nanoseconds, etc.), precision, and format in there?
934 /* Given an integer, fill in a nw_date_t struct. */
936 uint_to_nwdate(guint data, nw_date_t *nwdate)
938 nwdate->day = data & 0x001f;
939 nwdate->month = (data & 0x01e0) >> 5;
940 nwdate->year = ((data & 0xfe00) >> 9) + 1980;
943 /* Given an integer, fill in a nw_time_t struct. */
945 uint_to_nwtime(guint data, nw_time_t *nwtime)
947 /* 2-second resolution */
948 nwtime->second = (data & 0x001f) * 2;
949 nwtime->minute = ((data & 0x07e0) >> 5) + 1;
950 nwtime->hour = ((data & 0xf800) >> 11) + 1;
954 unicode_to_string(char * data, guint32 length)
961 if (data[1] == 0x00){
963 for (i = 0; i < length; i++) {
964 character = data[offset];
965 buffer[i] = character & 0xff;
977 padd_normal(ptvcursor_t *ptvc, const ptvc_record *rec)
980 ptvcursor_add(ptvc, *rec->hf_ptr,
981 rec->length, rec->endianness);
986 padd_date(ptvcursor_t *ptvc, const ptvc_record *rec)
992 offset = ptvcursor_current_offset(ptvc);
994 item = ptvcursor_add(ptvc, *rec->hf_ptr,
995 rec->length, rec->endianness);
997 uint_to_nwdate(get_item_value(item), &nw_date);
999 proto_item_set_text(item, get_item_name(item));
1000 proto_item_append_text(item, ": %04u/%02u/%02u",
1001 nw_date.year, nw_date.month, nw_date.day);
1006 padd_time(ptvcursor_t *ptvc, const ptvc_record *rec)
1012 offset = ptvcursor_current_offset(ptvc);
1014 item = ptvcursor_add(ptvc, *rec->hf_ptr,
1015 rec->length, rec->endianness);
1017 uint_to_nwtime(get_item_value(item), &nw_time);
1019 proto_item_set_text(item, get_item_name(item));
1020 proto_item_append_text(item, ": %02u:%02u:%02u",
1021 nw_time.hour, nw_time.minute, nw_time.second);
1026 /* Convert a string from little-endian unicode to ascii. At the moment we
1027 fake it by taking every odd byte. )-: The caller must free the
1030 padd_uni(ptvcursor_t *ptvc, const ptvc_record *rec)
1036 nw_uni.buffer = "\0";
1037 offset = ptvcursor_current_offset(ptvc);
1039 item = ptvcursor_add(ptvc, *rec->hf_ptr,
1040 rec->length, rec->endianness);
1042 proto_item_set_text(item, get_item_name(item));
1043 proto_item_append_text(item, " %s",
1049 /* Add a value for a ptvc_record, and process the sub-ptvc_record
1050 * that it points to. */
1052 process_bitfield_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1053 gboolean really_decode)
1056 proto_tree *sub_tree;
1057 const ptvc_record *sub_rec;
1060 ptvcursor_t *sub_ptvc;
1062 if (really_decode) {
1063 /* Save the current offset */
1064 current_offset = ptvcursor_current_offset(ptvc);
1067 item = ptvcursor_add(ptvc, *rec->hf_ptr, rec->length,
1070 ett = *rec->sub_ptvc_rec->ett;
1072 /* Make a new protocol sub-tree */
1073 sub_tree = proto_item_add_subtree(item, ett);
1075 /* Make a new ptvcursor */
1076 sub_ptvc = ptvcursor_new(sub_tree, ptvcursor_tvbuff(ptvc),
1080 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
1081 while(sub_rec->hf_ptr != NULL) {
1082 g_assert(!sub_rec->sub_ptvc_rec);
1083 ptvcursor_add_no_advance(sub_ptvc, *sub_rec->hf_ptr,
1084 sub_rec->length, sub_rec->endianness);
1089 ptvcursor_free(sub_ptvc);
1092 ptvcursor_advance(ptvc, rec->length);
1096 /* Process a sub-ptvc_record that points to a "struct" ptvc_record. */
1098 process_struct_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1099 int *req_cond_results, gboolean really_decode,
1100 const ncp_record *ncp_rec)
1102 const ptvc_record *sub_rec;
1104 proto_tree *old_tree=NULL, *new_tree;
1105 proto_item *item=NULL;
1108 /* Create a sub-proto_tree? */
1109 if (rec->sub_ptvc_rec->descr) {
1110 ett = *rec->sub_ptvc_rec->ett;
1111 old_tree = ptvcursor_tree(ptvc);
1112 offset = ptvcursor_current_offset(ptvc);
1113 item = proto_tree_add_text(old_tree, ptvcursor_tvbuff(ptvc),
1114 offset, PROTO_LENGTH_UNTIL_END,
1115 rec->sub_ptvc_rec->descr);
1116 new_tree = proto_item_add_subtree(item, ett);
1117 ptvcursor_set_tree(ptvc, new_tree);
1120 /* Get the ptvc_record for the struct and call our caller
1122 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
1123 process_ptvc_record(ptvc, sub_rec, req_cond_results, really_decode, ncp_rec);
1125 /* Re-set the tree */
1126 if (rec->sub_ptvc_rec->descr) {
1127 proto_item_set_len(item, ptvcursor_current_offset(ptvc) - offset);
1128 ptvcursor_set_tree(ptvc, old_tree);
1132 /* Run through the table of ptvc_record's and add info to the tree. This
1133 * is the work-horse of process_ptvc_record(). */
1135 _process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1136 int *req_cond_results, gboolean really_decode,
1137 const ncp_record *ncp_rec)
1140 guint i, repeat_count;
1141 padd_func_t func = NULL;
1143 if (rec->sub_ptvc_rec) {
1145 if (rec->repeat_index == NO_REPEAT) {
1146 if (rec->hf_ptr == PTVC_STRUCT) {
1147 process_struct_sub_ptvc_record(ptvc, rec,
1148 req_cond_results, really_decode,
1152 process_bitfield_sub_ptvc_record(ptvc, rec,
1157 repeat_count = repeat_vars[rec->repeat_index];
1158 for (i = 0; i < repeat_count; i++ ) {
1159 if (rec->hf_ptr == PTVC_STRUCT) {
1160 process_struct_sub_ptvc_record(ptvc, rec,
1161 req_cond_results, really_decode,
1165 process_bitfield_sub_ptvc_record(ptvc, rec,
1172 /* If we can't repeat this field, we might use it
1173 * to set a 'var'. */
1174 if (rec->repeat_index == NO_REPEAT) {
1175 if (really_decode) {
1176 /* Handle any special formatting. */
1177 switch(rec->special_fmt) {
1181 case NCP_FMT_NW_DATE:
1184 case NCP_FMT_NW_TIME:
1187 case NCP_FMT_UNICODE:
1191 g_assert_not_reached();
1193 item = func(ptvc, rec);
1195 /* Set the value as a 'var' ? */
1196 if (rec->var_index != NO_VAR) {
1197 repeat_vars[rec->var_index] = get_item_value(item);
1201 /* If we don't decode the field, we
1202 * better not use the value to set a var.
1203 * Actually, we could, as long as we don't
1204 * *use* that var; for now keep this assert in
1206 g_assert(rec->var_index == NO_VAR);
1207 ptvcursor_advance(ptvc, rec->length);
1211 /* We do repeat this field. */
1212 repeat_count = repeat_vars[rec->repeat_index];
1213 if (really_decode) {
1214 /* Handle any special formatting. */
1215 switch(rec->special_fmt) {
1219 case NCP_FMT_NW_DATE:
1222 case NCP_FMT_NW_TIME:
1225 case NCP_FMT_UNICODE:
1229 g_assert_not_reached();
1231 for (i = 0; i < repeat_count; i++ ) {
1236 for (i = 0; i < repeat_count; i++ ) {
1237 ptvcursor_advance(ptvc, rec->length);
1244 /* Run through the table of ptvc_record's and add info to the tree.
1245 * Honor a request condition result. */
1247 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1248 int *req_cond_results, gboolean really_decode,
1249 const ncp_record *ncp_rec)
1253 while(rec->hf_ptr != NULL) {
1254 decode = really_decode;
1255 /* If we're supposed to decode, check the request condition
1256 * results to see if we should override this and *not* decode. */
1257 if (decode && req_cond_results) {
1258 if (rec->req_cond_index != NO_REQ_COND) {
1259 if (req_cond_results[rec->req_cond_index] == FALSE) {
1264 if (decode || ncp_rec->req_cond_size_type == REQ_COND_SIZE_CONSTANT) {
1265 _process_ptvc_record(ptvc, rec, req_cond_results, decode, ncp_rec);
1273 /* Clear the repeat_vars array. */
1275 clear_repeat_vars(void)
1279 for (i = 0 ; i < NUM_REPEAT_VARS; i++ ) {
1285 /* Given an error_equivalency table and a completion code, return
1286 * the string representing the error. */
1288 ncp_error_string(const error_equivalency *errors, guint8 completion_code)
1290 while (errors->ncp_error_index != -1) {
1291 if (errors->error_in_packet == completion_code) {
1292 return ncp_errors[errors->ncp_error_index];
1297 return "Unknown Error Code";
1300 static const ncp_record ncp1111_request =
1301 { 0x01, 0x00, NO_SUBFUNC, "Create Connection Service", NCP_GROUP_CONNECTION,
1302 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1304 static const ncp_record ncp5555_request =
1305 { 0x01, 0x00, NO_SUBFUNC, "Destroy Connection Service", NCP_GROUP_CONNECTION,
1306 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1308 static const ncp_record ncpbbbb_request =
1309 { 0x01, 0x00, NO_SUBFUNC, "Server Broadcast Message", NCP_GROUP_CONNECTION,
1310 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1312 static const ncp_record ncplip_echo =
1313 { 0x01, 0x00, NO_SUBFUNC, "LIP Echo Packet", NCP_GROUP_CONNECTION,
1314 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
1316 /* Wrapper around proto_tree_free() */
1317 void free_proto_tree(void *tree)
1320 proto_tree_free((proto_tree*) tree);
1325 align_4(tvbuff_t *tvb, guint32 aoffset)
1327 if(tvb_length_remaining(tvb, aoffset) > 4 )
1335 * XXX - this routine assumes that "dest_buf" points to a buffer large
1336 * enough for the string we'll be generating; unfortunately, it usually
1337 * points to a null constant string, which is unlikely to be large
1338 * enough for any characters whatsoever (so that this routine will
1339 * overwrite some arbitrary stuff in memory), and may even be in
1340 * a read-only portion of the address space (so that this routine
1343 * We "#if 0" it out for now, to eliminate crashes.
1346 get_string(tvbuff_t* tvb, guint offset, guint str_length, char *dest_buf)
1351 guint32 length_remaining = 0;
1353 length_remaining = tvb_length_remaining(tvb, offset);
1354 if(str_length > length_remaining)
1356 strcpy(dest_buf, "String too long to process");
1359 for ( i = 0; i < str_length; i++ )
1361 c_char = tvb_get_guint8(tvb, offset );
1362 if (c_char<0x20 || c_char>0x7e)
1367 dest_buf[i] = c_char & 0xff;
1377 dest_buf[i] = c_char & 0xff;
1382 if(length_remaining==1)
1384 dest_buf[i+1] = '\0';
1393 /*************************************
1394 * Return based on % format in request
1395 * %d = integer in decimal format = 0
1396 * %x = integer in hex format = 1
1398 **************************************/
1400 get_info_type(gchar* check_string)
1406 length = strlen(check_string);
1408 for (i = 0 ; i < length-1 ; i++ ) {
1409 char_val = check_string[i+1];
1410 if (check_string[i] == 0x25 && check_string[i+1] == 0x64) {
1413 if ( check_string[i] == 0x25 && check_string[i+1] == 0x78) {
1421 process_bitfield(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
1423 char flags_str[512];
1426 proto_tree *flags_tree;
1430 bvalue = 0x00000001;
1431 strcpy(flags_str, "");
1433 for (i = 0 ; i < (values->vlength*8); i++ ) {
1434 if (values->vvalue & bvalue)
1436 strcat(flags_str, sep);
1439 strcat(flags_str, values->bit1);
1442 strcat(flags_str, values->bit2);
1445 strcat(flags_str, values->bit3);
1448 strcat(flags_str, values->bit4);
1451 strcat(flags_str, values->bit5);
1454 strcat(flags_str, values->bit6);
1457 strcat(flags_str, values->bit7);
1460 strcat(flags_str, values->bit8);
1463 strcat(flags_str, values->bit9);
1466 strcat(flags_str, values->bit10);
1469 strcat(flags_str, values->bit11);
1472 strcat(flags_str, values->bit12);
1475 strcat(flags_str, values->bit13);
1478 strcat(flags_str, values->bit14);
1481 strcat(flags_str, values->bit15);
1484 strcat(flags_str, values->bit16);
1493 if(values->vlength==4)
1495 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
1496 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%08x",
1497 values->vdesc, values->vvalue);
1501 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
1502 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%04x",
1503 values->vdesc, values->vvalue);
1505 if (flags_str[0] != '\0')
1506 proto_item_append_text(tinew, " - (%s)", flags_str);
1508 flags_tree = proto_item_add_subtree(tinew, ett_nds);
1510 bvalue = 0x00000001;
1512 for (i = 0 ; i < (values->vlength*8); i++ ) {
1513 if (values->vvalue & bvalue)
1518 proto_tree_add_item(flags_tree, values->bit1hfname, tvb, values->voffset, values->vlength, TRUE);
1521 proto_tree_add_item(flags_tree, values->bit2hfname, tvb, values->voffset, values->vlength, TRUE);
1524 proto_tree_add_item(flags_tree, values->bit3hfname, tvb, values->voffset, values->vlength, TRUE);
1527 proto_tree_add_item(flags_tree, values->bit4hfname, tvb, values->voffset, values->vlength, TRUE);
1530 proto_tree_add_item(flags_tree, values->bit5hfname, tvb, values->voffset, values->vlength, TRUE);
1533 proto_tree_add_item(flags_tree, values->bit6hfname, tvb, values->voffset, values->vlength, TRUE);
1536 proto_tree_add_item(flags_tree, values->bit7hfname, tvb, values->voffset, values->vlength, TRUE);
1539 proto_tree_add_item(flags_tree, values->bit8hfname, tvb, values->voffset, values->vlength, TRUE);
1542 proto_tree_add_item(flags_tree, values->bit9hfname, tvb, values->voffset, values->vlength, TRUE);
1545 proto_tree_add_item(flags_tree, values->bit10hfname, tvb, values->voffset, values->vlength, TRUE);
1548 proto_tree_add_item(flags_tree, values->bit11hfname, tvb, values->voffset, values->vlength, TRUE);
1551 proto_tree_add_item(flags_tree, values->bit12hfname, tvb, values->voffset, values->vlength, TRUE);
1554 proto_tree_add_item(flags_tree, values->bit13hfname, tvb, values->voffset, values->vlength, TRUE);
1557 proto_tree_add_item(flags_tree, values->bit14hfname, tvb, values->voffset, values->vlength, TRUE);
1560 proto_tree_add_item(flags_tree, values->bit15hfname, tvb, values->voffset, values->vlength, TRUE);
1563 proto_tree_add_item(flags_tree, values->bit16hfname, tvb, values->voffset, values->vlength, TRUE);
1575 print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val *vvalues)
1583 guint32 voffset = 0;
1585 guint32 number_of_values = 0;
1586 guint32 number_of_items = 0;
1592 char *valuestr = NULL;
1598 voffset = vvalues->voffset;
1599 if(tvb_get_guint8(tvb, voffset) == 0x00)
1601 voffset = voffset+2;
1604 number_of_values = tvb_get_letohl(tvb, voffset);
1606 vitem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset,
1607 4, number_of_values, "Number of Values: %d", number_of_values);
1609 nvtree = proto_item_add_subtree(vitem, ett_nds);
1611 voffset = voffset + 4;
1613 for (icounter = 1 ; icounter <= number_of_values; icounter++ )
1617 case 0x00000006: /* Case Insensitive List */
1618 case 0x0000000d: /* Binary String List */
1619 case 0x00000012: /* Postal Address */
1620 voffset += align_4(tvb, voffset);
1621 voffset = voffset+4;
1622 number_of_items = tvb_get_letohl(tvb, voffset);
1623 voffset = voffset+4;
1624 for (r=1; r<=number_of_items; r++)
1626 value1 = tvb_get_letohl(tvb, voffset);
1627 voffset = voffset + 4;
1628 get_string(tvb, voffset, value1, vvalues->vstring);
1629 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1630 value1, vvalues->vstring);
1631 voffset = voffset + value1;
1633 voffset += align_4(tvb, voffset);
1635 case 0x00000007: /* Boolean */
1636 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1639 vvalues->vstring = "False";
1643 vvalues->vstring = "True";
1645 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1646 value1, vvalues->vstring);
1649 case 0x00000009: /* Binary String */
1650 case 0x00000015: /* Stream */
1651 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1652 if(value1 > tvb_length_remaining(tvb, voffset))
1657 proto_tree_add_bytes(nvtree, hf_value_bytes, tvb, voffset, value1, tvb_get_ptr(tvb, voffset, value1));
1659 voffset += (value1%2);
1661 case 0x00000008: /* Signed Integer */
1662 case 0x00000016: /* Counter */
1663 case 0x00000018: /* Time */
1664 case 0x0000001b: /* Interval */
1665 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1666 voffset = voffset+4;
1667 value2 = tvb_get_letohl(tvb, voffset); /* Value */
1668 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1669 value1, value2, "Value %d", value2);
1670 voffset = voffset+4;
1672 case 0x0000000b: /* Fax Number */
1673 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1674 voffset = voffset+4;
1675 get_string(tvb, voffset, value1, vvalues->vstring);
1676 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1677 value1, vvalues->vstring);
1678 voffset = voffset + value1;
1679 voffset += align_4(tvb, voffset);
1680 value2 = tvb_get_letohl(tvb, voffset); /* Bit Count */
1682 value3 = tvb_get_letohl(tvb, voffset); /* Bit length */
1683 voffset = voffset+4;
1684 get_string(tvb, voffset, value3, vvalues->vstring);
1685 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1686 value3, vvalues->vstring);
1687 voffset = voffset+value3;
1688 voffset += align_4(tvb, voffset);
1690 case 0x0000000c: /* Network Address */
1691 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1692 voffset = voffset + 4;
1693 value2 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
1694 valuestr = match_strval(value2, nds_protocol_type);
1695 if (valuestr == NULL)
1697 valuestr="(Undefined Protocol)";
1699 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1700 value1, value2, valuestr, value2);
1701 voffset = voffset+4;
1702 value3 = tvb_get_letohl(tvb, voffset); /* length of address */
1703 voffset = voffset+4;
1707 proto_tree_add_item(nvtree, hf_nds_net, tvb, voffset, 4, FALSE);
1708 proto_tree_add_item(nvtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
1709 proto_tree_add_item(nvtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
1711 /*proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1712 value4 = tvb_get_letohl(tvb, voffset+2);
1713 proto_tree_add_ipv4(nvtree, hf_add_ref_ip, tvb, voffset+2, 4, value4);
1716 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1717 value4 = tvb_get_letohl(tvb, voffset+2);
1718 proto_tree_add_ipv4(nvtree, hf_add_ref_udp, tvb, voffset+2, 4, value4);
1721 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
1722 value4 = tvb_get_letohl(tvb, voffset+2);
1723 proto_tree_add_ipv4(nvtree, hf_add_ref_tcp, tvb, voffset+2, 4, value4);
1727 get_string(tvb, voffset, value3, vvalues->vstring);
1728 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1729 value3, vvalues->vstring);
1734 voffset = voffset + value3;
1735 voffset += align_4(tvb, voffset);
1737 case 0x0000000f: /* File System Path */
1738 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1739 voffset = voffset + 4;
1740 value2 = tvb_get_letohl(tvb, voffset); /* Name Space */
1741 valuestr = match_strval(value2, name_space_type);
1742 if (valuestr == NULL)
1744 valuestr = "Unknown Name Space";
1746 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1748 voffset = voffset+4;
1749 value3 = tvb_get_letohl(tvb, voffset); /* Length of Volume name */
1750 voffset = voffset+4;
1751 get_string(tvb, voffset, value3, vvalues->vstring);
1752 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1753 value3, vvalues->vstring);
1754 voffset = voffset+value3;
1755 voffset += align_4(tvb, voffset);
1756 value4 = tvb_get_letohl(tvb, voffset); /* Length of Path name */
1757 voffset = voffset+4;
1758 get_string(tvb, voffset, value4, vvalues->vstring);
1759 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1760 value4, vvalues->vstring);
1761 voffset = voffset+value4;
1762 voffset += align_4(tvb, voffset);
1764 case 0x00000010: /* Replica Pointer */
1765 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
1766 voffset = voffset + 4;
1767 value2 = tvb_get_letohl(tvb, voffset); /* Length of Server name */
1768 voffset = voffset+4;
1769 get_string(tvb, voffset, value2, vvalues->vstring);
1770 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1771 value2, vvalues->vstring);
1772 voffset = voffset+value2;
1773 voffset += align_4(tvb, voffset);
1774 rtype = tvb_get_letohs(tvb, voffset); /* replica type */
1775 valuestr = match_strval(rtype, nds_replica_type);
1776 if (valuestr == NULL)
1778 valuestr="(Unknown Replica Type)";
1780 proto_tree_add_string(nvtree, hf_replica_type, tvb, voffset,
1782 voffset = voffset+2;
1783 rstate = tvb_get_letohs(tvb, voffset); /* replica state */
1784 valuestr = match_strval(rstate, nds_replica_state);
1785 if (valuestr == NULL)
1787 valuestr="(Unknown Replica State)";
1789 proto_tree_add_string(nvtree, hf_replica_state, tvb, voffset,
1791 voffset = voffset+2;
1792 value3 = tvb_get_letohl(tvb, voffset); /* Replica number */
1793 proto_tree_add_uint_format(nvtree, hf_replica_number, tvb, voffset,
1794 4, value3, "Replica Number %d", value3);
1795 voffset = voffset+4;
1796 if(vvalues->nds_version == 0xfe)
1800 number_of_items = tvb_get_letohl(tvb, voffset); /* Number of Addresses */
1801 aditem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset,
1802 4, number_of_items, "Number of Addresses: %d", number_of_items);
1804 adtree = proto_item_add_subtree(aditem, ett_nds);
1805 voffset = voffset+4;
1806 for (r=1; r <= number_of_items; r++)
1808 voffset += align_4(tvb, voffset);
1809 value4 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
1810 valuestr = match_strval(value4, nds_protocol_type);
1811 if (valuestr == NULL)
1813 valuestr="(Undefined Protocol)";
1815 proto_tree_add_uint_format(adtree, hf_nds_uint32value, tvb, voffset,
1816 4, value4, valuestr, value4);
1817 voffset = voffset+4;
1818 value5 = tvb_get_letohl(tvb, voffset); /* length of address */
1819 voffset = voffset+4;
1823 proto_tree_add_item(adtree, hf_nds_net, tvb, voffset, 4, FALSE);
1824 proto_tree_add_item(adtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
1825 proto_tree_add_item(adtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
1828 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1829 value6 = tvb_get_letohl(tvb, voffset+2);
1830 proto_tree_add_ipv4(adtree, hf_add_ref_ip, tvb, voffset+2, 4, value6);
1833 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1834 value6 = tvb_get_letohl(tvb, voffset+2);
1835 proto_tree_add_ipv4(adtree, hf_add_ref_udp, tvb, voffset+2, 4, value6);
1838 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
1839 value6 = tvb_get_letohl(tvb, voffset+2);
1840 proto_tree_add_ipv4(adtree, hf_add_ref_tcp, tvb, voffset+2, 4, value6);
1843 get_string(tvb, voffset, value5, vvalues->vstring);
1844 proto_tree_add_string(adtree, hf_value_string, tvb, voffset,
1845 value5, vvalues->vstring);
1850 voffset = voffset + value5;
1852 voffset += align_4(tvb, voffset);
1854 case 0x00000011: /* Object ACL */
1855 value1 = tvb_get_letohl(tvb, voffset); /* Length of Field */
1856 voffset = voffset + 4;
1857 value2 = tvb_get_letohl(tvb, voffset);
1858 voffset = voffset + 4;
1859 get_string(tvb, voffset, value2, vvalues->vstring); /* Unicode String */
1860 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1861 value2, vvalues->vstring);
1862 voffset = voffset + value2;
1863 voffset += align_4(tvb, voffset);
1864 value3 = tvb_get_letohl(tvb, voffset);
1865 voffset = voffset + 4;
1866 get_string(tvb, voffset, value3, vvalues->vstring); /* Unicode Subject Name */
1867 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1868 value3, vvalues->vstring);
1869 voffset = voffset + value3;
1870 voffset += align_4(tvb, voffset);
1871 value4 = tvb_get_letohl(tvb, voffset); /* Privileges */
1872 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1873 4, value4, "Privileges %8x", value4);
1874 voffset = voffset+4;
1875 voffset += align_4(tvb, voffset);
1877 case 0x00000013: /* Time Stamp */
1878 value1 = tvb_get_letohl(tvb, voffset); /* Seconds */
1879 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1880 4, value1, "Lenght of Record: %d", value1);
1881 voffset = voffset+4;
1882 value2 = tvb_get_letohl(tvb, voffset);
1883 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1884 4, value2, "Seconds: %d", value2);
1885 voffset = voffset + 4;
1886 rnum = tvb_get_letohs(tvb, voffset); /* replica number */
1887 proto_tree_add_uint_format(nvtree, hf_nds_rnum, tvb, voffset,
1888 2, rnum, "Replica Number: %d", rnum);
1889 voffset = voffset+2;
1890 revent = tvb_get_letohs(tvb, voffset); /* Event */
1891 proto_tree_add_uint_format(nvtree, hf_nds_revent, tvb, voffset,
1892 2, revent, "Event: %d", revent);
1893 voffset = voffset+14;
1894 voffset += align_4(tvb, voffset);
1896 case 0x00000017: /* Back Link */
1897 value1 = tvb_get_letohl(tvb, voffset); /* Length */
1898 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1899 4, value1, "Length of Record %08x", value1);
1900 voffset = voffset+4;
1901 value2 = tvb_get_letohl(tvb, voffset); /* Remote ID */
1902 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1903 4, value2, "Remote ID %08x", value2);
1904 voffset = voffset+4;
1905 value3 = tvb_get_letohl(tvb, voffset); /* Length of string */
1906 voffset = voffset+4;
1907 get_string(tvb, voffset, value3, vvalues->vstring);
1908 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
1909 value3, vvalues->vstring,
1910 "Server Distinguished Name - %s", vvalues->vstring);
1911 voffset = voffset+value3;
1912 voffset += align_4(tvb, voffset);
1914 case 0x00000019: /* Typed Name */
1915 value1 = tvb_get_letohl(tvb, voffset); /* Length */
1916 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1917 4, value1, "Length of Record %08x", value1);
1918 voffset = voffset+4;
1919 value2 = tvb_get_letohl(tvb, voffset); /* Level */
1920 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1921 4, value2, "Level %d", value2);
1922 voffset = voffset+4;
1923 value3 = tvb_get_letohl(tvb, voffset); /* Interval */
1924 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1925 4, value3, "Interval %d", value3);
1926 voffset = voffset+4;
1927 value4 = tvb_get_letohl(tvb, voffset); /* Distinguished Name */
1928 voffset = voffset+4;
1929 get_string(tvb, voffset, value4, vvalues->vstring);
1930 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
1931 value4, vvalues->vstring,
1932 "Distinguished Name - %s", vvalues->vstring);
1933 voffset = voffset+value4;
1934 voffset += align_4(tvb, voffset);
1936 case 0x0000001a: /* Hold */
1937 value1 = tvb_get_letohl(tvb, voffset); /* Length */
1938 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1939 4, value1, "Length of Record %08x", value1);
1940 voffset = voffset+4;
1941 value2 = tvb_get_letohl(tvb, voffset); /* Amount */
1942 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
1943 4, value2, "Amount %d", value2);
1944 voffset = voffset+4;
1945 value3 = tvb_get_letohl(tvb, voffset); /* Subject */
1946 voffset = voffset+4;
1947 get_string(tvb, voffset, value3, vvalues->vstring);
1948 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
1949 value3, vvalues->vstring,
1950 "Subject - %s", vvalues->vstring);
1951 voffset = voffset+value3;
1952 voffset += align_4(tvb, voffset);
1954 case 0x00000001: /* Distinguished Name */
1955 case 0x00000002: /* Case Sensitive Unicode String */
1956 case 0x00000003: /* Non Case Sensitive Unicode String */
1957 case 0x00000004: /* Printable String */
1958 case 0x00000005: /* Numeric String */
1959 case 0x0000000a: /* Telephone Number */
1960 case 0x0000000e: /* Email Address */
1961 case 0x00000014: /* Class Name */
1963 value1 = tvb_get_letohl(tvb, voffset);
1964 voffset = voffset + 4;
1965 get_string(tvb, voffset, value1, vvalues->vstring);
1966 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
1967 value1, vvalues->vstring);
1968 voffset = voffset + value1;
1969 voffset += align_4(tvb, voffset);
1972 voffset += align_4(tvb, voffset);
1974 vvalues->voffset=voffset;
1979 print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, guint32 ioffset)
1986 guint32 number_of_referals;
1989 guint16 replica_num;
1992 proto_tree *nestree;
1993 proto_item *nesitem;
1998 mval_buf.buffer = "";
2002 case 0: /* No Specifier Type */
2003 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2004 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2006 ioffset = ioffset + 4;
2008 case 1: /* Unicode String */
2009 value1 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2010 ioffset = ioffset + 4;
2011 get_string(tvb, ioffset, value1, mval_buf.buffer);
2012 values->vstring = mval_buf.buffer;
2013 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2014 value1, values->vstring, "Delimeter ->%s", values->vstring);
2015 ioffset=ioffset + value1;
2016 ioffset += align_4(tvb, ioffset);
2017 value2 = tvb_get_letohl(tvb, ioffset);
2018 ioffset = ioffset + 4;
2019 get_string(tvb, ioffset, value2, mval_buf.buffer);
2020 values->vstring = mval_buf.buffer;
2021 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2022 value2, values->vstring);
2023 values->voffset=ioffset + value2;
2024 ioffset = values->voffset;
2027 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2028 vstring = match_strval(value1, es_type);
2029 if (vstring == NULL)
2031 vstring = "No ES Type Found";
2033 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2034 4, vstring, "Base Context Type - %s", vstring);
2035 nestree = proto_item_add_subtree(nesitem, ett_nds);
2036 ioffset = ioffset + 4;
2039 case 0: /* No Specifier Type */
2040 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2041 proto_tree_add_item(nestree, hf_es_value, tvb, ioffset,
2043 ioffset = ioffset + 4;
2045 case 1: /* Unicode String */
2046 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2047 ioffset = ioffset + 4;
2048 get_string(tvb, ioffset, value2, mval_buf.buffer);
2049 values->vstring = mval_buf.buffer;
2050 proto_tree_add_string_format(nestree, hf_mv_string, tvb, ioffset,
2051 value2, values->vstring, "Delimeter ->%s", values->vstring);
2052 ioffset=ioffset + value2;
2053 ioffset += align_4(tvb, ioffset);
2054 value3 = tvb_get_letohl(tvb, ioffset);
2055 ioffset = ioffset + 4;
2056 get_string(tvb, ioffset, value3, mval_buf.buffer);
2057 values->vstring = mval_buf.buffer;
2058 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
2059 value3, values->vstring);
2060 values->voffset=ioffset + value3;
2061 ioffset = values->voffset;
2065 case 3: /* Hinted */
2068 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2069 proto_tree_add_item(nestree, hf_es_rdn_count, tvb, ioffset,
2071 ioffset = ioffset + 4;
2072 for (r = 1 ; r <= value2; r++ )
2074 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2075 proto_tree_add_item(nestree, hf_es_seconds, tvb, ioffset,
2077 ioffset = ioffset + 4;
2078 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2079 proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset,
2081 ioffset = ioffset + 2;
2082 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2083 proto_tree_add_item(nestree, hf_nds_event_num, tvb, ioffset,
2085 ioffset = ioffset + 2;
2087 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2088 ioffset = ioffset + 4;
2089 get_string(tvb, ioffset, value4, mval_buf.buffer);
2090 values->vstring = mval_buf.buffer;
2091 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
2092 value4, values->vstring);
2093 ioffset=ioffset + value4;
2094 ioffset += align_4(tvb, ioffset);
2095 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2096 ioffset = ioffset + 4;
2097 get_string(tvb, ioffset, value5, mval_buf.buffer);
2098 values->vstring = mval_buf.buffer;
2099 proto_tree_add_string(nestree, hf_rdn_string, tvb, ioffset,
2100 value5, values->vstring);
2101 ioffset=ioffset + value5;
2102 ioffset += align_4(tvb, ioffset);
2108 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2109 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2111 ioffset = ioffset + 4;
2114 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2115 vstring = match_strval(value1, es_type);
2116 if (vstring == NULL)
2118 vstring = "No ES Type Found";
2120 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2121 4, vstring, "Object Name Type - %s", vstring);
2122 nestree = proto_item_add_subtree(nesitem, ett_nds);
2123 ioffset = ioffset + 4;
2126 case 0: /* No Specifier Type */
2127 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2128 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2130 ioffset = ioffset + 4;
2132 case 1: /* Unicode String */
2133 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2134 ioffset = ioffset + 4;
2135 get_string(tvb, ioffset, value2, mval_buf.buffer);
2136 values->vstring = mval_buf.buffer;
2137 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2138 value2, values->vstring, "Delimeter ->%s", values->vstring);
2139 ioffset=ioffset + value2;
2140 ioffset += align_4(tvb, ioffset);
2141 value3 = tvb_get_letohl(tvb, ioffset);
2142 ioffset = ioffset + 4;
2143 get_string(tvb, ioffset, value3, mval_buf.buffer);
2144 values->vstring = mval_buf.buffer;
2145 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2146 value3, values->vstring);
2147 values->voffset=ioffset + value3;
2148 ioffset = values->voffset;
2152 case 3: /* Hinted */
2155 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2156 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2158 ioffset = ioffset + 4;
2159 for (r = 1 ; r <= value2; r++ )
2161 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2162 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2164 ioffset = ioffset + 4;
2165 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2166 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2168 ioffset = ioffset + 2;
2169 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2170 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2172 ioffset = ioffset + 2;
2174 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2175 ioffset = ioffset + 4;
2176 get_string(tvb, ioffset, value4, mval_buf.buffer);
2177 values->vstring = mval_buf.buffer;
2178 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2179 value4, values->vstring);
2180 ioffset=ioffset + value4;
2181 ioffset += align_4(tvb, ioffset);
2182 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2183 ioffset = ioffset + 4;
2184 get_string(tvb, ioffset, value5, mval_buf.buffer);
2185 values->vstring = mval_buf.buffer;
2186 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2187 value5, values->vstring);
2188 ioffset=ioffset + value5;
2189 ioffset += align_4(tvb, ioffset);
2195 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2196 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2198 ioffset = ioffset + 4;
2202 case 3: /* Hinted */
2203 number_of_referals = tvb_get_letohl(tvb, ioffset);
2205 for (r = 1 ; r <= number_of_referals; r++ )
2207 aitem = proto_tree_add_uint_format(estree, hf_referal_record, tvb, 6, 0,
2208 r, "NDS Referal Record #%d", r);
2209 atree = proto_item_add_subtree(aitem, ett_nds);
2211 value1 = tvb_get_letohl(tvb, ioffset);
2213 proto_tree_add_uint_format(atree, hf_referal_addcount, tvb, ioffset, 4,
2214 value1, "Number of Addresses in Referal - %d", value1);
2216 ioffset = ioffset + 4;
2217 for (i = 1 ; i <= value1; i++ )
2219 value2 = tvb_get_letohl(tvb, ioffset);
2220 values->vstring = match_strval(value2, nds_protocol_type);
2221 if (values->vstring == NULL)
2223 values->vstring="(Undefined Protocol)";
2225 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
2226 4, value2, vstring, value2);
2227 ioffset = ioffset+4;
2228 value3 = tvb_get_letohl(tvb, ioffset);
2229 ioffset = ioffset+4;
2233 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
2234 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
2235 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
2238 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2239 value4 = tvb_get_letohl(tvb, ioffset+2);
2240 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4);
2243 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2244 value4 = tvb_get_letohl(tvb, ioffset+2);
2245 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4);
2248 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2249 value4 = tvb_get_letohl(tvb, ioffset+2);
2250 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4);
2253 get_string(tvb, ioffset, value3, values->vstring);
2254 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
2255 value3, values->vstring);
2260 ioffset = ioffset + value3;
2261 ioffset += align_4(tvb, ioffset);
2265 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2266 vstring = match_strval(value1, es_type);
2267 if (vstring == NULL)
2269 vstring = "No ES Type Found";
2271 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
2272 4, vstring, "Object Name Type - %s", vstring);
2273 nestree = proto_item_add_subtree(nesitem, ett_nds);
2274 ioffset = ioffset + 4;
2277 case 0: /* No Specifier Type */
2278 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2279 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2281 ioffset = ioffset + 4;
2283 case 1: /* Unicode String */
2284 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2285 ioffset = ioffset + 4;
2286 get_string(tvb, ioffset, value2, mval_buf.buffer);
2287 values->vstring = mval_buf.buffer;
2288 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
2289 value2, values->vstring, "Delimeter ->%s", values->vstring);
2290 ioffset=ioffset + value2;
2291 ioffset += align_4(tvb, ioffset);
2292 value3 = tvb_get_letohl(tvb, ioffset);
2293 ioffset = ioffset + 4;
2294 get_string(tvb, ioffset, value3, mval_buf.buffer);
2295 values->vstring = mval_buf.buffer;
2296 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2297 value3, values->vstring);
2298 values->voffset=ioffset + value3;
2299 ioffset = values->voffset;
2303 case 3: /* Hinted */
2306 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
2307 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2309 ioffset = ioffset + 4;
2310 for (r = 1 ; r <= value2; r++ )
2312 value3 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2313 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2315 ioffset = ioffset + 4;
2316 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2317 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2319 ioffset = ioffset + 2;
2320 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2321 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2323 ioffset = ioffset + 2;
2325 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2326 ioffset = ioffset + 4;
2327 get_string(tvb, ioffset, value4, mval_buf.buffer);
2328 values->vstring = mval_buf.buffer;
2329 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2330 value4, values->vstring);
2331 ioffset=ioffset + value4;
2332 ioffset += align_4(tvb, ioffset);
2333 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
2334 ioffset = ioffset + 4;
2335 get_string(tvb, ioffset, value5, mval_buf.buffer);
2336 values->vstring = mval_buf.buffer;
2337 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2338 value5, values->vstring);
2339 ioffset=ioffset + value5;
2340 ioffset += align_4(tvb, ioffset);
2346 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2347 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2349 ioffset = ioffset + 4;
2354 value1 = tvb_get_letohl(tvb, ioffset); /* Count */
2355 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
2357 ioffset = ioffset + 4;
2358 for (r = 1 ; r <= value1; r++ )
2360 value2 = tvb_get_letohl(tvb, ioffset); /* Seconds */
2361 proto_tree_add_item(estree, hf_es_seconds, tvb, ioffset,
2363 ioffset = ioffset + 4;
2364 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2365 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
2367 ioffset = ioffset + 2;
2368 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2369 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
2371 ioffset = ioffset + 2;
2373 value3 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
2374 ioffset = ioffset + 4;
2375 get_string(tvb, ioffset, value3, mval_buf.buffer);
2376 values->vstring = mval_buf.buffer;
2377 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
2378 value3, values->vstring);
2379 ioffset=ioffset + value3;
2380 ioffset += align_4(tvb, ioffset);
2381 value4 = tvb_get_letohl(tvb, ioffset); /* RDN */
2382 ioffset = ioffset + 4;
2383 get_string(tvb, ioffset, value4, mval_buf.buffer);
2384 values->vstring = mval_buf.buffer;
2385 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
2386 value4, values->vstring);
2387 ioffset=ioffset + value4;
2388 ioffset += align_4(tvb, ioffset);
2394 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
2395 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
2397 ioffset = ioffset + 4;
2404 process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
2408 guint32 ioffset = 0;
2416 char * valuestr = "";
2421 guint32 number_of_referals = 0;
2425 guint16 replica_num = 0;
2426 guint16 event_num = 0;
2428 nds_val temp_values;
2429 proto_tree *sub1tree;
2430 proto_item *sub1item;
2431 proto_tree *sub2tree;
2432 proto_item *sub2item;
2434 mval_buf.buffer = "";
2435 if(values->mvtype != 12)
2437 nitem = proto_tree_add_uint_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
2438 values->vlength, values->vvalue, values->vdesc, values->vvalue);
2442 nitem = proto_tree_add_string_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
2443 values->vlength, values->vdesc, "%s", values->vdesc);
2445 ioffset = (values->voffset+4);
2447 ntree = proto_item_add_subtree(nitem, ett_nds);
2449 switch (values->mvtype)
2451 case 1: /* Attribute Request */
2452 for (i = 1 ; i <= values->vvalue; i++ )
2454 ioffset += align_4(tvb, ioffset);
2455 value1 = tvb_get_letohl(tvb, ioffset);
2456 ioffset = ioffset + 4;
2457 get_string(tvb, ioffset, value1, mval_buf.buffer);
2458 values->vstring = mval_buf.buffer;
2459 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2460 value1, values->vstring);
2461 ioffset = ioffset + value1;
2464 case 2: /* Attribute Reply */
2465 switch(values->vflags)
2468 for (i = 1 ; i <= values->vvalue; i++ )
2470 ioffset += align_4(tvb, ioffset);
2471 value1 = tvb_get_letohl(tvb, ioffset);
2472 ioffset = ioffset + 4;
2473 get_string(tvb, ioffset, value1, mval_buf.buffer);
2474 values->vstring = mval_buf.buffer;
2475 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2476 value1, values->vstring);
2477 ioffset = ioffset + value1;
2481 for (i = 1 ; i <= values->vvalue; i++ )
2483 value1 = tvb_get_letohl(tvb, ioffset);
2484 values->vstring = match_strval(value1, nds_syntax);
2485 if (values->vstring == NULL)
2487 values->vstring = "No Syntax Found";
2489 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2490 4, values->vstring);
2491 ioffset = ioffset + 4;
2492 value2 = tvb_get_letohl(tvb, ioffset);
2493 ioffset = ioffset + 4;
2494 get_string(tvb, ioffset, value2, mval_buf.buffer);
2495 values->vstring = mval_buf.buffer;
2496 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2497 value2, values->vstring);
2498 values->voffset=ioffset + value2;
2499 print_nds_values(ntree, tvb, value1, values);
2500 ioffset = values->voffset;
2504 for (i = 1 ; i <= values->vvalue; i++ )
2506 value1 = tvb_get_letohl(tvb, ioffset);
2507 values->vstring = match_strval(value1, nds_syntax);
2508 if (values->vstring == NULL)
2510 values->vstring = "No Syntax Found";
2512 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2513 4, values->vstring);
2514 ioffset = ioffset + 4;
2515 value2 = tvb_get_letohl(tvb, ioffset);
2516 ioffset = ioffset + 4;
2517 get_string(tvb, ioffset, value2, mval_buf.buffer);
2518 values->vstring = mval_buf.buffer;
2519 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2520 value2, values->vstring);
2521 values->voffset=ioffset + value2;
2523 ioffset += align_4(tvb, ioffset);
2524 value3 = tvb_get_letohl(tvb, ioffset);
2526 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2527 value1, "Number of Values - %d", value1);
2529 ioffset = ioffset + 4;
2530 for (r = 1 ; r <= value3; r++ )
2532 ioffset += 4; /* Length = 4 */
2533 value4 = tvb_get_letohl(tvb, ioffset);
2534 proto_tree_add_uint(ntree, hf_nds_privileges, tvb, ioffset,
2535 values->vlength, value4);
2536 ioffset = ioffset+4;
2541 for (i = 1 ; i <= values->vvalue; i++ )
2543 value1 = tvb_get_letohl(tvb, ioffset);
2544 values->vstring = match_strval(value1, nds_syntax);
2545 if (values->vstring == NULL)
2547 values->vstring = "No Syntax Found";
2549 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2550 4, values->vstring);
2551 ioffset = ioffset + 4;
2552 value2 = tvb_get_letohl(tvb, ioffset);
2553 ioffset = ioffset + 4;
2554 get_string(tvb, ioffset, value2, mval_buf.buffer);
2555 values->vstring = mval_buf.buffer;
2556 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2557 value2, values->vstring);
2558 ioffset = ioffset + value2;
2559 ioffset += align_4(tvb, ioffset);
2560 value3 = tvb_get_letohl(tvb, ioffset);
2562 aitem = proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2563 value3, "Number of Values - %d", value3);
2565 atree = proto_item_add_subtree(aitem, ett_nds);
2567 ioffset = ioffset + 4;
2568 for (r = 1 ; r <= value3; r++ )
2570 ioffset += align_4(tvb, ioffset);
2571 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2572 temp_values.vlength = 2;
2573 temp_values.hfname = hf_nds_vflags;
2574 temp_values.voffset = ioffset;
2575 temp_values.vdesc = "Value Flags";
2576 temp_values.bit1 = "Naming";
2577 temp_values.bit1hfname = hf_bit1vflags;
2578 temp_values.bit2 = "Base Class";
2579 temp_values.bit2hfname = hf_bit2vflags;
2580 temp_values.bit3 = "Present";
2581 temp_values.bit3hfname = hf_bit3vflags;
2582 temp_values.bit4 = "Value Damaged";
2583 temp_values.bit4hfname = hf_bit4vflags;
2584 temp_values.bit5 = "Not Defined";
2585 temp_values.bit5hfname = hf_bit5vflags;
2586 temp_values.bit6 = "Not Defined";
2587 temp_values.bit6hfname = hf_bit6vflags;
2588 temp_values.bit7 = "Not Defined";
2589 temp_values.bit7hfname = hf_bit7vflags;
2590 temp_values.bit8 = "Not Defined";
2591 temp_values.bit8hfname = hf_bit8vflags;
2592 temp_values.bit9 = "Not Defined";
2593 temp_values.bit9hfname = hf_bit9vflags;
2594 temp_values.bit10 = "Not Defined";
2595 temp_values.bit10hfname = hf_bit10vflags;
2596 temp_values.bit11 = "Not Defined";
2597 temp_values.bit11hfname = hf_bit11vflags;
2598 temp_values.bit12 = "Not Defined";
2599 temp_values.bit12hfname = hf_bit12vflags;
2600 temp_values.bit13 = "Not Defined";
2601 temp_values.bit13hfname = hf_bit13vflags;
2602 temp_values.bit14 = "Not Defined";
2603 temp_values.bit14hfname = hf_bit14vflags;
2604 temp_values.bit15 = "Not Defined";
2605 temp_values.bit15hfname = hf_bit15vflags;
2606 temp_values.bit16 = "Not Defined";
2607 temp_values.bit16hfname = hf_bit16vflags;
2608 process_bitfield(atree, tvb, &temp_values);
2609 ioffset = ioffset + 4;
2610 value4 = tvb_get_letohl(tvb, ioffset);
2611 proto_tree_add_uint_format(atree, hf_es_seconds, tvb, ioffset,
2612 4, value4, "Seconds %d", value4);
2613 ioffset = ioffset + 4;
2614 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2615 proto_tree_add_item(atree, hf_nds_replica_num, tvb, ioffset,
2617 ioffset = ioffset + 2;
2618 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2619 proto_tree_add_item(atree, hf_nds_event_num, tvb, ioffset,
2621 ioffset = ioffset + 2;
2622 value5 = tvb_get_letohl(tvb, ioffset); /* length of field */
2623 if(value5 > tvb_length_remaining(tvb, ioffset))
2628 proto_tree_add_bytes(atree, hf_value_bytes, tvb, ioffset, value5, tvb_get_ptr(tvb, ioffset, value5));
2630 ioffset += (value5%2);
2635 for (i = 1 ; i <= values->vvalue; i++ )
2637 value1 = tvb_get_letohl(tvb, ioffset);
2638 values->vstring = match_strval(value1, nds_syntax);
2639 if (values->vstring == NULL)
2641 values->vstring = "No Syntax Found";
2643 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
2644 4, values->vstring);
2645 ioffset = ioffset + 4;
2646 value2 = tvb_get_letohl(tvb, ioffset);
2647 ioffset = ioffset + 4;
2648 get_string(tvb, ioffset, value2, mval_buf.buffer);
2649 values->vstring = mval_buf.buffer;
2650 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2651 value2, values->vstring);
2652 ioffset = ioffset + value2;
2653 value3 = tvb_get_letohl(tvb, ioffset);
2655 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
2656 value3, "Number of Values - %d", value3);
2658 ioffset = ioffset + 4;
2659 for (r = 1 ; r <= value3; r++ )
2661 ioffset += align_4(tvb, ioffset);
2662 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2663 temp_values.vlength = 2;
2664 temp_values.hfname = hf_nds_vflags;
2665 temp_values.voffset = ioffset;
2666 temp_values.vdesc = "Value Flags";
2667 temp_values.bit1 = "Naming";
2668 temp_values.bit1hfname = hf_bit1vflags;
2669 temp_values.bit2 = "Base Class";
2670 temp_values.bit2hfname = hf_bit2vflags;
2671 temp_values.bit3 = "Present";
2672 temp_values.bit3hfname = hf_bit3vflags;
2673 temp_values.bit4 = "Value Damaged";
2674 temp_values.bit4hfname = hf_bit4vflags;
2675 temp_values.bit5 = "Not Defined";
2676 temp_values.bit5hfname = hf_bit5vflags;
2677 temp_values.bit6 = "Not Defined";
2678 temp_values.bit6hfname = hf_bit6vflags;
2679 temp_values.bit7 = "Not Defined";
2680 temp_values.bit7hfname = hf_bit7vflags;
2681 temp_values.bit8 = "Not Defined";
2682 temp_values.bit8hfname = hf_bit8vflags;
2683 temp_values.bit9 = "Not Defined";
2684 temp_values.bit9hfname = hf_bit9vflags;
2685 temp_values.bit10 = "Not Defined";
2686 temp_values.bit10hfname = hf_bit10vflags;
2687 temp_values.bit11 = "Not Defined";
2688 temp_values.bit11hfname = hf_bit11vflags;
2689 temp_values.bit12 = "Not Defined";
2690 temp_values.bit12hfname = hf_bit12vflags;
2691 temp_values.bit13 = "Not Defined";
2692 temp_values.bit13hfname = hf_bit13vflags;
2693 temp_values.bit14 = "Not Defined";
2694 temp_values.bit14hfname = hf_bit14vflags;
2695 temp_values.bit15 = "Not Defined";
2696 temp_values.bit15hfname = hf_bit15vflags;
2697 temp_values.bit16 = "Not Defined";
2698 temp_values.bit16hfname = hf_bit16vflags;
2699 process_bitfield(ntree, tvb, &temp_values);
2700 ioffset = ioffset + 4;
2701 value1 = tvb_get_letohl(tvb, ioffset);
2702 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
2703 4, value1, "Seconds %d", value1);
2704 ioffset = ioffset + 4;
2705 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2706 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
2708 ioffset = ioffset + 2;
2709 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2710 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
2712 ioffset = ioffset + 2;
2713 value1 = tvb_get_letohl(tvb, ioffset);
2714 proto_tree_add_uint(ntree, hf_nds_value_len, tvb, ioffset,
2716 ioffset = ioffset + 4;
2724 case 3: /* Attribute Request */
2725 for (i = 1 ; i <= values->vvalue; i++ )
2727 ioffset += align_4(tvb, ioffset);
2728 value1 = tvb_get_letohl(tvb, ioffset);
2729 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
2730 4, value1, "Value %d", value1);
2731 ioffset = ioffset + value1;
2734 case 4: /* Read Class Request */
2735 for (i = 1 ; i <= values->vvalue; i++ )
2737 ioffset += align_4(tvb, ioffset);
2738 value1 = tvb_get_letohl(tvb, ioffset);
2739 ioffset = ioffset + 4;
2740 get_string(tvb, ioffset, value1, mval_buf.buffer);
2741 values->vstring = mval_buf.buffer;
2742 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
2743 value1, values->vstring);
2745 ioffset = ioffset + value1;
2748 case 5: /* Read Replicas */
2749 for (i = 1 ; i <= values->vvalue; i++ )
2752 bvalue = 0x00000001;
2754 for (r = 0 ; r < 9; r++ )
2757 if (values->vflags & bvalue)
2761 case 0x00000001: /*p3values.bit1 = "Output Flags"*/
2762 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
2763 temp_values.vlength = 2;
2764 temp_values.hfname = hf_nds_rflags;
2765 temp_values.voffset = ioffset;
2766 temp_values.vdesc = "Output Flags";
2767 temp_values.bit1 = values->bit1;
2768 temp_values.bit1hfname = hf_bit1outflags;
2769 temp_values.bit2 = values->bit2;
2770 temp_values.bit2hfname = hf_bit2outflags;
2771 temp_values.bit3 = values->bit3;
2772 temp_values.bit3hfname = hf_bit3outflags;
2773 temp_values.bit4 = values->bit4;
2774 temp_values.bit4hfname = hf_bit4outflags;
2775 temp_values.bit5 = values->bit5;
2776 temp_values.bit5hfname = hf_bit5outflags;
2777 temp_values.bit6 = values->bit6;
2778 temp_values.bit6hfname = hf_bit6outflags;
2779 temp_values.bit7 = values->bit7;
2780 temp_values.bit7hfname = hf_bit7outflags;
2781 temp_values.bit8 = values->bit8;
2782 temp_values.bit8hfname = hf_bit8outflags;
2783 temp_values.bit9 = values->bit9;
2784 temp_values.bit9hfname = hf_bit9outflags;
2785 temp_values.bit10 = "Not Defined";
2786 temp_values.bit10hfname = hf_bit10outflags;
2787 temp_values.bit11 = "Not Defined";
2788 temp_values.bit11hfname = hf_bit11outflags;
2789 temp_values.bit12 = "Not Defined";
2790 temp_values.bit12hfname = hf_bit12outflags;
2791 temp_values.bit13 = "Not Defined";
2792 temp_values.bit13hfname = hf_bit13outflags;
2793 temp_values.bit14 = "Not Defined";
2794 temp_values.bit14hfname = hf_bit14outflags;
2795 temp_values.bit15 = "Not Defined";
2796 temp_values.bit15hfname = hf_bit15outflags;
2797 temp_values.bit16 = "Not Defined";
2798 temp_values.bit16hfname = hf_bit16outflags;
2799 process_bitfield(ntree, tvb, &temp_values);
2800 ioffset = ioffset + 4;
2802 case 0x00000002: /*p3values.bit2 = "Entry ID"*/
2803 value1 = tvb_get_letohl(tvb, ioffset);
2804 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
2805 4, value1, "Entry ID %08x", value1);
2806 ioffset = ioffset + 4;
2808 case 0x00000004: /*p3values.bit3 = "Replica State"*/
2809 value1 = tvb_get_letohl(tvb, ioffset);
2810 temp_values.vstring = match_strval(value1, nds_replica_state);
2811 if (temp_values.vstring == NULL)
2813 temp_values.vstring = "No Replica State Found";
2815 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
2816 4, temp_values.vstring);
2817 ioffset = ioffset + 4;
2819 case 0x0000008: /*p3values.bit4 = "Modification Timestamp"*/
2820 value1 = tvb_get_letohl(tvb, ioffset);
2821 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
2822 4, value1, "Seconds %d", value1);
2823 ioffset = ioffset + 4;
2824 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
2825 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
2827 ioffset = ioffset + 2;
2828 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
2829 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
2831 ioffset = ioffset + 2;
2833 case 0x00000010: /*p3values.bit5 = "Purge Time"*/
2834 value1 = tvb_get_letohl(tvb, ioffset);
2835 proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset,
2836 4, value1, "Purge Time %d", value1);
2837 ioffset = ioffset + 4;
2839 case 0x00000020: /*p3values.bit6 = "Local Partition ID"*/
2840 value1 = tvb_get_letohl(tvb, ioffset);
2841 proto_tree_add_uint_format(ntree, hf_nds_local_partition, tvb, ioffset,
2842 4, value1, "Local Partition ID %08x", value1);
2843 ioffset = ioffset + 4;
2845 case 0x00000040: /*p3values.bit7 = "Distinguished Name"*/
2846 value1 = tvb_get_letohl(tvb, ioffset);
2847 ioffset = ioffset + 4;
2848 get_string(tvb, ioffset, value1, mval_buf.buffer);
2849 temp_values.vstring = mval_buf.buffer;
2850 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
2851 value1, temp_values.vstring);
2852 ioffset = ioffset + value1;
2854 case 0x00000080: /*p3values.bit8 = "Replica Type & State"*/
2855 value1 = tvb_get_letohl(tvb, ioffset);
2856 value2 = value1 & 0x00ff;
2857 temp_values.vstring = match_strval(value2, nds_replica_type);
2858 if (temp_values.vstring == NULL)
2860 temp_values.vstring = "No Replica Type Found";
2862 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
2863 4, temp_values.vstring);
2864 value3 = value1 & 0xff00;
2865 temp_values.vstring = match_strval(value3, nds_replica_state);
2866 if (temp_values.vstring == NULL)
2868 temp_values.vstring = "No Replica State Found";
2870 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
2871 4, temp_values.vstring);
2872 ioffset = ioffset + 4;
2874 case 0x00000100: /*p3values.bit9 = "Partition Busy"*/
2875 value1 = tvb_get_letohs(tvb, ioffset);
2876 proto_tree_add_boolean(ntree, hf_partition_busy, tvb, ioffset, 4, value1);
2885 ioffset += align_4(tvb, ioffset);
2886 if(tvb_length_remaining(tvb, ioffset) < 4 )
2891 if(tvb_length_remaining(tvb, ioffset) < 4 )
2897 case 6: /* Modify Attribute Request */
2898 for (i = 0 ; i < values->vvalue; i++ )
2900 ioffset += align_4(tvb, ioffset);
2901 value1 = tvb_get_letohl(tvb, ioffset);
2902 valuestr = match_strval(value1, nds_kind_of_changes);
2903 if (valuestr == NULL)
2905 valuestr="(Kind Change Not Found)";
2907 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
2908 values->vlength, value1, valuestr, value1);
2909 ioffset = ioffset+4;
2910 value2 = tvb_get_letohl(tvb, ioffset);
2911 ioffset = ioffset + 4;
2912 get_string(tvb, ioffset, value2, mval_buf.buffer); /* Name of Attribute */
2913 temp_values.vstring = mval_buf.buffer;
2914 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
2915 value2, temp_values.vstring);
2916 ioffset = ioffset + value2;
2917 ioffset += align_4(tvb, ioffset);
2918 if(value1 != 1 && value1 != 6)
2920 values->voffset = ioffset;
2921 print_nds_values(ntree, tvb, 9, values);
2922 ioffset = values->voffset;
2926 case 7: /* Address Referal Request */
2927 for (i = 0 ; i < values->vvalue; i++ )
2930 value1 = tvb_get_letohl(tvb, ioffset);
2931 valuestr = match_strval(value1, nds_protocol_type);
2932 if (valuestr == NULL)
2934 valuestr="(Undefined Protocol)";
2936 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
2937 values->vlength, value1, valuestr, value1);
2938 ioffset = ioffset+4;
2941 case 8: /* Address Referal Reply */
2942 number_of_referals = values->vvalue;
2944 for (r = 1 ; r <= number_of_referals; r++ )
2946 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, 6, 0,
2947 r, "NDS Referal Record #%d", r);
2948 atree = proto_item_add_subtree(aitem, ett_nds);
2950 value1 = tvb_get_letohl(tvb, ioffset);
2952 proto_tree_add_uint_format(atree, hf_referal_addcount, tvb, ioffset, 4,
2953 value1, "Number of Addresses in Referal - %d", value1);
2955 ioffset = ioffset + 4;
2956 for (i = 1 ; i <= value1; i++ )
2958 value2 = tvb_get_letohl(tvb, ioffset);
2959 valuestr = match_strval(value2, nds_protocol_type);
2960 if (valuestr == NULL)
2962 valuestr="(Undefined Protocol)";
2964 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
2965 values->vlength, value2, valuestr, value2);
2966 ioffset = ioffset+4;
2967 value3 = tvb_get_letohl(tvb, ioffset);
2968 ioffset = ioffset+4;
2972 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
2973 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
2974 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
2977 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2978 value4 = tvb_get_letohl(tvb, ioffset+2);
2979 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset+2, 4, value4);
2982 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2983 value4 = tvb_get_letohl(tvb, ioffset+2);
2984 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset+2, 4, value4);
2987 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
2988 value4 = tvb_get_letohl(tvb, ioffset+2);
2989 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, value4);
2992 get_string(tvb, ioffset, value3, values->vstring);
2993 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
2994 value3, values->vstring);
2999 ioffset = ioffset + value3;
3000 ioffset += align_4(tvb, ioffset);
3006 case 9: /* Local Address Referal Reply */
3007 number_of_referals = values->vvalue;
3009 for (r = 1 ; r <= number_of_referals; r++ )
3011 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, 6, 0,
3012 r, "NDS Referal Record #%d", r);
3013 atree = proto_item_add_subtree(aitem, ett_nds);
3015 value2 = tvb_get_letohl(tvb, ioffset);
3016 valuestr = match_strval(value2, nds_protocol_type);
3017 if (valuestr == NULL)
3019 valuestr="(Undefined Protocol)";
3021 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
3022 values->vlength, value2, valuestr, value2);
3023 ioffset = ioffset+4;
3024 value3 = tvb_get_letohl(tvb, ioffset);
3025 ioffset = ioffset+4;
3030 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
3031 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
3032 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
3035 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3037 value4 = tvb_get_letohl(tvb, ioffset);
3038 proto_tree_add_ipv4(atree, hf_add_ref_ip, tvb, ioffset, 4, value4);
3041 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3043 value4 = tvb_get_letohl(tvb, ioffset);
3044 proto_tree_add_ipv4(atree, hf_add_ref_udp, tvb, ioffset, 4, value4);
3047 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
3049 value4 = tvb_get_letohl(tvb, ioffset);
3050 proto_tree_add_ipv4(atree, hf_add_ref_tcp, tvb, ioffset, 4, value4);
3053 get_string(tvb, ioffset, value3, values->vstring);
3054 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
3055 value3, values->vstring);
3060 ioffset = ioffset + value3;
3061 ioffset += align_4(tvb, ioffset);
3064 case 10: /* Process Entry Specifiers */
3065 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3066 values->vstring = match_strval(value2, es_type);
3067 if (values->vstring == NULL)
3069 values->vstring = "No ES Type Found";
3071 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
3072 4, values->vstring, "Output Entry Specifier - %s", values->vstring);
3073 estree = proto_item_add_subtree(esitem, ett_nds);
3074 ioffset = ioffset + 4;
3075 ioffset = print_es_type(estree, tvb, values, value2, ioffset);
3076 value3 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3077 values->vstring = match_strval(value3, es_type);
3078 if (values->vstring == NULL)
3080 values->vstring = "No ES Type Found";
3082 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
3083 4, values->vstring, "Input Entry Specifier - %s", values->vstring);
3084 estree = proto_item_add_subtree(esitem, ett_nds);
3085 ioffset = ioffset + 4;
3086 ioffset = print_es_type(estree, tvb, values, value3, ioffset);
3087 value4 = tvb_get_letohl(tvb, ioffset);
3088 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, ioffset, 4,
3089 value4, "Referal Protocols - %d", value4);
3090 atree = proto_item_add_subtree(aitem, ett_nds);
3092 for (i = 0 ; i < value4; i++ )
3094 value5 = tvb_get_letohl(tvb, ioffset);
3095 valuestr = match_strval(value5, nds_protocol_type);
3096 if (valuestr == NULL)
3098 valuestr="(Undefined Protocol)";
3100 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
3101 4, valuestr, "Protocol -> %s", valuestr);
3102 ioffset = ioffset+4;
3104 value6 = tvb_get_letohl(tvb, ioffset);
3105 aitem = proto_tree_add_uint_format(ntree, hf_referal_record, tvb, ioffset, 4,
3106 value6, "Tree Walking Protocols - %d", value6);
3107 atree = proto_item_add_subtree(aitem, ett_nds);
3109 for (i = 0 ; i < value6; i++ )
3111 value7 = tvb_get_letohl(tvb, ioffset);
3112 valuestr = match_strval(value7, nds_protocol_type);
3113 if (valuestr == NULL)
3115 valuestr="(Undefined Protocol)";
3117 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
3118 4, valuestr, "Protocol -> %s", valuestr);
3119 ioffset = ioffset+4;
3122 case 11: /* Print Timestamp */
3123 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3124 proto_tree_add_item(ncp_tree, hf_nds_replica_num, tvb, ioffset,
3126 ioffset = ioffset + 2;
3127 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3128 proto_tree_add_item(ncp_tree, hf_nds_event_num, tvb, ioffset,
3130 ioffset = ioffset + 2;
3131 case 12: /* List Partitions */
3132 number_of_referals = values->vvalue;
3133 for (i = 0; i < number_of_referals; i++)
3135 bvalue = 0x00000001;
3137 for (r = 0 ; r < 32; r++ )
3139 if (values->vflags & bvalue)
3143 case 0x00000001: /* Information Flags */
3144 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
3145 temp_values.vtype = 5; /* Bitfield */
3146 temp_values.vstring = "";
3147 temp_values.vdesc = "Information Flags (low) Byte:";
3148 temp_values.vlength = 2;
3149 temp_values.hfname= hf_nds_rflags;
3150 temp_values.voffset = ioffset;
3151 temp_values.bit1 = "Output Flags";
3152 temp_values.bit1hfname = hf_bit1infoflagsl;
3153 temp_values.bit2 = "Entry ID";
3154 temp_values.bit2hfname = hf_bit2infoflagsl;
3155 temp_values.bit3 = "Entry Flags";
3156 temp_values.bit3hfname = hf_bit3infoflagsl;
3157 temp_values.bit4 = "Subordinate Count";
3158 temp_values.bit4hfname = hf_bit4infoflagsl;
3159 temp_values.bit5 = "Modification Time";
3160 temp_values.bit5hfname = hf_bit5infoflagsl;
3161 temp_values.bit6 = "Modification Timestamp";
3162 temp_values.bit6hfname = hf_bit6infoflagsl;
3163 temp_values.bit7 = "Creation Timestamp";
3164 temp_values.bit7hfname = hf_bit7infoflagsl;
3165 temp_values.bit8 = "Partition Root ID";
3166 temp_values.bit8hfname = hf_bit8infoflagsl;
3167 temp_values.bit9 = "Parent ID";
3168 temp_values.bit9hfname = hf_bit9infoflagsl;
3169 temp_values.bit10 = "Revision Count";
3170 temp_values.bit10hfname = hf_bit10infoflagsl;
3171 temp_values.bit11 = "Replica Type";
3172 temp_values.bit11hfname = hf_bit11infoflagsl;
3173 temp_values.bit12 = "Base Class";
3174 temp_values.bit12hfname = hf_bit12infoflagsl;
3175 temp_values.bit13 = "Relative Distinguished Name";
3176 temp_values.bit13hfname = hf_bit13infoflagsl;
3177 temp_values.bit14 = "Distinguished Name";
3178 temp_values.bit14hfname = hf_bit14infoflagsl;
3179 temp_values.bit15 = "Root Distinguished Name";
3180 temp_values.bit15hfname = hf_bit15infoflagsl;
3181 temp_values.bit16 = "Parent Distinguished Name";
3182 temp_values.bit16hfname = hf_bit16infoflagsl;
3183 process_bitfield(ntree, tvb, &temp_values);
3184 ioffset = ioffset+2;
3185 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
3186 temp_values.vtype = 5; /* Bitfield */
3187 temp_values.vstring = "";
3188 temp_values.vdesc = "Information Flags (high) Byte:";
3189 temp_values.vlength = 2;
3190 temp_values.hfname= hf_nds_rflags;
3191 temp_values.voffset = ioffset;
3192 temp_values.bit1 = "Purge Time";
3193 temp_values.bit1hfname = hf_bit1infoflagsh;
3194 temp_values.bit2 = "Dereference Base Class";
3195 temp_values.bit2hfname = hf_bit2infoflagsh;
3196 temp_values.bit3 = "Not Defined";
3197 temp_values.bit3hfname = hf_bit3infoflagsh;
3198 temp_values.bit4 = "Not Defined";
3199 temp_values.bit4hfname = hf_bit4infoflagsh;
3200 temp_values.bit5 = "Not Defined";
3201 temp_values.bit5hfname = hf_bit5infoflagsh;
3202 temp_values.bit6 = "Not Defined";
3203 temp_values.bit6hfname = hf_bit6infoflagsh;
3204 temp_values.bit7 = "Not Defined";
3205 temp_values.bit7hfname = hf_bit7infoflagsh;
3206 temp_values.bit8 = "Not Defined";
3207 temp_values.bit8hfname = hf_bit8infoflagsh;
3208 temp_values.bit9 = "Not Defined";
3209 temp_values.bit9hfname = hf_bit9infoflagsh;
3210 temp_values.bit10 = "Not Defined";
3211 temp_values.bit10hfname = hf_bit10infoflagsh;
3212 temp_values.bit11 = "Not Defined";
3213 temp_values.bit11hfname = hf_bit11infoflagsh;
3214 temp_values.bit12 = "Not Defined";
3215 temp_values.bit12hfname = hf_bit12infoflagsh;
3216 temp_values.bit13 = "Not Defined";
3217 temp_values.bit13hfname = hf_bit13infoflagsh;
3218 temp_values.bit14 = "Not Defined";
3219 temp_values.bit14hfname = hf_bit14infoflagsh;
3220 temp_values.bit15 = "Not Defined";
3221 temp_values.bit15hfname = hf_bit15infoflagsh;
3222 temp_values.bit16 = "Not Defined";
3223 temp_values.bit16hfname = hf_bit16infoflagsh;
3224 process_bitfield(ntree, tvb, &temp_values);
3225 ioffset = ioffset+2;
3227 case 0x00000002: /* Entry ID */
3228 value1 = tvb_get_letohl(tvb, ioffset);
3229 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
3230 4, value1, "Entry ID %08x", value1);
3231 ioffset = ioffset + 4;
3233 case 0x00000004: /* Entry Flags */
3234 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
3235 temp_values.vtype = 5; /* Bitfield */
3236 temp_values.vstring = "";
3237 temp_values.vdesc = "Entry Flags:";
3238 temp_values.vlength = 2;
3239 temp_values.hfname= hf_nds_eflags;
3240 temp_values.voffset = ioffset;
3241 temp_values.bit1 = "Alias Entry";
3242 temp_values.bit1hfname = hf_bit1eflags;
3243 temp_values.bit2 = "Partition Root";
3244 temp_values.bit2hfname = hf_bit2eflags;
3245 temp_values.bit3 = "Container Entry";
3246 temp_values.bit3hfname = hf_bit3eflags;
3247 temp_values.bit4 = "Container Alias";
3248 temp_values.bit4hfname = hf_bit4eflags;
3249 temp_values.bit5 = "Matches List Filter";
3250 temp_values.bit5hfname = hf_bit5eflags;
3251 temp_values.bit6 = "Reference Entry";
3252 temp_values.bit6hfname = hf_bit6eflags;
3253 temp_values.bit7 = "40x Reference Entry";
3254 temp_values.bit7hfname = hf_bit7eflags;
3255 temp_values.bit8 = "Back Linked";
3256 temp_values.bit8hfname = hf_bit8eflags;
3257 temp_values.bit9 = "New Entry";
3258 temp_values.bit9hfname = hf_bit9eflags;
3259 temp_values.bit10 = "Temporary Reference";
3260 temp_values.bit10hfname = hf_bit10eflags;
3261 temp_values.bit11 = "Audited";
3262 temp_values.bit11hfname = hf_bit11eflags;
3263 temp_values.bit12 = "Entry Not Present";
3264 temp_values.bit12hfname = hf_bit12eflags;
3265 temp_values.bit13 = "Entry Verify CTS";
3266 temp_values.bit13hfname = hf_bit13eflags;
3267 temp_values.bit14 = "Entry Damaged";
3268 temp_values.bit14hfname = hf_bit14eflags;
3269 temp_values.bit15 = "Not Defined";
3270 temp_values.bit15hfname = hf_bit15eflags;
3271 temp_values.bit16 = "Not Defined";
3272 temp_values.bit16hfname = hf_bit16eflags;
3273 process_bitfield(ntree, tvb, &temp_values);
3274 ioffset = ioffset+4;
3276 case 0x0000008: /* Subordinate Count */
3277 value1 = tvb_get_letohl(tvb, ioffset);
3278 proto_tree_add_uint_format(ntree, hf_sub_count, tvb, ioffset,
3279 4, value1, "Subordinate Count %d", value1);
3280 ioffset = ioffset + 4;
3282 case 0x0000010: /* Modification Time */
3283 value1 = tvb_get_letohl(tvb, ioffset);
3284 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3285 4, value1, "Modification Time in Seconds %d", value1);
3286 ioffset = ioffset + 4;
3288 case 0x0000020: /* Modification Timestamp */
3289 value1 = tvb_get_letohl(tvb, ioffset);
3290 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3291 4, value1, "Modification Timestamp Seconds %d", value1);
3292 ioffset = ioffset + 4;
3293 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3294 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
3296 ioffset = ioffset + 2;
3297 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3298 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
3300 ioffset = ioffset + 2;
3302 case 0x0000040: /* Creation Timestamp */
3303 value1 = tvb_get_letohl(tvb, ioffset);
3304 proto_tree_add_uint_format(ntree, hf_es_seconds, tvb, ioffset,
3305 4, value1, "Creation Timestamp Seconds %d", value1);
3306 ioffset = ioffset + 4;
3307 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3308 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
3310 ioffset = ioffset + 2;
3311 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3312 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
3314 ioffset = ioffset + 2;
3316 case 0x00000080: /* Partition Root ID */
3317 value1 = tvb_get_letohl(tvb, ioffset);
3318 proto_tree_add_uint_format(ntree, hf_nds_partition_root_id, tvb, ioffset,
3319 4, value1, "Partition Root ID %08x", value1);
3320 ioffset = ioffset + 4;
3322 case 0x00000100: /* Parent ID */
3323 value1 = tvb_get_letohl(tvb, ioffset);
3324 proto_tree_add_uint_format(ntree, hf_nds_parent, tvb, ioffset,
3325 4, value1, "Parent ID %08x", value1);
3326 ioffset = ioffset + 4;
3328 case 0x00000200: /* Revision Count */
3329 value1 = tvb_get_letohl(tvb, ioffset);
3330 proto_tree_add_uint_format(ntree, hf_nds_revision, tvb, ioffset,
3331 4, value1, "Revision Count %d", value1);
3332 ioffset = ioffset + 4;
3334 case 0x00000400: /* Replica Type & State */
3335 value1 = tvb_get_letohl(tvb, ioffset);
3336 value2 = value1 & 0x00ff;
3337 temp_values.vstring = match_strval(value2, nds_replica_type);
3338 if (temp_values.vstring == NULL)
3340 temp_values.vstring = "No Replica Type Found";
3342 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
3343 4, temp_values.vstring);
3344 value3 = value1 & 0xff00;
3345 temp_values.vstring = match_strval(value3, nds_replica_state);
3346 if (temp_values.vstring == NULL)
3348 temp_values.vstring = "No Replica State Found";
3350 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
3351 4, temp_values.vstring);
3352 ioffset = ioffset + 4;
3354 case 0x00000800: /* Base Class */
3355 value1 = tvb_get_letohl(tvb, ioffset);
3356 ioffset = ioffset + 4;
3357 get_string(tvb, ioffset, value1, mval_buf.buffer);
3358 temp_values.vstring = mval_buf.buffer;
3359 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
3360 value1, temp_values.vstring);
3361 ioffset = ioffset + value1;
3363 case 0x00001000: /* Relative Distinguished Name */
3364 value1 = tvb_get_letohl(tvb, ioffset);
3365 ioffset = ioffset + 4;
3366 get_string(tvb, ioffset, value1, mval_buf.buffer);
3367 temp_values.vstring = mval_buf.buffer;
3368 proto_tree_add_string(ntree, hf_nds_relative_dn, tvb, ioffset,
3369 value1, temp_values.vstring);
3370 ioffset = ioffset + value1;
3372 case 0x00002000: /* Distinguished Name */
3373 value1 = tvb_get_letohl(tvb, ioffset);
3374 ioffset = ioffset + 4;
3375 get_string(tvb, ioffset, value1, mval_buf.buffer);
3376 temp_values.vstring = mval_buf.buffer;
3377 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3378 value1, temp_values.vstring);
3379 ioffset = ioffset + value1;
3381 case 0x00004000: /* Root Distinguished Name */
3382 value1 = tvb_get_letohl(tvb, ioffset);
3383 ioffset = ioffset + 4;
3384 get_string(tvb, ioffset, value1, mval_buf.buffer);
3385 temp_values.vstring = mval_buf.buffer;
3386 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3387 value1, temp_values.vstring);
3388 ioffset = ioffset + value1;
3390 case 0x00008000: /* Parent Distinguished Name */
3391 value1 = tvb_get_letohl(tvb, ioffset);
3392 ioffset = ioffset + 4;
3393 get_string(tvb, ioffset, value1, mval_buf.buffer);
3394 temp_values.vstring = mval_buf.buffer;
3395 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
3396 value1, temp_values.vstring);
3397 ioffset = ioffset + value1;
3399 case 0x00010000: /* Purge Time */
3400 value1 = tvb_get_letohl(tvb, ioffset);
3401 proto_tree_add_uint_format(ntree, hf_nds_purge, tvb, ioffset,
3402 4, value1, "Purge Time %d", value1);
3403 ioffset = ioffset + 4;
3405 case 0x00020000: /* Dereference Base Class */
3406 value1 = tvb_get_letohl(tvb, ioffset);
3407 ioffset = ioffset + 4;
3408 get_string(tvb, ioffset, value1, mval_buf.buffer);
3409 temp_values.vstring = mval_buf.buffer;
3410 proto_tree_add_string(ntree, hf_deref_base, tvb, ioffset,
3411 value1, temp_values.vstring);
3412 ioffset = ioffset + value1;
3418 ioffset += align_4(tvb, ioffset);
3421 if(tvb_length_remaining(tvb, ioffset) < 4 )
3426 if(tvb_length_remaining(tvb, ioffset) < 4 )
3432 case 13: /* Class Names */
3433 number_of_referals = values->vvalue;
3434 for (i = 0; i < number_of_referals; i++)
3436 ioffset += align_4(tvb, ioffset);
3437 value1 = tvb_get_letohl(tvb, ioffset);
3438 ioffset = ioffset + 4;
3439 get_string(tvb, ioffset, value1, mval_buf.buffer);
3440 temp_values.vstring = mval_buf.buffer;
3441 sub1item = proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset,
3442 value1, temp_values.vstring);
3443 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
3444 ioffset = ioffset + value1;
3445 ioffset += align_4(tvb, ioffset);
3446 if(values->vflags != 0)
3448 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
3449 temp_values.vtype = 5; /* Bitfield */
3450 temp_values.vstring = "";
3451 temp_values.vdesc = "Class Flags:";
3452 temp_values.vlength = 2;
3453 temp_values.hfname= hf_nds_cflags;
3454 temp_values.voffset = ioffset;
3455 temp_values.bit1 = "Ambiguous Containment";
3456 temp_values.bit1hfname = hf_bit1cflags;
3457 temp_values.bit2 = "Ambiguous Naming";
3458 temp_values.bit2hfname = hf_bit2cflags;
3459 temp_values.bit3 = "Class Definition Cannot be Removed";
3460 temp_values.bit3hfname = hf_bit3cflags;
3461 temp_values.bit4 = "Effective Class";
3462 temp_values.bit4hfname = hf_bit4cflags;
3463 temp_values.bit5 = "Container Class";
3464 temp_values.bit5hfname = hf_bit5cflags;
3465 temp_values.bit6 = "Not Defined";
3466 temp_values.bit6hfname = hf_bit6cflags;
3467 temp_values.bit7 = "Not Defined";
3468 temp_values.bit7hfname = hf_bit7cflags;
3469 temp_values.bit8 = "Not Defined";
3470 temp_values.bit8hfname = hf_bit8cflags;
3471 temp_values.bit9 = "Not Defined";
3472 temp_values.bit9hfname = hf_bit9cflags;
3473 temp_values.bit10 = "Not Defined";
3474 temp_values.bit10hfname = hf_bit10cflags;
3475 temp_values.bit11 = "Not Defined";
3476 temp_values.bit11hfname = hf_bit11cflags;
3477 temp_values.bit12 = "Not Defined";
3478 temp_values.bit12hfname = hf_bit12cflags;
3479 temp_values.bit13 = "Not Defined";
3480 temp_values.bit13hfname = hf_bit13cflags;
3481 temp_values.bit14 = "Not Defined";
3482 temp_values.bit14hfname = hf_bit14cflags;
3483 temp_values.bit15 = "Not Defined";
3484 temp_values.bit15hfname = hf_bit15cflags;
3485 temp_values.bit16 = "Not Defined";
3486 temp_values.bit16hfname = hf_bit16cflags;
3487 process_bitfield(sub1tree, tvb, &temp_values);
3488 ioffset = ioffset+4;
3489 if(values->vflags != 5)
3491 value1 = tvb_get_letohl(tvb, ioffset); /* length of field */
3492 if(value1 > tvb_length_remaining(tvb, ioffset))
3497 proto_tree_add_bytes(sub1tree, hf_nds_asn1, tvb, ioffset, value1, tvb_get_ptr(tvb, ioffset, value1));
3499 ioffset += (value1%2);
3501 if(values->vflags == 1 || values->vflags == 2 || values->vflags == 4)
3503 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
3504 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3505 4, value1, "Super Classes %d", value1);
3506 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3507 ioffset = ioffset + 4;
3508 for (r = 0; r < value1; r++)
3510 value2 = tvb_get_letohl(tvb, ioffset);
3511 ioffset = ioffset + 4;
3512 get_string(tvb, ioffset, value2, mval_buf.buffer);
3513 temp_values.vstring = mval_buf.buffer;
3514 proto_tree_add_string(sub2tree, hf_nds_super, tvb, ioffset,
3515 value2, temp_values.vstring);
3516 ioffset = ioffset + value2;
3517 ioffset += align_4(tvb, ioffset);
3519 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3520 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3521 4, value1, "Containment Classes %d", value1);
3522 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3523 ioffset = ioffset + 4;
3524 for (r = 0; r < value1; r++)
3526 value2 = tvb_get_letohl(tvb, ioffset);
3527 ioffset = ioffset + 4;
3528 get_string(tvb, ioffset, value2, mval_buf.buffer);
3529 temp_values.vstring = mval_buf.buffer;
3530 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3531 value2, temp_values.vstring);
3532 ioffset = ioffset + value2;
3533 ioffset += align_4(tvb, ioffset);
3535 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3536 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3537 4, value1, "Naming Attributes %d", value1);
3538 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3539 ioffset = ioffset + 4;
3540 for (r = 0; r < value1; r++)
3542 value2 = tvb_get_letohl(tvb, ioffset);
3543 ioffset = ioffset + 4;
3544 get_string(tvb, ioffset, value2, mval_buf.buffer);
3545 temp_values.vstring = mval_buf.buffer;
3546 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3547 value2, temp_values.vstring);
3548 ioffset = ioffset + value2;
3549 ioffset += align_4(tvb, ioffset);
3551 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3552 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3553 4, value1, "Mandatory Attributes %d", value1);
3554 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3555 ioffset = ioffset + 4;
3556 for (r = 0; r < value1; r++)
3558 value2 = tvb_get_letohl(tvb, ioffset);
3559 ioffset = ioffset + 4;
3560 get_string(tvb, ioffset, value2, mval_buf.buffer);
3561 temp_values.vstring = mval_buf.buffer;
3562 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3563 value2, temp_values.vstring);
3564 ioffset = ioffset + value2;
3565 ioffset += align_4(tvb, ioffset);
3567 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3568 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3569 4, value1, "Optional Attributes %d", value1);
3570 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3571 ioffset = ioffset + 4;
3572 for (r = 0; r < value1; r++)
3574 ioffset += align_4(tvb, ioffset);
3575 value2 = tvb_get_letohl(tvb, ioffset);
3576 ioffset = ioffset + 4;
3577 get_string(tvb, ioffset, value2, mval_buf.buffer);
3578 temp_values.vstring = mval_buf.buffer;
3579 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3580 value2, temp_values.vstring);
3581 ioffset = ioffset + value2;
3582 if(tvb_length_remaining(tvb, ioffset) < 4 )
3588 if(values->vflags == 2 || values->vflags == 4) /* Class Definitions of Super Classes */
3590 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3591 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3592 4, value1, "Containment Classes %d", value1);
3593 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3594 ioffset = ioffset + 4;
3595 for (r = 0; r < value1; r++)
3597 value2 = tvb_get_letohl(tvb, ioffset);
3598 ioffset = ioffset + 4;
3599 get_string(tvb, ioffset, value2, mval_buf.buffer);
3600 temp_values.vstring = mval_buf.buffer;
3601 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
3602 value2, temp_values.vstring);
3603 ioffset = ioffset + value2;
3604 ioffset += align_4(tvb, ioffset);
3606 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3607 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3608 4, value1, "Naming Attributes %d", value1);
3609 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3610 ioffset = ioffset + 4;
3611 for (r = 0; r < value1; r++)
3613 value2 = tvb_get_letohl(tvb, ioffset);
3614 ioffset = ioffset + 4;
3615 get_string(tvb, ioffset, value2, mval_buf.buffer);
3616 temp_values.vstring = mval_buf.buffer;
3617 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3618 value2, temp_values.vstring);
3619 ioffset = ioffset + value2;
3620 ioffset += align_4(tvb, ioffset);
3622 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3623 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3624 4, value1, "Mandatory Attributes %d", value1);
3625 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3626 ioffset = ioffset + 4;
3627 for (r = 0; r < value1; r++)
3629 value2 = tvb_get_letohl(tvb, ioffset);
3630 ioffset = ioffset + 4;
3631 get_string(tvb, ioffset, value2, mval_buf.buffer);
3632 temp_values.vstring = mval_buf.buffer;
3633 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3634 value2, temp_values.vstring);
3635 ioffset = ioffset + value2;
3636 ioffset += align_4(tvb, ioffset);
3638 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3639 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3640 4, value1, "Optional Attributes %d", value1);
3641 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3642 ioffset = ioffset + 4;
3643 for (r = 0; r < value1; r++)
3645 value2 = tvb_get_letohl(tvb, ioffset);
3646 ioffset = ioffset + 4;
3647 get_string(tvb, ioffset, value2, mval_buf.buffer);
3648 temp_values.vstring = mval_buf.buffer;
3649 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3650 value2, temp_values.vstring);
3651 ioffset = ioffset + value2;
3652 ioffset += align_4(tvb, ioffset);
3654 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
3655 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
3656 4, value1, "Default ACL %08x", value1);
3657 ioffset = ioffset + 4;
3658 if(tvb_length_remaining(tvb, ioffset) < 4 )
3663 if(values->vflags == 5) /* Base Class Definitions */
3665 value1 = tvb_get_letohl(tvb, ioffset); /* Creation Timestamp */
3666 proto_tree_add_uint_format(sub1tree, hf_es_seconds, tvb, ioffset,
3667 4, value1, "Creation Timestamp Seconds %d", value1);
3668 ioffset = ioffset + 4;
3669 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3670 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
3672 ioffset = ioffset + 2;
3673 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3674 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
3676 ioffset = ioffset + 2;
3677 value1 = tvb_get_letohl(tvb, ioffset); /* Modification Timestamp */
3678 proto_tree_add_uint_format(sub1tree, hf_es_seconds, tvb, ioffset,
3679 4, value1, "Modification Timestamp Seconds %d", value1);
3680 ioffset = ioffset + 4;
3681 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3682 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
3684 ioffset = ioffset + 2;
3685 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3686 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
3688 ioffset = ioffset + 2;
3689 /* Class Definition */
3690 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
3691 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3692 4, value1, "Super Classes %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_nds_super, tvb, ioffset,
3702 value2, temp_values.vstring);
3703 ioffset = ioffset + value2;
3704 ioffset += align_4(tvb, ioffset);
3706 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
3707 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3708 4, value1, "Containment Classes %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_nds_base_class, tvb, ioffset,
3718 value2, temp_values.vstring);
3719 ioffset = ioffset + value2;
3720 ioffset += align_4(tvb, ioffset);
3722 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
3723 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3724 4, value1, "Naming Attributes %d", value1);
3725 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3726 ioffset = ioffset + 4;
3727 for (r = 0; r < value1; r++)
3729 value2 = tvb_get_letohl(tvb, ioffset);
3730 ioffset = ioffset + 4;
3731 get_string(tvb, ioffset, value2, mval_buf.buffer);
3732 temp_values.vstring = mval_buf.buffer;
3733 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3734 value2, temp_values.vstring);
3735 ioffset = ioffset + value2;
3736 ioffset += align_4(tvb, ioffset);
3738 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
3739 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3740 4, value1, "Mandatory Attributes %d", value1);
3741 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3742 ioffset = ioffset + 4;
3743 for (r = 0; r < value1; r++)
3745 value2 = tvb_get_letohl(tvb, ioffset);
3746 ioffset = ioffset + 4;
3747 get_string(tvb, ioffset, value2, mval_buf.buffer);
3748 temp_values.vstring = mval_buf.buffer;
3749 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3750 value2, temp_values.vstring);
3751 ioffset = ioffset + value2;
3752 ioffset += align_4(tvb, ioffset);
3754 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
3755 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_purge, tvb, ioffset,
3756 4, value1, "Optional Attributes %d", value1);
3757 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3758 ioffset = ioffset + 4;
3759 for (r = 0; r < value1; r++)
3761 value2 = tvb_get_letohl(tvb, ioffset);
3762 ioffset = ioffset + 4;
3763 get_string(tvb, ioffset, value2, mval_buf.buffer);
3764 temp_values.vstring = mval_buf.buffer;
3765 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
3766 value2, temp_values.vstring);
3767 ioffset = ioffset + value2;
3768 ioffset += align_4(tvb, ioffset);
3770 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
3771 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
3772 4, value1, "Default ACL %08x", value1);
3773 ioffset = ioffset + 4;
3774 if(tvb_length_remaining(tvb, ioffset) < 4 )
3782 case 14: /* Modify Class */
3783 for (i = 1 ; i <= values->vvalue; i++ ) /* Attribute Names to add*/
3785 ioffset += align_4(tvb, ioffset);
3786 value1 = tvb_get_letohl(tvb, ioffset);
3787 ioffset = ioffset + 4;
3788 get_string(tvb, ioffset, value1, mval_buf.buffer);
3789 values->vstring = mval_buf.buffer;
3790 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
3791 value1, values->vstring);
3792 ioffset = ioffset + value1;
3794 if(tvb_length_remaining(tvb, ioffset) < 4 )
3798 ioffset += align_4(tvb, ioffset);
3799 value1 = tvb_get_letohl(tvb, ioffset);
3800 proto_tree_add_uint_format(ntree, hf_nds_att_del, tvb, ioffset,
3801 4, value1, "Attribute Names to Delete %d", value1);
3802 ioffset = ioffset + 4;
3803 for (i = 1 ; i <= value1; i++ ) /* Attribute Names to delete*/
3805 ioffset += align_4(tvb, ioffset);
3806 value2 = tvb_get_letohl(tvb, ioffset);
3807 ioffset = ioffset + 4;
3808 get_string(tvb, ioffset, value2, mval_buf.buffer);
3809 values->vstring = mval_buf.buffer;
3810 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
3811 value2, values->vstring);
3812 ioffset = ioffset + value2;
3814 if(tvb_length_remaining(tvb, ioffset) < 4 )
3818 ioffset += align_4(tvb, ioffset);
3819 value1 = tvb_get_letohl(tvb, ioffset);
3820 proto_tree_add_uint_format(ntree, hf_nds_acl_add, tvb, ioffset,
3821 4, value1, "ACL Templates to Add %d", value1);
3822 ioffset = ioffset + 4;
3823 for (i = 1 ; i <= value1; i++ ) /* ACL templates to add*/
3825 ioffset += align_4(tvb, ioffset);
3826 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
3827 ioffset = ioffset + 4;
3828 get_string(tvb, ioffset, value2, mval_buf.buffer);
3829 values->vstring = mval_buf.buffer;
3830 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
3831 value2, values->vstring);
3832 ioffset = ioffset + value2;
3833 ioffset += align_4(tvb, ioffset);
3834 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
3835 ioffset = ioffset + 4;
3836 get_string(tvb, ioffset, value2, mval_buf.buffer);
3837 values->vstring = mval_buf.buffer;
3838 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
3839 value2, values->vstring);
3840 ioffset = ioffset + value2;
3841 ioffset += align_4(tvb, ioffset);
3842 value1 = tvb_get_letohl(tvb, ioffset);
3843 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
3844 4, value1, "Priviledges 0x%08x", value1);
3845 ioffset = ioffset + 4;
3847 if(tvb_length_remaining(tvb, ioffset) < 4 )
3851 ioffset += align_4(tvb, ioffset);
3852 value1 = tvb_get_letohl(tvb, ioffset);
3853 proto_tree_add_uint_format(ntree, hf_nds_acl_del, tvb, ioffset,
3854 4, value1, "ACL Templates to Delete %d", value1);
3855 ioffset = ioffset + 4;
3856 for (i = 1 ; i <= value1; i++ ) /* ACL templates to delete*/
3858 ioffset += align_4(tvb, ioffset);
3859 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
3860 ioffset = ioffset + 4;
3861 get_string(tvb, ioffset, value2, mval_buf.buffer);
3862 values->vstring = mval_buf.buffer;
3863 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
3864 value2, values->vstring);
3865 ioffset = ioffset + value2;
3866 ioffset += align_4(tvb, ioffset);
3867 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
3868 ioffset = ioffset + 4;
3869 get_string(tvb, ioffset, value2, mval_buf.buffer);
3870 values->vstring = mval_buf.buffer;
3871 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
3872 value2, values->vstring);
3873 ioffset = ioffset + value2;
3874 ioffset += align_4(tvb, ioffset);
3875 value1 = tvb_get_letohl(tvb, ioffset); /* Priviledges */
3876 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
3877 4, value1, "Priviledges 0x%08x", value1);
3878 ioffset = ioffset + 4;
3887 dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
3888 guint16 nw_connection, guint8 sequence,
3889 guint16 type, proto_tree *ncp_tree)
3891 guint8 func, subfunc = 0;
3892 gboolean requires_subfunc;
3893 gboolean has_length = TRUE;
3894 ncp_req_hash_value *request_value = NULL;
3895 const ncp_record *ncp_rec = NULL;
3896 conversation_t *conversation;
3897 ptvcursor_t *ptvc = NULL;
3898 proto_tree *temp_tree = NULL;
3899 gboolean run_req_cond = FALSE;
3900 gboolean run_info_str = FALSE;
3901 guint32 length_remaining;
3904 func = tvb_get_guint8(tvb, 6);
3906 requires_subfunc = ncp_requires_subfunc(func);
3907 has_length = ncp_has_length_parameter(func);
3908 if (requires_subfunc) {
3910 subfunc = tvb_get_guint8(tvb, 9);
3913 subfunc = tvb_get_guint8(tvb, 7);
3917 /* Determine which ncp_record to use. */
3919 case NCP_ALLOCATE_SLOT:
3920 length_remaining = tvb_length_remaining(tvb, 4);
3921 if (length_remaining > 4)
3923 testvar = tvb_get_ntohl(tvb, 4);
3924 if( testvar == 0x4c495020)
3926 ncp_rec = &ncplip_echo;
3930 ncp_rec = &ncp1111_request;
3935 ncp_rec = &ncp1111_request;
3938 case NCP_SERVICE_REQUEST:
3939 ncp_rec = ncp_record_find(func, subfunc);
3941 case NCP_DEALLOCATE_SLOT:
3942 ncp_rec = &ncp5555_request;
3944 case NCP_BROADCAST_SLOT:
3945 ncp_rec = &ncpbbbb_request;
3948 ncp_rec = &ncplip_echo;
3954 /* Fill in the INFO column. */
3955 if (check_col(pinfo->cinfo, COL_INFO)) {
3957 col_add_fstr(pinfo->cinfo, COL_INFO, "C %s", ncp_rec->name);
3960 if (requires_subfunc) {
3961 col_add_fstr(pinfo->cinfo, COL_INFO,
3962 "C Unknown Function %d %d (0x%02X/0x%02x)",
3963 func, subfunc, func, subfunc);
3966 col_add_fstr(pinfo->cinfo, COL_INFO,
3967 "C Unknown Function %d (0x%02x)",
3973 if (!pinfo->fd->flags.visited) {
3974 /* This is the first time we've looked at this packet.
3975 Keep track of the address and connection whence the request
3976 came, and the address and connection to which the request
3977 is being sent, so that we can match up calls with replies.
3978 (We don't include the sequence number, as we may want
3979 to have all packets over the same connection treated
3980 as being part of a single conversation so that we can
3981 let the user select that conversation to be displayed.) */
3982 conversation = find_conversation(&pinfo->src, &pinfo->dst,
3983 PT_NCP, nw_connection, nw_connection, 0);
3985 if (conversation == NULL) {
3986 /* It's not part of any conversation - create a new one. */
3987 conversation = conversation_new(&pinfo->src, &pinfo->dst,
3988 PT_NCP, nw_connection, nw_connection, 0);
3990 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
3991 request_value->req_frame_num = pinfo->fd->num;
3993 /* If this is the first time we're examining the packet,
3994 * check to see if this NCP type uses a "request condition".
3995 * If so, we have to build a proto_tree because request conditions
3996 * use display filters to work, and without a proto_tree,
3997 * display filters can't possibly work. If we already have
3998 * a proto_tree, then wonderful. If we don't, we need to build
4001 if (ncp_rec->req_cond_indexes) {
4002 run_req_cond = TRUE;
4004 /* Only create info string if COL_INFO is available. */
4005 if (ncp_rec->req_info_str && check_col(pinfo->cinfo, COL_INFO)) {
4006 run_info_str = TRUE;
4008 /* We also have to use a tree if we have to construct an info_str */
4009 if ((run_info_str || run_req_cond) && !ncp_tree) {
4012 temp_tree = proto_tree_create_root();
4013 proto_tree_set_visible(temp_tree, FALSE);
4014 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
4015 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
4021 /* If the dissection throws an exception, be sure to free
4022 * the temporary proto_tree that was created. Because of the
4023 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
4024 * block; it has to be in the same scope as the terminating
4025 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
4026 * call CLEANUP_POP and friends, but the value of temp_tree is
4027 * NULL if no cleanup is needed, and non-null if cleanup is needed. */
4028 CLEANUP_PUSH(free_proto_tree, temp_tree);
4030 /* Before the dissection, if we're saving data for a request
4031 * condition, we have to prime the proto tree using the
4032 * dfilter information */
4037 needed = ncp_rec->req_cond_indexes;
4039 while (*needed != -1) {
4040 dfilter = req_conds[*needed].dfilter;
4041 /* Prime the proto_tree with "interesting fields". */
4042 dfilter_prime_proto_tree(dfilter, ncp_tree);
4047 /* Before the dissection, if we need a field for the info_str,
4048 * prime the tree. */
4050 proto_tree_prime_hfid(ncp_tree, *ncp_rec->req_info_str->hf_ptr);
4053 conversation = find_conversation(&pinfo->src, &pinfo->dst,
4054 PT_NCP, nw_connection, nw_connection, 0);
4057 case NCP_BROADCAST_SLOT:
4061 case NCP_SERVICE_REQUEST:
4062 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
4063 func, "Function: %d (0x%02X), %s",
4064 func, func, ncp_rec ? ncp_rec->name : "Unknown");
4072 if (requires_subfunc) {
4074 proto_tree_add_item(ncp_tree, hf_ncp_length, tvb, 7,
4076 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 9, 1,
4077 subfunc, "SubFunction: %d (0x%02x)",
4079 ptvc = ptvcursor_new(ncp_tree, tvb, 10);
4082 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
4083 subfunc, "SubFunction: %d (0x%02x)",
4085 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
4089 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
4092 /* The group is not part of the packet, but it's useful
4093 * information to display anyway. */
4095 proto_tree_add_text(ncp_tree, tvb, 6, 1, "Group: %s",
4096 ncp_groups[ncp_rec->group]);
4099 if (ncp_rec && ncp_rec->request_ptvc) {
4100 clear_repeat_vars();
4101 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
4103 ptvcursor_free(ptvc);
4105 /* Now that the dissection is done, do we need to run
4106 * some display filters on the resulting tree in order
4107 * to save results for "request conditions" ? */
4113 results = g_new0(gboolean, NUM_REQ_CONDS);
4114 needed = ncp_rec->req_cond_indexes;
4116 while (*needed != -1) {
4117 /* ncp_tree is not a root proto_tree, but
4118 * dfilters will still work on it. */
4119 dfilter = req_conds[*needed].dfilter;
4120 results[*needed] = dfilter_apply(dfilter, ncp_tree);
4124 /* Save the results so the reply packet dissection
4126 request_value->req_cond_results = results;
4129 /* Construct the info string if necessary */
4136 parray = proto_get_finfo_ptr_array(ncp_tree,
4137 *ncp_rec->req_info_str->hf_ptr);
4138 len = g_ptr_array_len(parray);
4142 col_set_str(pinfo->cinfo, COL_INFO, "C ");
4144 finfo = g_ptr_array_index(parray, 0);
4146 info_type = get_info_type((gchar*) ncp_rec->req_info_str->first_string);
4148 if (info_type == 2) { /* Is this a string or not? */
4150 col_append_fstr(pinfo->cinfo, COL_INFO,
4151 (gchar*) ncp_rec->req_info_str->first_string,
4152 fvalue_get(finfo->value));
4157 col_append_fstr(pinfo->cinfo, COL_INFO,
4158 (gchar*) ncp_rec->req_info_str->first_string,
4159 fvalue_get_integer(finfo->value));
4163 for (i = 1; i < len; i++) {
4164 finfo = g_ptr_array_index(parray, i);
4165 info_type = get_info_type((gchar*) ncp_rec->req_info_str->repeat_string);
4167 if (info_type == 2) { /* Is this a string or not? */
4169 col_append_fstr(pinfo->cinfo, COL_INFO,
4170 (gchar*) ncp_rec->req_info_str->repeat_string,
4171 fvalue_get(finfo->value));
4176 col_append_fstr(pinfo->cinfo, COL_INFO,
4177 (gchar*) ncp_rec->req_info_str->repeat_string,
4178 fvalue_get_integer(finfo->value));
4185 /* Free the temporary proto_tree */
4186 CLEANUP_CALL_AND_POP;
4192 dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
4193 guint16 nw_connection, guint8 sequence, guint16 type,
4194 proto_tree *ncp_tree)
4196 conversation_t *conversation = NULL;
4197 ncp_req_hash_value *request_value = NULL;
4198 ncp_req_eid_hash_value *request_eid_value = NULL;
4199 const ncp_record *ncp_rec = NULL;
4200 int *req_cond_results;
4201 guint8 completion_code=0;
4203 ptvcursor_t *ptvc = NULL;
4204 const char *error_string;
4205 guint32 nds_string_len = 0;
4206 guint8 ping_version = 0;
4207 guint32 nds_flags = 0;
4208 guint32 nds_offset = 0;
4209 nw_uni_t reply_buffer;
4210 char * verb_string="";
4211 guint32 nds_error_code = 0;
4212 guint32 nds_reply_buffer = 0;
4213 char * nds_error_string = NULL;
4224 gboolean resolve_eid=FALSE;
4225 guint32 global_eid=0;
4226 gboolean add_eid = FALSE;
4227 char *global_object_name='\0';
4230 reply_buffer.buffer = "\0";
4231 if (!pinfo->fd->flags.visited) {
4232 /* Find the conversation whence the request would have come. */
4233 conversation = find_conversation(&pinfo->src, &pinfo->dst,
4234 PT_NCP, nw_connection, nw_connection, 0);
4235 if (conversation != NULL) {
4236 /* find the record telling us the request made that caused
4238 request_value = ncp_hash_lookup(conversation, sequence);
4239 if (request_value) {
4240 ncp_rec = request_value->ncp_rec;
4242 p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
4244 /* else... we haven't seen an NCP Request for that conversation and sequence. */
4247 request_value = p_get_proto_data(pinfo->fd, proto_ncp);
4248 if (request_value) {
4249 ncp_rec = request_value->ncp_rec;
4253 if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
4254 if (ncp_rec && ncp_rec->func==0x68 &&
4255 (ncp_rec->subfunc==0x02 || ncp_rec->subfunc==0x01)) {
4256 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
4260 /* A completion code of 0 always means OK. Non-zero means failure,
4261 * but each non-zero value has a different meaning. And the same value
4262 * can have different meanings, depending on the ncp.func (and ncp.subfunc)
4264 completion_code = tvb_get_guint8(tvb, 6);
4265 if (ncp_rec && ncp_rec->errors) {
4266 error_string = ncp_error_string(ncp_rec->errors, completion_code);
4268 else if (completion_code == 0) {
4269 if(type == NCP_POSITIVE_ACK)
4271 error_string = "Server Busy, Request Being Processed";
4275 error_string = "OK";
4279 error_string = "Not OK";
4281 if (type == NCP_SERVICE_REPLY && ncp_rec && ncp_rec->func==0x68 &&
4282 ncp_rec->subfunc==0x02)
4285 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
4286 nds_frag = tvb_get_letohl(tvb, 12);
4287 if (nds_reply_buffer > 7)
4290 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4291 nds_error_string = match_strval(nds_error_code, nds_reply_errors);
4292 if (nds_error_string == NULL)
4295 nds_error_code = tvb_get_letohl(tvb, nds_offset);
4296 nds_error_string = match_strval(nds_error_code, nds_reply_errors);
4298 if (nds_error_string == NULL || nds_error_code == 0x00000000)
4300 if (nds_frag != 0xffffffff)
4302 nds_error_string = "NDS Fragment";
4306 nds_error_string = "Ok";
4312 if (check_col(pinfo->cinfo, COL_INFO)) {
4313 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
4314 type == NCP_SERVICE_REPLY ? "R" : "ACK",
4315 nds_error_string ? nds_error_string : error_string);
4319 if (request_value) {
4320 proto_tree_add_uint(ncp_tree, hf_ncp_req_frame_num, tvb, 0, 0,
4321 request_value->req_frame_num);
4324 /* Put the func (and maybe subfunc) from the request packet
4325 * in the proto tree, but hidden. That way filters on ncp.func
4326 * or ncp.subfunc will find both the requests and the replies.
4329 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 0,
4330 ncp_rec->func, "Function: %d (0x%02X), %s",
4331 ncp_rec->func, ncp_rec->func, ncp_rec->name);
4332 if (ncp_requires_subfunc(ncp_rec->func)) {
4333 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 6, 0,
4334 ncp_rec->subfunc, "SubFunction: %d (0x%02x)",
4335 ncp_rec->subfunc, ncp_rec->subfunc);
4339 proto_tree_add_uint_format(ncp_tree, hf_ncp_completion_code, tvb, 6, 1,
4340 completion_code, "Completion Code: %d (0x%02x), %s",
4341 completion_code, completion_code, error_string);
4343 proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb, 7, 1, FALSE);
4346 * Unless this is a reply, that's all there is to parse.
4348 if (type != NCP_SERVICE_REPLY)
4351 /* Decode NDS Reply packets */
4353 if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x01) {
4354 ping_version = tvb_get_guint8(tvb, 8);
4355 proto_tree_add_item(ncp_tree, hf_ping_version, tvb, 8, 1, TRUE);
4356 if (ping_version == 9) {
4357 nds_string_len = tvb_get_ntohl(tvb, 9);
4358 nds_offset = nds_string_len+16;
4359 proto_tree_add_item(ncp_tree, hf_nds_tree_name, tvb, 16, nds_string_len, FALSE);
4360 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, FALSE);
4361 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, (nds_offset+4), 4, FALSE);
4362 proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, (nds_offset+8), 4, TRUE);
4366 nds_flags = request_value->req_nds_flags;
4367 if (nds_flags & 0x00200000) {
4368 nds_offset = nds_offset+4;
4370 if (nds_flags & 0x00000002) {
4371 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, TRUE);
4372 nds_offset = nds_offset+4;
4374 if (nds_flags & 0x00000004) {
4375 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, nds_offset, 4, TRUE);
4376 nds_offset = nds_offset+4;
4378 if (nds_flags & 0x00000008) {
4379 proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, nds_offset, 4, TRUE);
4380 nds_offset = nds_offset+4;
4382 if (nds_flags & 0x00020000) {
4383 nds_string_len = tvb_get_letohl(tvb, nds_offset);
4384 get_string(tvb, nds_offset+4, nds_string_len, reply_buffer.buffer);
4385 proto_tree_add_text(ncp_tree, tvb, nds_offset+4, nds_string_len, "NDS Tree Name: %s", reply_buffer.buffer);
4389 if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x02)
4393 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
4394 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_size, tvb, 8,
4395 4, nds_reply_buffer);
4396 nds_frag = tvb_get_letohl(tvb, 12);
4397 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, 12,
4399 if (nds_reply_buffer > 7)
4401 proto_tree_add_uint_format(ncp_tree, hf_nds_reply_error, tvb, nds_offset,
4402 4, nds_error_code, "NDS Completion Code: 0x%08x, %s",
4403 nds_error_code, nds_error_string);
4405 if (request_value && nds_error_code == 0x00000000 && nds_frag == 0xffffffff)
4417 p1values.vvalue = 0;
4418 p2values.vvalue = 0;
4419 p3values.vvalue = 0;
4420 p4values.vvalue = 0;
4421 p5values.vvalue = 0;
4422 p6values.vvalue = 0;
4423 p7values.vvalue = 0;
4424 p8values.vvalue = 0;
4425 p9values.vvalue = 0;
4426 p1values.vlength = 0;
4427 p2values.vlength = 0;
4428 p3values.vlength = 0;
4429 p4values.vlength = 0;
4430 p5values.vlength = 0;
4431 p6values.vlength = 0;
4432 p7values.vlength = 0;
4433 p8values.vlength = 0;
4434 p9values.vlength = 0;
4435 p1values.voffset = 0;
4436 p2values.voffset = 0;
4437 p3values.voffset = 0;
4438 p4values.voffset = 0;
4439 p5values.voffset = 0;
4440 p6values.voffset = 0;
4441 p7values.voffset = 0;
4442 p8values.voffset = 0;
4443 p9values.voffset = 0;
4444 p1values.hfname = 0;
4445 p2values.hfname = 0;
4446 p3values.hfname = 0;
4447 p4values.hfname = 0;
4448 p5values.hfname = 0;
4449 p6values.hfname = 0;
4450 p7values.hfname = 0;
4451 p8values.hfname = 0;
4452 p9values.hfname = 0;
4453 p1values.vdesc = "";
4454 p2values.vdesc = "";
4455 p3values.vdesc = "";
4456 p4values.vdesc = "";
4457 p5values.vdesc = "";
4458 p6values.vdesc = "";
4459 p7values.vdesc = "";
4460 p8values.vdesc = "";
4461 p9values.vdesc = "";
4462 p1values.vstring = "";
4463 p2values.vstring = "";
4464 p3values.vstring = "";
4465 p4values.vstring = "";
4466 p5values.vstring = "";
4467 p6values.vstring = "";
4468 p7values.vstring = "";
4469 p8values.vstring = "";
4470 p9values.vstring = "";
4471 switch (request_value->nds_request_verb)
4474 verb_string = "Resolve Name";
4475 if(request_value->nds_version == 0)
4477 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4478 p1values.vstring = match_strval(p1values.vvalue, nds_tags);
4479 if(p1values.vstring == NULL)
4481 p1values.vstring = "No Tags Set";
4483 p1values.vtype = 4; /* String */
4484 p1values.vdesc = "Tag: %s";
4485 p1values.vlength = 4;
4486 p1values.voffset = nds_offset;
4487 p1values.hfname = hf_nds_tag_string;
4488 nds_offset = nds_offset+p1values.vlength;
4489 switch(p1values.vvalue)
4491 case 0: /* No Such Entry */
4493 case 1: /* Local Entry */
4494 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4495 p2values.vstring = "";
4496 p2values.vtype = 3; /* Uint32 */
4497 p2values.vdesc = "Entry ID: 0x%08x";
4499 global_object_name = request_value->object_name;
4500 global_eid = p2values.vvalue;
4501 p2values.vlength = 4;
4502 p2values.voffset = nds_offset;
4503 p2values.hfname = hf_nds_eid;
4504 nds_offset = nds_offset+p2values.vlength;
4505 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4506 p3values.vtype = 6; /* Multivalue Uint32 */
4507 p3values.vstring = "";
4508 p3values.vdesc = "Referal Records: %d";
4509 p3values.vlength = 4;
4510 p3values.voffset = nds_offset;
4511 p3values.hfname = hf_nds_referals;
4512 p3values.mvtype = 9;
4514 case 2: /* Remote Entry */
4515 nds_offset += 4; /* GUINT32 reserved field */
4516 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4517 p2values.vstring = "";
4518 p2values.vtype = 3; /* Uint32 */
4519 p2values.vdesc = "Entry ID: 0x%08x";
4521 global_eid = p2values.vvalue;
4522 global_object_name = request_value->object_name;
4523 p2values.vlength = 4;
4524 p2values.voffset = nds_offset;
4525 p2values.hfname = hf_nds_eid;
4526 nds_offset = nds_offset+p2values.vlength;
4527 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4528 p3values.vtype = 6; /* Multivalue Uint32 */
4529 p3values.vstring = "";
4530 p3values.vdesc = "Referal Records: %d";
4531 p3values.vlength = 4;
4532 p3values.voffset = nds_offset;
4533 p3values.hfname = hf_nds_referals;
4534 p3values.mvtype = 9;
4536 case 3: /* Alias Entry */
4537 p2values.vtype = 4; /* String */
4538 p2values.vdesc = "Alias Name: %s";
4539 p2values.vstring = "";
4540 p2values.mvtype = 1;
4541 p2values.vvalue = 0;
4542 p2values.vlength = 256;
4543 p2values.vlength = tvb_get_letohl(tvb, nds_offset);
4544 if (p2values.vlength == 0x00)
4549 p2values.voffset = nds_offset+4;
4551 get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring);
4552 nds_offset += p2values.vlength;
4553 nds_offset += align_4(tvb, nds_offset);
4554 p2values.hfname= hf_nds_name;
4556 case 4: /* Referral Information */
4557 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4558 p2values.vstring = "";
4559 p2values.vtype = 3; /* Uint32 */
4560 p2values.vdesc = "Distance Object is From Root: 0x%08x";
4561 p2values.vlength = 4;
4562 p2values.voffset = nds_offset;
4563 p2values.hfname = hf_nds_eid;
4564 nds_offset = nds_offset+p2values.vlength;
4565 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4566 p3values.vtype = 6; /* Multivalue Uint32 */
4567 p3values.vstring = "";
4568 p3values.vdesc = "Referal Records: %d";
4569 p3values.vlength = 4;
4570 p3values.voffset = nds_offset;
4571 p3values.hfname = hf_nds_depth;
4572 p3values.mvtype = 9;
4574 case 6: /* Entry and Referrals */
4575 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4576 p2values.vstring = "";
4577 p2values.vtype = 3; /* Uint32 */
4578 p2values.vdesc = "Result Flags: 0x%08x";
4579 p2values.vlength = 4;
4580 p2values.voffset = nds_offset;
4581 p2values.hfname = hf_nds_result_flags;
4582 nds_offset = nds_offset+p2values.vlength;
4583 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4584 p3values.vstring = "";
4585 p3values.vtype = 3; /* Uint32 */
4586 p3values.vdesc = "Entry ID: 0x%08x";
4588 global_eid = p3values.vvalue;
4589 global_object_name = request_value->object_name;
4590 p3values.vlength = 4;
4591 p3values.voffset = nds_offset;
4592 p3values.hfname = hf_nds_eid;
4593 nds_offset = nds_offset+p3values.vlength;
4594 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4595 p4values.vtype = 6; /* Multivalue Uint32 */
4596 p4values.vstring = "";
4597 p4values.vdesc = "Referal Records: %d";
4598 p4values.vlength = 4;
4599 p4values.voffset = nds_offset;
4600 p4values.mvtype = 8;
4601 p4values.hfname = hf_nds_referals;
4609 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4610 p1values.vstring = "";
4611 p1values.vtype = 3; /* Uint32 */
4612 p1values.vdesc = "CRC: 0x%08x";
4613 p1values.vlength = 4;
4614 p1values.voffset = nds_offset;
4615 p1values.hfname = hf_nds_crc;
4616 nds_offset = nds_offset+p1values.vlength;
4617 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4618 p2values.vstring = match_strval(p2values.vvalue, nds_tags);
4619 if(p2values.vstring == NULL)
4621 p2values.vstring = "No Tags Set";
4623 p2values.vtype = 4; /* String */
4624 p2values.vdesc = "Tag: %s";
4625 p2values.vlength = 4;
4626 p2values.voffset = nds_offset;
4627 nds_offset = nds_offset+p2values.vlength;
4628 p2values.hfname = hf_nds_tag_string;
4629 switch(p2values.vvalue)
4631 case 0: /* No Such Entry */
4633 case 1: /* Local Entry */
4634 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4635 p3values.vstring = "";
4636 p3values.vtype = 3; /* Uint32 */
4637 p3values.vdesc = "Entry ID: 0x%08x";
4639 global_eid = p3values.vvalue;
4640 global_object_name = request_value->object_name;
4641 p3values.vlength = 4;
4642 p3values.voffset = nds_offset;
4643 p3values.hfname = hf_nds_eid;
4644 nds_offset = nds_offset+p3values.vlength;
4645 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4646 p4values.vtype = 6; /* Multivalue Uint32 */
4647 p4values.vstring = "";
4648 p4values.vdesc = "Referal Records: %d";
4649 p4values.vlength = 4;
4650 p4values.voffset = nds_offset;
4651 p4values.hfname = hf_nds_referals;
4652 p4values.mvtype = 9;
4654 case 2: /* Remote Entry */
4655 nds_offset += 4; /* GUINT32 reserved field */
4656 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4657 p3values.vstring = "";
4659 global_eid = p3values.vvalue;
4660 global_object_name = request_value->object_name;
4661 p3values.vtype = 3; /* Uint32 */
4662 p3values.vdesc = "Entry ID: 0x%08x";
4663 p3values.vlength = 4;
4664 p3values.voffset = nds_offset;
4665 p3values.hfname = hf_nds_eid;
4666 nds_offset = nds_offset+p3values.vlength;
4667 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4668 p4values.vtype = 6; /* Multivalue Uint32 */
4669 p4values.vstring = "";
4670 p4values.vdesc = "Referal Records: %d";
4671 p4values.vlength = 4;
4672 p4values.voffset = nds_offset;
4673 p4values.hfname = hf_nds_referals;
4674 p4values.mvtype = 9;
4676 case 3: /* Alias Entry */
4677 p3values.vtype = 4; /* String */
4678 p3values.vdesc = "Alias Name: %s";
4679 p3values.vstring = "";
4680 p3values.mvtype = 1;
4681 p3values.vvalue = 0;
4682 p3values.vlength = 256;
4683 p3values.vlength = tvb_get_letohl(tvb, nds_offset);
4684 if (p3values.vlength == 0x00)
4689 p3values.voffset = nds_offset+4;
4691 get_string(tvb, p3values.voffset, p3values.vlength, p3values.vstring);
4692 nds_offset += p3values.vlength;
4693 nds_offset += align_4(tvb, nds_offset);
4694 p3values.hfname= hf_nds_name;
4696 case 4: /* Referral Information */
4697 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4698 p3values.vstring = "";
4699 p3values.vtype = 3; /* Uint32 */
4700 p3values.vdesc = "Distance Object is From Root: 0x%08x";
4701 p3values.vlength = 4;
4702 p3values.voffset = nds_offset;
4703 p3values.hfname = hf_nds_eid;
4704 nds_offset = nds_offset+p3values.vlength;
4705 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4706 p4values.vtype = 6; /* Multivalue Uint32 */
4707 p4values.vstring = "";
4708 p4values.vdesc = "Referal Records: %d";
4709 p4values.vlength = 4;
4710 p4values.voffset = nds_offset;
4711 p4values.hfname = hf_nds_depth;
4712 p4values.mvtype = 8;
4714 case 6: /* Entry and Referrals */
4715 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4716 p3values.vstring = "";
4717 p3values.vtype = 3; /* Uint32 */
4718 p3values.vdesc = "Result Flags: 0x%08x";
4719 p3values.vlength = 4;
4720 p3values.voffset = nds_offset;
4721 p3values.hfname = hf_nds_result_flags;
4722 nds_offset = nds_offset+p3values.vlength;
4723 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4724 p4values.vstring = "";
4725 p4values.vtype = 3; /* Uint32 */
4726 p4values.vdesc = "Entry ID: 0x%08x";
4728 global_object_name = request_value->object_name;
4729 global_eid = p4values.vvalue;
4730 p4values.vlength = 4;
4731 p4values.voffset = nds_offset;
4732 p4values.hfname = hf_nds_eid;
4733 nds_offset = nds_offset+p4values.vlength;
4734 p5values.vvalue = tvb_get_letohl(tvb, nds_offset);
4735 p5values.vtype = 6; /* Multivalue Uint32 */
4736 p5values.vstring = "";
4737 p5values.vdesc = "Referal Records: %d";
4738 p5values.vlength = 4;
4739 p5values.voffset = nds_offset;
4740 p5values.mvtype = 8;
4741 p5values.hfname = hf_nds_referals;
4750 verb_string = "Read Entry Information";
4751 if(request_value->nds_version != 0x000000fe)
4753 p1values.vvalue = 1;
4754 p1values.vtype = 6; /* Multivalue Uint32 */
4755 p1values.vstring = "";
4756 p1values.vdesc = "Entry Information";
4757 p1values.vlength = 0;
4758 p1values.voffset = nds_offset-4;
4759 p1values.hfname = hf_nds_name;
4760 p1values.mvtype = 12;
4761 p1values.vflags = request_value->req_nds_flags;
4765 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4766 p1values.vstring = "";
4767 p1values.vtype = 3; /* Uint32 */
4768 p1values.vdesc = "CRC: 0x%08x";
4769 p1values.vlength = 4;
4770 p1values.voffset = nds_offset;
4771 p1values.hfname = hf_nds_crc;
4772 nds_offset = nds_offset+p1values.vlength;
4773 p2values.vvalue = 1;
4774 p2values.vtype = 6; /* Multivalue Uint32 */
4775 p2values.vstring = "";
4776 p2values.vdesc = "Entry Information";
4777 p2values.vlength = 0;
4778 p2values.voffset = nds_offset-4;
4779 p2values.hfname = hf_nds_name;
4780 p2values.mvtype = 12;
4781 p2values.vflags = request_value->req_nds_flags;
4785 verb_string = "Read";
4786 if(request_value->nds_version != 0x000000fe)
4788 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4789 p1values.vstring = "";
4790 p1values.vtype = 3; /* Uint32 */
4791 p1values.vdesc = "Iteration Handle: 0x%08x";
4792 p1values.vlength = 4;
4793 p1values.voffset = nds_offset;
4794 p1values.hfname = hf_nds_iteration;
4795 nds_offset = nds_offset+p1values.vlength;
4796 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4797 p2values.vstring = match_strval(p2values.vvalue, nds_info_type);
4798 if(p2values.vstring == NULL)
4800 p2values.vstring = "No Info Type Set";
4802 p2values.vtype = 4; /* String */
4803 p2values.vdesc = "Info Type: %s";
4804 p2values.vlength = 4;
4805 p2values.voffset = nds_offset;
4806 p2values.hfname = hf_nds_info_type;
4807 nds_offset = nds_offset+p2values.vlength;
4808 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4809 p3values.vtype = 6; /* Multivalue Uint32 */
4810 p3values.vstring = "";
4811 p3values.vdesc = "Number of Attributes: %d";
4812 p3values.vlength = 4;
4813 p3values.voffset = nds_offset;
4814 p3values.hfname = hf_nds_attr;
4815 p3values.mvtype = 2;
4816 p3values.vflags = request_value->req_nds_flags;
4817 p3values.nds_version = request_value->nds_version;
4821 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4822 p1values.vstring = "";
4823 p1values.vtype = 3; /* Uint32 */
4824 p1values.vdesc = "CRC: 0x%08x";
4825 p1values.vlength = 4;
4826 p1values.voffset = nds_offset;
4827 p1values.hfname = hf_nds_crc;
4828 nds_offset = nds_offset+p1values.vlength;
4829 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4830 p2values.vstring = "";
4831 p2values.vtype = 3; /* Uint32 */
4832 p2values.vdesc = "Iteration Handle: 0x%08x";
4833 p2values.vlength = 4;
4834 p2values.voffset = nds_offset;
4835 p2values.hfname = hf_nds_iteration;
4836 nds_offset = nds_offset+p2values.vlength;
4837 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
4838 p3values.vstring = match_strval(p3values.vvalue, nds_info_type);
4839 if(p3values.vstring == NULL)
4841 p3values.vstring = "No Info Type Set";
4843 p3values.vtype = 4; /* String */
4844 p3values.vdesc = "Info Type: %s";
4845 p3values.vlength = 4;
4846 p3values.voffset = nds_offset;
4847 p3values.hfname = hf_nds_info_type;
4848 nds_offset = nds_offset+p3values.vlength;
4849 p4values.vvalue = tvb_get_letohl(tvb, nds_offset);
4850 p4values.vtype = 6; /* Multivalue Uint32 */
4851 p4values.vstring = "";
4852 p4values.vdesc = "Number of Attributes: %d";
4853 p4values.vlength = 4;
4854 p4values.voffset = nds_offset;
4855 p4values.hfname = hf_nds_attr;
4856 p4values.mvtype = 2;
4857 p4values.vflags = request_value->req_nds_flags;
4858 p4values.nds_version = request_value->nds_version;
4862 verb_string = "Compare";
4863 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4864 if (p1values.vvalue == 0x00000000)
4866 p1values.vstring = "Did Not Match";
4870 p1values.vstring = "Matched";
4872 p1values.vtype = 4; /* String */
4873 p1values.vdesc = "Compare Values Returned - %s";
4874 p1values.vlength = 4;
4875 p1values.voffset = nds_offset;
4876 p1values.mvtype = 0;
4877 p1values.hfname= hf_nds_compare_results;
4878 nds_offset += p1values.vlength;
4881 verb_string = "List";
4882 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4883 p1values.vstring = "";
4884 p1values.vtype = 3; /* Uint32 */
4885 p1values.vdesc = "Iteration Handle: 0x%08x";
4886 p1values.vlength = 4;
4887 p1values.voffset = nds_offset;
4888 p1values.hfname = hf_nds_iteration;
4889 nds_offset = nds_offset+p1values.vlength;
4890 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);;
4891 p2values.vtype = 6; /* Multivalue Uint32 */
4892 p2values.vstring = "";
4893 p2values.vdesc = "Entry Information";
4894 p2values.vlength = 0;
4895 p2values.voffset = nds_offset;
4896 p2values.hfname = hf_nds_name;
4897 p2values.mvtype = 12;
4898 p2values.vflags = request_value->req_nds_flags;
4901 verb_string = "Search Entries";
4904 verb_string = "Add Entry";
4907 verb_string = "Remove Entry";
4910 verb_string = "Modify Entry";
4913 verb_string = "Modify RDN";
4916 verb_string = "Define Attribute";
4919 verb_string = "Read Attribute Definition";
4922 verb_string = "Remove Attribute Definition";
4925 verb_string = "Define Class";
4928 verb_string = "Read Class Definition";
4929 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4930 p1values.vstring = "";
4931 p1values.vtype = 3; /* Uint32 */
4932 p1values.vdesc = "Iteration Handle: 0x%08x";
4933 p1values.vlength = 4;
4934 p1values.voffset = nds_offset;
4935 p1values.hfname = hf_nds_iteration;
4936 nds_offset = nds_offset+p1values.vlength;
4937 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4938 p2values.vstring = match_strval(p2values.vvalue, class_def_type);
4939 if(p2values.vstring == NULL)
4941 p2values.vstring = "No Class Definition Type Set";
4943 p2values.vtype = 4; /* String */
4944 p2values.vdesc = "Class Definition Type: %s";
4945 p2values.vlength = 4;
4946 p2values.voffset = nds_offset;
4947 p2values.mvtype = 0;
4948 p2values.hfname= hf_nds_class_def_type;
4949 nds_offset = nds_offset + p2values.vlength;
4950 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);;
4951 p3values.vtype = 6; /* Multivalue Uint32 */
4952 p3values.vstring = "";
4953 p3values.vdesc = "Class Definitions %d";
4954 p3values.vlength = 0;
4955 p3values.voffset = nds_offset;
4956 p3values.hfname = hf_nds_classes;
4957 p3values.mvtype = 13;
4958 p3values.vflags = request_value->req_nds_flags;
4961 verb_string = "Modify Class Definition";
4964 verb_string = "Remove Class Definition";
4967 verb_string = "List Containable Classes";
4968 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4969 p1values.vstring = "";
4970 p1values.vtype = 3; /* Uint32 */
4971 p1values.vdesc = "Iteration Handle: 0x%08x";
4972 p1values.vlength = 4;
4973 p1values.voffset = nds_offset;
4974 p1values.hfname = hf_nds_iteration;
4975 nds_offset = nds_offset+p1values.vlength;
4976 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
4977 p2values.vtype = 6; /* Multivalue Uint32 */
4978 p2values.vstring = "";
4979 p2values.vdesc = "Classes: %d";
4980 p2values.vlength = 4;
4981 p2values.voffset = nds_offset;
4982 p2values.mvtype = 4;
4983 p2values.hfname= hf_nds_classes;
4986 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
4987 p1values.vstring = "";
4988 p1values.vtype = 3; /* Uint32 */
4989 p1values.vdesc = "Privileges: 0x%08x";
4990 p1values.vlength = 4;
4991 p1values.voffset = nds_offset;
4992 p1values.hfname = hf_nds_privileges;
4993 nds_offset = nds_offset+p1values.vlength;
4996 verb_string = "Add Partition";
4999 verb_string = "Remove Partition";
5002 verb_string = "List Partitions";
5003 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
5004 p1values.vstring = "";
5005 p1values.vtype = 3; /* Uint32 */
5006 p1values.vdesc = "Iteration Handle: 0x%08x";
5007 p1values.vlength = 4;
5008 p1values.voffset = nds_offset;
5009 p1values.hfname = hf_nds_iteration;
5010 nds_offset = nds_offset+p1values.vlength;
5011 p2values.vtype = 4; /* String */
5012 p2values.vdesc = "Server Distinguished Name: %s";
5013 p2values.vstring = "";
5014 p2values.mvtype = 1;
5015 p2values.vvalue = 0;
5016 p2values.vlength = 256;
5017 p2values.vlength = tvb_get_letohl(tvb, nds_offset);
5018 if (p2values.vlength == 0x00)
5023 p2values.voffset = nds_offset+4;
5025 get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring);
5026 nds_offset += p2values.vlength;
5027 nds_offset += align_4(tvb, nds_offset);
5028 p2values.hfname= hf_nds_name;
5029 nds_offset += align_4(tvb, nds_offset);
5030 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
5031 p3values.vtype = 6; /* Multivalue Uint32 */
5032 p3values.vstring = "";
5033 p3values.vdesc = "Replicas: %d";
5034 p3values.vlength = 4;
5035 p3values.voffset = nds_offset;
5036 p3values.hfname = hf_nds_replicas;
5037 p3values.mvtype = 5;
5038 p3values.bit1 = "Output Flags";
5039 p3values.bit2 = "Entry ID";
5040 p3values.bit3 = "Replica State";
5041 p3values.bit4 = "Modification Timestamp";
5042 p3values.bit5 = "Purge Time";
5043 p3values.bit6 = "Local Partition ID";
5044 p3values.bit7 = "Distinguished Name";
5045 p3values.bit8 = "Replica Type";
5046 p3values.bit9 = "Partition Busy";
5047 p3values.vflags = request_value->req_nds_flags;
5050 verb_string = "Split Partition";
5053 verb_string = "Join Partitions";
5056 verb_string = "Add Replica";
5059 verb_string = "Remove Replica";
5062 verb_string = "Open Stream";
5063 p1values.vvalue = tvb_get_ntohl(tvb, nds_offset);
5064 p1values.vstring = "";
5065 p1values.vtype = 3; /* Uint32 */
5066 p1values.vdesc = "File Handle: 0x%08x";
5067 p1values.vlength = 4;
5068 p1values.voffset = nds_offset;
5069 p1values.hfname = hf_nds_file_handle;
5070 nds_offset = nds_offset+p1values.vlength;
5071 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
5072 p2values.vstring = "";
5073 p2values.vtype = 3; /* Uint32 */
5074 p2values.vdesc = "File Size: %d";
5075 p2values.vlength = 4;
5076 p2values.voffset = nds_offset;
5077 p2values.hfname = hf_nds_file_size;
5078 nds_offset = nds_offset+p2values.vlength;
5081 verb_string = "Search Filter";
5084 verb_string = "Create Subordinate Reference";
5087 verb_string = "Link Replica";
5090 verb_string = "Change Replica Type";
5093 verb_string = "Start Update Schema";
5096 verb_string = "End Update Schema";
5099 verb_string = "Update Schema";
5102 verb_string = "Start Update Replica";
5105 verb_string = "End Update Replica";
5108 verb_string = "Update Replica";
5111 verb_string = "Synchronize Partition";
5114 verb_string = "Synchronize Schema";
5117 verb_string = "Read Syntaxes";
5120 verb_string = "Get Replica Root ID";
5123 verb_string = "Begin Move Entry";
5126 verb_string = "Finish Move Entry";
5129 verb_string = "Release Moved Entry";
5132 verb_string = "Backup Entry";
5135 verb_string = "Restore Entry";
5138 verb_string = "Save DIB";
5141 verb_string = "Control";
5144 verb_string = "Remove Backlink";
5147 verb_string = "Close Iteration";
5150 verb_string = "Mutate Entry";
5153 verb_string = "Audit Skulking";
5156 verb_string = "Get Server Address";
5157 if(request_value->nds_version != 0x000000fe)
5159 p1values.vtype = 4; /* String */
5160 p1values.vdesc = "Distinguished Name: %s";
5161 p1values.vstring = "";
5162 p1values.mvtype = 1;
5163 p1values.vvalue = 0;
5164 p1values.vlength = 256;
5165 p1values.vlength = tvb_get_letohl(tvb, nds_offset);
5166 if (p1values.vlength == 0x00)
5171 p1values.voffset = nds_offset+4;
5173 get_string(tvb, p1values.voffset, p1values.vlength, p1values.vstring);
5174 nds_offset += p1values.vlength;
5175 nds_offset += align_4(tvb, nds_offset);
5176 p1values.hfname= hf_nds_name;
5177 p2values.vvalue = tvb_get_letohl(tvb, nds_offset);
5178 p2values.vtype = 6; /* Multivalue Uint32 */
5179 p2values.vstring = "";
5180 p2values.vdesc = "Referal Records: %d";
5181 p2values.vlength = 4;
5182 p2values.voffset = nds_offset;
5183 p2values.hfname = hf_nds_referals;
5184 p2values.mvtype = 9;
5188 p1values.vvalue = tvb_get_letohl(tvb, nds_offset);
5189 p1values.vstring = "";
5190 p1values.vtype = 3; /* Uint32 */
5191 p1values.vdesc = "Iteration Handle: 0x%08x";
5192 p1values.vlength = 4;
5193 p1values.voffset = nds_offset;
5194 p1values.hfname = hf_nds_iteration;
5195 nds_offset = nds_offset+p1values.vlength;
5196 p2values.vtype = 4; /* String */
5197 p2values.vdesc = "Distinguished Name: %s";
5198 p2values.vstring = "";
5199 p2values.mvtype = 1;
5200 p2values.vvalue = 0;
5201 p2values.vlength = 256;
5202 p2values.vlength = tvb_get_letohl(tvb, nds_offset);
5203 if (p2values.vlength == 0x00)
5208 p2values.voffset = nds_offset+4;
5210 get_string(tvb, p2values.voffset, p2values.vlength, p2values.vstring);
5211 nds_offset += p2values.vlength;
5212 nds_offset += align_4(tvb, nds_offset);
5213 p2values.hfname= hf_nds_name;
5214 p3values.vvalue = tvb_get_letohl(tvb, nds_offset);
5215 p3values.vtype = 6; /* Multivalue Uint32 */
5216 p3values.vstring = "";
5217 p3values.vdesc = "Referal Records: %d";
5218 p3values.vlength = 4;
5219 p3values.voffset = nds_offset;
5220 p3values.hfname = hf_nds_referals;
5221 p3values.mvtype = 9;
5225 verb_string = "Set Keys";
5228 verb_string = "Change Password";
5231 verb_string = "Verify Password";
5234 verb_string = "Begin Login";
5237 verb_string = "Finish Login";
5240 verb_string = "Begin Authentication";
5243 verb_string = "Finish Authentication";
5246 verb_string = "Logout";
5249 verb_string = "Repair Ring";
5252 verb_string = "Repair Timestamps";
5255 verb_string = "Create Back Link";
5258 verb_string = "Delete External Reference";
5261 verb_string = "Rename External Reference";
5264 verb_string = "Create Directory Entry";
5267 verb_string = "Remove Directory Entry";
5270 verb_string = "Designate New Master";
5273 verb_string = "Change Tree Name";
5276 verb_string = "Partition Entry Count";
5279 verb_string = "Check Login Restrictions";
5282 verb_string = "Start Join";
5285 verb_string = "Low Level Split";
5288 verb_string = "Low Level Join";
5291 verb_string = "Abort Low Level Join";
5294 verb_string = "Get All Servers";
5297 verb_string = "NDS Continuation Fragment";
5300 if(request_value->nds_request_verb != 0)
5302 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 6, 0,
5303 request_value->nds_request_verb, "NDS Verb: %d, %s",
5304 request_value->nds_request_verb, verb_string);
5306 /* NDS Entry ID's (EID) is identified in the reply packet of an NDS
5307 * resolve name. We need to store this EID and it's associated
5308 * name into our hash so that we can resolve the name for
5309 * other NDS requests. */
5310 if (!pinfo->fd->flags.visited) {
5313 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
5314 if (!request_eid_value) {
5315 request_eid_value = ncp_eid_hash_insert(global_eid);
5316 strcpy(request_eid_value->object_name, global_object_name);
5320 /* For NDS requests with just an EID, resolve name from hash table. */
5323 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
5324 if (request_eid_value) {
5325 global_object_name = request_eid_value->object_name;
5326 proto_tree_add_string_format(ncp_tree, hf_nds_name, tvb, 6, 0,
5327 global_object_name, "NDS Name for EID - %s",
5328 global_object_name);
5331 if (p1values.vtype != 0) {
5332 switch (p1values.vtype) {
5334 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5335 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
5338 case 2: /* uint16 */
5339 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5340 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
5343 case 3: /* uint32 */
5344 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5345 p1values.vlength, p1values.vvalue, p1values.vdesc,
5348 case 4: /* string */
5349 proto_tree_add_string_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
5350 p1values.vlength, p1values.vstring, p1values.vdesc, p1values.vstring);
5352 case 5: /* boolean */
5353 process_bitfield(ncp_tree, tvb, &p1values);
5355 case 6: /*multivalue uint32 */
5356 process_multivalues(ncp_tree, tvb, &p1values);
5359 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, p1values.voffset,
5360 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
5364 switch (p2values.vtype) {
5367 case 2: /* uint16 */
5369 case 3: /* uint32 */
5370 proto_tree_add_uint_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
5371 p2values.vlength, p2values.vvalue, p2values.vdesc,
5374 case 4: /* string */
5375 proto_tree_add_string_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
5376 p2values.vlength, p2values.vstring, p2values.vdesc, p2values.vstring);
5378 case 5: /* boolean */
5379 process_bitfield(ncp_tree, tvb, &p2values);
5381 case 6: /*multivalue uint32 */
5382 process_multivalues(ncp_tree, tvb, &p2values);
5387 switch (p3values.vtype) {
5390 case 2: /* uint16 */
5392 case 3: /* uint32 */
5393 proto_tree_add_uint_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
5394 p3values.vlength, p3values.vvalue, p3values.vdesc,
5397 case 4: /* string */
5398 proto_tree_add_string_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
5399 p3values.vlength, p3values.vstring, p3values.vdesc, p3values.vstring);
5401 case 5: /* boolean */
5402 process_bitfield(ncp_tree, tvb, &p3values);
5404 case 6: /*multivalue uint32 */
5405 process_multivalues(ncp_tree, tvb, &p3values);
5410 switch (p4values.vtype) {
5413 case 2: /* uint16 */
5415 case 3: /* uint32 */
5416 proto_tree_add_uint_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
5417 p4values.vlength, p4values.vvalue, p4values.vdesc,
5420 case 4: /* string */
5421 proto_tree_add_string_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
5422 p4values.vlength, p4values.vstring, p4values.vdesc, p4values.vstring);
5424 case 5: /* boolean */
5425 process_bitfield(ncp_tree, tvb, &p4values);
5427 case 6: /*multivalue uint32 */
5428 process_multivalues(ncp_tree, tvb, &p4values);
5433 switch (p5values.vtype) {
5436 case 2: /* uint16 */
5438 case 3: /* uint32 */
5439 proto_tree_add_uint_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
5440 p5values.vlength, p5values.vvalue, p5values.vdesc,
5443 case 4: /* string */
5444 proto_tree_add_string_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
5445 p5values.vlength, p5values.vstring, p5values.vdesc, p5values.vstring);
5447 case 5: /* boolean */
5448 process_bitfield(ncp_tree, tvb, &p5values);
5450 case 6: /*multivalue uint32 */
5451 process_multivalues(ncp_tree, tvb, &p5values);
5456 switch (p6values.vtype) {
5459 case 2: /* uint16 */
5461 case 3: /* uint32 */
5462 proto_tree_add_uint_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
5463 p6values.vlength, p6values.vvalue, p6values.vdesc,
5466 case 4: /* string */
5467 proto_tree_add_string_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
5468 p6values.vlength, p6values.vstring, p6values.vdesc, p6values.vstring);
5470 case 5: /* boolean */
5471 process_bitfield(ncp_tree, tvb, &p6values);
5473 case 6: /*multivalue uint32 */
5474 process_multivalues(ncp_tree, tvb, &p6values);
5479 switch (p7values.vtype) {
5482 case 2: /* uint16 */
5484 case 3: /* uint32 */
5485 proto_tree_add_uint_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
5486 p7values.vlength, p7values.vvalue, p7values.vdesc,
5489 case 4: /* string */
5490 proto_tree_add_string_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
5491 p7values.vlength, p7values.vstring, p7values.vdesc, p7values.vstring);
5493 case 5: /* boolean */
5494 process_bitfield(ncp_tree, tvb, &p7values);
5496 case 6: /*multivalue uint32 */
5497 process_multivalues(ncp_tree, tvb, &p7values);
5502 switch (p8values.vtype) {
5505 case 2: /* uint16 */
5507 case 3: /* uint32 */
5508 proto_tree_add_uint_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
5509 p8values.vlength, p8values.vvalue, p8values.vdesc,
5512 case 4: /* string */
5513 proto_tree_add_string_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
5514 p8values.vlength, p8values.vstring, p8values.vdesc, p8values.vstring);
5516 case 5: /* boolean */
5517 process_bitfield(ncp_tree, tvb, &p8values);
5519 case 6: /*multivalue uint32 */
5520 process_multivalues(ncp_tree, tvb, &p8values);
5525 switch (p9values.vtype) {
5528 case 2: /* uint16 */
5530 case 3: /* uint32 */
5531 proto_tree_add_uint_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
5532 p9values.vlength, p9values.vvalue, p9values.vdesc,
5535 case 4: /* string */
5536 proto_tree_add_string_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
5537 p9values.vlength, p9values.vstring, p9values.vdesc, p9values.vstring);
5539 case 5: /* boolean */
5540 process_bitfield(ncp_tree, tvb, &p9values);
5542 case 6: /*multivalue uint32 */
5543 process_multivalues(ncp_tree, tvb, &p9values);
5553 length = tvb_length(tvb);
5554 if (!ncp_rec && length > 8) {
5555 proto_tree_add_text(ncp_tree, tvb, 8, length - 8,
5556 "No request record found. Parsing is impossible.");
5558 else if (ncp_rec && ncp_rec->reply_ptvc) {
5559 /* If a non-zero completion code was found, it is
5560 * legal to not have any fields, even if the packet
5561 * type is defined as having fields. */
5562 if (completion_code != 0 && tvb_length(tvb) == 8) {
5565 /*printf("func=0x%x subfunc=0x%x\n", ncp_rec->func, ncp_rec->subfunc);*/
5567 /* Any request condition results? */
5568 if (request_value) {
5569 req_cond_results = request_value->req_cond_results;
5572 req_cond_results = NULL;
5575 clear_repeat_vars();
5576 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
5577 process_ptvc_record(ptvc, ncp_rec->reply_ptvc, req_cond_results,
5579 ptvcursor_free(ptvc);
5585 dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
5586 guint16 nw_connection, guint8 sequence,
5587 guint16 type, proto_tree *ncp_tree)
5589 guint8 func, subfunc = 0;
5590 ncp_req_hash_value *request_value = NULL;
5591 ncp_req_eid_hash_value *request_eid_value = NULL;
5592 const ncp_record *ncp_rec = NULL;
5593 conversation_t *conversation;
5594 ptvcursor_t *ptvc = NULL;
5595 proto_tree *temp_tree = NULL;
5596 guint8 nds_verb = 0;
5597 char * verb_string = "";
5598 guint32 nds_frag = 0;
5608 guint8 nds_version = 0;
5609 guint32 foffset = 0;
5610 guint32 nds_reply_buffer;
5611 nw_uni_t req_buffer;
5612 char * global_object_name="\0";
5613 guint32 global_eid=0;
5614 gboolean resolve_eid=FALSE;
5615 guint32 global_flags=0;
5626 p1values.mvtype = 0;
5627 p2values.mvtype = 0;
5628 p3values.mvtype = 0;
5629 p4values.mvtype = 0;
5630 p5values.mvtype = 0;
5631 p6values.mvtype = 0;
5632 p7values.mvtype = 0;
5633 p8values.mvtype = 0;
5634 p9values.mvtype = 0;
5635 req_buffer.buffer = "\0";
5636 func = tvb_get_guint8(tvb, 6);
5637 subfunc = tvb_get_guint8(tvb, 7);
5639 ncp_rec = ncp_record_find(func, subfunc);
5641 /* Check to see if this is a fragment packet */
5642 nds_frag = tvb_get_letohl(tvb, 8);
5646 if (nds_frag == 0xffffffff) {
5647 nds_verb = tvb_get_guint8(tvb, 24);
5648 if (nds_verb == 0xfe)
5650 nds_version = nds_verb;
5651 nds_verb = tvb_get_guint8(tvb, 32);
5659 nds_reply_buffer = tvb_get_letohl(tvb, foffset);
5660 proto_tree_add_uint(ncp_tree, hf_nds_buffer_size, tvb, foffset,
5661 4, nds_reply_buffer);
5662 foffset = foffset+4;
5666 verb_string = "Resolve Name -> ";
5667 p1values.vvalue = tvb_get_letohl(tvb, foffset);
5668 nds_version = p1values.vvalue;
5669 p1values.vstring = "";
5670 p1values.vtype = 3; /* Uint32 */
5671 p1values.vdesc = "Version: %d";
5672 p1values.vlength = 4;
5673 p1values.hfname = hf_nds_ver;
5674 p1values.voffset = foffset;
5675 foffset = foffset+p1values.vlength;
5676 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5677 p2values.vtype = 5; /* Bitfield */
5678 p2values.vstring = "";
5679 p2values.vdesc = "Flags:";
5680 p2values.vlength = 2;
5681 p2values.hfname= hf_nds_nflags;
5682 p2values.voffset = foffset;
5683 p2values.bit1 = "Entry ID";
5684 p2values.bit1hfname = hf_bit1nflags;
5685 p2values.bit2 = "Readable";
5686 p2values.bit2hfname = hf_bit2nflags;
5687 p2values.bit3 = "Writeable";
5688 p2values.bit3hfname = hf_bit3nflags;
5689 p2values.bit4 = "Master";
5690 p2values.bit4hfname = hf_bit4nflags;
5691 p2values.bit5 = "Create ID";
5692 p2values.bit5hfname = hf_bit5nflags;
5693 p2values.bit6 = "Walk Tree";
5694 p2values.bit6hfname = hf_bit6nflags;
5695 p2values.bit7 = "Dereference Alias";
5696 p2values.bit7hfname = hf_bit7nflags;
5697 p2values.bit8 = "Not Defined";
5698 p2values.bit8hfname = hf_bit8nflags;
5699 p2values.bit9 = "Not Defined";
5700 p2values.bit9hfname = hf_bit9nflags;
5701 p2values.bit10 = "Not Defined";
5702 p2values.bit10hfname = hf_bit10nflags;
5703 p2values.bit11= "Not Defined";
5704 p2values.bit11hfname = hf_bit11nflags;
5705 p2values.bit12 = "Not Defined";
5706 p2values.bit12hfname = hf_bit12nflags;
5707 p2values.bit13 = "Not Defined";
5708 p2values.bit13hfname = hf_bit13nflags;
5709 p2values.bit14 = "Prefer Referalls";
5710 p2values.bit14hfname = hf_bit14nflags;
5711 p2values.bit15 = "Prefer Only Referalls";
5712 p2values.bit15hfname = hf_bit15nflags;
5713 p2values.bit16 = "Not Defined";
5714 p2values.bit16hfname = hf_bit16nflags;
5715 foffset = foffset+4;
5716 if (p1values.vvalue == 0 || p1values.vvalue == 1)
5718 p3values.vtype = 3; /* Uint32 */
5719 p3values.vdesc = "Scope: %d";
5720 p3values.vstring = "";
5721 p3values.vlength = 4;
5722 p3values.voffset = foffset;
5723 p3values.vvalue = tvb_get_letohl(tvb, foffset);
5724 p3values.hfname= hf_nds_scope;
5725 foffset = foffset+p3values.vlength;
5726 p4values.vtype = 4; /* String */
5727 p4values.vdesc = "Name: %s";
5728 p4values.vstring = "";
5729 p4values.mvtype = 1;
5730 p4values.vvalue = 0;
5731 p4values.vlength = 256;
5732 p4values.vlength = tvb_get_letohl(tvb, foffset);
5733 if (p4values.vlength == 0x00)
5738 p4values.voffset = foffset+4;
5739 foffset = foffset + 4;
5740 get_string(tvb, p4values.voffset, p4values.vlength, req_buffer.buffer);
5741 p4values.vstring = req_buffer.buffer;
5742 global_object_name = req_buffer.buffer;
5743 p4values.hfname= hf_nds_name;
5744 foffset = foffset+p4values.vlength;
5745 foffset += align_4(tvb, foffset);
5746 p5values.vvalue = tvb_get_letohl(tvb, foffset);
5747 p5values.vtype = 6; /* Mulitvalue Uint32 */
5748 p5values.vstring = "";
5749 p5values.vdesc = "Communications Transports: %d";
5750 p5values.vlength = 4;
5751 p5values.hfname= hf_nds_comm_trans;
5752 p5values.voffset = foffset;
5753 p5values.mvtype = 7;
5754 foffset = foffset + (p5values.vvalue * 4) + 4;
5755 p6values.vvalue = tvb_get_letohl(tvb, foffset);
5756 p6values.vtype = 6; /* Multivalue Uint32 */
5757 p6values.vstring = "";
5758 p6values.vdesc = "Tree Walker Transport Type: %d";
5759 p6values.vlength = 4;
5760 p6values.mvtype = 7;
5761 p6values.hfname= hf_nds_tree_trans;
5762 p6values.voffset = foffset;
5766 p3values.vtype = 3; /* Uint32 */
5767 p3values.vdesc = "Minimum DS Version: %d";
5768 p3values.vstring = "";
5769 p3values.vlength = 4;
5770 p3values.voffset = foffset;
5771 p3values.vvalue = tvb_get_letohl(tvb, foffset);
5772 p3values.hfname= hf_min_nds_ver;
5773 foffset = foffset+p3values.vlength;
5774 p4values.vvalue = tvb_get_letohl(tvb, foffset);
5775 p4values.vtype = 6; /* Multivalue Uint32 */
5776 p4values.vstring = "";
5777 p4values.vdesc = "Number of Versions to Include: %d";
5778 p4values.vlength = 4;
5779 p4values.mvtype = 3;
5780 p4values.voffset = foffset;
5781 p4values.hfname= hf_nds_ver_include;
5782 foffset += (p4values.vvalue * 4) + 4;
5783 p5values.vvalue = tvb_get_letohl(tvb, foffset);
5784 p5values.vtype = 6; /* Multivalue Uint32 */
5785 p5values.vstring = "";
5786 p5values.vdesc = "Number of Versions to Exclude: %d";
5787 p5values.vlength = 4;
5788 p5values.mvtype = 3;
5789 p5values.hfname= hf_nds_ver_exclude;
5790 p5values.voffset = foffset;
5792 p6values.vtype = 3; /* Uint32 */
5793 p6values.vdesc = "DN Output Type: %d";
5794 p6values.vstring = "";
5795 p6values.vlength = 4;
5796 p6values.voffset = foffset;
5797 p6values.vvalue = tvb_get_letohl(tvb, foffset);
5798 p6values.hfname= hf_nds_dn_output_type;
5799 foffset = foffset+p6values.vlength;
5800 p7values.vtype = 3; /* Uint32 */
5801 p7values.vdesc = "Nested Output Type: %d";
5802 p7values.vstring = "";
5803 p7values.vlength = 4;
5804 p7values.voffset = foffset;
5805 p7values.vvalue = tvb_get_letohl(tvb, foffset);
5806 p7values.hfname= hf_nds_nested_output_type;
5807 foffset = foffset+p7values.vlength;
5808 p8values.vtype = 4; /* String */
5809 p8values.vdesc = "Output Delimiter: %s";
5810 p8values.vstring = "";
5811 p8values.mvtype = 1;
5812 p8values.vvalue = 0;
5813 p8values.vlength = 256;
5814 p8values.vlength = tvb_get_letohl(tvb, foffset);
5815 p8values.voffset = foffset+4;
5816 foffset = foffset + 4;
5817 get_string(tvb, p8values.voffset, p8values.vlength, req_buffer.buffer);
5818 p8values.vstring = req_buffer.buffer;
5819 p8values.hfname= hf_nds_output_delimiter;
5820 foffset = foffset+p8values.vlength;
5821 foffset += align_4(tvb, foffset);
5822 p9values.vvalue = tvb_get_letohl(tvb, foffset);
5823 p9values.vtype = 6; /* Multivalue Uint32 */
5824 p9values.vstring = "";
5825 p9values.vdesc = "Size of Entry Specifier: %d";
5826 p9values.vlength = 4;
5827 p9values.mvtype = 10;
5828 p9values.hfname= hf_nds_output_entry_specifier;
5829 p9values.voffset = foffset;
5833 verb_string = "Read Entry Information";
5834 p1values.vvalue = tvb_get_letohl(tvb, foffset);
5835 p1values.vstring = "";
5836 p1values.vtype = 3; /* Uint32 */
5837 p1values.vdesc = "Version: %d";
5838 p1values.vlength = 4;
5839 p1values.voffset = foffset;
5840 p1values.hfname= hf_nds_ver;
5841 foffset = foffset+p1values.vlength;
5842 switch(p1values.vvalue)
5845 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5846 p2values.vstring = "";
5847 p2values.vtype = 3; /* Uint32 */
5848 p2values.vdesc = "Entry ID: 0x%08x";
5849 p2values.vlength = 4;
5851 global_eid = p2values.vvalue;
5852 p2values.voffset = foffset;
5853 p2values.hfname = hf_nds_eid;
5854 foffset = foffset+p2values.vlength;
5857 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5858 p2values.vtype = 5; /* Bitfield */
5859 p2values.vstring = "";
5860 p2values.vdesc = "Request Flags:";
5861 p2values.vlength = 2;
5862 p2values.hfname= hf_nds_rflags;
5863 p2values.voffset = foffset;
5864 p2values.bit1 = "Typeless";
5865 p2values.bit1hfname = hf_bit1rflags;
5866 p2values.bit2 = "Slashed";
5867 p2values.bit2hfname = hf_bit2rflags;
5868 p2values.bit3 = "Dotted";
5869 p2values.bit3hfname = hf_bit3rflags;
5870 p2values.bit4 = "Tuned";
5871 p2values.bit4hfname = hf_bit4rflags;
5872 p2values.bit5 = "Not Defined";
5873 p2values.bit5hfname = hf_bit5rflags;
5874 p2values.bit6 = "Not Defined";
5875 p2values.bit6hfname = hf_bit6rflags;
5876 p2values.bit7 = "Not Defined";
5877 p2values.bit7hfname = hf_bit7rflags;
5878 p2values.bit8 = "Not Defined";
5879 p2values.bit8hfname = hf_bit8rflags;
5880 p2values.bit9 = "Not Defined";
5881 p2values.bit9hfname = hf_bit9rflags;
5882 p2values.bit10 = "Not Defined";
5883 p2values.bit10hfname = hf_bit10rflags;
5884 p2values.bit11 = "Not Defined";
5885 p2values.bit11hfname = hf_bit11rflags;
5886 p2values.bit12 = "Not Defined";
5887 p2values.bit12hfname = hf_bit12rflags;
5888 p2values.bit13 = "Not Defined";
5889 p2values.bit13hfname = hf_bit13rflags;
5890 p2values.bit14 = "Not Defined";
5891 p2values.bit14hfname = hf_bit14rflags;
5892 p2values.bit15 = "Not Defined";
5893 p2values.bit15hfname = hf_bit15rflags;
5894 p2values.bit16 = "Not Defined";
5895 p2values.bit16hfname = hf_bit16rflags;
5896 if((p2values.vvalue&&0xf000) == 0xc000)
5898 p3values.vtype = 4; /* String */
5899 p3values.vdesc = "Name Type: %s";
5900 p3values.vstring = "Partial";
5901 p3values.mvtype = 0;
5902 p3values.vvalue = 0;
5903 p3values.vlength = 0;
5904 p3values.voffset = 0;
5905 p3values.hfname= hf_nds_name_type;
5909 p3values.vtype = 4; /* String */
5910 p3values.vdesc = "Name Type: %s";
5911 p3values.vstring = "Full";
5912 p3values.vvalue = 0;
5913 p3values.mvtype = 0;
5914 p3values.vlength = 0;
5915 p3values.voffset = 0;
5916 p3values.hfname= hf_nds_name_type;
5918 foffset = foffset+4;
5919 p4values.vvalue = tvb_get_letohl(tvb, foffset);
5920 p4values.vstring = "";
5921 p4values.vtype = 3; /* Uint32 */
5922 p4values.vdesc = "Entry ID: 0x%08x";
5923 p4values.vlength = 4;
5924 p4values.voffset = foffset;
5926 global_eid = p4values.vvalue;
5927 p4values.hfname = hf_nds_eid;
5928 foffset = foffset+p4values.vlength;
5931 p2values.vvalue = tvb_get_letohl(tvb, foffset);
5932 p2values.vtype = 5; /* Bitfield */
5933 p2values.vstring = "";
5934 p2values.vdesc = "Request Flags:";
5935 p2values.vlength = 2;
5936 p2values.hfname= hf_nds_rflags;
5937 p2values.voffset = foffset;
5938 p2values.bit1 = "Typeless";
5939 p2values.bit1hfname = hf_bit1rflags;
5940 p2values.bit2 = "Slashed";
5941 p2values.bit2hfname = hf_bit2rflags;
5942 p2values.bit3 = "Dotted";
5943 p2values.bit3hfname = hf_bit3rflags;
5944 p2values.bit4 = "Tuned";
5945 p2values.bit4hfname = hf_bit4rflags;
5946 p2values.bit5 = "Not Defined";
5947 p2values.bit5hfname = hf_bit5rflags;
5948 p2values.bit6 = "Not Defined";
5949 p2values.bit6hfname = hf_bit6rflags;
5950 p2values.bit7 = "Not Defined";
5951 p2values.bit7hfname = hf_bit7rflags;
5952 p2values.bit8 = "Not Defined";
5953 p2values.bit8hfname = hf_bit8rflags;
5954 p2values.bit9 = "Not Defined";
5955 p2values.bit9hfname = hf_bit9rflags;
5956 p2values.bit10 = "Not Defined";
5957 p2values.bit10hfname = hf_bit10rflags;
5958 p2values.bit11 = "Not Defined";
5959 p2values.bit11hfname = hf_bit11rflags;
5960 p2values.bit12 = "Not Defined";
5961 p2values.bit12hfname = hf_bit12rflags;
5962 p2values.bit13 = "Not Defined";
5963 p2values.bit13hfname = hf_bit13rflags;
5964 p2values.bit14 = "Not Defined";
5965 p2values.bit14hfname = hf_bit14rflags;
5966 p2values.bit15 = "Not Defined";
5967 p2values.bit15hfname = hf_bit15rflags;
5968 p2values.bit16 = "Not Defined";
5969 p2values.bit16hfname = hf_bit16rflags;
5970 if((p2values.vvalue&&0xf000) == 0xc000)
5972 p3values.vtype = 4; /* String */
5973 p3values.vdesc = "Name Type: %s";
5974 p3values.vstring = "Return Partion Name";
5975 p3values.vvalue = 0;
5976 p3values.vlength = 4;
5977 p3values.voffset = p2values.voffset;
5978 p3values.mvtype = 0;
5979 p3values.hfname= hf_nds_name_type;
5983 p3values.vtype = 4; /* String */
5984 p3values.vdesc = "Name Type: %s";
5985 p3values.vstring = "Return Full Name";
5986 p3values.vvalue = 0;
5987 p3values.vlength = 4;
5988 p3values.mvtype = 0;
5989 p3values.voffset = p2values.voffset;
5990 p3values.hfname= hf_nds_name_type;
5992 foffset = foffset+4;
5993 p4values.vvalue = tvb_get_letohs(tvb, foffset);
5994 global_flags = tvb_get_letohl(tvb, foffset);
5995 p4values.vtype = 5; /* Bitfield */
5996 p4values.vstring = "";
5997 p4values.vdesc = "Information Flags (low) Byte:";
5998 p4values.vlength = 2;
5999 p4values.hfname= hf_nds_rflags;
6000 p4values.voffset = foffset;
6001 p4values.bit1 = "Output Flags";
6002 p4values.bit1hfname = hf_bit1infoflagsl;
6003 p4values.bit2 = "Entry ID";
6004 p4values.bit2hfname = hf_bit2infoflagsl;
6005 p4values.bit3 = "Entry Flags";
6006 p4values.bit3hfname = hf_bit3infoflagsl;
6007 p4values.bit4 = "Subordinate Count";
6008 p4values.bit4hfname = hf_bit4infoflagsl;
6009 p4values.bit5 = "Modification Time";
6010 p4values.bit5hfname = hf_bit5infoflagsl;
6011 p4values.bit6 = "Modification Timestamp";
6012 p4values.bit6hfname = hf_bit6infoflagsl;
6013 p4values.bit7 = "Creation Timestamp";
6014 p4values.bit7hfname = hf_bit7infoflagsl;
6015 p4values.bit8 = "Partition Root ID";
6016 p4values.bit8hfname = hf_bit8infoflagsl;
6017 p4values.bit9 = "Parent ID";
6018 p4values.bit9hfname = hf_bit9infoflagsl;
6019 p4values.bit10 = "Revision Count";
6020 p4values.bit10hfname = hf_bit10infoflagsl;
6021 p4values.bit11 = "Replica Type";
6022 p4values.bit11hfname = hf_bit11infoflagsl;
6023 p4values.bit12 = "Base Class";
6024 p4values.bit12hfname = hf_bit12infoflagsl;
6025 p4values.bit13 = "Relative Distinguished Name";
6026 p4values.bit13hfname = hf_bit13infoflagsl;
6027 p4values.bit14 = "Distinguished Name";
6028 p4values.bit14hfname = hf_bit14infoflagsl;
6029 p4values.bit15 = "Root Distinguished Name";
6030 p4values.bit15hfname = hf_bit15infoflagsl;
6031 p4values.bit16 = "Parent Distinguished Name";
6032 p4values.bit16hfname = hf_bit16infoflagsl;
6033 foffset = foffset+2;
6034 p5values.vvalue = tvb_get_letohs(tvb, foffset);
6035 p5values.vtype = 5; /* Bitfield */
6036 p5values.vstring = "";
6037 p5values.vdesc = "Information Flags (high) Byte:";
6038 p5values.vlength = 2;
6039 p5values.hfname= hf_nds_rflags;
6040 p5values.voffset = foffset;
6041 p5values.bit1 = "Purge Time";
6042 p5values.bit1hfname = hf_bit1infoflagsh;
6043 p5values.bit2 = "Dereference Base Class";
6044 p5values.bit2hfname = hf_bit2infoflagsh;
6045 p5values.bit3 = "Not Defined";
6046 p5values.bit3hfname = hf_bit3infoflagsh;
6047 p5values.bit4 = "Not Defined";
6048 p5values.bit4hfname = hf_bit4infoflagsh;
6049 p5values.bit5 = "Not Defined";
6050 p5values.bit5hfname = hf_bit5infoflagsh;
6051 p5values.bit6 = "Not Defined";
6052 p5values.bit6hfname = hf_bit6infoflagsh;
6053 p5values.bit7 = "Not Defined";
6054 p5values.bit7hfname = hf_bit7infoflagsh;
6055 p5values.bit8 = "Not Defined";
6056 p5values.bit8hfname = hf_bit8infoflagsh;
6057 p5values.bit9 = "Not Defined";
6058 p5values.bit9hfname = hf_bit9infoflagsh;
6059 p5values.bit10 = "Not Defined";
6060 p5values.bit10hfname = hf_bit10infoflagsh;
6061 p5values.bit11 = "Not Defined";
6062 p5values.bit11hfname = hf_bit11infoflagsh;
6063 p5values.bit12 = "Not Defined";
6064 p5values.bit12hfname = hf_bit12infoflagsh;
6065 p5values.bit13 = "Not Defined";
6066 p5values.bit13hfname = hf_bit13infoflagsh;
6067 p5values.bit14 = "Not Defined";
6068 p5values.bit14hfname = hf_bit14infoflagsh;
6069 p5values.bit15 = "Not Defined";
6070 p5values.bit15hfname = hf_bit15infoflagsh;
6071 p5values.bit16 = "Not Defined";
6072 p5values.bit16hfname = hf_bit16infoflagsh;
6073 foffset = foffset+2;
6074 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6075 p6values.vstring = "";
6076 p6values.vtype = 3; /* Uint32 */
6077 p6values.vdesc = "Entry ID: 0x%08x";
6078 p6values.vlength = 4;
6079 p6values.voffset = foffset;
6081 global_eid = p6values.vvalue;
6082 p6values.hfname = hf_nds_eid;
6083 foffset = foffset+p6values.vlength;
6091 verb_string = "Read -> ";
6092 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6093 p1values.vstring = "";
6094 p1values.vtype = 3; /* Uint32 */
6095 p1values.vdesc = "Version: %d";
6096 p1values.vlength = 4;
6097 p1values.voffset = foffset;
6098 p1values.hfname= hf_nds_ver;
6099 foffset = foffset+p1values.vlength;
6100 if(p1values.vvalue == 0)
6102 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6103 p2values.vstring = "";
6104 p2values.vtype = 3; /* Uint32 */
6105 p2values.vdesc = "Iteration Handle: 0x%08x";
6106 p2values.vlength = 4;
6107 p2values.voffset = foffset;
6108 p2values.hfname= hf_nds_iteration;
6109 foffset = foffset+p2values.vlength;
6110 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6111 p3values.vstring = "";
6112 p3values.vtype = 3; /* Uint32 */
6113 p3values.vdesc = "Entry ID: 0x%08x";
6114 p3values.vlength = 4;
6116 global_eid = p3values.vvalue;
6117 p3values.voffset = foffset;
6118 p3values.hfname= hf_nds_eid;
6119 foffset = foffset+p3values.vlength;
6120 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6121 p4values.vstring = match_strval(p4values.vvalue, nds_info_type);
6122 global_flags = p4values.vvalue;
6123 if(p4values.vstring == NULL)
6125 p4values.vstring = "No Info Type Set";
6127 p4values.vtype = 4; /* String */
6128 p4values.vdesc = "Info Type: %s";
6129 p4values.vlength = 4;
6130 p4values.voffset = foffset;
6131 p4values.mvtype = 1;
6132 p4values.hfname= hf_nds_info_type;
6133 foffset = foffset + p4values.vlength;
6134 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6135 p5values.vstring = "";
6136 p5values.vtype = 3; /* Uint32 */
6137 p5values.vdesc = "All Attributes: %d";
6138 p5values.vlength = 4;
6139 p5values.voffset = foffset;
6140 p5values.hfname= hf_nds_all_attr;
6141 foffset = foffset+p5values.vlength;
6142 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6143 p6values.vtype = 6; /* Multivalue Uint32 */
6144 p6values.vstring = "";
6145 p6values.vdesc = "Attributes: %d";
6146 p6values.vlength = 4;
6147 p6values.voffset = foffset;
6148 p6values.mvtype = 1;
6149 p6values.hfname= hf_nds_attr;
6153 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6154 p2values.vstring = "";
6155 p2values.vtype = 3; /* Uint32 */
6156 p2values.vdesc = "Request Flags: 0x%08x";
6157 p2values.vlength = 4;
6158 p2values.voffset = foffset;
6159 p2values.hfname= hf_nds_req_flags;
6160 foffset = foffset+p2values.vlength;
6161 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6162 p3values.vstring = "";
6163 p3values.vtype = 3; /* Uint32 */
6164 p3values.vdesc = "Iteration Handle: 0x%08x";
6165 p3values.vlength = 4;
6166 p3values.voffset = foffset;
6167 p3values.hfname= hf_nds_iteration;
6168 foffset = foffset+p3values.vlength;
6169 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6170 p4values.vstring = "";
6171 p4values.vtype = 3; /* Uint32 */
6172 p4values.vdesc = "Entry ID: 0x%08x";
6173 p4values.vlength = 4;
6175 global_eid = p4values.vvalue;
6176 p4values.voffset = foffset;
6177 p4values.hfname= hf_nds_eid;
6178 foffset = foffset+p4values.vlength;
6179 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6180 p5values.vstring = match_strval(p5values.vvalue, nds_info_type);
6181 global_flags = p5values.vvalue;
6182 if(p5values.vstring == NULL)
6184 p5values.vstring = "No Info Type Set";
6186 p5values.vtype = 4; /* String */
6187 p5values.vdesc = "Info Type: %s";
6188 p5values.vlength = 4;
6189 p5values.voffset = foffset;
6190 p5values.hfname= hf_nds_info_type;
6191 p5values.mvtype = 1;
6192 foffset = foffset+p5values.vlength;
6193 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6194 p6values.vstring = "";
6195 p6values.vtype = 3; /* Uint32 */
6196 p6values.vdesc = "All Attributes: %d";
6197 p6values.vlength = 4;
6198 p6values.voffset = foffset;
6199 p6values.hfname= hf_nds_all_attr;
6200 foffset = foffset+p6values.vlength;
6201 p7values.vvalue = tvb_get_letohl(tvb, foffset);
6202 p7values.vtype = 6; /* Multivalue Uint32 */
6203 p7values.vstring = "";
6204 p7values.vdesc = "Attributes: %d";
6205 p7values.vlength = 4;
6206 p7values.voffset = foffset;
6207 p7values.mvtype = 1;
6208 p7values.hfname= hf_nds_attr;
6212 verb_string = "Compare";
6213 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6214 p1values.vstring = "";
6215 p1values.vtype = 3; /* Uint32 */
6216 p1values.vdesc = "Version: %d";
6217 p1values.vlength = 4;
6218 p1values.voffset = foffset;
6219 p1values.hfname= hf_nds_ver;
6220 foffset = foffset+p1values.vlength;
6221 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6222 p2values.vstring = "";
6223 p2values.vtype = 3; /* Uint32 */
6224 p2values.vdesc = "Entry ID: 0x%08x";
6225 p2values.vlength = 4;
6227 global_eid = p2values.vvalue;
6228 p2values.voffset = foffset;
6229 p2values.hfname = hf_nds_eid;
6230 foffset = foffset+p2values.vlength;
6231 foffset += 4; /* Attribute Count = 1 */
6232 p3values.vtype = 4; /* String */
6233 p3values.vdesc = "Attribute Name Being Compared: %s";
6234 p3values.vstring = "";
6235 p3values.mvtype = 1;
6236 p3values.vvalue = 0;
6237 p3values.vlength = 256;
6238 p3values.vlength = tvb_get_letohl(tvb, foffset);
6239 if (p3values.vlength == 0x00)
6244 p3values.voffset = foffset+4;
6245 foffset = foffset + 4;
6246 get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer);
6247 p3values.vstring = req_buffer.buffer;
6248 global_object_name = req_buffer.buffer;
6249 p3values.hfname= hf_nds_name;
6250 foffset = foffset+p3values.vlength;
6251 foffset += align_4(tvb, foffset);
6252 foffset += 4; /* Attribute Value Count = 1 */
6254 * Need Trace file to test. Will have to create a
6255 * new mvtype to call print_nds_values.
6259 verb_string = "List -> ";
6260 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6261 p1values.vstring = "";
6262 p1values.vtype = 3; /* Uint32 */
6263 p1values.vdesc = "Version: %d";
6264 p1values.vlength = 4;
6265 p1values.voffset = foffset;
6266 p1values.hfname= hf_nds_ver;
6267 foffset = foffset+p1values.vlength;
6268 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6269 p2values.vtype = 5; /* Bitfield */
6270 p2values.vstring = "";
6271 p2values.vdesc = "Request Flags:";
6272 p2values.vlength = 2;
6273 p2values.hfname= hf_nds_rflags;
6274 p2values.voffset = foffset;
6275 p2values.bit1 = "List Typeless";
6276 p2values.bit1hfname = hf_bit1lflags;
6277 p2values.bit2 = "List Containers";
6278 p2values.bit2hfname = hf_bit2lflags;
6279 p2values.bit3 = "List Slashed";
6280 p2values.bit3hfname = hf_bit3lflags;
6281 p2values.bit4 = "List Dotted";
6282 p2values.bit4hfname = hf_bit4lflags;
6283 p2values.bit5 = "Dereference Alias";
6284 p2values.bit5hfname = hf_bit5lflags;
6285 p2values.bit6 = "List All Containers";
6286 p2values.bit6hfname = hf_bit6lflags;
6287 p2values.bit7 = "List Obsolete";
6288 p2values.bit7hfname = hf_bit7lflags;
6289 p2values.bit8 = "List Tuned Output";
6290 p2values.bit8hfname = hf_bit8lflags;
6291 p2values.bit9 = "List External Reference";
6292 p2values.bit9hfname = hf_bit9lflags;
6293 p2values.bit10 = "Not Defined";
6294 p2values.bit10hfname = hf_bit10lflags;
6295 p2values.bit11 = "Not Defined";
6296 p2values.bit11hfname = hf_bit11lflags;
6297 p2values.bit12 = "Not Defined";
6298 p2values.bit12hfname = hf_bit12lflags;
6299 p2values.bit13 = "Not Defined";
6300 p2values.bit13hfname = hf_bit13lflags;
6301 p2values.bit14 = "Not Defined";
6302 p2values.bit14hfname = hf_bit14lflags;
6303 p2values.bit15 = "Not Defined";
6304 p2values.bit15hfname = hf_bit15lflags;
6305 p2values.bit16 = "Not Defined";
6306 p2values.bit16hfname = hf_bit16lflags;
6307 foffset = foffset+p2values.vlength;
6309 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6310 p3values.vstring = "";
6311 p3values.vtype = 3; /* Uint32 */
6312 p3values.vdesc = "Iteration Handle: 0x%08x";
6313 p3values.vlength = 4;
6314 p3values.voffset = foffset;
6315 p3values.hfname= hf_nds_iteration;
6316 foffset = foffset+p3values.vlength;
6317 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6318 p4values.vstring = "";
6319 p4values.vtype = 3; /* Uint32 */
6320 p4values.vdesc = "Parent ID: 0x%08x";
6321 p4values.vlength = 4;
6322 p4values.voffset = foffset;
6323 p4values.hfname= hf_nds_parent;
6324 foffset = foffset+p4values.vlength;
6325 p5values.vvalue = tvb_get_letohs(tvb, foffset);
6326 global_flags = tvb_get_letohl(tvb, foffset);
6327 p5values.vtype = 5; /* Bitfield */
6328 p5values.vstring = "";
6329 p5values.vdesc = "Information Flags (low) Byte:";
6330 p5values.vlength = 2;
6331 p5values.hfname= hf_nds_rflags;
6332 p5values.voffset = foffset;
6333 p5values.bit1 = "Output Flags";
6334 p5values.bit1hfname = hf_bit1infoflagsl;
6335 p5values.bit2 = "Entry ID";
6336 p5values.bit2hfname = hf_bit2infoflagsl;
6337 p5values.bit3 = "Entry Flags";
6338 p5values.bit3hfname = hf_bit3infoflagsl;
6339 p5values.bit4 = "Subordinate Count";
6340 p5values.bit4hfname = hf_bit4infoflagsl;
6341 p5values.bit5 = "Modification Time";
6342 p5values.bit5hfname = hf_bit5infoflagsl;
6343 p5values.bit6 = "Modification Timestamp";
6344 p5values.bit6hfname = hf_bit6infoflagsl;
6345 p5values.bit7 = "Creation Timestamp";
6346 p5values.bit7hfname = hf_bit7infoflagsl;
6347 p5values.bit8 = "Partition Root ID";
6348 p5values.bit8hfname = hf_bit8infoflagsl;
6349 p5values.bit9 = "Parent ID";
6350 p5values.bit9hfname = hf_bit9infoflagsl;
6351 p5values.bit10 = "Revision Count";
6352 p5values.bit10hfname = hf_bit10infoflagsl;
6353 p5values.bit11 = "Replica Type";
6354 p5values.bit11hfname = hf_bit11infoflagsl;
6355 p5values.bit12 = "Base Class";
6356 p5values.bit12hfname = hf_bit12infoflagsl;
6357 p5values.bit13 = "Relative Distinguished Name";
6358 p5values.bit13hfname = hf_bit13infoflagsl;
6359 p5values.bit14 = "Distinguished Name";
6360 p5values.bit14hfname = hf_bit14infoflagsl;
6361 p5values.bit15 = "Root Distinguished Name";
6362 p5values.bit15hfname = hf_bit15infoflagsl;
6363 p5values.bit16 = "Parent Distinguished Name";
6364 p5values.bit16hfname = hf_bit16infoflagsl;
6365 foffset = foffset+2;
6366 p6values.vvalue = tvb_get_letohs(tvb, foffset);
6367 p6values.vtype = 5; /* Bitfield */
6368 p6values.vstring = "";
6369 p6values.vdesc = "Information Flags (high) Byte:";
6370 p6values.vlength = 2;
6371 p6values.hfname= hf_nds_rflags;
6372 p6values.voffset = foffset;
6373 p6values.bit1 = "Purge Time";
6374 p6values.bit1hfname = hf_bit1infoflagsh;
6375 p6values.bit2 = "Dereference Base Class";
6376 p6values.bit2hfname = hf_bit2infoflagsh;
6377 p6values.bit3 = "Not Defined";
6378 p6values.bit3hfname = hf_bit3infoflagsh;
6379 p6values.bit4 = "Not Defined";
6380 p6values.bit4hfname = hf_bit4infoflagsh;
6381 p6values.bit5 = "Not Defined";
6382 p6values.bit5hfname = hf_bit5infoflagsh;
6383 p6values.bit6 = "Not Defined";
6384 p6values.bit6hfname = hf_bit6infoflagsh;
6385 p6values.bit7 = "Not Defined";
6386 p6values.bit7hfname = hf_bit7infoflagsh;
6387 p6values.bit8 = "Not Defined";
6388 p6values.bit8hfname = hf_bit8infoflagsh;
6389 p6values.bit9 = "Not Defined";
6390 p6values.bit9hfname = hf_bit9infoflagsh;
6391 p6values.bit10 = "Not Defined";
6392 p6values.bit10hfname = hf_bit10infoflagsh;
6393 p6values.bit11 = "Not Defined";
6394 p6values.bit11hfname = hf_bit11infoflagsh;
6395 p6values.bit12 = "Not Defined";
6396 p6values.bit12hfname = hf_bit12infoflagsh;
6397 p6values.bit13 = "Not Defined";
6398 p6values.bit13hfname = hf_bit13infoflagsh;
6399 p6values.bit14 = "Not Defined";
6400 p6values.bit14hfname = hf_bit14infoflagsh;
6401 p6values.bit15 = "Not Defined";
6402 p6values.bit15hfname = hf_bit15infoflagsh;
6403 p6values.bit16 = "Not Defined";
6404 p6values.bit16hfname = hf_bit16infoflagsh;
6405 foffset = foffset+2;
6406 p7values.vtype = 4; /* String */
6407 p7values.vdesc = "Name Filter: %s";
6408 p7values.vstring = "";
6409 p7values.mvtype = 1;
6410 p7values.vvalue = 0;
6411 p7values.vlength = 256;
6412 p7values.vlength = tvb_get_letohl(tvb, foffset);
6413 p7values.voffset = foffset+4;
6414 foffset = foffset + 4;
6415 get_string(tvb, p7values.voffset, p7values.vlength, p7values.vstring);
6416 p7values.hfname= hf_nds_name_filter;
6417 foffset = foffset+p7values.vlength;
6418 if(p1values.vvalue == 0)
6422 foffset += align_4(tvb, foffset);
6423 p8values.vtype = 4; /* String */
6424 p8values.vdesc = "Class Filter: %s";
6425 p8values.vstring = "";
6426 p8values.mvtype = 1;
6427 p8values.vvalue = 0;
6428 p8values.vlength = 256;
6429 p8values.vlength = tvb_get_letohl(tvb, foffset);
6430 p8values.voffset = foffset+4;
6431 foffset = foffset + 4;
6432 get_string(tvb, p8values.voffset, p8values.vlength, p8values.vstring);
6433 p8values.hfname= hf_nds_class_filter;
6434 foffset = foffset+p8values.vlength;
6435 if(p1values.vvalue == 1)
6439 foffset += align_4(tvb, foffset);
6440 p9values.vvalue = tvb_get_letohl(tvb, foffset);
6441 p9values.vtype = 6; /* Multivalue Uint32 */
6442 p9values.vstring = "";
6443 p9values.vdesc = "Seconds %d";
6444 p9values.vlength = 4;
6445 p9values.mvtype = 11;
6446 p9values.hfname= hf_nds_time_filter;
6447 p9values.voffset = foffset;
6450 verb_string = "Search Entries";
6451 p1values.vtype = 0; /* Not Defined */
6454 verb_string = "Add Entry";
6455 p1values.vtype = 0; /* Not Defined */
6458 verb_string = "Remove Entry";
6459 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6460 p1values.vstring = "";
6461 p1values.vtype = 3; /* Uint32 */
6462 p1values.vdesc = "Version: %d";
6463 p1values.vlength = 4;
6464 p1values.voffset = foffset;
6465 p1values.hfname= hf_nds_ver;
6466 foffset = foffset+p1values.vlength;
6467 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6468 p2values.vstring = "";
6469 p2values.vtype = 3; /* Uint32 */
6470 p2values.vdesc = "Entry ID: 0x%08x";
6471 p2values.vlength = 4;
6473 global_eid = p2values.vvalue;
6474 p2values.voffset = foffset;
6475 p2values.hfname= hf_nds_eid;
6476 foffset = foffset+p2values.vlength;
6479 verb_string = "Modify Entry";
6480 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6481 p1values.vstring = "";
6482 p1values.vtype = 3; /* Uint32 */
6483 p1values.vdesc = "Version: %d";
6484 p1values.vlength = 4;
6485 p1values.voffset = foffset;
6486 p1values.hfname= hf_nds_ver;
6487 foffset = foffset+p1values.vlength;
6488 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6489 p2values.vtype = 3; /* Uint32 */
6490 p2values.vstring = "";
6491 p2values.vdesc = "Request Flags: 0x%08x"; /* always 0 */
6492 p2values.vlength = 4;
6493 p2values.hfname= hf_nds_rflags;
6494 p2values.voffset = foffset;
6495 foffset = foffset+4;
6496 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6497 p3values.vtype = 3; /* Uint32 */
6498 p3values.vstring = "";
6499 p3values.vdesc = "Iteration Handle: 0x%08x"; /* always 0 */
6500 p3values.vlength = 4;
6501 p3values.hfname= hf_nds_iteration;
6502 p3values.voffset = foffset;
6503 foffset = foffset+4;
6504 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6505 p4values.vstring = "";
6506 p4values.vtype = 3; /* Uint32 */
6507 p4values.vdesc = "Entry ID: 0x%08x";
6508 p4values.vlength = 4;
6509 p4values.voffset = foffset;
6511 global_eid = p4values.vvalue;
6512 p4values.hfname = hf_nds_eid;
6513 foffset = foffset+p4values.vlength;
6514 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6515 p5values.vtype = 6; /* Multivalue Uint32 */
6516 p5values.vstring = "";
6517 p5values.vdesc = "Number of Attributes to Change %d";
6518 p5values.vlength = 4;
6519 p5values.mvtype = 6;
6520 p5values.hfname= hf_nds_number_of_changes;
6521 p5values.voffset = foffset;
6524 verb_string = "Modify RDN";
6525 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6526 p1values.vstring = "";
6527 p1values.vtype = 3; /* Uint32 */
6528 p1values.vdesc = "Version: %d";
6529 p1values.vlength = 4;
6530 p1values.voffset = foffset;
6531 p1values.hfname= hf_nds_ver;
6532 foffset = foffset+p1values.vlength;
6533 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6534 p2values.vstring = "";
6535 p2values.vtype = 3; /* Uint32 */
6536 p2values.vdesc = "Entry ID: 0x%08x";
6537 p2values.vlength = 4;
6539 global_eid = p2values.vvalue;
6540 p2values.voffset = foffset;
6541 p2values.hfname = hf_nds_eid;
6542 foffset = foffset+p2values.vlength;
6543 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6544 p3values.vtype = 8; /* Boolean */
6545 p3values.vdesc = "Keep Original RDN: %s";
6546 p3values.vlength = 4;
6547 p3values.voffset = foffset;
6548 p3values.mvtype = 0;
6549 p3values.hfname= hf_nds_keep;
6550 foffset = foffset+4;
6551 foffset += align_4(tvb, foffset);
6552 p4values.vtype = 4; /* String */
6553 p4values.vdesc = "New RDN: %s";
6554 p4values.vstring = "";
6555 p4values.mvtype = 0;
6556 p4values.vvalue = 0;
6557 p4values.vlength = 256;
6558 p4values.vlength = tvb_get_letohl(tvb, foffset);
6559 p4values.voffset = foffset+4;
6560 foffset = foffset + 4;
6561 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
6562 p4values.hfname= hf_nds_new_rdn;
6563 foffset = foffset+p4values.vlength;
6566 verb_string = "Define Attribute ->";
6567 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6568 p1values.vstring = "";
6569 p1values.vtype = 3; /* Uint32 */
6570 p1values.vdesc = "Version: %d";
6571 p1values.vlength = 4;
6572 p1values.voffset = foffset;
6573 p1values.hfname= hf_nds_ver;
6574 foffset = foffset+p1values.vlength;
6575 p2values.vvalue = tvb_get_letohs(tvb, foffset);
6576 global_flags = tvb_get_letohl(tvb, foffset);
6577 p2values.vtype = 5; /* Bitfield */
6578 p2values.vstring = "";
6579 p2values.vdesc = "Attribute Constraints:";
6580 p2values.vlength = 2;
6581 p2values.hfname= hf_nds_acflags;
6582 p2values.voffset = foffset;
6583 p2values.bit1 = "Single Valued";
6584 p2values.bit1hfname = hf_bit1acflags;
6585 p2values.bit2 = "Sized";
6586 p2values.bit2hfname = hf_bit2acflags;
6587 p2values.bit3 = "Non-Removable";
6588 p2values.bit3hfname = hf_bit3acflags;
6589 p2values.bit4 = "Read Only";
6590 p2values.bit4hfname = hf_bit4acflags;
6591 p2values.bit5 = "Hidden";
6592 p2values.bit5hfname = hf_bit5acflags;
6593 p2values.bit6 = "String";
6594 p2values.bit6hfname = hf_bit6acflags;
6595 p2values.bit7 = "Synchronize Immediate";
6596 p2values.bit7hfname = hf_bit7acflags;
6597 p2values.bit8 = "Public Read";
6598 p2values.bit8hfname = hf_bit8acflags;
6599 p2values.bit9 = "Server Read";
6600 p2values.bit9hfname = hf_bit9acflags;
6601 p2values.bit10 = "Write Managed";
6602 p2values.bit10hfname = hf_bit10acflags;
6603 p2values.bit11 = "Per Replica";
6604 p2values.bit11hfname = hf_bit11acflags;
6605 p2values.bit12 = "Never Schedule Synchronization";
6606 p2values.bit12hfname = hf_bit12acflags;
6607 p2values.bit13 = "Operational";
6608 p2values.bit13hfname = hf_bit13acflags;
6609 p2values.bit14 = "Not Defined";
6610 p2values.bit14hfname = hf_bit14acflags;
6611 p2values.bit15 = "Not Defined";
6612 p2values.bit15hfname = hf_bit15acflags;
6613 p2values.bit16 = "Not Defined";
6614 p2values.bit16hfname = hf_bit16acflags;
6615 foffset = foffset+4;
6616 p3values.vtype = 4; /* String */
6617 p3values.vdesc = "Attribute Name: %s";
6618 p3values.vstring = "";
6619 p3values.mvtype = 1;
6620 p3values.vvalue = 0;
6621 p3values.vlength = 256;
6622 p3values.vlength = tvb_get_letohl(tvb, foffset);
6623 if (p3values.vlength == 0x00)
6628 p3values.voffset = foffset+4;
6629 foffset = foffset + 4;
6630 get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer);
6631 p3values.vstring = req_buffer.buffer;
6632 global_object_name = req_buffer.buffer;
6633 p3values.hfname= hf_nds_name;
6634 foffset = foffset+p3values.vlength;
6635 foffset += align_4(tvb, foffset);
6636 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6637 p4values.vstring = match_strval(p4values.vvalue, nds_syntax);
6638 if(p4values.vstring == NULL)
6640 p4values.vstring = "No Syntax Found";
6642 p4values.vtype = 4; /* String */
6643 p4values.vdesc = "Syntax: %s";
6644 p4values.vlength = 4;
6645 p4values.voffset = foffset;
6646 p4values.hfname= hf_nds_syntax;
6647 p4values.mvtype = 0;
6648 foffset = foffset+p4values.vlength;
6649 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6650 p5values.vstring = "";
6651 p5values.vtype = 3; /* Uint32 */
6652 p5values.vdesc = "Lower Limit Value %d";
6653 p5values.vlength = 4;
6654 p5values.voffset = foffset;
6655 p5values.hfname = hf_nds_lower;
6657 p6values.vvalue = tvb_get_letohl(tvb, foffset);
6658 p6values.vstring = "";
6659 p6values.vtype = 3; /* Uint32 */
6660 p6values.vdesc = "Upper Limit Value %d";
6661 p6values.vlength = 4;
6662 p6values.voffset = foffset;
6663 p6values.hfname = hf_nds_upper;
6664 p7values.vvalue = tvb_get_letohl(tvb, foffset); /* Length of bytes field */
6666 p7values.vstring = "";
6667 p7values.vtype = 7; /* Bytes */
6668 p7values.vdesc = "ASN.1 ID";
6669 p7values.vlength = p7values.vvalue;
6670 p7values.voffset = foffset;
6671 p7values.hfname = hf_nds_asn1;
6674 verb_string = "Read Attribute Definition";
6675 p1values.vtype = 0; /* Not Defined */
6678 verb_string = "Remove Attribute Definition";
6679 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6680 p1values.vstring = "";
6681 p1values.vtype = 3; /* Uint32 */
6682 p1values.vdesc = "Version: %d";
6683 p1values.vlength = 4;
6684 p1values.voffset = foffset;
6685 p1values.hfname= hf_nds_ver;
6686 foffset = foffset+p1values.vlength;
6687 p2values.vtype = 4; /* String */
6688 p2values.vdesc = "Attribute Name: %s";
6689 p2values.vstring = "";
6690 p2values.mvtype = 1;
6691 p2values.vvalue = 0;
6692 p2values.vlength = 256;
6693 p2values.vlength = tvb_get_letohl(tvb, foffset);
6694 if (p2values.vlength == 0x00)
6699 p2values.voffset = foffset+4;
6700 foffset = foffset + 4;
6701 get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer);
6702 p2values.vstring = req_buffer.buffer;
6703 global_object_name = req_buffer.buffer;
6704 p2values.hfname= hf_nds_attribute_dn;
6707 verb_string = "Define Class";
6708 p1values.vtype = 0; /* Not Defined */
6711 verb_string = "Read Class Definition ->";
6712 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6713 p1values.vstring = "";
6714 p1values.vtype = 3; /* Uint32 */
6715 p1values.vdesc = "Version: %d";
6716 p1values.vlength = 4;
6717 p1values.voffset = foffset;
6718 p1values.hfname= hf_nds_ver;
6719 foffset = foffset+p1values.vlength;
6720 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6721 p2values.vstring = "";
6722 p2values.vtype = 3; /* Uint32 */
6723 p2values.vdesc = "Iteration Handle: 0x%08x";
6724 p2values.vlength = 4;
6725 p2values.voffset = foffset;
6726 p2values.hfname= hf_nds_iteration;
6727 foffset = foffset+p2values.vlength;
6728 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6729 global_flags = p3values.vvalue;
6730 p3values.vstring = match_strval(p3values.vvalue, class_def_type);
6731 if(p3values.vstring == NULL)
6733 p3values.vstring = "No Class Definition Type Set";
6735 p3values.vtype = 4; /* String */
6736 p3values.vdesc = "Class Definition Type: %s";
6737 p3values.vlength = 4;
6738 p3values.voffset = foffset;
6739 p3values.mvtype = 0;
6740 p3values.hfname= hf_nds_class_def_type;
6741 foffset = foffset + p3values.vlength;
6742 p4values.vvalue = tvb_get_letohl(tvb, foffset);
6743 if (p4values.vvalue == 0x00000000)
6745 p4values.vstring = "Return All Classes = False";
6749 p4values.vstring = "Return All Classes = True";
6751 p4values.vtype = 4; /* String */
6752 p4values.vdesc = "Return all Classes %s";
6753 p4values.vlength = 4;
6754 p4values.voffset = foffset;
6755 p4values.mvtype = 0;
6756 p4values.hfname= hf_nds_return_all_classes;
6757 foffset = foffset + p4values.vlength;
6758 foffset += align_4(tvb, foffset);
6759 p5values.vvalue = tvb_get_letohl(tvb, foffset);
6760 p5values.vtype = 6; /* Multivalue Uint32 */
6761 p5values.vstring = "";
6762 p5values.vdesc = "Classes: %d";
6763 p5values.vlength = 4;
6764 p5values.voffset = foffset;
6765 p5values.mvtype = 4;
6766 p5values.hfname= hf_nds_classes;
6769 verb_string = "Modify Class Definition -> ";
6770 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6771 p1values.vstring = "";
6772 p1values.vtype = 3; /* Uint32 */
6773 p1values.vdesc = "Version: %d";
6774 p1values.vlength = 4;
6775 p1values.voffset = foffset;
6776 p1values.hfname= hf_nds_ver;
6777 foffset = foffset+p1values.vlength;
6778 p2values.vtype = 4; /* String */
6779 p2values.vdesc = "Class Name: %s";
6780 p2values.vstring = "";
6781 p2values.mvtype = 1;
6782 p2values.vvalue = 0;
6783 p2values.vlength = 256;
6784 p2values.vlength = tvb_get_letohl(tvb, foffset);
6785 if (p2values.vlength == 0x00)
6790 p2values.voffset = foffset+4;
6791 foffset = foffset + 4;
6792 get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer);
6793 p2values.vstring = req_buffer.buffer;
6794 global_object_name = req_buffer.buffer;
6795 p2values.hfname= hf_nds_base_class;
6796 foffset = foffset+p2values.vlength;
6797 foffset += align_4(tvb, foffset);
6798 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6799 p3values.vtype = 6; /* Multivalue Uint32 */
6800 p3values.vstring = "";
6801 p3values.vdesc = "Number of Attributes to Add: %d";
6802 p3values.vlength = 4;
6803 p3values.voffset = foffset;
6804 p3values.mvtype = 14;
6805 p3values.hfname= hf_nds_att_add;
6808 verb_string = "Remove Class Definition";
6809 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6810 p1values.vstring = "";
6811 p1values.vtype = 3; /* Uint32 */
6812 p1values.vdesc = "Version: %d";
6813 p1values.vlength = 4;
6814 p1values.voffset = foffset;
6815 p1values.hfname= hf_nds_ver;
6816 foffset = foffset+p1values.vlength;
6817 p2values.vtype = 4; /* String */
6818 p2values.vdesc = "Class Name: %s";
6819 p2values.vstring = "";
6820 p2values.mvtype = 1;
6821 p2values.vvalue = 0;
6822 p2values.vlength = 256;
6823 p2values.vlength = tvb_get_letohl(tvb, foffset);
6824 if (p2values.vlength == 0x00)
6829 p2values.voffset = foffset+4;
6830 foffset = foffset + 4;
6831 get_string(tvb, p2values.voffset, p2values.vlength, req_buffer.buffer);
6832 p2values.vstring = req_buffer.buffer;
6833 global_object_name = req_buffer.buffer;
6834 p2values.hfname= hf_nds_base;
6837 verb_string = "List Containable Classes";
6838 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6839 p1values.vstring = "";
6840 p1values.vtype = 3; /* Uint32 */
6841 p1values.vdesc = "Version: %d";
6842 p1values.vlength = 4;
6843 p1values.voffset = foffset;
6844 p1values.hfname= hf_nds_ver;
6845 foffset = foffset+p1values.vlength;
6846 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6847 p2values.vstring = "";
6848 p2values.vtype = 3; /* Uint32 */
6849 p2values.vdesc = "Iteration Handle: 0x%08x";
6850 p2values.vlength = 4;
6851 p2values.voffset = foffset;
6852 p2values.hfname= hf_nds_iteration;
6853 foffset = foffset+p2values.vlength;
6854 p3values.vvalue = tvb_get_letohl(tvb, foffset);
6855 p3values.vstring = "";
6856 p3values.vtype = 3; /* Uint32 */
6857 p3values.vdesc = "Entry ID: 0x%08x";
6858 p3values.vlength = 4;
6860 global_eid = p3values.vvalue;
6861 p3values.voffset = foffset;
6862 p3values.hfname= hf_nds_eid;
6863 foffset = foffset+p3values.vlength;
6866 verb_string = "Get Effective Rights -> ";
6867 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6868 p1values.vstring = "";
6869 p1values.vtype = 3; /* Uint32 */
6870 p1values.vdesc = "Version: %d";
6871 p1values.vlength = 4;
6872 p1values.voffset = foffset;
6873 p1values.hfname= hf_nds_ver;
6874 foffset = foffset+p1values.vlength;
6875 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6876 p2values.vstring = "";
6877 p2values.vtype = 3; /* Uint32 */
6878 p2values.vdesc = "Entry ID: 0x%08x";
6879 p2values.vlength = 4;
6881 global_eid = p2values.vvalue;
6882 p2values.voffset = foffset;
6883 p2values.hfname= hf_nds_eid;
6884 foffset = foffset+p2values.vlength;
6885 p3values.vtype = 4; /* String */
6886 p3values.vdesc = "Trustee Name: %s";
6887 p3values.vstring = "";
6888 p3values.mvtype = 1;
6889 p3values.vvalue = 0;
6890 p3values.vlength = 256;
6891 p3values.vlength = tvb_get_letohl(tvb, foffset);
6892 if (p3values.vlength == 0x00)
6897 p3values.voffset = foffset+4;
6898 foffset = foffset + 4;
6899 get_string(tvb, p3values.voffset, p3values.vlength, req_buffer.buffer);
6900 p3values.vstring = req_buffer.buffer;
6901 p3values.hfname= hf_nds_name;
6902 foffset = foffset+p3values.vlength;
6903 foffset += align_4(tvb, foffset);
6904 p4values.vtype = 4; /* String */
6905 p4values.vdesc = "Attribute to be Checked: %s";
6906 p4values.vstring = "";
6907 p4values.mvtype = 0;
6908 p4values.vvalue = 0;
6909 p4values.vlength = 256;
6910 p4values.vlength = tvb_get_letohl(tvb, foffset);
6911 if (p4values.vlength == 0x00)
6916 p4values.voffset = foffset+4;
6917 foffset = foffset + 4;
6918 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
6919 p4values.hfname= hf_nds_name;
6920 foffset = foffset+p4values.vlength;
6921 foffset += align_4(tvb, foffset);
6922 if(p1values.vvalue != 0)
6924 p5values.vtype = 4; /* String */
6925 p5values.vdesc = "Security Equivalence: %s";
6926 p5values.vstring = "";
6927 p5values.mvtype = 1;
6928 p5values.vvalue = 0;
6929 p5values.vlength = 256;
6930 p5values.vlength = tvb_get_letohl(tvb, foffset);
6931 if (p5values.vlength == 0x00)
6936 p5values.voffset = foffset+4;
6937 foffset = foffset + 4;
6938 get_string(tvb, p5values.voffset, p5values.vlength, p5values.vstring);
6939 p5values.hfname= hf_nds_name;
6940 foffset = foffset+p5values.vlength;
6941 foffset += align_4(tvb, foffset);
6945 verb_string = "Add Partition";
6946 p1values.vtype = 0; /* Not Defined */
6949 verb_string = "Remove Partition";
6950 p1values.vtype = 0; /* Not Defined */
6953 verb_string = "List Partitions";
6954 p1values.vvalue = tvb_get_letohl(tvb, foffset);
6955 p1values.vstring = "";
6956 p1values.vtype = 3; /* Uint32 */
6957 p1values.vdesc = "Version: %d";
6958 p1values.vlength = 4;
6959 p1values.voffset = foffset;
6960 p1values.hfname= hf_nds_ver;
6961 foffset = foffset+p1values.vlength;
6962 p2values.vvalue = tvb_get_letohl(tvb, foffset);
6963 p2values.vtype = 5; /* Bitfield */
6964 p2values.vstring = "";
6965 p2values.vdesc = "Request Flags:";
6966 p2values.vlength = 2;
6967 p2values.hfname= hf_nds_rflags;
6968 p2values.voffset = foffset;
6969 p2values.bit1 = "Typeless";
6970 p2values.bit1hfname = hf_nds_bit1;
6971 p2values.bit2 = "All Containers";
6972 p2values.bit2hfname = hf_nds_bit2;
6973 p2values.bit3 = "Slashed";
6974 p2values.bit3hfname = hf_nds_bit3;
6975 p2values.bit4 = "Dotted";
6976 p2values.bit4hfname = hf_nds_bit4;
6977 p2values.bit5 = "Tuned";
6978 p2values.bit5hfname = hf_nds_bit5;
6979 p2values.bit6 = "Not Defined";
6980 p2values.bit6hfname = hf_nds_bit6;
6981 p2values.bit7 = "Not Defined";
6982 p2values.bit7hfname = hf_nds_bit7;
6983 p2values.bit8 = "Not Defined";
6984 p2values.bit8hfname = hf_nds_bit8;
6985 p2values.bit9 = "Not Defined";
6986 p2values.bit9hfname = hf_nds_bit9;
6987 p2values.bit10 = "Not Defined";
6988 p2values.bit10hfname = hf_nds_bit10;
6989 p2values.bit11 = "Not Defined";
6990 p2values.bit11hfname = hf_nds_bit11;
6991 p2values.bit12 = "Not Defined";
6992 p2values.bit12hfname = hf_nds_bit12;
6993 p2values.bit13 = "Not Defined";
6994 p2values.bit13hfname = hf_nds_bit13;
6995 p2values.bit14 = "Not Defined";
6996 p2values.bit14hfname = hf_nds_bit14;
6997 p2values.bit15 = "Not Defined";
6998 p2values.bit15hfname = hf_nds_bit15;
6999 p2values.bit16 = "Not Defined";
7000 p2values.bit16hfname = hf_nds_bit16;
7001 foffset = foffset+p2values.vlength;
7002 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7003 p3values.vstring = "";
7004 p3values.vtype = 3; /* Uint32 */
7005 p3values.vdesc = "Iteration Handle: 0x%08x";
7006 p3values.vlength = 4;
7007 p3values.voffset = foffset;
7008 p3values.hfname= hf_nds_iteration;
7009 foffset = foffset+p3values.vlength;
7010 if(p1values.vvalue == 0)
7012 global_flags = 0x000000c0;
7015 p4values.vvalue = tvb_get_letohs(tvb, foffset);
7016 p4values.vtype = 5; /* Bitfield */
7017 p4values.vstring = "";
7018 p4values.vdesc = "Information Flags (low) Byte:";
7019 p4values.vlength = 2;
7020 p4values.hfname= hf_nds_rflags;
7021 p4values.voffset = foffset;
7022 p4values.bit1 = "Output Flags";
7023 p4values.bit1hfname = hf_bit1l1flagsl;
7024 p4values.bit2 = "Entry ID";
7025 p4values.bit2hfname = hf_bit2l1flagsl;
7026 p4values.bit3 = "Replica State";
7027 p4values.bit3hfname = hf_bit3l1flagsl;
7028 p4values.bit4 = "Modification Timestamp";
7029 p4values.bit4hfname = hf_bit4l1flagsl;
7030 p4values.bit5 = "Purge Time";
7031 p4values.bit5hfname = hf_bit5l1flagsl;
7032 p4values.bit6 = "Local Partition ID";
7033 p4values.bit6hfname = hf_bit6l1flagsl;
7034 p4values.bit7 = "Distinguished Name";
7035 p4values.bit7hfname = hf_bit7l1flagsl;
7036 p4values.bit8 = "Replica Type";
7037 p4values.bit8hfname = hf_bit8l1flagsl;
7038 p4values.bit9 = "Partition Busy";
7039 p4values.bit9hfname = hf_bit9l1flagsl;
7040 p4values.bit10 = "Not Defined";
7041 p4values.bit10hfname = hf_bit10l1flagsl;
7042 p4values.bit11 = "Not Defined";
7043 p4values.bit11hfname = hf_bit11l1flagsl;
7044 p4values.bit12 = "Not Defined";
7045 p4values.bit12hfname = hf_bit12l1flagsl;
7046 p4values.bit13 = "Not Defined";
7047 p4values.bit13hfname = hf_bit13l1flagsl;
7048 p4values.bit14 = "Not Defined";
7049 p4values.bit14hfname = hf_bit14l1flagsl;
7050 p4values.bit15 = "Not Defined";
7051 p4values.bit15hfname = hf_bit15l1flagsl;
7052 p4values.bit16 = "Not Defined";
7053 p4values.bit16hfname = hf_bit16l1flagsl;
7054 global_flags = p4values.vvalue;
7055 foffset = foffset+2;
7056 p5values.vvalue = tvb_get_letohs(tvb, foffset);
7057 p5values.vtype = 5; /* Bitfield */
7058 p5values.vstring = "";
7059 p5values.vdesc = "Information Flags (high) Byte:";
7060 p5values.vlength = 2;
7061 p5values.hfname= hf_nds_rflags;
7062 p5values.voffset = foffset;
7063 p5values.bit1 = "Not Defined";
7064 p5values.bit1hfname = hf_bit1l1flagsl;
7065 p5values.bit2 = "Not Defined";
7066 p5values.bit2hfname = hf_bit2l1flagsl;
7067 p5values.bit3 = "Not Defined";
7068 p5values.bit3hfname = hf_bit3l1flagsl;
7069 p5values.bit4 = "Not Defined";
7070 p5values.bit4hfname = hf_bit4l1flagsl;
7071 p5values.bit5 = "Not Defined";
7072 p5values.bit5hfname = hf_bit5l1flagsl;
7073 p5values.bit6 = "Not Defined";
7074 p5values.bit6hfname = hf_bit6l1flagsl;
7075 p5values.bit7 = "Not Defined";
7076 p5values.bit7hfname = hf_bit7l1flagsl;
7077 p5values.bit8 = "Not Defined";
7078 p5values.bit8hfname = hf_bit8l1flagsl;
7079 p5values.bit9 = "Not Defined";
7080 p5values.bit9hfname = hf_bit9l1flagsl;
7081 p5values.bit10 = "Not Defined";
7082 p5values.bit10hfname = hf_bit10l1flagsl;
7083 p5values.bit11 = "Not Defined";
7084 p5values.bit11hfname = hf_bit11l1flagsl;
7085 p5values.bit12 = "Not Defined";
7086 p5values.bit12hfname = hf_bit12l1flagsl;
7087 p5values.bit13 = "Not Defined";
7088 p5values.bit13hfname = hf_bit13l1flagsl;
7089 p5values.bit14 = "Not Defined";
7090 p5values.bit14hfname = hf_bit14l1flagsl;
7091 p5values.bit15 = "Not Defined";
7092 p5values.bit15hfname = hf_bit15l1flagsl;
7093 p5values.bit16 = "Not Defined";
7094 p5values.bit16hfname = hf_bit16l1flagsl;
7095 foffset = foffset+2;
7096 if(p1values.vvalue == 1)
7100 p6values.vvalue = tvb_get_letohl(tvb, foffset);
7101 p6values.vstring = "";
7102 p6values.vtype = 3; /* Uint32 */
7103 p6values.vdesc = "Partition Root ID: 0x%08x";
7104 p6values.vlength = 4;
7105 p6values.voffset = foffset;
7106 p6values.hfname= hf_nds_partition_root_id;
7107 foffset = foffset+p6values.vlength;
7110 verb_string = "Split Partition";
7111 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7112 nds_version = p1values.vvalue;
7113 p1values.vstring = "";
7114 p1values.vtype = 3; /* Uint32 */
7115 p1values.vdesc = "Version: %d";
7116 p1values.vlength = 4;
7117 p1values.hfname = hf_nds_ver;
7118 p1values.voffset = foffset;
7119 foffset = foffset+p1values.vlength;
7120 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7121 nds_version = p2values.vvalue;
7122 p2values.vstring = "";
7123 p2values.vtype = 3; /* Uint32 */
7124 p2values.vdesc = "Flags: 0x%08x";
7125 p2values.vlength = 4;
7126 p2values.hfname = hf_nds_req_flags;
7127 p2values.voffset = foffset;
7128 foffset = foffset+p2values.vlength;
7129 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7130 p3values.vstring = "";
7131 p3values.vtype = 3; /* Uint32 */
7132 p3values.vdesc = "New Partition Root ID: 0x%08x";
7133 p3values.vlength = 4;
7134 p3values.voffset = foffset;
7135 p3values.hfname= hf_nds_new_part_id;
7136 foffset = foffset+p3values.vlength;
7139 verb_string = "Join Partitions";
7140 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7141 nds_version = p1values.vvalue;
7142 p1values.vstring = "";
7143 p1values.vtype = 3; /* Uint32 */
7144 p1values.vdesc = "Version: %d";
7145 p1values.vlength = 4;
7146 p1values.hfname = hf_nds_ver;
7147 p1values.voffset = foffset;
7148 foffset = foffset+p1values.vlength;
7149 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7150 nds_version = p2values.vvalue;
7151 p2values.vstring = "";
7152 p2values.vtype = 3; /* Uint32 */
7153 p2values.vdesc = "Flags: 0x%08x";
7154 p2values.vlength = 4;
7155 p2values.hfname = hf_nds_req_flags;
7156 p2values.voffset = foffset;
7157 foffset = foffset+p2values.vlength;
7158 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7159 p3values.vstring = "";
7160 p3values.vtype = 3; /* Uint32 */
7161 p3values.vdesc = "Child Partition Root ID: 0x%08x";
7162 p3values.vlength = 4;
7163 p3values.voffset = foffset;
7164 p3values.hfname= hf_nds_child_part_id;
7165 foffset = foffset+p3values.vlength;
7168 verb_string = "Add Replica";
7169 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7170 nds_version = p1values.vvalue;
7171 p1values.vstring = "";
7172 p1values.vtype = 3; /* Uint32 */
7173 p1values.vdesc = "Version: %d";
7174 p1values.vlength = 4;
7175 p1values.hfname = hf_nds_ver;
7176 p1values.voffset = foffset;
7177 foffset = foffset+p1values.vlength;
7178 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7179 nds_version = p2values.vvalue;
7180 p2values.vstring = "";
7181 p2values.vtype = 3; /* Uint32 */
7182 p2values.vdesc = "Flags: 0x%08x";
7183 p2values.vlength = 4;
7184 p2values.hfname = hf_nds_req_flags;
7185 p2values.voffset = foffset;
7186 foffset = foffset+p2values.vlength;
7187 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7188 p3values.vstring = "";
7189 p3values.vtype = 3; /* Uint32 */
7190 p3values.vdesc = "Master Partition Root ID: 0x%08x";
7191 p3values.vlength = 4;
7192 p3values.voffset = foffset;
7193 p3values.hfname= hf_nds_master_part_id;
7194 foffset = foffset+p3values.vlength;
7195 p4values.vvalue = tvb_get_letohl(tvb, foffset);
7196 p4values.vstring = match_strval(p4values.vvalue, nds_replica_type);
7197 if(p4values.vstring == NULL)
7199 p4values.vstring = "No Replica Type Found";
7201 p4values.vtype = 4; /* String */
7202 p4values.vdesc = "Replica Type: %s";
7203 p4values.vlength = 4;
7204 p4values.voffset = foffset;
7205 p4values.mvtype = 0;
7206 p4values.hfname= hf_replica_type;
7207 foffset = foffset + p4values.vlength;
7208 p5values.vtype = 4; /* String */
7209 p5values.vdesc = "Target Server Name: %s";
7210 p5values.vstring = "";
7211 p5values.mvtype = 0;
7212 p5values.vvalue = 0;
7213 p5values.vlength = 256;
7214 p5values.vlength = tvb_get_letohl(tvb, foffset);
7215 if (p5values.vlength == 0x00)
7220 p5values.voffset = foffset+4;
7221 foffset = foffset + 4;
7222 get_string(tvb, p5values.voffset, p5values.vlength, p5values.vstring);
7223 p5values.hfname= hf_nds_target_name;
7226 verb_string = "Remove Replica";
7227 p1values.vtype = 0; /* Not Defined */
7230 verb_string = "Open Stream -> ";
7231 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7232 nds_version = p1values.vvalue;
7233 p1values.vstring = "";
7234 p1values.vtype = 3; /* Uint32 */
7235 p1values.vdesc = "Version: %d";
7236 p1values.vlength = 4;
7237 p1values.hfname = hf_nds_ver;
7238 p1values.voffset = foffset;
7239 foffset = foffset+p1values.vlength;
7240 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7241 nds_version = p2values.vvalue;
7242 p2values.vstring = "";
7243 p2values.vtype = 3; /* Uint32 */
7244 p2values.vdesc = "Streams Flags: 0x%08x";
7245 p2values.vlength = 4;
7246 p2values.hfname = hf_nds_stream_flags;
7247 p2values.voffset = foffset;
7248 foffset = foffset+p2values.vlength;
7249 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7250 p3values.vstring = "";
7251 p3values.vtype = 3; /* Uint32 */
7252 p3values.vdesc = "Entry ID: 0x%08x";
7253 p3values.vlength = 4;
7255 global_eid = p3values.vvalue;
7256 p3values.voffset = foffset;
7257 p3values.hfname= hf_nds_eid;
7258 foffset = foffset+p3values.vlength;
7259 p4values.vtype = 4; /* String */
7260 p4values.vdesc = "Stream Name: %s";
7261 p4values.vstring = "";
7262 p4values.mvtype = 1;
7263 p4values.vvalue = 0;
7264 p4values.vlength = 256;
7265 p4values.vlength = tvb_get_letohl(tvb, foffset);
7266 if (p4values.vlength == 0x00)
7271 p4values.voffset = foffset+4;
7273 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
7274 foffset += p4values.vlength;
7275 foffset += align_4(tvb, foffset);
7276 p4values.hfname= hf_nds_stream_name;
7279 verb_string = "Search Filter";
7280 p1values.vtype = 0; /* Not Defined */
7283 verb_string = "Create Subordinate Reference";
7284 p1values.vtype = 0; /* Not Defined */
7287 verb_string = "Link Replica";
7288 p1values.vtype = 0; /* Not Defined */
7291 verb_string = "Change Replica Type";
7292 p1values.vtype = 0; /* Not Defined */
7295 verb_string = "Start Update Schema";
7296 p1values.vtype = 0; /* Not Defined */
7299 verb_string = "End Update Schema";
7300 p1values.vtype = 0; /* Not Defined */
7303 verb_string = "Update Schema";
7304 p1values.vtype = 0; /* Not Defined */
7307 verb_string = "Start Update Replica";
7308 p1values.vtype = 0; /* Not Defined */
7311 verb_string = "End Update Replica";
7312 p1values.vtype = 0; /* Not Defined */
7315 verb_string = "Update Replica";
7316 p1values.vtype = 0; /* Not Defined */
7319 verb_string = "Synchronize Partition";
7320 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7321 nds_version = p1values.vvalue;
7322 p1values.vstring = "";
7323 p1values.vtype = 3; /* Uint32 */
7324 p1values.vdesc = "Version: %d";
7325 p1values.vlength = 4;
7326 p1values.hfname = hf_nds_ver;
7327 p1values.voffset = foffset;
7328 foffset = foffset+p1values.vlength;
7329 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7330 nds_version = p2values.vvalue;
7331 p2values.vstring = "";
7332 p2values.vtype = 3; /* Uint32 */
7333 p2values.vdesc = "Flags: 0x%08x";
7334 p2values.vlength = 4;
7335 p2values.hfname = hf_nds_req_flags;
7336 p2values.voffset = foffset;
7337 foffset = foffset+p2values.vlength;
7338 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7339 p3values.vstring = "";
7340 p3values.vtype = 3; /* Uint32 */
7341 p3values.vdesc = "Time Delay in Seconds: %d";
7342 p3values.vlength = 4;
7343 p3values.voffset = foffset;
7344 p3values.hfname= hf_nds_time_delay;
7345 foffset = foffset+p3values.vlength;
7346 if(p1values.vvalue == 0)
7348 p4values.vtype = 4; /* String */
7349 p4values.vdesc = "Root Most Object Name: %s";
7350 p4values.vstring = "";
7351 p4values.mvtype = 1;
7352 p4values.vvalue = 0;
7353 p4values.vlength = 256;
7354 p4values.vlength = tvb_get_letohl(tvb, foffset);
7355 if (p4values.vlength == 0x00)
7360 p4values.voffset = foffset+4;
7362 get_string(tvb, p4values.voffset, p4values.vlength, p4values.vstring);
7363 foffset += p4values.vlength;
7364 foffset += align_4(tvb, foffset);
7365 p4values.hfname= hf_nds_root_name;
7369 p4values.vvalue = tvb_get_letohl(tvb, foffset);
7370 p4values.vstring = "";
7371 p4values.vtype = 3; /* Uint32 */
7372 p4values.vdesc = "Entry ID: 0x%08x";
7373 p4values.vlength = 4;
7375 global_eid = p4values.vvalue;
7376 p4values.voffset = foffset;
7377 p4values.hfname= hf_nds_eid;
7378 foffset = foffset+p4values.vlength;
7380 global_eid = p4values.vvalue;
7384 verb_string = "Synchronize Schema";
7385 p1values.vtype = 0; /* Not Defined */
7388 verb_string = "Read Syntaxes";
7389 p1values.vtype = 0; /* Not Defined */
7392 verb_string = "Get Replica Root ID";
7393 p1values.vtype = 0; /* Not Defined */
7396 verb_string = "Begin Move Entry";
7397 p1values.vtype = 0; /* Not Defined */
7400 verb_string = "Finish Move Entry";
7401 p1values.vtype = 0; /* Not Defined */
7404 verb_string = "Release Moved Entry";
7405 p1values.vtype = 0; /* Not Defined */
7408 verb_string = "Backup Entry";
7409 p1values.vtype = 0; /* Not Defined */
7412 verb_string = "Restore Entry";
7413 p1values.vtype = 0; /* Not Defined */
7416 verb_string = "Save DIB";
7417 p1values.vtype = 0; /* Not Defined */
7420 verb_string = "Control";
7421 p1values.vtype = 0; /* Not Defined */
7424 verb_string = "Remove Backlink";
7425 p1values.vtype = 0; /* Not Defined */
7428 verb_string = "Close Iteration";
7429 p1values.vtype = 0; /* Not Defined */
7432 verb_string = "Mutate Entry";
7433 p1values.vtype = 0; /* Not Defined */
7436 verb_string = "Audit Skulking";
7437 p1values.vtype = 0; /* Not Defined */
7440 verb_string = "Get Server Address";
7441 p1values.vvalue = 0;
7444 verb_string = "Set Keys";
7445 p1values.vtype = 0; /* Not Defined */
7448 verb_string = "Change Password";
7449 p1values.vtype = 0; /* Not Defined */
7452 verb_string = "Verify Password";
7453 p1values.vtype = 0; /* Not Defined */
7456 verb_string = "Begin Login";
7457 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7458 p1values.vstring = "";
7459 p1values.vtype = 3; /* Uint32 */
7460 p1values.vdesc = "Version: %d";
7461 p1values.vlength = 4;
7462 p1values.voffset = foffset;
7463 p1values.hfname= hf_nds_ver;
7464 foffset = foffset+p1values.vlength;
7465 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7466 p2values.vstring = "";
7467 p2values.vtype = 3; /* Uint32 */
7468 p2values.vdesc = "Entry ID: 0x%08x";
7469 p2values.vlength = 4;
7471 global_eid = p2values.vvalue;
7472 p2values.voffset = foffset;
7473 p2values.hfname= hf_nds_eid;
7474 foffset = foffset+p2values.vlength;
7477 verb_string = "Finish Login";
7478 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7479 p1values.vstring = "";
7480 p1values.vtype = 3; /* Uint32 */
7481 p1values.vdesc = "Reply Buffer Size: %d";
7482 p1values.vlength = 4;
7483 p1values.voffset = foffset;
7484 p1values.hfname= hf_nds_buffer_size;
7485 foffset = foffset+p1values.vlength;
7486 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7487 p2values.vstring = "";
7488 p2values.vtype = 3; /* Uint32 */
7489 p2values.vdesc = "Version: %d";
7490 p2values.vlength = 4;
7491 p2values.voffset = foffset;
7492 p2values.hfname= hf_nds_ver;
7493 foffset = foffset+p2values.vlength;
7494 p3values.vvalue = tvb_get_letohl(tvb, foffset);
7495 p3values.vstring = "";
7496 p3values.vtype = 3; /* Uint32 */
7497 p3values.vdesc = "Entry ID: 0x%08x";
7498 p3values.vlength = 4;
7500 global_eid = p3values.vvalue;
7501 p3values.voffset = foffset;
7502 p3values.hfname= hf_nds_eid;
7503 foffset = foffset+p3values.vlength;
7506 verb_string = "Begin Authentication";
7507 p1values.vvalue = tvb_get_letohl(tvb, foffset);
7508 p1values.vstring = "";
7509 p1values.vtype = 3; /* Uint32 */
7510 p1values.vdesc = "Version: %d";
7511 p1values.vlength = 4;
7512 p1values.voffset = foffset;
7513 p1values.hfname= hf_nds_ver;
7514 foffset = foffset+p1values.vlength;
7515 p2values.vvalue = tvb_get_letohl(tvb, foffset);
7516 p2values.vstring = "";
7517 p2values.vtype = 3; /* Uint32 */
7518 p2values.vdesc = "Entry ID: 0x%08x";
7519 p2values.vlength = 4;
7521 global_eid = p2values.vvalue;
7522 p2values.voffset = foffset;
7523 p2values.hfname= hf_nds_eid;
7524 foffset = foffset+p2values.vlength;
7527 verb_string = "Finish Authentication";
7530 verb_string = "Logout";
7531 p1values.vtype = 0; /* Not Defined */
7534 verb_string = "Repair Ring";
7535 p1values.vtype = 0; /* Not Defined */
7538 verb_string = "Repair Timestamps";
7539 p1values.vtype = 0; /* Not Defined */
7542 verb_string = "Create Back Link";
7543 p1values.vtype = 0; /* Not Defined */
7546 verb_string = "Delete External Reference";
7547 p1values.vtype = 0; /* Not Defined */
7550 verb_string = "Rename External Reference";
7551 p1values.vtype = 0; /* Not Defined */
7554 verb_string = "Create Directory Entry";
7555 p1values.vtype = 0; /* Not Defined */
7558 verb_string = "Remove Directory Entry";
7559 p1values.vtype = 0; /* Not Defined */
7562 verb_string = "Designate New Master";
7563 p1values.vtype = 0; /* Not Defined */
7566 verb_string = "Change Tree Name";
7567 p1values.vtype = 0; /* Not Defined */
7570 verb_string = "Partition Entry Count";
7571 p1values.vtype = 0; /* Not Defined */
7574 verb_string = "Check Login Restrictions";
7575 p1values.vtype = 0; /* Not Defined */
7578 verb_string = "Start Join";
7579 p1values.vtype = 0; /* Not Defined */
7582 verb_string = "Low Level Split";
7583 p1values.vtype = 0; /* Not Defined */
7586 verb_string = "Low Level Join";
7587 p1values.vtype = 0; /* Not Defined */
7590 verb_string = "Abort Low Level Join";
7591 p1values.vtype = 0; /* Not Defined */
7594 verb_string = "Get All Servers";
7595 p1values.vtype = 0; /* Not Defined */
7598 verb_string = "NDS Continuation Fragment";
7599 p1values.vtype = 0; /* Not Defined */
7602 /* Fill in the INFO column. */
7603 if (check_col(pinfo->cinfo, COL_INFO)) {
7606 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
7607 if (nds_frag != 0xffffffff) {
7608 col_add_fstr(pinfo->cinfo, COL_INFO, "C Continue NDS Fragment %08x", nds_frag);
7611 col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string);
7615 col_add_fstr(pinfo->cinfo, COL_INFO,
7616 "C Unknown Function %d (0x%02x)",
7621 if (!pinfo->fd->flags.visited) {
7623 /* This is the first time we've looked at this packet.
7624 Keep track of the address and connection whence the request
7625 came, and the address and connection to which the request
7626 is being sent, so that we can match up calls with replies.
7627 (We don't include the sequence number, as we may want
7628 to have all packets over the same connection treated
7629 as being part of a single conversation so that we can
7630 let the user select that conversation to be displayed.) */
7632 conversation = find_conversation(&pinfo->src, &pinfo->dst,
7633 PT_NCP, nw_connection, nw_connection, 0);
7635 if (conversation == NULL) {
7636 /* It's not part of any conversation - create a new one. */
7637 conversation = conversation_new(&pinfo->src, &pinfo->dst,
7638 PT_NCP, nw_connection, nw_connection, 0);
7641 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
7642 request_value->req_frame_num = pinfo->fd->num;
7644 /* If this is the first time we're examining the packet,
7645 * check to see if this NCP type uses a "request condition".
7646 * If so, we have to build a proto_tree because request conditions
7647 * use display filters to work, and without a proto_tree,
7648 * display filters can't possibly work. If we already have
7649 * a proto_tree, then wonderful. If we don't, we need to build
7651 if (ncp_rec && !ncp_tree) {
7654 temp_tree = proto_tree_create_root();
7655 proto_tree_set_visible(temp_tree, FALSE);
7656 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
7657 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
7662 /* If the dissection throws an exception, be sure to free
7663 * the temporary proto_tree that was created. Because of the
7664 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
7665 * block; it has to be in the same scope as the terminating
7666 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
7667 * call CLEANUP_POP and friends, but the value of temp_tree is
7668 * NULL if no cleanup is needed, and non-null if cleanup is needed.
7671 CLEANUP_PUSH(free_proto_tree, temp_tree);
7673 conversation = find_conversation(&pinfo->src, &pinfo->dst,
7674 PT_NCP, nw_connection, nw_connection, 0);
7679 case NCP_BROADCAST_SLOT:
7683 case NCP_SERVICE_REQUEST:
7685 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
7686 if (ncp_rec && ncp_rec->request_ptvc)
7688 clear_repeat_vars();
7689 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
7691 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
7692 func, "Function: %d (0x%02X), %s",
7693 func, func, ncp_rec ? ncp_rec->name : "Unknown");
7695 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
7696 subfunc, "SubFunction: %d (0x%02x)",
7699 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, 8, 4,
7702 if (nds_frag == 0xffffffff) {
7704 proto_tree_add_item(ncp_tree, hf_ncp_fragment_size, tvb, 12, 4, TRUE);
7706 proto_tree_add_item(ncp_tree, hf_ncp_message_size, tvb, 16, 4, TRUE);
7708 proto_tree_add_item(ncp_tree, hf_ncp_nds_flag, tvb, 20, 4, FALSE);
7710 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 24, 4,
7711 nds_verb, "NDS Verb: %d, (0x%02x), %s",
7712 nds_verb, nds_verb, verb_string);
7713 if (p1values.vtype != 0) {
7714 switch (p1values.vtype) {
7716 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7717 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
7720 case 2: /* uint16 */
7721 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7722 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
7725 case 3: /* uint32 */
7726 proto_tree_add_uint_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7727 p1values.vlength, p1values.vvalue, p1values.vdesc,
7730 case 4: /* string */
7731 proto_tree_add_string_format(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7732 p1values.vlength, p1values.vstring, p1values.vdesc, p1values.vstring);
7733 if (p1values.mvtype == 1)
7735 if (check_col(pinfo->cinfo, COL_INFO))
7737 col_append_str(pinfo->cinfo, COL_INFO, p1values.vstring);
7741 case 5: /* bitfield */
7742 process_bitfield(ncp_tree, tvb, &p1values);
7744 case 6: /*multivalue uint32 */
7745 process_multivalues(ncp_tree, tvb, &p1values);
7746 if (p1values.mvtype == 1 || p1values.mvtype == 10)
7748 if (p1values.mvtype == 10)
7750 global_object_name = p1values.vstring;
7752 if (check_col(pinfo->cinfo, COL_INFO))
7754 col_append_str(pinfo->cinfo, COL_INFO, p1values.vstring);
7759 proto_tree_add_bytes(ncp_tree, p1values.hfname, tvb, p1values.voffset,
7760 p1values.vlength, tvb_get_ptr(tvb, p1values.voffset, p1values.vvalue));
7763 proto_tree_add_item(ncp_tree, p1values.hfname, tvb, p1values.voffset, p1values.vlength, TRUE);
7766 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, p1values.voffset,
7767 p1values.vlength, p1values.vtype, "NDS Parameter not defined %d",
7771 switch (p2values.vtype) {
7774 case 2: /* uint16 */
7776 case 3: /* uint32 */
7777 proto_tree_add_uint_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
7778 p2values.vlength, p2values.vvalue, p2values.vdesc,
7781 case 4: /* string */
7782 proto_tree_add_string_format(ncp_tree, p2values.hfname, tvb, p2values.voffset,
7783 p2values.vlength, p2values.vstring, p2values.vdesc, p2values.vstring);
7784 if (p2values.mvtype == 1)
7786 if (check_col(pinfo->cinfo, COL_INFO))
7788 col_append_str(pinfo->cinfo, COL_INFO, p2values.vstring);
7792 case 5: /* boolean */
7793 process_bitfield(ncp_tree, tvb, &p2values);
7795 case 6: /*multivalue uint32 */
7796 process_multivalues(ncp_tree, tvb, &p2values);
7797 if (p2values.mvtype == 1 || p2values.mvtype == 10)
7799 if (p2values.mvtype == 10)
7801 global_object_name = p1values.vstring;
7803 if (check_col(pinfo->cinfo, COL_INFO))
7805 col_append_str(pinfo->cinfo, COL_INFO, p2values.vstring);
7810 proto_tree_add_bytes(ncp_tree, p2values.hfname, tvb, p2values.voffset,
7811 p2values.vlength, tvb_get_ptr(tvb, p2values.voffset, p2values.vvalue));
7814 proto_tree_add_item(ncp_tree, p2values.hfname, tvb, p2values.voffset, p2values.vlength, TRUE);
7819 switch (p3values.vtype) {
7822 case 2: /* uint16 */
7824 case 3: /* uint32 */
7825 proto_tree_add_uint_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
7826 p3values.vlength, p3values.vvalue, p3values.vdesc,
7829 case 4: /* string */
7830 proto_tree_add_string_format(ncp_tree, p3values.hfname, tvb, p3values.voffset,
7831 p3values.vlength, p3values.vstring, p3values.vdesc, p3values.vstring);
7832 if (p3values.mvtype == 1)
7834 if (check_col(pinfo->cinfo, COL_INFO))
7836 col_append_str(pinfo->cinfo, COL_INFO, p3values.vstring);
7840 case 5: /* boolean */
7841 process_bitfield(ncp_tree, tvb, &p3values);
7843 case 6: /*multivalue uint32 */
7844 process_multivalues(ncp_tree, tvb, &p3values);
7845 if (p3values.mvtype == 1 || p3values.mvtype == 10)
7847 if (p3values.mvtype == 10)
7849 global_object_name = p3values.vstring;
7851 if (check_col(pinfo->cinfo, COL_INFO))
7853 col_append_str(pinfo->cinfo, COL_INFO, p3values.vstring);
7858 proto_tree_add_bytes(ncp_tree, p3values.hfname, tvb, p3values.voffset,
7859 p3values.vlength, tvb_get_ptr(tvb, p3values.voffset, p3values.vvalue));
7862 proto_tree_add_item(ncp_tree, p3values.hfname, tvb, p3values.voffset, p3values.vlength, TRUE);
7867 switch (p4values.vtype) {
7870 case 2: /* uint16 */
7872 case 3: /* uint32 */
7873 proto_tree_add_uint_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
7874 p4values.vlength, p4values.vvalue, p4values.vdesc,
7877 case 4: /* string */
7878 proto_tree_add_string_format(ncp_tree, p4values.hfname, tvb, p4values.voffset,
7879 p4values.vlength, p4values.vstring, p4values.vdesc, p4values.vstring);
7880 if (p4values.mvtype == 1)
7882 if (check_col(pinfo->cinfo, COL_INFO))
7884 col_append_str(pinfo->cinfo, COL_INFO, p4values.vstring);
7888 case 5: /* boolean */
7889 process_bitfield(ncp_tree, tvb, &p4values);
7891 case 6: /*multivalue uint32 */
7892 process_multivalues(ncp_tree, tvb, &p4values);
7893 if (p4values.mvtype == 1 || p4values.mvtype == 10)
7895 if (p4values.mvtype == 10)
7897 global_object_name = p4values.vstring;
7899 if (check_col(pinfo->cinfo, COL_INFO))
7901 col_append_str(pinfo->cinfo, COL_INFO, p4values.vstring);
7906 proto_tree_add_bytes(ncp_tree, p4values.hfname, tvb, p4values.voffset,
7907 p4values.vlength, tvb_get_ptr(tvb, p4values.voffset, p4values.vvalue));
7910 proto_tree_add_item(ncp_tree, p4values.hfname, tvb, p4values.voffset, p4values.vlength, TRUE);
7915 switch (p5values.vtype) {
7918 case 2: /* uint16 */
7920 case 3: /* uint32 */
7921 proto_tree_add_uint_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
7922 p5values.vlength, p5values.vvalue, p5values.vdesc,
7925 case 4: /* string */
7926 proto_tree_add_string_format(ncp_tree, p5values.hfname, tvb, p5values.voffset,
7927 p5values.vlength, p5values.vstring, p5values.vdesc, p5values.vstring);
7928 if (p5values.mvtype == 1 || p5values.mvtype == 10)
7930 if (p5values.mvtype == 10)
7932 global_object_name = p5values.vstring;
7934 if (check_col(pinfo->cinfo, COL_INFO))
7936 col_append_str(pinfo->cinfo, COL_INFO, p5values.vstring);
7940 case 5: /* boolean */
7941 process_bitfield(ncp_tree, tvb, &p5values);
7943 case 6: /*multivalue uint32 */
7944 process_multivalues(ncp_tree, tvb, &p5values);
7945 if (p5values.mvtype == 1)
7947 if (check_col(pinfo->cinfo, COL_INFO))
7949 col_append_str(pinfo->cinfo, COL_INFO, p5values.vstring);
7954 proto_tree_add_bytes(ncp_tree, p5values.hfname, tvb, p5values.voffset,
7955 p5values.vlength, tvb_get_ptr(tvb, p5values.voffset, p5values.vvalue));
7958 proto_tree_add_item(ncp_tree, p5values.hfname, tvb, p5values.voffset, p5values.vlength, TRUE);
7963 switch (p6values.vtype) {
7966 case 2: /* uint16 */
7968 case 3: /* uint32 */
7969 proto_tree_add_uint_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
7970 p6values.vlength, p6values.vvalue, p6values.vdesc,
7973 case 4: /* string */
7974 proto_tree_add_string_format(ncp_tree, p6values.hfname, tvb, p6values.voffset,
7975 p6values.vlength, p6values.vstring, p6values.vdesc, p6values.vstring);
7976 if (p6values.mvtype == 1 || p6values.mvtype == 10)
7978 if (p6values.mvtype == 10)
7980 global_object_name = p6values.vstring;
7982 if (check_col(pinfo->cinfo, COL_INFO))
7984 col_append_str(pinfo->cinfo, COL_INFO, p6values.vstring);
7988 case 5: /* boolean */
7989 process_bitfield(ncp_tree, tvb, &p6values);
7991 case 6: /*multivalue uint32 */
7992 process_multivalues(ncp_tree, tvb, &p6values);
7993 if (p6values.mvtype == 1)
7995 if (check_col(pinfo->cinfo, COL_INFO))
7997 col_append_str(pinfo->cinfo, COL_INFO, p6values.vstring);
8002 proto_tree_add_bytes(ncp_tree, p6values.hfname, tvb, p6values.voffset,
8003 p6values.vlength, tvb_get_ptr(tvb, p6values.voffset, p6values.vvalue));
8006 proto_tree_add_item(ncp_tree, p6values.hfname, tvb, p6values.voffset, p6values.vlength, TRUE);
8011 switch (p7values.vtype) {
8014 case 2: /* uint16 */
8016 case 3: /* uint32 */
8017 proto_tree_add_uint_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
8018 p7values.vlength, p7values.vvalue, p7values.vdesc,
8021 case 4: /* string */
8022 proto_tree_add_string_format(ncp_tree, p7values.hfname, tvb, p7values.voffset,
8023 p7values.vlength, p7values.vstring, p7values.vdesc, p7values.vstring);
8024 if (p7values.mvtype == 1 || p7values.mvtype == 10)
8026 if (p7values.mvtype == 10)
8028 global_object_name = p7values.vstring;
8030 if (check_col(pinfo->cinfo, COL_INFO))
8032 col_append_str(pinfo->cinfo, COL_INFO, p7values.vstring);
8036 case 5: /* boolean */
8037 process_bitfield(ncp_tree, tvb, &p7values);
8039 case 6: /*multivalue uint32 */
8040 process_multivalues(ncp_tree, tvb, &p7values);
8041 if (p7values.mvtype == 1)
8043 if (check_col(pinfo->cinfo, COL_INFO))
8045 col_append_str(pinfo->cinfo, COL_INFO, p7values.vstring);
8050 proto_tree_add_bytes(ncp_tree, p7values.hfname, tvb, p7values.voffset,
8051 p7values.vlength, tvb_get_ptr(tvb, p7values.voffset, p7values.vvalue));
8054 proto_tree_add_item(ncp_tree, p7values.hfname, tvb, p7values.voffset, p7values.vlength, TRUE);
8059 switch (p8values.vtype) {
8062 case 2: /* uint16 */
8064 case 3: /* uint32 */
8065 proto_tree_add_uint_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
8066 p8values.vlength, p8values.vvalue, p8values.vdesc,
8069 case 4: /* string */
8070 proto_tree_add_string_format(ncp_tree, p8values.hfname, tvb, p8values.voffset,
8071 p8values.vlength, p8values.vstring, p8values.vdesc, p8values.vstring);
8072 if (p8values.mvtype == 1)
8074 if (check_col(pinfo->cinfo, COL_INFO))
8076 col_append_str(pinfo->cinfo, COL_INFO, p8values.vstring);
8080 case 5: /* boolean */
8081 process_bitfield(ncp_tree, tvb, &p8values);
8083 case 6: /*multivalue uint32 */
8084 process_multivalues(ncp_tree, tvb, &p8values);
8085 if (p8values.mvtype == 1 || p8values.mvtype == 10)
8087 if (p8values.mvtype == 10)
8089 global_object_name = p8values.vstring;
8091 if (check_col(pinfo->cinfo, COL_INFO))
8093 col_append_str(pinfo->cinfo, COL_INFO, p8values.vstring);
8098 proto_tree_add_bytes(ncp_tree, p8values.hfname, tvb, p8values.voffset,
8099 p8values.vlength, tvb_get_ptr(tvb, p8values.voffset, p8values.vvalue));
8102 proto_tree_add_item(ncp_tree, p8values.hfname, tvb, p8values.voffset, p8values.vlength, TRUE);
8107 switch (p9values.vtype) {
8110 case 2: /* uint16 */
8112 case 3: /* uint32 */
8113 proto_tree_add_uint_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
8114 p9values.vlength, p9values.vvalue, p9values.vdesc,
8117 case 4: /* string */
8118 proto_tree_add_string_format(ncp_tree, p9values.hfname, tvb, p9values.voffset,
8119 p9values.vlength, p9values.vstring, p9values.vdesc, p9values.vstring);
8120 if (p9values.mvtype == 1)
8122 if (check_col(pinfo->cinfo, COL_INFO))
8124 col_append_str(pinfo->cinfo, COL_INFO, p9values.vstring);
8128 case 5: /* boolean */
8129 process_bitfield(ncp_tree, tvb, &p9values);
8131 case 6: /*multivalue uint32 */
8132 process_multivalues(ncp_tree, tvb, &p9values);
8133 if (p9values.mvtype == 1 || p9values.mvtype == 10)
8135 if (p9values.mvtype == 10)
8137 global_object_name = p9values.vstring;
8139 if (check_col(pinfo->cinfo, COL_INFO))
8141 col_append_str(pinfo->cinfo, COL_INFO, p9values.vstring);
8146 proto_tree_add_bytes(ncp_tree, p9values.hfname, tvb, p9values.voffset,
8147 p9values.vlength, tvb_get_ptr(tvb, p9values.voffset, p9values.vvalue));
8150 proto_tree_add_item(ncp_tree, p9values.hfname, tvb, p9values.voffset, p9values.vlength, TRUE);
8157 /* For NDS requests with just an EID, resolve name from hash table. */
8158 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
8159 if (request_eid_value) {
8160 global_object_name = request_eid_value->object_name;
8161 if (check_col(pinfo->cinfo, COL_INFO))
8163 col_append_str(pinfo->cinfo, COL_INFO, ", Object Name - ");
8164 col_append_str(pinfo->cinfo, COL_INFO, global_object_name);
8171 request_value->nds_request_verb = nds_verb;
8172 request_value->nds_version = nds_version;
8173 request_value->object_name = global_object_name;
8174 request_value->req_nds_flags = global_flags;
8183 ptvcursor_free(ptvc);
8185 /* Free the temporary proto_tree */
8186 CLEANUP_CALL_AND_POP;
8192 dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
8193 guint16 nw_connection, guint8 sequence,
8194 guint16 type, proto_tree *ncp_tree)
8196 guint8 func, subfunc = 0;
8197 ncp_req_hash_value *request_value = NULL;
8198 const ncp_record *ncp_rec = NULL;
8199 conversation_t *conversation;
8200 ptvcursor_t *ptvc = NULL;
8201 proto_tree *temp_tree = NULL;
8202 guint32 nds_version = 0;
8203 gint length_remaining = 0;
8204 char flags_str[1+3+1+3+1+3+1+3+1+1];
8206 proto_tree *flags_tree;
8209 guint32 nds_flag_tree = 0x00020000;
8210 guint32 nds_flag_depth = 0x00000002;
8211 guint32 nds_flag_rev = 0x00000004;
8212 guint32 nds_flag_flags = 0x00000008;
8214 func = tvb_get_guint8(tvb, 6);
8215 subfunc = tvb_get_guint8(tvb, 7);
8217 ncp_rec = ncp_record_find(func, subfunc);
8219 /* Fill in the INFO column. */
8220 if (check_col(pinfo->cinfo, COL_INFO))
8225 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
8226 col_add_fstr(pinfo->cinfo, COL_INFO, "C Ping for NDS");
8230 if (!pinfo->fd->flags.visited)
8233 /* This is the first time we've looked at this packet.
8234 Keep track of the address and connection whence the request
8235 came, and the address and connection to which the request
8236 is being sent, so that we can match up calls with replies.
8237 (We don't include the sequence number, as we may want
8238 to have all packets over the same connection treated
8239 as being part of a single conversation so that we can
8240 let the user select that conversation to be displayed.) */
8242 conversation = find_conversation(&pinfo->src, &pinfo->dst,
8243 PT_NCP, nw_connection, nw_connection, 0);
8245 if (conversation == NULL)
8247 /* It's not part of any conversation - create a new one. */
8248 conversation = conversation_new(&pinfo->src, &pinfo->dst,
8249 PT_NCP, nw_connection, nw_connection, 0);
8252 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
8253 request_value->req_frame_num = pinfo->fd->num;
8255 /* If this is the first time we're examining the packet,
8256 * check to see if this NCP type uses a "request condition".
8257 * If so, we have to build a proto_tree because request conditions
8258 * use display filters to work, and without a proto_tree,
8259 * display filters can't possibly work. If we already have
8260 * a proto_tree, then wonderful. If we don't, we need to build
8266 temp_tree = proto_tree_create_root();
8267 proto_tree_set_visible(temp_tree, FALSE);
8268 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
8269 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
8275 /* If the dissection throws an exception, be sure to free
8276 * the temporary proto_tree that was created. Because of the
8277 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
8278 * block; it has to be in the same scope as the terminating
8279 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
8280 * call CLEANUP_POP and friends, but the value of temp_tree is
8281 * NULL if no cleanup is needed, and non-null if cleanup is needed.
8284 CLEANUP_PUSH(free_proto_tree, temp_tree);
8286 conversation = find_conversation(&pinfo->src, &pinfo->dst,
8287 PT_NCP, nw_connection, nw_connection, 0);
8291 case NCP_BROADCAST_SLOT:
8295 case NCP_SERVICE_REQUEST:
8296 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
8297 func, "Function: %d (0x%02X), %s",
8298 func, func, ncp_rec ? ncp_rec->name : "Unknown");
8300 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
8301 subfunc, "SubFunction: %d (0x%02x)",
8304 proto_tree_add_uint(ncp_tree, hf_nds_version, tvb, 8, 4,
8307 length_remaining = tvb_length_remaining(tvb, 8);
8308 if (length_remaining > 6)
8310 nds_flags = tvb_get_letohl(tvb, 12);
8311 strcpy(flags_str, " ");
8313 if (nds_flags & nds_flag_tree)
8315 strcat(flags_str, sep);
8316 strcat(flags_str, "Tree");
8319 if (nds_flags & nds_flag_depth)
8321 strcat(flags_str, sep);
8322 strcat(flags_str, "Depth");
8325 if (nds_flags & nds_flag_rev)
8327 strcat(flags_str, sep);
8328 strcat(flags_str, "Revision");
8330 if (nds_flags & nds_flag_flags)
8332 strcat(flags_str, sep);
8333 strcat(flags_str, "Flags");
8335 if (flags_str[0] != '\0')
8337 strcat(flags_str, ")");
8338 tinew = proto_tree_add_uint_format(ncp_tree, hf_nds_flags,
8339 tvb, 12, 4, nds_flags, "Flags: 0x%08x -%s", nds_flags,
8342 flags_tree = proto_item_add_subtree(tinew, ett_nds);
8346 request_value->req_nds_flags = nds_flags;
8349 proto_tree_add_item(flags_tree, hf_nds_flags_tree,
8351 proto_tree_add_item(flags_tree, hf_nds_flags_flags,
8353 proto_tree_add_item(flags_tree, hf_nds_flags_rev,
8355 proto_tree_add_item(flags_tree, hf_nds_flags_depth,
8366 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
8367 if (ncp_rec && ncp_rec->request_ptvc) {
8368 clear_repeat_vars();
8369 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
8371 ptvcursor_free(ptvc);
8373 /* Free the temporary proto_tree */
8374 CLEANUP_CALL_AND_POP;