1 #define FAKE_TREE_IS_VISIBLE 1
2 /* fake that the tree is visible so that proto.c will not try to
3 "fake" generation of finfo values/nodes.
4 Thus this means netware dissector is slower than it has to, but it wont crash.
5 once the dissector is refactored to avoid calling fvalue_ functions directly this faking of whether the tree is visible or not can be removed.
11 * Routines for NetWare Core Protocol. This C code gets #include'd
12 * into packet-ncp2222.c, which is generated from ncp2222.py. It's
13 * #include'd instead of being in a separate compilation unit so
14 * that all the data tables in packet-ncp2222.c can remain static.
16 * Gilbert Ramirez <gram@alumni.rice.edu>
17 * Modified to decode NDS packets by Greg Morris <gmorris@novell.com>
19 * Portions Copyright (c) Gilbert Ramirez 2000-2002
20 * Portions Copyright (c) Novell, Inc. 2000-2003
24 * Wireshark - Network traffic analyzer
25 * By Gerald Combs <gerald@wireshark.org>
26 * Copyright 2000 Gerald Combs
28 * This program is free software; you can redistribute it and/or
29 * modify it under the terms of the GNU General Public License
30 * as published by the Free Software Foundation; either version 2
31 * of the License, or (at your option) any later version.
33 * This program is distributed in the hope that it will be useful,
34 * but WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 * GNU General Public License for more details.
38 * You should have received a copy of the GNU General Public License
39 * along with this program; if not, write to the Free Software
40 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
43 #define NCP_PACKET_INIT_COUNT 200
44 #define PROTO_LENGTH_UNTIL_END -1
46 gboolean nds_defragment = TRUE;
47 gboolean nds_echo_eid = TRUE;
48 gboolean ncp_echo_err = TRUE;
49 gboolean ncp_echo_conn = FALSE;
50 gboolean ncp_echo_server = TRUE;
51 gboolean ncp_echo_file = FALSE;
52 gboolean ncp_newstyle = TRUE;
54 extern dissector_handle_t nds_data_handle;
56 guint32 nds_frag_verb;
57 guint32 nds_frag_version;
58 guint32 nds_frag_flags;
59 guint32 nds_frag_prot_flags;
62 gboolean nds_fragmented;
66 char mv_resolve_name_string[128];
68 const fragment_items nds_frag_items = {
73 &hf_nds_segment_overlap,
74 &hf_nds_segment_overlap_conflict,
75 &hf_nds_segment_multiple_tails,
76 &hf_nds_segment_too_long_segment,
77 &hf_nds_segment_error,
82 #define NDS_TAG_NO_SUCH_ENTRY 0x00000000
83 #define NDS_TAG_LOCAL_ENTRY 0x00000001
84 #define NDS_TAG_REMOTE_ENTRY 0x00000002
85 #define NDS_TAG_ALIAS_ENTRY 0x00000003
86 #define NDS_TAG_REFERRAL_INFORMATION 0x00000004
87 #define NDS_TAG_ENTRY_AND_REFERRALS 0x00000006
90 #define NDS_SEARCH_ENTRY 0
91 #define NDS_SEARCH_SUBORDINATES 1
92 #define NDS_SEARCH_SUBTREE 2
93 #define NDS_SEARCH_PARTITION 3
95 /* Search Referal Types */
96 #define NDS_ALIAS_REFERRAL 0
97 #define NDS_PARTITION_REFERRAL 1
99 /* Search Filter Types */
100 #define NDS_SEARCH_ITEM 0
101 #define NDS_SEARCH_OR 1
102 #define NDS_SEARCH_AND 2
103 #define NDS_SEARCH_NOT 3
105 /* Search Operators */
106 #define NDS_SEARCH_EQUAL 7
107 #define NDS_SEARCH_GREATER_OR_EQUAL 8
108 #define NDS_SEARCH_LESS_OR_EQUAL 9
109 #define NDS_SEARCH_APPROX 10
110 #define NDS_SEARCH_PRESENT 15
111 #define NDS_SEARCH_RDN 16
112 #define NDS_SEARCH_BASE_CLASS 17
113 #define NDS_SEARCH_MODIFICATION_GE 18 /* Deprecated, use DS_SEARCH_ENTRY_MTS_GE */
114 #define NDS_SEARCH_VALUE_TIME_GE 19 /* Deprecated, use DS_SEARCH_VALUE_MTS_GE */
115 #define NDS_SEARCH_REFERENCES 20
116 #define NDS_SEARCH_DN_IN_VALUE 21
117 #define NDS_SEARCH_SCHEMA_IN_VALUE 22
118 #define NDS_SEARCH_ENTRY_FLAGS 23
119 #define NDS_SEARCH_ENTRY_HAS_FLAG 24
120 #define NDS_SEARCH_VALUE_FLAGS 25
121 #define NDS_SEARCH_VALUE_HAS_FLAG 26
122 #define NDS_SEARCH_ATTR_FLAGS 27
123 #define NDS_SEARCH_ATTR_HAS_FLAG 28
124 #define NDS_SEARCH_EID 29
126 #define NDS_SEARCH_ENTRY_MTS_GE 18
127 #define NDS_SEARCH_ENTRY_MTS_G 30
128 #define NDS_SEARCH_ENTRY_MTS_LE 31
129 #define NDS_SEARCH_ENTRY_MTS_L 32
130 #define NDS_SEARCH_ENTRY_MTS_EQ 33
131 #define NDS_SEARCH_ENTRY_MTS_EQ_APPROX 34
132 #define NDS_SEARCH_VALUE_MTS_GE 19
133 #define NDS_SEARCH_VALUE_MTS_G 35
134 #define NDS_SEARCH_VALUE_MTS_LE 36
135 #define NDS_SEARCH_VALUE_MTS_L 37
136 #define NDS_SEARCH_VALUE_MTS_EQ 38
137 #define NDS_SEARCH_VALUE_MTS_EQ_APPROX 39
139 #define NDS_SEARCH_ENTRY_CTS_GE 40
140 #define NDS_SEARCH_ENTRY_CTS_G 41
141 #define NDS_SEARCH_ENTRY_CTS_LE 42
142 #define NDS_SEARCH_ENTRY_CTS_L 43
143 #define NDS_SEARCH_ENTRY_CTS_EQ 44
144 #define NDS_SEARCH_ENTRY_CTS_EQ_APPROX 45
145 #define NDS_SEARCH_VALUE_CTS_GE 46
146 #define NDS_SEARCH_VALUE_CTS_G 47
147 #define NDS_SEARCH_VALUE_CTS_LE 48
148 #define NDS_SEARCH_VALUE_CTS_L 49
149 #define NDS_SEARCH_VALUE_CTS_EQ 50
150 #define NDS_SEARCH_VALUE_CTS_EQ_APPROX 51
151 #define NDS_SEARCH_EXTENSIBLE 52
152 #define NDS_SEARCH_ENTRY_SUBCOUNT_GE 53
153 #define NDS_SEARCH_ENTRY_SUBCOUNT_G 54
154 #define NDS_SEARCH_ENTRY_SUBCOUNT_LE 55
155 #define NDS_SEARCH_ENTRY_SUBCOUNT_L 56
156 #define NDS_SEARCH_ENTRY_SUBCOUNT_EQ 57
158 #define DCS_OPS 0x10000000L
159 #define DCS_MOD_GE_WITH_ATTR DCS_OPS + NDS_SEARCH_MODIFICATION_GE
160 #define DCS_VALUE_GE_WITH_ATTR DCS_OPS + NDS_SEARCH_VALUE_TIME_GE
161 #define DCS_MASK ~DCS_OPS
172 #define IT_GETPOSITION 9
176 #define IT_POSITION 13
177 #define IT_POSITION_IT 14
178 #define IT_SETINDEX 15
179 #define IT_SETFILTER 16
181 #define IT_TYPEDOWN 18
182 #define IT_ATFIRST 19
184 #define IT_GETINDEX 21
185 #define IT_ISPOSITIONABLE 22
189 /* Iteration information flags */
190 #define DSI_OUTPUT_FIELDS 0x00000001L
191 #define DSI_ENTRY_ID 0x00000002L
192 #define DSI_ENTRY_FLAGS 0x00000004L
193 #define DSI_SUBORDINATE_COUNT 0x00000008L
194 #define DSI_MODIFICATION_TIME 0x00000010L
195 #define DSI_MODIFICATION_TIMESTAMP 0x00000020L
196 #define DSI_CREATION_TIMESTAMP 0x00000040L
197 #define DSI_PARTITION_ROOT_ID 0x00000080L
198 #define DSI_PARENT_ID 0x00000100L
199 #define DSI_REVISION_COUNT 0x00000200L
200 #define DSI_REPLICA_TYPE 0x00000400L
201 #define DSI_BASE_CLASS 0x00000800L
202 #define DSI_ENTRY_RDN 0x00001000L
203 #define DSI_ENTRY_DN 0x00002000L
204 #define DSI_PARTITION_ROOT_DN 0x00004000L
205 #define DSI_PARENT_DN 0x00008000L
206 #define DSI_PURGE_TIME 0x00010000L
207 #define DSI_DEREFERENCED_BASE_CLASS 0x00020000L
208 #define DSI_REPLICA_NUMBER 0x00040000L
209 #define DSI_REPLICA_STATE 0x00080000L
210 #define DSI_FEDERATION_BOUNDARY 0x00100000L
211 #define DSI_SCHEMA_BOUNDARY 0x00200000L
212 #define DSI_FEDERATION_BOUNDARY_ID 0x00400000L
213 #define DSI_SCHEMA_BOUNDARY_ID 0x00800000L
214 #define DSI_CUR_SUBCOUNT 0x01000000L
215 #define DSI_LOCAL_ENTRY_FLAGS 0x02000000L
217 static const value_string zensearchenum[] = {
219 { 1, "Object Container" },
220 { 2, "Associated Container" },
221 { 3, "Selected Container" },
225 static const value_string itersearchenum[] = {
226 { NDS_SEARCH_ITEM, "Search Item" },
227 { NDS_SEARCH_OR, "OR" },
228 { NDS_SEARCH_AND, "AND" },
229 { NDS_SEARCH_NOT, "NOT" },
230 { NDS_SEARCH_EQUAL, "Equals" },
231 { NDS_SEARCH_GREATER_OR_EQUAL, "Greater or Equals" },
232 { NDS_SEARCH_LESS_OR_EQUAL, "Less or Equals" },
233 { NDS_SEARCH_APPROX, "Approximately" },
234 { NDS_SEARCH_PRESENT, "Present" },
235 { NDS_SEARCH_RDN, "Relative Distinguished Name" },
236 { NDS_SEARCH_BASE_CLASS, "Base Class" },
237 { NDS_SEARCH_MODIFICATION_GE, "Modification Greater or Equal" },
238 { NDS_SEARCH_VALUE_TIME_GE, "Time Value Greater or Equal" },
239 { NDS_SEARCH_REFERENCES, "References" },
240 { NDS_SEARCH_DN_IN_VALUE, "Designated Name in Value" },
241 { NDS_SEARCH_SCHEMA_IN_VALUE, "Schema in Value" },
242 { NDS_SEARCH_ENTRY_FLAGS, "Entry Flags" },
243 { NDS_SEARCH_ENTRY_HAS_FLAG, "Entry has Flags" },
244 { NDS_SEARCH_VALUE_FLAGS, "Value Flags" },
245 { NDS_SEARCH_VALUE_HAS_FLAG, "Value has Flags" },
246 { NDS_SEARCH_ATTR_FLAGS, "Attribute Flags" },
247 { NDS_SEARCH_ATTR_HAS_FLAG, "Attribute has Flags" },
248 { NDS_SEARCH_EID, "Entry ID" },
249 { NDS_SEARCH_ENTRY_MTS_GE, "Entry Modification Timestamp Greater or Equal" },
250 { NDS_SEARCH_ENTRY_MTS_G, "Entry Modification Timestamp Greater" },
251 { NDS_SEARCH_ENTRY_MTS_LE, "Entry Modification Timestamp Less or Equals" },
252 { NDS_SEARCH_ENTRY_MTS_L, "Entry Modification Timestamp Less" },
253 { NDS_SEARCH_ENTRY_MTS_EQ, "Entry Modification Timestamp Equals" },
254 { NDS_SEARCH_ENTRY_MTS_EQ_APPROX, "Entry Modification Timestamp Equals Approximately" },
255 { NDS_SEARCH_VALUE_MTS_GE, "Value Modification Timestamp Greater or Equal" },
256 { NDS_SEARCH_VALUE_MTS_G, "Value Modification Timestamp Greater" },
257 { NDS_SEARCH_VALUE_MTS_LE, "Value Modification Timestamp Less or Equals" },
258 { NDS_SEARCH_VALUE_MTS_L, "Value Modification Timestamp Less" },
259 { NDS_SEARCH_VALUE_MTS_EQ, "Value Modification Timestamp Equals" },
260 { NDS_SEARCH_VALUE_MTS_EQ_APPROX, "Value Modification Timestamp Equals Approximately" },
261 { NDS_SEARCH_ENTRY_CTS_GE, "Entry Creation Timestamp Greater or Equals" },
262 { NDS_SEARCH_ENTRY_CTS_G, "Entry Creation Timestamp Greater" },
263 { NDS_SEARCH_ENTRY_CTS_LE, "Entry Creation Timestamp Less or Equals" },
264 { NDS_SEARCH_ENTRY_CTS_L, "Entry Creation Timestamp Less" },
265 { NDS_SEARCH_ENTRY_CTS_EQ, "Entry Creation Timestamp Equals" },
266 { NDS_SEARCH_ENTRY_CTS_EQ_APPROX, "Entry Creation Timestamp Equals Approximately" },
267 { NDS_SEARCH_VALUE_CTS_GE, "Value Creation Timestamp Greater or Equals" },
268 { NDS_SEARCH_VALUE_CTS_G, "Value Creation Timestamp Greater" },
269 { NDS_SEARCH_VALUE_CTS_LE, "Value Creation Timestamp Less or Equals" },
270 { NDS_SEARCH_VALUE_CTS_L, "Value Creation Timestamp Less" },
271 { NDS_SEARCH_VALUE_CTS_EQ, "Value Creation Timestamp Equals" },
272 { NDS_SEARCH_VALUE_CTS_EQ_APPROX, "Value Creation Timestamp Equals Approximately" },
273 { NDS_SEARCH_EXTENSIBLE, "Extensible" },
274 { NDS_SEARCH_ENTRY_SUBCOUNT_GE, "Entry SubCount Greater or Equals" },
275 { NDS_SEARCH_ENTRY_SUBCOUNT_G, "Entry SubCount Greater" },
276 { NDS_SEARCH_ENTRY_SUBCOUNT_LE, "Entry SubCount Less or Equals" },
277 { NDS_SEARCH_ENTRY_SUBCOUNT_L, "Entry SubCount Less" },
278 { NDS_SEARCH_ENTRY_SUBCOUNT_EQ, "Entry SubCount Equals" },
282 static const value_string iterator_subverbs[] = {
283 { IT_CLEAR, "Clear" },
285 { IT_COUNT, "Count" },
286 { IT_CREATE, "Create" },
287 { IT_CURRENT, "Current" },
288 { IT_DESTROY, "Destroy" },
290 { IT_FIRST, "First" },
291 { IT_GETPOSITION, "Get Position" },
294 { IT_PREV, "Previous" },
295 { IT_POSITION, "Position" },
296 { IT_POSITION_IT, "Position Iterator" },
297 { IT_SETINDEX, "Set Index" },
298 { IT_SETFILTER, "Set Filter" },
300 { IT_TYPEDOWN, "Type Down" },
301 { IT_ATFIRST, "At First" },
302 { IT_ATEOF, "At End of File" },
303 { IT_GETINDEX, "Get Index" },
304 { IT_ISPOSITIONABLE, "Is Positionable" },
305 { IT_ATBOF, "At Beginning of File" },
306 { IT_ATLAST, "At Last" },
311 static const value_string nds_tuned_tags[] = {
313 { 1, "RDN History" },
317 static const value_string nds_scope_vals[] = {
318 { 0, "Search Scope: 0x0000 - Examine base object only" },
319 { 1, "Search Scope: 0x0001 - Search the immediate subordinates of the base object" },
320 { 2, "Search Scope: 0x0002 - Search the base object and all of its subordinates" },
321 { 3, "Search Scope: 0x0003 - Search the base objects and all objects in its partition (NDS version 8 or higher)" },
325 static const value_string nds_tuned_item_tags[] = {
326 { 0, "Single Item" },
327 { 1, "Multiple Items" },
331 static const value_string nds_tags[] = {
332 { NDS_TAG_NO_SUCH_ENTRY, "No Such Entry" },
333 { NDS_TAG_LOCAL_ENTRY, "Local Entry" },
334 { NDS_TAG_REMOTE_ENTRY, "Remote Entry" },
335 { NDS_TAG_ALIAS_ENTRY, "Alias Entry" },
336 { NDS_TAG_REFERRAL_INFORMATION, "Referral Information" },
337 { NDS_TAG_ENTRY_AND_REFERRALS, "Entry and Referrals" },
341 static const value_string nds_info_type[] = {
342 { 0x00000000, "Attribute Names Only / " },
343 { 0x00000001, "Attribute Name & Value / " },
344 { 0x00000002, "Effective Privileges / " },
345 { 0x00000003, "Value Information / " },
346 { 0x00000004, "Abbreviated Value / " },
350 static const value_string nds_kind_of_changes[] = {
351 { 0x00000000, "Add Attribute" },
352 { 0x00000001, "Remove Attribute" },
353 { 0x00000002, "Add Value" },
354 { 0x00000003, "Remove Value" },
355 { 0x00000004, "Add Additional Value" },
356 { 0x00000005, "Overwrite Value" },
357 { 0x00000006, "Clear Attribute" },
358 { 0x00000007, "Clear Value" },
362 static const value_string es_type[] = {
363 { 0x00000000, "No type is specified" },
364 { 0x00000001, "Unicode string" },
365 { 0x00000002, "Partial name" },
366 { 0x00000003, "Referrals" },
367 { 0x00000004, "Tuned name" },
368 { 0x00000005, "GUID attribute" },
369 { 0x00000006, "Local entry ID" },
370 { 0x00000007, "Number of defined entry specifiers" },
374 static const value_string ncp_rights_vals[] = {
375 { 0x00, "No Rights"},
378 { 0x03, "Read, Write"},
379 { 0x04, "Deny Read"},
380 { 0x05, "Read, Deny Read"},
381 { 0x06, "Write, Deny Read"},
382 { 0x07, "Read, Write, Deny Read"},
383 { 0x08, "Deny Write"},
384 { 0x09, "Read, Deny Write"},
385 { 0x0a, "Write, Deny Write"},
386 { 0x0b, "Read, Write, Deny Write"},
387 { 0x0c, "Deny Read, Deny Write"},
388 { 0x0d, "Read, Deny Read, Deny Write"},
389 { 0x0e, "Write, Deny Read, Deny Write"},
390 { 0x0f, "Read, Write, Deny Read, Deny Write"},
391 { 0x10, "Compatibility"},
392 { 0x11, "Read, Compatibility"},
393 { 0x12, "Write, Compatibility"},
394 { 0x13, "Read, Write, Compatibility"},
395 { 0x14, "Deny Read, Compatibility"},
396 { 0x15, "Read, Deny Read, Compatibility"},
397 { 0x16, "Write, Deny Read, Compatibility"},
398 { 0x17, "Read, Write, Deny Read, Compatibility"},
399 { 0x18, "Deny Write, Compatibility"},
400 { 0x19, "Read, Deny Write, Compatibility"},
401 { 0x1a, "Write, Deny Write, Compatibility"},
402 { 0x1b, "Read, Write, Deny Write, Compatibility"},
403 { 0x1c, "Deny Read, Deny Write, Compatibility"},
404 { 0x1d, "Read, Deny Read, Deny Write, Compatibility"},
405 { 0x1e, "Write, Deny Read, Deny Write, Compatibility"},
406 { 0x1f, "Read, Write, Deny Read, Deny Write, Compatibility"},
407 { 0x40, "File Write Through"},
408 { 0x41, "Read, File Write Through"},
409 { 0x42, "Write, File Write Through"},
410 { 0x43, "Read, Write, File Write Through"},
411 { 0x44, "Deny Read, File Write Through"},
412 { 0x45, "Read, Deny Read, File Write Through"},
413 { 0x46, "Write, Deny Read, File Write Through"},
414 { 0x47, "Read, Write, Deny Read, File Write Through"},
415 { 0x48, "Deny Write, File Write Through"},
416 { 0x49, "Read, Deny Write, File Write Through"},
417 { 0x4a, "Write, Deny Write, File Write Through"},
418 { 0x4b, "Read, Write, Deny Write, File Write Through"},
419 { 0x4c, "Deny Read, Deny Write, File Write Through"},
420 { 0x4d, "Read, Deny Read, Deny Write, File Write Through"},
421 { 0x4e, "Write, Deny Read, Deny Write, File Write Through"},
422 { 0x4f, "Read, Write, Deny Read, Deny Write, File Write Through"},
423 { 0x50, "Compatibility, File Write Through"},
424 { 0x51, "Read, Compatibility, File Write Through"},
425 { 0x52, "Write, Compatibility, File Write Through"},
426 { 0x53, "Read, Write, Compatibility, File Write Through"},
427 { 0x54, "Deny Read, Compatibility, File Write Through"},
428 { 0x55, "Read, Deny Read, Compatibility, File Write Through"},
429 { 0x56, "Write, Deny Read, Compatibility, File Write Through"},
430 { 0x57, "Read, Write, Deny Read, Compatibility, File Write Through"},
431 { 0x58, "Deny Write, Compatibility, File Write Through"},
432 { 0x59, "Read, Deny Write, Compatibility, File Write Through"},
433 { 0x5a, "Write, Deny Write, Compatibility, File Write Through"},
434 { 0x5b, "Read, Write, Deny Write, Compatibility, File Write Through"},
435 { 0x5c, "Deny Read, Deny Write, Compatibility, File Write Through"},
436 { 0x5d, "Read, Deny Read, Deny Write, Compatibility, File Write Through"},
437 { 0x5e, "Write, Deny Read, Deny Write, Compatibility, File Write Through"},
438 { 0x5f, "Read, Write, Deny Read, Deny Write, Compatibility, File Write Through"},
442 static const value_string open_create_mode_vals[] = {
445 { 0x03, "Open, Replace"},
447 { 0x09, "Open, Create"},
448 { 0x0a, "Replace, Create"},
449 { 0x0b, "Open, Replace, Create"},
451 { 0x21, "Open, 64-bit"},
452 { 0x22, "Replace, 64-bit"},
453 { 0x23, "Open, Replace, 64-bit"},
454 { 0x28, "Create, 64-bit"},
455 { 0x29, "Open, Create, 64-bit"},
456 { 0x2a, "Replace, Create, 64-bit"},
457 { 0x2b, "Open, Replace, Create, 64-bit"},
458 { 0x40, "Read Only"},
459 { 0x41, "Open, Read Only"},
460 { 0x42, "Replace, Read Only"},
461 { 0x43, "Open, Replace, Read Only"},
462 { 0x48, "Create, Read Only"},
463 { 0x49, "Open, Create, Read Only"},
464 { 0x4a, "Replace, Create, Read Only"},
465 { 0x4b, "Open, Replace, Create, Read Only"},
466 { 0x60, "64-bit, Read Only"},
467 { 0x61, "Open, 64-bit, Read Only"},
468 { 0x62, "Replace, 64-bit, Read Only"},
469 { 0x63, "Open, Replace, 64-bit, Read Only"},
470 { 0x68, "Create, 64-bit, Read Only"},
471 { 0x69, "Open, Create, 64-bit, Read Only"},
472 { 0x6a, "Replace, Create, 64-bit, Read Only"},
473 { 0x6b, "Open, Replace, Create, 64-bit, Read Only"},
475 { 0x81, "Open, Op-Lock"},
476 { 0x82, "Replace, Op-Lock"},
477 { 0x83, "Open, Replace, Op-Lock"},
478 { 0x88, "Create, Op-Lock"},
479 { 0x89, "Open, Create, Op-Lock"},
480 { 0x8a, "Replace, Create, Op-Lock"},
481 { 0x8b, "Open, Replace, Create, Op-Lock"},
482 { 0xa0, "64-bit, Op-Lock"},
483 { 0xa1, "Open, 64-bit, Op-Lock"},
484 { 0xa2, "Replace, 64-bit, Op-Lock"},
485 { 0xa3, "Open, Replace, 64-bit, Op-Lock"},
486 { 0xa8, "Create, 64-bit, Op-Lock"},
487 { 0xa9, "Open, Create, 64-bit, Op-Lock"},
488 { 0xaa, "Replace, Create, 64-bit, Op-Lock"},
489 { 0xab, "Open, Replace, Create, 64-bit, Op-Lock"},
490 { 0xc0, "Read Only, Op-Lock"},
491 { 0xc1, "Open, Read Only, Op-Lock"},
492 { 0xc2, "Replace, Read Only, Op-Lock"},
493 { 0xc3, "Open, Replace, Read Only, Op-Lock"},
494 { 0xc8, "Create, Read Only, Op-Lock"},
495 { 0xc9, "Open, Create, Read Only, Op-Lock"},
496 { 0xca, "Replace, Create, Read Only, Op-Lock"},
497 { 0xcb, "Open, Replace, Create, Read Only, Op-Lock"},
498 { 0xe0, "64-bit, Read Only, Op-Lock"},
499 { 0xe1, "Open, 64-bit, Read Only, Op-Lock"},
500 { 0xe2, "Replace, 64-bit, Read Only, Op-Lock"},
501 { 0xe3, "Open, Replace, 64-bit, Read Only, Op-Lock"},
502 { 0xe8, "Create, 64-bit, Read Only, Op-Lock"},
503 { 0xe9, "Open, Create, 64-bit, Read Only, Op-Lock"},
504 { 0xea, "Replace, Create, 64-bit, Read Only, Op-Lock"},
505 { 0xeb, "Open, Replace, Create, 64-bit, Read Only, Op-Lock"},
509 static const value_string open_create_action_vals[] = {
512 { 0x03, "Opened, Created"},
514 { 0x05, "Opened, Replaced"},
515 { 0x06, "Created, Replaced"},
516 { 0x07, "Opened, Created, Replaced"},
517 { 0x08, "Compressed"},
518 { 0x09, "Opened, Compressed"},
519 { 0x0a, "Created, Compressed"},
520 { 0x0b, "Opened, Created, Compressed"},
521 { 0x0c, "Replaced, Compressed"},
522 { 0x0d, "Opened, Replaced, Compressed"},
523 { 0x0e, "Created, Replaced, Compressed"},
524 { 0x0f, "Opened, Created, Replaced, Compressed"},
525 { 0x80, "Read Only"},
526 { 0x81, "Opened, Read Only"},
527 { 0x82, "Created, Read Only"},
528 { 0x83, "Opened, Created, Read Only"},
529 { 0x84, "Replaced, Read Only"},
530 { 0x85, "Opened, Replaced, Read Only"},
531 { 0x86, "Created, Replaced, Read Only"},
532 { 0x87, "Opened, Created, Replaced, Read Only"},
533 { 0x88, "Compressed, Read Only"},
534 { 0x89, "Opened, Compressed, Read Only"},
535 { 0x8a, "Created, Compressed, Read Only"},
536 { 0x8b, "Opened, Created, Compressed, Read Only"},
537 { 0x8c, "Replaced, Compressed, Read Only"},
538 { 0x8d, "Opened, Replaced, Compressed, Read Only"},
539 { 0x8e, "Created, Replaced, Compressed, Read Only"},
540 { 0x8f, "Opened, Created, Replaced, Compressed, Read Only"},
544 static const value_string access_rights_vals[] = {
545 { 0x0000, "No Rights"},
548 { 0x0003, "Read, Write"},
550 { 0x0005, "Read, Open"},
551 { 0x0006, "Write, Open"},
552 { 0x0007, "Read, Write, Open"},
554 { 0x0009, "Read, Create"},
555 { 0x000a, "Write, Create"},
556 { 0x000b, "Read, Write, Create"},
557 { 0x000c, "Open, Create"},
558 { 0x000d, "Read, Open, Create"},
559 { 0x000e, "Write, Open, Create"},
560 { 0x000f, "Read, Write, Open, Create"},
562 { 0x0011, "Read, Delete"},
563 { 0x0012, "Write, Delete"},
564 { 0x0013, "Read, Write, Delete"},
565 { 0x0014, "Open, Delete"},
566 { 0x0015, "Read, Open, Delete"},
567 { 0x0016, "Write, Open, Delete"},
568 { 0x0017, "Read, Write, Open, Delete"},
569 { 0x0018, "Create, Delete"},
570 { 0x0019, "Read, Create, Delete"},
571 { 0x001a, "Write, Create, Delete"},
572 { 0x001b, "Read, Write, Create, Delete"},
573 { 0x001c, "Open, Create, Delete"},
574 { 0x001d, "Read, Open, Create, Delete"},
575 { 0x001e, "Write, Open, Create, Delete"},
576 { 0x001f, "Read, Write, Open, Create, Delete"},
577 { 0x0020, "Parental"},
578 { 0x0021, "Read, Parental"},
579 { 0x0022, "Write, Parental"},
580 { 0x0023, "Read, Write, Parental"},
581 { 0x0024, "Open, Parental"},
582 { 0x0025, "Read, Open, Parental"},
583 { 0x0026, "Write, Open, Parental"},
584 { 0x0027, "Read, Write, Open, Parental"},
585 { 0x0028, "Create, Parental"},
586 { 0x0029, "Read, Create, Parental"},
587 { 0x002a, "Write, Create, Parental"},
588 { 0x002b, "Read, Write, Create, Parental"},
589 { 0x002c, "Open, Create, Parental"},
590 { 0x002d, "Read, Open, Create, Parental"},
591 { 0x002e, "Write, Open, Create, Parental"},
592 { 0x002f, "Read, Write, Open, Create, Parental"},
593 { 0x0030, "Delete, Parental"},
594 { 0x0031, "Read, Delete, Parental"},
595 { 0x0032, "Write, Delete, Parental"},
596 { 0x0033, "Read, Write, Delete, Parental"},
597 { 0x0034, "Open, Delete, Parental"},
598 { 0x0035, "Read, Open, Delete, Parental"},
599 { 0x0036, "Write, Open, Delete, Parental"},
600 { 0x0037, "Read, Write, Open, Delete, Parental"},
601 { 0x0038, "Create, Delete, Parental"},
602 { 0x0039, "Read, Create, Delete, Parental"},
603 { 0x003a, "Write, Create, Delete, Parental"},
604 { 0x003b, "Read, Write, Create, Delete, Parental"},
605 { 0x003c, "Open, Create, Delete, Parental"},
606 { 0x003d, "Read, Open, Create, Delete, Parental"},
607 { 0x003e, "Write, Open, Create, Delete, Parental"},
608 { 0x003f, "Read, Write, Open, Create, Delete, Parental"},
610 { 0x0041, "Read, Search"},
611 { 0x0042, "Write, Search"},
612 { 0x0043, "Read, Write, Search"},
613 { 0x0044, "Open, Search"},
614 { 0x0045, "Read, Open, Search"},
615 { 0x0046, "Write, Open, Search"},
616 { 0x0047, "Read, Write, Open, Search"},
617 { 0x0048, "Create, Search"},
618 { 0x0049, "Read, Create, Search"},
619 { 0x004a, "Write, Create, Search"},
620 { 0x004b, "Read, Write, Create, Search"},
621 { 0x004c, "Open, Create, Search"},
622 { 0x004d, "Read, Open, Create, Search"},
623 { 0x004e, "Write, Open, Create, Search"},
624 { 0x004f, "Read, Write, Open, Create, Search"},
625 { 0x0050, "Delete, Search"},
626 { 0x0051, "Read, Delete, Search"},
627 { 0x0052, "Write, Delete, Search"},
628 { 0x0053, "Read, Write, Delete, Search"},
629 { 0x0054, "Open, Delete, Search"},
630 { 0x0055, "Read, Open, Delete, Search"},
631 { 0x0056, "Write, Open, Delete, Search"},
632 { 0x0057, "Read, Write, Open, Delete, Search"},
633 { 0x0058, "Create, Delete, Search"},
634 { 0x0059, "Read, Create, Delete, Search"},
635 { 0x005a, "Write, Create, Delete, Search"},
636 { 0x005b, "Read, Write, Create, Delete, Search"},
637 { 0x005c, "Open, Create, Delete, Search"},
638 { 0x005d, "Read, Open, Create, Delete, Search"},
639 { 0x005e, "Write, Open, Create, Delete, Search"},
640 { 0x005f, "Read, Write, Open, Create, Delete, Search"},
641 { 0x0060, "Parental, Search"},
642 { 0x0061, "Read, Parental, Search"},
643 { 0x0062, "Write, Parental, Search"},
644 { 0x0063, "Read, Write, Parental, Search"},
645 { 0x0064, "Open, Parental, Search"},
646 { 0x0065, "Read, Open, Parental, Search"},
647 { 0x0066, "Write, Open, Parental, Search"},
648 { 0x0067, "Read, Write, Open, Parental, Search"},
649 { 0x0068, "Create, Parental, Search"},
650 { 0x0069, "Read, Create, Parental, Search"},
651 { 0x006a, "Write, Create, Parental, Search"},
652 { 0x006b, "Read, Write, Create, Parental, Search"},
653 { 0x006c, "Open, Create, Parental, Search"},
654 { 0x006d, "Read, Open, Create, Parental, Search"},
655 { 0x006e, "Write, Open, Create, Parental, Search"},
656 { 0x006f, "Read, Write, Open, Create, Parental, Search"},
657 { 0x0070, "Delete, Parental, Search"},
658 { 0x0071, "Read, Delete, Parental, Search"},
659 { 0x0072, "Write, Delete, Parental, Search"},
660 { 0x0073, "Read, Write, Delete, Parental, Search"},
661 { 0x0074, "Open, Delete, Parental, Search"},
662 { 0x0075, "Read, Open, Delete, Parental, Search"},
663 { 0x0076, "Write, Open, Delete, Parental, Search"},
664 { 0x0077, "Read, Write, Open, Delete, Parental, Search"},
665 { 0x0078, "Create, Delete, Parental, Search"},
666 { 0x0079, "Read, Create, Delete, Parental, Search"},
667 { 0x007a, "Write, Create, Delete, Parental, Search"},
668 { 0x007b, "Read, Write, Create, Delete, Parental, Search"},
669 { 0x007c, "Open, Create, Delete, Parental, Search"},
670 { 0x007d, "Read, Open, Create, Delete, Parental, Search"},
671 { 0x007e, "Write, Open, Create, Delete, Parental, Search"},
672 { 0x007f, "Read, Write, Open, Create, Delete, Parental, Search"},
674 { 0x0081, "Read, Modify"},
675 { 0x0082, "Write, Modify"},
676 { 0x0083, "Read, Write, Modify"},
677 { 0x0084, "Open, Modify"},
678 { 0x0085, "Read, Open, Modify"},
679 { 0x0086, "Write, Open, Modify"},
680 { 0x0087, "Read, Write, Open, Modify"},
681 { 0x0088, "Create, Modify"},
682 { 0x0089, "Read, Create, Modify"},
683 { 0x008a, "Write, Create, Modify"},
684 { 0x008b, "Read, Write, Create, Modify"},
685 { 0x008c, "Open, Create, Modify"},
686 { 0x008d, "Read, Open, Create, Modify"},
687 { 0x008e, "Write, Open, Create, Modify"},
688 { 0x008f, "Read, Write, Open, Create, Modify"},
689 { 0x0090, "Delete, Modify"},
690 { 0x0091, "Read, Delete, Modify"},
691 { 0x0092, "Write, Delete, Modify"},
692 { 0x0093, "Read, Write, Delete, Modify"},
693 { 0x0094, "Open, Delete, Modify"},
694 { 0x0095, "Read, Open, Delete, Modify"},
695 { 0x0096, "Write, Open, Delete, Modify"},
696 { 0x0097, "Read, Write, Open, Delete, Modify"},
697 { 0x0098, "Create, Delete, Modify"},
698 { 0x0099, "Read, Create, Delete, Modify"},
699 { 0x009a, "Write, Create, Delete, Modify"},
700 { 0x009b, "Read, Write, Create, Delete, Modify"},
701 { 0x009c, "Open, Create, Delete, Modify"},
702 { 0x009d, "Read, Open, Create, Delete, Modify"},
703 { 0x009e, "Write, Open, Create, Delete, Modify"},
704 { 0x009f, "Read, Write, Open, Create, Delete, Modify"},
705 { 0x00a0, "Parental, Modify"},
706 { 0x00a1, "Read, Parental, Modify"},
707 { 0x00a2, "Write, Parental, Modify"},
708 { 0x00a3, "Read, Write, Parental, Modify"},
709 { 0x00a4, "Open, Parental, Modify"},
710 { 0x00a5, "Read, Open, Parental, Modify"},
711 { 0x00a6, "Write, Open, Parental, Modify"},
712 { 0x00a7, "Read, Write, Open, Parental, Modify"},
713 { 0x00a8, "Create, Parental, Modify"},
714 { 0x00a9, "Read, Create, Parental, Modify"},
715 { 0x00aa, "Write, Create, Parental, Modify"},
716 { 0x00ab, "Read, Write, Create, Parental, Modify"},
717 { 0x00ac, "Open, Create, Parental, Modify"},
718 { 0x00ad, "Read, Open, Create, Parental, Modify"},
719 { 0x00ae, "Write, Open, Create, Parental, Modify"},
720 { 0x00af, "Read, Write, Open, Create, Parental, Modify"},
721 { 0x00b0, "Delete, Parental, Modify"},
722 { 0x00b1, "Read, Delete, Parental, Modify"},
723 { 0x00b2, "Write, Delete, Parental, Modify"},
724 { 0x00b3, "Read, Write, Delete, Parental, Modify"},
725 { 0x00b4, "Open, Delete, Parental, Modify"},
726 { 0x00b5, "Read, Open, Delete, Parental, Modify"},
727 { 0x00b6, "Write, Open, Delete, Parental, Modify"},
728 { 0x00b7, "Read, Write, Open, Delete, Parental, Modify"},
729 { 0x00b8, "Create, Delete, Parental, Modify"},
730 { 0x00b9, "Read, Create, Delete, Parental, Modify"},
731 { 0x00ba, "Write, Create, Delete, Parental, Modify"},
732 { 0x00bb, "Read, Write, Create, Delete, Parental, Modify"},
733 { 0x00bc, "Open, Create, Delete, Parental, Modify"},
734 { 0x00bd, "Read, Open, Create, Delete, Parental, Modify"},
735 { 0x00be, "Write, Open, Create, Delete, Parental, Modify"},
736 { 0x00bf, "Read, Write, Open, Create, Delete, Parental, Modify"},
737 { 0x00c0, "Search, Modify"},
738 { 0x00c1, "Read, Search, Modify"},
739 { 0x00c2, "Write, Search, Modify"},
740 { 0x00c3, "Read, Write, Search, Modify"},
741 { 0x00c4, "Open, Search, Modify"},
742 { 0x00c5, "Read, Open, Search, Modify"},
743 { 0x00c6, "Write, Open, Search, Modify"},
744 { 0x00c7, "Read, Write, Open, Search, Modify"},
745 { 0x00c8, "Create, Search, Modify"},
746 { 0x00c9, "Read, Create, Search, Modify"},
747 { 0x00ca, "Write, Create, Search, Modify"},
748 { 0x00cb, "Read, Write, Create, Search, Modify"},
749 { 0x00cc, "Open, Create, Search, Modify"},
750 { 0x00cd, "Read, Open, Create, Search, Modify"},
751 { 0x00ce, "Write, Open, Create, Search, Modify"},
752 { 0x00cf, "Read, Write, Open, Create, Search, Modify"},
753 { 0x00d0, "Delete, Search, Modify"},
754 { 0x00d1, "Read, Delete, Search, Modify"},
755 { 0x00d2, "Write, Delete, Search, Modify"},
756 { 0x00d3, "Read, Write, Delete, Search, Modify"},
757 { 0x00d4, "Open, Delete, Search, Modify"},
758 { 0x00d5, "Read, Open, Delete, Search, Modify"},
759 { 0x00d6, "Write, Open, Delete, Search, Modify"},
760 { 0x00d7, "Read, Write, Open, Delete, Search, Modify"},
761 { 0x00d8, "Create, Delete, Search, Modify"},
762 { 0x00d9, "Read, Create, Delete, Search, Modify"},
763 { 0x00da, "Write, Create, Delete, Search, Modify"},
764 { 0x00db, "Read, Write, Create, Delete, Search, Modify"},
765 { 0x00dc, "Open, Create, Delete, Search, Modify"},
766 { 0x00dd, "Read, Open, Create, Delete, Search, Modify"},
767 { 0x00de, "Write, Open, Create, Delete, Search, Modify"},
768 { 0x00df, "Read, Write, Open, Create, Delete, Search, Modify"},
769 { 0x00e0, "Parental, Search, Modify"},
770 { 0x00e1, "Read, Parental, Search, Modify"},
771 { 0x00e2, "Write, Parental, Search, Modify"},
772 { 0x00e3, "Read, Write, Parental, Search, Modify"},
773 { 0x00e4, "Open, Parental, Search, Modify"},
774 { 0x00e5, "Read, Open, Parental, Search, Modify"},
775 { 0x00e6, "Write, Open, Parental, Search, Modify"},
776 { 0x00e7, "Read, Write, Open, Parental, Search, Modify"},
777 { 0x00e8, "Create, Parental, Search, Modify"},
778 { 0x00e9, "Read, Create, Parental, Search, Modify"},
779 { 0x00ea, "Write, Create, Parental, Search, Modify"},
780 { 0x00eb, "Read, Write, Create, Parental, Search, Modify"},
781 { 0x00ec, "Open, Create, Parental, Search, Modify"},
782 { 0x00ed, "Read, Open, Create, Parental, Search, Modify"},
783 { 0x00ee, "Write, Open, Create, Parental, Search, Modify"},
784 { 0x00ef, "Read, Write, Open, Create, Parental, Search, Modify"},
785 { 0x00f0, "Delete, Parental, Search, Modify"},
786 { 0x00f1, "Read, Delete, Parental, Search, Modify"},
787 { 0x00f2, "Write, Delete, Parental, Search, Modify"},
788 { 0x00f3, "Read, Write, Delete, Parental, Search, Modify"},
789 { 0x00f4, "Open, Delete, Parental, Search, Modify"},
790 { 0x00f5, "Read, Open, Delete, Parental, Search, Modify"},
791 { 0x00f6, "Write, Open, Delete, Parental, Search, Modify"},
792 { 0x00f7, "Read, Write, Open, Delete, Parental, Search, Modify"},
793 { 0x00f8, "Create, Delete, Parental, Search, Modify"},
794 { 0x00f9, "Read, Create, Delete, Parental, Search, Modify"},
795 { 0x00fa, "Write, Create, Delete, Parental, Search, Modify"},
796 { 0x00fb, "Read, Write, Create, Delete, Parental, Search, Modify"},
797 { 0x00fc, "Open, Create, Delete, Parental, Search, Modify"},
798 { 0x00fd, "Read, Open, Create, Delete, Parental, Search, Modify"},
799 { 0x00fe, "Write, Open, Create, Delete, Parental, Search, Modify"},
800 { 0x00ff, "Read, Write, Open, Create, Delete, Parental, Search, Modify"},
801 { 0x0100, "Supervisor"},
802 { 0x0101, "Read, Supervisor"},
803 { 0x0102, "Write, Supervisor"},
804 { 0x0103, "Read, Write, Supervisor"},
805 { 0x0104, "Open, Supervisor"},
806 { 0x0105, "Read, Open, Supervisor"},
807 { 0x0106, "Write, Open, Supervisor"},
808 { 0x0107, "Read, Write, Open, Supervisor"},
809 { 0x0108, "Create, Supervisor"},
810 { 0x0109, "Read, Create, Supervisor"},
811 { 0x010a, "Write, Create, Supervisor"},
812 { 0x010b, "Read, Write, Create, Supervisor"},
813 { 0x010c, "Open, Create, Supervisor"},
814 { 0x010d, "Read, Open, Create, Supervisor"},
815 { 0x010e, "Write, Open, Create, Supervisor"},
816 { 0x010f, "Read, Write, Open, Create, Supervisor"},
817 { 0x0110, "Delete, Supervisor"},
818 { 0x0111, "Read, Delete, Supervisor"},
819 { 0x0112, "Write, Delete, Supervisor"},
820 { 0x0113, "Read, Write, Delete, Supervisor"},
821 { 0x0114, "Open, Delete, Supervisor"},
822 { 0x0115, "Read, Open, Delete, Supervisor"},
823 { 0x0116, "Write, Open, Delete, Supervisor"},
824 { 0x0117, "Read, Write, Open, Delete, Supervisor"},
825 { 0x0118, "Create, Delete, Supervisor"},
826 { 0x0119, "Read, Create, Delete, Supervisor"},
827 { 0x011a, "Write, Create, Delete, Supervisor"},
828 { 0x011b, "Read, Write, Create, Delete, Supervisor"},
829 { 0x011c, "Open, Create, Delete, Supervisor"},
830 { 0x011d, "Read, Open, Create, Delete, Supervisor"},
831 { 0x011e, "Write, Open, Create, Delete, Supervisor"},
832 { 0x011f, "Read, Write, Open, Create, Delete, Supervisor"},
833 { 0x0120, "Parental, Supervisor"},
834 { 0x0121, "Read, Parental, Supervisor"},
835 { 0x0122, "Write, Parental, Supervisor"},
836 { 0x0123, "Read, Write, Parental, Supervisor"},
837 { 0x0124, "Open, Parental, Supervisor"},
838 { 0x0125, "Read, Open, Parental, Supervisor"},
839 { 0x0126, "Write, Open, Parental, Supervisor"},
840 { 0x0127, "Read, Write, Open, Parental, Supervisor"},
841 { 0x0128, "Create, Parental, Supervisor"},
842 { 0x0129, "Read, Create, Parental, Supervisor"},
843 { 0x012a, "Write, Create, Parental, Supervisor"},
844 { 0x012b, "Read, Write, Create, Parental, Supervisor"},
845 { 0x012c, "Open, Create, Parental, Supervisor"},
846 { 0x012d, "Read, Open, Create, Parental, Supervisor"},
847 { 0x012e, "Write, Open, Create, Parental, Supervisor"},
848 { 0x012f, "Read, Write, Open, Create, Parental, Supervisor"},
849 { 0x0130, "Delete, Parental, Supervisor"},
850 { 0x0131, "Read, Delete, Parental, Supervisor"},
851 { 0x0132, "Write, Delete, Parental, Supervisor"},
852 { 0x0133, "Read, Write, Delete, Parental, Supervisor"},
853 { 0x0134, "Open, Delete, Parental, Supervisor"},
854 { 0x0135, "Read, Open, Delete, Parental, Supervisor"},
855 { 0x0136, "Write, Open, Delete, Parental, Supervisor"},
856 { 0x0137, "Read, Write, Open, Delete, Parental, Supervisor"},
857 { 0x0138, "Create, Delete, Parental, Supervisor"},
858 { 0x0139, "Read, Create, Delete, Parental, Supervisor"},
859 { 0x013a, "Write, Create, Delete, Parental, Supervisor"},
860 { 0x013b, "Read, Write, Create, Delete, Parental, Supervisor"},
861 { 0x013c, "Open, Create, Delete, Parental, Supervisor"},
862 { 0x013d, "Read, Open, Create, Delete, Parental, Supervisor"},
863 { 0x013e, "Write, Open, Create, Delete, Parental, Supervisor"},
864 { 0x013f, "Read, Write, Open, Create, Delete, Parental, Supervisor"},
865 { 0x0140, "Search, Supervisor"},
866 { 0x0141, "Read, Search, Supervisor"},
867 { 0x0142, "Write, Search, Supervisor"},
868 { 0x0143, "Read, Write, Search, Supervisor"},
869 { 0x0144, "Open, Search, Supervisor"},
870 { 0x0145, "Read, Open, Search, Supervisor"},
871 { 0x0146, "Write, Open, Search, Supervisor"},
872 { 0x0147, "Read, Write, Open, Search, Supervisor"},
873 { 0x0148, "Create, Search, Supervisor"},
874 { 0x0149, "Read, Create, Search, Supervisor"},
875 { 0x014a, "Write, Create, Search, Supervisor"},
876 { 0x014b, "Read, Write, Create, Search, Supervisor"},
877 { 0x014c, "Open, Create, Search, Supervisor"},
878 { 0x014d, "Read, Open, Create, Search, Supervisor"},
879 { 0x014e, "Write, Open, Create, Search, Supervisor"},
880 { 0x014f, "Read, Write, Open, Create, Search, Supervisor"},
881 { 0x0150, "Delete, Search, Supervisor"},
882 { 0x0151, "Read, Delete, Search, Supervisor"},
883 { 0x0152, "Write, Delete, Search, Supervisor"},
884 { 0x0153, "Read, Write, Delete, Search, Supervisor"},
885 { 0x0154, "Open, Delete, Search, Supervisor"},
886 { 0x0155, "Read, Open, Delete, Search, Supervisor"},
887 { 0x0156, "Write, Open, Delete, Search, Supervisor"},
888 { 0x0157, "Read, Write, Open, Delete, Search, Supervisor"},
889 { 0x0158, "Create, Delete, Search, Supervisor"},
890 { 0x0159, "Read, Create, Delete, Search, Supervisor"},
891 { 0x015a, "Write, Create, Delete, Search, Supervisor"},
892 { 0x015b, "Read, Write, Create, Delete, Search, Supervisor"},
893 { 0x015c, "Open, Create, Delete, Search, Supervisor"},
894 { 0x015d, "Read, Open, Create, Delete, Search, Supervisor"},
895 { 0x015e, "Write, Open, Create, Delete, Search, Supervisor"},
896 { 0x015f, "Read, Write, Open, Create, Delete, Search, Supervisor"},
897 { 0x0160, "Parental, Search, Supervisor"},
898 { 0x0161, "Read, Parental, Search, Supervisor"},
899 { 0x0162, "Write, Parental, Search, Supervisor"},
900 { 0x0163, "Read, Write, Parental, Search, Supervisor"},
901 { 0x0164, "Open, Parental, Search, Supervisor"},
902 { 0x0165, "Read, Open, Parental, Search, Supervisor"},
903 { 0x0166, "Write, Open, Parental, Search, Supervisor"},
904 { 0x0167, "Read, Write, Open, Parental, Search, Supervisor"},
905 { 0x0168, "Create, Parental, Search, Supervisor"},
906 { 0x0169, "Read, Create, Parental, Search, Supervisor"},
907 { 0x016a, "Write, Create, Parental, Search, Supervisor"},
908 { 0x016b, "Read, Write, Create, Parental, Search, Supervisor"},
909 { 0x016c, "Open, Create, Parental, Search, Supervisor"},
910 { 0x016d, "Read, Open, Create, Parental, Search, Supervisor"},
911 { 0x016e, "Write, Open, Create, Parental, Search, Supervisor"},
912 { 0x016f, "Read, Write, Open, Create, Parental, Search, Supervisor"},
913 { 0x0170, "Delete, Parental, Search, Supervisor"},
914 { 0x0171, "Read, Delete, Parental, Search, Supervisor"},
915 { 0x0172, "Write, Delete, Parental, Search, Supervisor"},
916 { 0x0173, "Read, Write, Delete, Parental, Search, Supervisor"},
917 { 0x0174, "Open, Delete, Parental, Search, Supervisor"},
918 { 0x0175, "Read, Open, Delete, Parental, Search, Supervisor"},
919 { 0x0176, "Write, Open, Delete, Parental, Search, Supervisor"},
920 { 0x0177, "Read, Write, Open, Delete, Parental, Search, Supervisor"},
921 { 0x0178, "Create, Delete, Parental, Search, Supervisor"},
922 { 0x0179, "Read, Create, Delete, Parental, Search, Supervisor"},
923 { 0x017a, "Write, Create, Delete, Parental, Search, Supervisor"},
924 { 0x017b, "Read, Write, Create, Delete, Parental, Search, Supervisor"},
925 { 0x017c, "Open, Create, Delete, Parental, Search, Supervisor"},
926 { 0x017d, "Read, Open, Create, Delete, Parental, Search, Supervisor"},
927 { 0x017e, "Write, Open, Create, Delete, Parental, Search, Supervisor"},
928 { 0x017f, "Read, Write, Open, Create, Delete, Parental, Search, Supervisor"},
929 { 0x0180, "Modify, Supervisor"},
930 { 0x0181, "Read, Modify, Supervisor"},
931 { 0x0182, "Write, Modify, Supervisor"},
932 { 0x0183, "Read, Write, Modify, Supervisor"},
933 { 0x0184, "Open, Modify, Supervisor"},
934 { 0x0185, "Read, Open, Modify, Supervisor"},
935 { 0x0186, "Write, Open, Modify, Supervisor"},
936 { 0x0187, "Read, Write, Open, Modify, Supervisor"},
937 { 0x0188, "Create, Modify, Supervisor"},
938 { 0x0189, "Read, Create, Modify, Supervisor"},
939 { 0x018a, "Write, Create, Modify, Supervisor"},
940 { 0x018b, "Read, Write, Create, Modify, Supervisor"},
941 { 0x018c, "Open, Create, Modify, Supervisor"},
942 { 0x018d, "Read, Open, Create, Modify, Supervisor"},
943 { 0x018e, "Write, Open, Create, Modify, Supervisor"},
944 { 0x018f, "Read, Write, Open, Create, Modify, Supervisor"},
945 { 0x0190, "Delete, Modify, Supervisor"},
946 { 0x0191, "Read, Delete, Modify, Supervisor"},
947 { 0x0192, "Write, Delete, Modify, Supervisor"},
948 { 0x0193, "Read, Write, Delete, Modify, Supervisor"},
949 { 0x0194, "Open, Delete, Modify, Supervisor"},
950 { 0x0195, "Read, Open, Delete, Modify, Supervisor"},
951 { 0x0196, "Write, Open, Delete, Modify, Supervisor"},
952 { 0x0197, "Read, Write, Open, Delete, Modify, Supervisor"},
953 { 0x0198, "Create, Delete, Modify, Supervisor"},
954 { 0x0199, "Read, Create, Delete, Modify, Supervisor"},
955 { 0x019a, "Write, Create, Delete, Modify, Supervisor"},
956 { 0x019b, "Read, Write, Create, Delete, Modify, Supervisor"},
957 { 0x019c, "Open, Create, Delete, Modify, Supervisor"},
958 { 0x019d, "Read, Open, Create, Delete, Modify, Supervisor"},
959 { 0x019e, "Write, Open, Create, Delete, Modify, Supervisor"},
960 { 0x019f, "Read, Write, Open, Create, Delete, Modify, Supervisor"},
961 { 0x01a0, "Parental, Modify, Supervisor"},
962 { 0x01a1, "Read, Parental, Modify, Supervisor"},
963 { 0x01a2, "Write, Parental, Modify, Supervisor"},
964 { 0x01a3, "Read, Write, Parental, Modify, Supervisor"},
965 { 0x01a4, "Open, Parental, Modify, Supervisor"},
966 { 0x01a5, "Read, Open, Parental, Modify, Supervisor"},
967 { 0x01a6, "Write, Open, Parental, Modify, Supervisor"},
968 { 0x01a7, "Read, Write, Open, Parental, Modify, Supervisor"},
969 { 0x01a8, "Create, Parental, Modify, Supervisor"},
970 { 0x01a9, "Read, Create, Parental, Modify, Supervisor"},
971 { 0x01aa, "Write, Create, Parental, Modify, Supervisor"},
972 { 0x01ab, "Read, Write, Create, Parental, Modify, Supervisor"},
973 { 0x01ac, "Open, Create, Parental, Modify, Supervisor"},
974 { 0x01ad, "Read, Open, Create, Parental, Modify, Supervisor"},
975 { 0x01ae, "Write, Open, Create, Parental, Modify, Supervisor"},
976 { 0x01af, "Read, Write, Open, Create, Parental, Modify, Supervisor"},
977 { 0x01b0, "Delete, Parental, Modify, Supervisor"},
978 { 0x01b1, "Read, Delete, Parental, Modify, Supervisor"},
979 { 0x01b2, "Write, Delete, Parental, Modify, Supervisor"},
980 { 0x01b3, "Read, Write, Delete, Parental, Modify, Supervisor"},
981 { 0x01b4, "Open, Delete, Parental, Modify, Supervisor"},
982 { 0x01b5, "Read, Open, Delete, Parental, Modify, Supervisor"},
983 { 0x01b6, "Write, Open, Delete, Parental, Modify, Supervisor"},
984 { 0x01b7, "Read, Write, Open, Delete, Parental, Modify, Supervisor"},
985 { 0x01b8, "Create, Delete, Parental, Modify, Supervisor"},
986 { 0x01b9, "Read, Create, Delete, Parental, Modify, Supervisor"},
987 { 0x01ba, "Write, Create, Delete, Parental, Modify, Supervisor"},
988 { 0x01bb, "Read, Write, Create, Delete, Parental, Modify, Supervisor"},
989 { 0x01bc, "Open, Create, Delete, Parental, Modify, Supervisor"},
990 { 0x01bd, "Read, Open, Create, Delete, Parental, Modify, Supervisor"},
991 { 0x01be, "Write, Open, Create, Delete, Parental, Modify, Supervisor"},
992 { 0x01bf, "Read, Write, Open, Create, Delete, Parental, Modify, Supervisor"},
993 { 0x01c0, "Search, Modify, Supervisor"},
994 { 0x01c1, "Read, Search, Modify, Supervisor"},
995 { 0x01c2, "Write, Search, Modify, Supervisor"},
996 { 0x01c3, "Read, Write, Search, Modify, Supervisor"},
997 { 0x01c4, "Open, Search, Modify, Supervisor"},
998 { 0x01c5, "Read, Open, Search, Modify, Supervisor"},
999 { 0x01c6, "Write, Open, Search, Modify, Supervisor"},
1000 { 0x01c7, "Read, Write, Open, Search, Modify, Supervisor"},
1001 { 0x01c8, "Create, Search, Modify, Supervisor"},
1002 { 0x01c9, "Read, Create, Search, Modify, Supervisor"},
1003 { 0x01ca, "Write, Create, Search, Modify, Supervisor"},
1004 { 0x01cb, "Read, Write, Create, Search, Modify, Supervisor"},
1005 { 0x01cc, "Open, Create, Search, Modify, Supervisor"},
1006 { 0x01cd, "Read, Open, Create, Search, Modify, Supervisor"},
1007 { 0x01ce, "Write, Open, Create, Search, Modify, Supervisor"},
1008 { 0x01cf, "Read, Write, Open, Create, Search, Modify, Supervisor"},
1009 { 0x01d0, "Delete, Search, Modify, Supervisor"},
1010 { 0x01d1, "Read, Delete, Search, Modify, Supervisor"},
1011 { 0x01d2, "Write, Delete, Search, Modify, Supervisor"},
1012 { 0x01d3, "Read, Write, Delete, Search, Modify, Supervisor"},
1013 { 0x01d4, "Open, Delete, Search, Modify, Supervisor"},
1014 { 0x01d5, "Read, Open, Delete, Search, Modify, Supervisor"},
1015 { 0x01d6, "Write, Open, Delete, Search, Modify, Supervisor"},
1016 { 0x01d7, "Read, Write, Open, Delete, Search, Modify, Supervisor"},
1017 { 0x01d8, "Create, Delete, Search, Modify, Supervisor"},
1018 { 0x01d9, "Read, Create, Delete, Search, Modify, Supervisor"},
1019 { 0x01da, "Write, Create, Delete, Search, Modify, Supervisor"},
1020 { 0x01db, "Read, Write, Create, Delete, Search, Modify, Supervisor"},
1021 { 0x01dc, "Open, Create, Delete, Search, Modify, Supervisor"},
1022 { 0x01dd, "Read, Open, Create, Delete, Search, Modify, Supervisor"},
1023 { 0x01de, "Write, Open, Create, Delete, Search, Modify, Supervisor"},
1024 { 0x01df, "Read, Write, Open, Create, Delete, Search, Modify, Supervisor"},
1025 { 0x01e0, "Parental, Search, Modify, Supervisor"},
1026 { 0x01e1, "Read, Parental, Search, Modify, Supervisor"},
1027 { 0x01e2, "Write, Parental, Search, Modify, Supervisor"},
1028 { 0x01e3, "Read, Write, Parental, Search, Modify, Supervisor"},
1029 { 0x01e4, "Open, Parental, Search, Modify, Supervisor"},
1030 { 0x01e5, "Read, Open, Parental, Search, Modify, Supervisor"},
1031 { 0x01e6, "Write, Open, Parental, Search, Modify, Supervisor"},
1032 { 0x01e7, "Read, Write, Open, Parental, Search, Modify, Supervisor"},
1033 { 0x01e8, "Create, Parental, Search, Modify, Supervisor"},
1034 { 0x01e9, "Read, Create, Parental, Search, Modify, Supervisor"},
1035 { 0x01ea, "Write, Create, Parental, Search, Modify, Supervisor"},
1036 { 0x01eb, "Read, Write, Create, Parental, Search, Modify, Supervisor"},
1037 { 0x01ec, "Open, Create, Parental, Search, Modify, Supervisor"},
1038 { 0x01ed, "Read, Open, Create, Parental, Search, Modify, Supervisor"},
1039 { 0x01ee, "Write, Open, Create, Parental, Search, Modify, Supervisor"},
1040 { 0x01ef, "Read, Write, Open, Create, Parental, Search, Modify, Supervisor"},
1041 { 0x01f0, "Delete, Parental, Search, Modify, Supervisor"},
1042 { 0x01f1, "Read, Delete, Parental, Search, Modify, Supervisor"},
1043 { 0x01f2, "Write, Delete, Parental, Search, Modify, Supervisor"},
1044 { 0x01f3, "Read, Write, Delete, Parental, Search, Modify, Supervisor"},
1045 { 0x01f4, "Open, Delete, Parental, Search, Modify, Supervisor"},
1046 { 0x01f5, "Read, Open, Delete, Parental, Search, Modify, Supervisor"},
1047 { 0x01f6, "Write, Open, Delete, Parental, Search, Modify, Supervisor"},
1048 { 0x01f7, "Read, Write, Open, Delete, Parental, Search, Modify, Supervisor"},
1049 { 0x01f8, "Create, Delete, Parental, Search, Modify, Supervisor"},
1050 { 0x01f9, "Read, Create, Delete, Parental, Search, Modify, Supervisor"},
1051 { 0x01fa, "Write, Create, Delete, Parental, Search, Modify, Supervisor"},
1052 { 0x01fb, "Read, Write, Create, Delete, Parental, Search, Modify, Supervisor"},
1053 { 0x01fc, "Open, Create, Delete, Parental, Search, Modify, Supervisor"},
1054 { 0x01fd, "Read, Open, Create, Delete, Parental, Search, Modify, Supervisor"},
1055 { 0x01fe, "Write, Open, Create, Delete, Parental, Search, Modify, Supervisor"},
1056 { 0x01ff, "Read, Write, Open, Create, Delete, Parental, Search, Modify, Supervisor"},
1061 static const value_string nds_reply_errors[] = {
1062 { 0xffffffff, "(-1) Insufficient Space" },
1063 { 0xffffff89, "(-119) Buffer too Small" },
1064 { 0xffffff88, "(-120) RR Volume Flag Not Set" },
1065 { 0xffffff87, "(-121) No Items Found" },
1066 { 0xffffff86, "(-122) Connection Already Temporary" },
1067 { 0xffffff85, "(-123) Connection Already Logged In" },
1068 { 0xffffff84, "(-124) Connection Not Authenticated" },
1069 { 0xffffff83, "(-125) Connection Not Logged In" },
1070 { 0xffffff82, "(-126) NCP Boundary Check Failed" },
1071 { 0xffffff81, "(-127) Lock Waiting" },
1072 { 0xffffff80, "(-128) Lock Fail" },
1073 { 0xffffff7f, "(-129) Out of Handles" },
1074 { 0xffffff7e, "(-130) No Open Privilege" },
1075 { 0xffffff7d, "(-131) Hard IO Error" },
1076 { 0xffffff7c, "(-132) No Create Privilege" },
1077 { 0xffffff7b, "(-133) No Create Delete Privilege" },
1078 { 0xffffff7a, "(-134) Create Duplicate When Read Only" },
1079 { 0xffffff79, "(-135) Create File with Invalid Name" },
1080 { 0xffffff78, "(-136) Invalid File Handle" },
1081 { 0xffffff77, "(-137) No Search Privilege" },
1082 { 0xffffff76, "(-138) No Delete Privilege" },
1083 { 0xffffff75, "(-139) No Rename Privilege" },
1084 { 0xffffff74, "(-140) No Set Privilege" },
1085 { 0xffffff73, "(-141) Some File in Use" },
1086 { 0xffffff72, "(-142) All File in Use" },
1087 { 0xffffff71, "(-143) Some Read Only" },
1088 { 0xffffff70, "(-144) All Read Only" },
1089 { 0xffffff6f, "(-145) Some names Exist" },
1090 { 0xffffff6e, "(-146) All Names Exist" },
1091 { 0xffffff6d, "(-147) No Read Privilege" },
1092 { 0xffffff6c, "(-148) No Write Privilege" },
1093 { 0xffffff6b, "(-149) File Detached" },
1094 { 0xffffff6a, "(-150) No Alloc Space/Target Not a Subdirectory/Insuffficient Memory" },
1095 { 0xffffff69, "(-151) No Spool Space" },
1096 { 0xffffff68, "(-152) Invalid Volume" },
1097 { 0xffffff67, "(-153) Directory Full" },
1098 { 0xffffff66, "(-154) Rename Across Volume" },
1099 { 0xffffff65, "(-155) Bad Directory Handle" },
1100 { 0xffffff64, "(-156) Invalid Path/No Such Extension" },
1101 { 0xffffff63, "(-157) No Directory Handles" },
1102 { 0xffffff62, "(-158) Bad File Name" },
1103 { 0xffffff61, "(-159) Directory Active" },
1104 { 0xffffff60, "(-160) Directory Not Empty" },
1105 { 0xffffff5f, "(-161) Directory IO Error" },
1106 { 0xffffff5e, "(-162) IO Locked" },
1107 { 0xffffff5d, "(-163) Transaction Restarted" },
1108 { 0xffffff5c, "(-164) Rename Directory Invalid" },
1109 { 0xffffff5b, "(-165) Invalid Open/Create Mode" },
1110 { 0xffffff5a, "(-166) Already in Use" },
1111 { 0xffffff59, "(-167) Invalid Resource Tag" },
1112 { 0xffffff58, "(-168) Access Denied" },
1113 { 0xffffff44, "(-188) Login Signing Required" },
1114 { 0xffffff43, "(-189) Login Encryption Required" },
1115 { 0xffffff42, "(-190) Invalid Data Stream" },
1116 { 0xffffff41, "(-191) Invalid Name Space" },
1117 { 0xffffff40, "(-192) No Accounting Privileges" },
1118 { 0xffffff3f, "(-193) No Account Balance" },
1119 { 0xffffff3e, "(-194) Credit Limit Exceeded" },
1120 { 0xffffff3d, "(-195) Too Many Holds" },
1121 { 0xffffff3c, "(-196) Accounting Disabled" },
1122 { 0xffffff3b, "(-197) Intruder Login Lockout" },
1123 { 0xffffff3a, "(-198) No Console Rights" },
1124 { 0xffffff30, "(-208) Queue IO Failure" },
1125 { 0xffffff2f, "(-209) No Queue" },
1126 { 0xffffff2e, "(-210) No Queue Server" },
1127 { 0xffffff2d, "(-211) No Queue Rights" },
1128 { 0xffffff2c, "(-212) Queue Full" },
1129 { 0xffffff2b, "(-213) No Queue Job" },
1130 { 0xffffff2a, "(-214) No Queue Job Rights/Unencrypted Not Allowed" },
1131 { 0xffffff29, "(-215) Queue In Service/Duplicate Password" },
1132 { 0xffffff28, "(-216) Queue Not Active/Password Too Short" },
1133 { 0xffffff27, "(-217) Queue Station Not Server/Maximum Logins Exceeded" },
1134 { 0xffffff26, "(-218) Queue Halted/Bad Login Time" },
1135 { 0xffffff25, "(-219) Queue Maximum Servers/Node Address Violation" },
1136 { 0xffffff24, "(-220) Login Account Expired" },
1137 { 0xffffff22, "(-222) Bad Password" },
1138 { 0xffffff21, "(-223) Password Expired" },
1139 { 0xffffff20, "(-224) No Login Connection Available" },
1140 { 0xffffff18, "(-232) Write to Group Property" },
1141 { 0xffffff17, "(-233) Member Already Exists" },
1142 { 0xffffff16, "(-234) No Such Member" },
1143 { 0xffffff15, "(-235) Property Not Group" },
1144 { 0xffffff14, "(-236) No Such Value Set" },
1145 { 0xffffff13, "(-237) Property Already Exists" },
1146 { 0xffffff12, "(-238) Object Already Exists" },
1147 { 0xffffff11, "(-239) Illegal Name" },
1148 { 0xffffff10, "(-240) Illegal Wildcard" },
1149 { 0xffffff0f, "(-241) Bindery Security" },
1150 { 0xffffff0e, "(-242) No Object Read Rights" },
1151 { 0xffffff0d, "(-243) No Object Rename Rights" },
1152 { 0xffffff0c, "(-244) No Object Delete Rights" },
1153 { 0xffffff0b, "(-245) No Object Create Rights" },
1154 { 0xffffff0a, "(-246) No Property Delete Rights" },
1155 { 0xffffff09, "(-247) No Property Create Rigths" },
1156 { 0xffffff08, "(-248) No Property Write Rights" },
1157 { 0xffffff07, "(-249) No Propery Read Rights" },
1158 { 0xffffff06, "(-250) Temp Remap" },
1159 { 0xffffff05, "(-251) Unknown Request/No Such Property" },
1160 { 0xffffff04, "(-252) Message Queue Full/Target Already Has Message/No Such Object" },
1161 { 0xffffff03, "(-253) Bad Station Number" },
1162 { 0xffffff02, "(-254) Bindery Locked/Directory Locked/Spool Delete/Trustee not Found/Timeout" },
1163 { 0xffffff01, "(-255) Hard Failure" },
1164 { 0xfffffed3, "(-301) Not Enough Memory" },
1165 { 0xfffffed2, "(-302) Bad Key" },
1166 { 0xfffffed1, "(-303) Bad Context" },
1167 { 0xfffffed0, "(-304) Buffer Full" },
1168 { 0xfffffecf, "(-305) List Empty" },
1169 { 0xfffffece, "(-306) Bad Syntax" },
1170 { 0xfffffecd, "(-307) Buffer Empty" },
1171 { 0xfffffecc, "(-308) Bad Verb" },
1172 { 0xfffffecb, "(-309) Expected Identifier" },
1173 { 0xfffffeca, "(-310) Expected Equals" },
1174 { 0xfffffec9, "(-311) Attribute Type Expected" },
1175 { 0xfffffec8, "(-312) Attribute Type Not Expected" },
1176 { 0xfffffec7, "(-313) Filter Tree Empty" },
1177 { 0xfffffec6, "(-314) Invalid Object Name" },
1178 { 0xfffffec5, "(-315) Expected RDN Delimiter" },
1179 { 0xfffffec4, "(-316) Too Many Tokens" },
1180 { 0xfffffec3, "(-317) Inconsistent MultiAVA" },
1181 { 0xfffffec2, "(-318) Country Name Too Long" },
1182 { 0xfffffec1, "(-319) Internal Error" },
1183 { 0xfffffec0, "(-320) Can't Add Root" },
1184 { 0xfffffebf, "(-321) Unable to Attach" },
1185 { 0xfffffebe, "(-322) Invalid Iteration Handle" },
1186 { 0xfffffebd, "(-323) Buffer Zero Length" },
1187 { 0xfffffebc, "(-324) Invalid Replica Type" },
1188 { 0xfffffebb, "(-325) Invalid Attribute Syntax" },
1189 { 0xfffffeba, "(-326) Invalid Filter Syntax" },
1190 { 0xfffffeb8, "(-328) Unicode Error during Context Creation" },
1191 { 0xfffffeb7, "(-329) Invalid Union Tag" },
1192 { 0xfffffeb6, "(-330) Invalid Server Response" },
1193 { 0xfffffeb5, "(-331) Null Pointer" },
1194 { 0xfffffeb4, "(-332) No Server Found" },
1195 { 0xfffffeb3, "(-333) No Connection" },
1196 { 0xfffffeb2, "(-334) RDN Too Long" },
1197 { 0xfffffeb1, "(-335) Duplicate Type" },
1198 { 0xfffffeb0, "(-336) Data Store Failure" },
1199 { 0xfffffeaf, "(-337) Not Logged In" },
1200 { 0xfffffeae, "(-338) Invalid Password Characters" },
1201 { 0xfffffead, "(-339) Failed Server Authentication" },
1202 { 0xfffffeac, "(-340) Transport Failed" },
1203 { 0xfffffeab, "(-341) No Such Syntax" },
1204 { 0xfffffeaa, "(-342) Invalid DS Name" },
1205 { 0xfffffea9, "(-343) Attribute Name Too Long" },
1206 { 0xfffffea8, "(-344) Invalid TDS" },
1207 { 0xfffffea7, "(-345) Invalid DS Version" },
1208 { 0xfffffea6, "(-346) Unicode Translation" },
1209 { 0xfffffea5, "(-347) Schema Name Too Long" },
1210 { 0xfffffea4, "(-348) Unicode File Not Found" },
1211 { 0xfffffea3, "(-349) Unicode Already Loaded" },
1212 { 0xfffffea2, "(-350) Not Context Owner" },
1213 { 0xfffffea1, "(-351) Attempt to Authenticate" },
1214 { 0xfffffea0, "(-352) No Writable Replicas" },
1215 { 0xfffffe9f, "(-353) DN Too Long" },
1216 { 0xfffffe9e, "(-354) Rename Not Allowed" },
1217 { 0xfffffe9d, "(-355) Not NDS for NT" },
1218 { 0xfffffe9c, "(-356) NDS for NT - No Domain" },
1219 { 0xfffffe9b, "(-357) NDS for NT - Sync Disabled" },
1220 { 0xfffffe9a, "(-358) Iterator Invalid Handle" },
1221 { 0xfffffe99, "(-359) Iterator Invalid Position" },
1222 { 0xfffffe98, "(-360) Iterator Invalid Search Data" },
1223 { 0xfffffe97, "(-361) Iterator Invalid Scope" },
1224 { 0xfffffda7, "(-601) No Such Entry" },
1225 { 0xfffffda6, "(-602) No Such Value" },
1226 { 0xfffffda5, "(-603) No Such Attribute" },
1227 { 0xfffffda4, "(-604) No Such Class" },
1228 { 0xfffffda3, "(-605) No Such Partition" },
1229 { 0xfffffda2, "(-606) Entry Already Exists" },
1230 { 0xfffffda1, "(-607) Not Effective Class" },
1231 { 0xfffffda0, "(-608) Illegal Attribute" },
1232 { 0xfffffd9f, "(-609) Missing Mandatory" },
1233 { 0xfffffd9e, "(-610) Illegal DS Name" },
1234 { 0xfffffd9d, "(-611) Illegal Containment" },
1235 { 0xfffffd9c, "(-612) Can't Have Multiple Values" },
1236 { 0xfffffd9b, "(-613) Syntax Violation" },
1237 { 0xfffffd9a, "(-614) Duplicate Value" },
1238 { 0xfffffd99, "(-615) Attribute Already Exists" },
1239 { 0xfffffd98, "(-616) Maximum Entries Exist" },
1240 { 0xfffffd97, "(-617) Database Format" },
1241 { 0xfffffd96, "(-618) Inconsistent Database" },
1242 { 0xfffffd95, "(-619) Invalid Comparison" },
1243 { 0xfffffd94, "(-620) Comparison Failed" },
1244 { 0xfffffd93, "(-621) Transaction Tracking Disabled" },
1245 { 0xfffffd92, "(-622) Invalid Transport" },
1246 { 0xfffffd91, "(-623) Syntax Invalid in Name" },
1247 { 0xfffffd90, "(-624) Replica Already Exists" },
1248 { 0xfffffd8f, "(-625) Transport Failure" },
1249 { 0xfffffd8e, "(-626) All Referrals Failed" },
1250 { 0xfffffd8d, "(-627) Can't Remove Naming Value" },
1251 { 0xfffffd8c, "(-628) Object Class Violation" },
1252 { 0xfffffd8b, "(-629) Entry is Not Leaf" },
1253 { 0xfffffd8a, "(-630) Different Tree" },
1254 { 0xfffffd89, "(-631) Illegal Replica Type" },
1255 { 0xfffffd88, "(-632) System Failure" },
1256 { 0xfffffd87, "(-633) Invalid Entry for Root" },
1257 { 0xfffffd86, "(-634) No Referrals" },
1258 { 0xfffffd85, "(-635) Remote Failure" },
1259 { 0xfffffd84, "(-636) Unreachable Server" },
1260 { 0xfffffd83, "(-637) Previous Move in Progress" },
1261 { 0xfffffd82, "(-638) No Character Mapping" },
1262 { 0xfffffd81, "(-639) Incomplete Authentication" },
1263 { 0xfffffd80, "(-640) Invalid Certificate" },
1264 { 0xfffffd7f, "(-641) Invalid Request" },
1265 { 0xfffffd7e, "(-642) Invalid Iteration" },
1266 { 0xfffffd7d, "(-643) Schema is Non-removable" },
1267 { 0xfffffd7c, "(-644) Schema is in Use" },
1268 { 0xfffffd7b, "(-645) Class Already Exists" },
1269 { 0xfffffd7a, "(-646) Bad Naming Attributes" },
1270 { 0xfffffd79, "(-647) Not Root Partition" },
1271 { 0xfffffd78, "(-648) Insufficient Stack" },
1272 { 0xfffffd77, "(-649) Insufficient Buffer" },
1273 { 0xfffffd76, "(-650) Ambiguous Containment" },
1274 { 0xfffffd75, "(-651) Ambiguous Naming" },
1275 { 0xfffffd74, "(-652) Duplicate Mandatory" },
1276 { 0xfffffd73, "(-653) Duplicate Optional" },
1277 { 0xfffffd72, "(-654) Partition Busy" },
1278 { 0xfffffd71, "(-655) Multiple Replicas" },
1279 { 0xfffffd70, "(-656) Crucial Replica" },
1280 { 0xfffffd6f, "(-657) Schema Sync in Progress" },
1281 { 0xfffffd6e, "(-658) Skulk in Progress" },
1282 { 0xfffffd6d, "(-659) Time Not Synchronized" },
1283 { 0xfffffd6c, "(-660) Record in Use" },
1284 { 0xfffffd6b, "(-661) DS Volume Not Mounted" },
1285 { 0xfffffd6a, "(-662) DS Volume IO Failure" },
1286 { 0xfffffd69, "(-663) DS Locked" },
1287 { 0xfffffd68, "(-664) Old Epoch" },
1288 { 0xfffffd67, "(-665) New Epoch" },
1289 { 0xfffffd66, "(-666) Incompatible DS Version" },
1290 { 0xfffffd65, "(-667) Partition Root" },
1291 { 0xfffffd64, "(-668) Entry Not Container" },
1292 { 0xfffffd63, "(-669) Failed Authentication" },
1293 { 0xfffffd62, "(-670) Invalid Context" },
1294 { 0xfffffd61, "(-671) No Such Parent" },
1295 { 0xfffffd60, "(-672) No Access" },
1296 { 0xfffffd5f, "(-673) Replica Not On" },
1297 { 0xfffffd5e, "(-674) Invalid Name Service" },
1298 { 0xfffffd5d, "(-675) Invalid Task" },
1299 { 0xfffffd5c, "(-676) Invalide Connection Handle" },
1300 { 0xfffffd5b, "(-677) Invalid Identity" },
1301 { 0xfffffd5a, "(-678) Duplicate ACL" },
1302 { 0xfffffd59, "(-679) Partition Already Exists" },
1303 { 0xfffffd58, "(-680) Transport Modified" },
1304 { 0xfffffd57, "(-681) Alias of an Alias" },
1305 { 0xfffffd56, "(-682) Auditing Failed" },
1306 { 0xfffffd55, "(-683) Invalid API Version" },
1307 { 0xfffffd54, "(-684) Secure NCP Violation" },
1308 { 0xfffffd53, "(-685) Move in Progress" },
1309 { 0xfffffd52, "(-686) Not a Leaf Partition" },
1310 { 0xfffffd51, "(-687) Cannot Abort" },
1311 { 0xfffffd50, "(-688) Cache Overflow" },
1312 { 0xfffffd4f, "(-689) Invalid Subordinate Count" },
1313 { 0xfffffd4e, "(-690) Invalid RDN" },
1314 { 0xfffffd4d, "(-691) Modification Time Not Current" },
1315 { 0xfffffd4c, "(-692) Incorrect Base Class" },
1316 { 0xfffffd4b, "(-693) Missing Reference" },
1317 { 0xfffffd4a, "(-694) Lost Entry" },
1318 { 0xfffffd49, "(-695) Agent Already Registered" },
1319 { 0xfffffd48, "(-696) DS Loader Busy" },
1320 { 0xfffffd47, "(-697) DS Cannot Reload" },
1321 { 0xfffffd46, "(-698) Replica in Skulk" },
1322 { 0xfffffd45, "(-699) Fatal" },
1323 { 0xfffffd44, "(-700) Obsolete API" },
1324 { 0xfffffd43, "(-701) Synchronization Disabled" },
1325 { 0xfffffd42, "(-702) Invalid Parameter" },
1326 { 0xfffffd41, "(-703) Duplicate Template" },
1327 { 0xfffffd40, "(-704) No Master Replica" },
1328 { 0xfffffd3f, "(-705) Duplicate Containment" },
1329 { 0xfffffd3e, "(-706) Not a Sibling" },
1330 { 0xfffffd3d, "(-707) Invalid Signature" },
1331 { 0xfffffd3c, "(-708) Invalid Response" },
1332 { 0xfffffd3b, "(-709) Insufficient Sockets" },
1333 { 0xfffffd3a, "(-710) Database Read Fail" },
1334 { 0xfffffd39, "(-711) Invalid Code Page" },
1335 { 0xfffffd38, "(-712) Invalid Escape Character" },
1336 { 0xfffffd37, "(-713) Invalide Delimiters" },
1337 { 0xfffffd36, "(-714) Not Implemented" },
1338 { 0xfffffd35, "(-715) Checksum Failure" },
1339 { 0xfffffd34, "(-716) Checksumming Not Supported" },
1340 { 0xfffffd33, "(-717) CRC Failure" },
1341 { 0xfffffd32, "(-718) Invalid Entry Handle" },
1342 { 0xfffffd31, "(-719) Invalid Value Handle" },
1343 { 0xfffffd30, "(-720) Connection Denied" },
1344 { 0xfffffd2f, "(-721) No Such Federation Link" },
1345 { 0xfffffd2e, "(-722) Operetational Schema Mismatch" },
1346 { 0xfffffd2d, "(-723) Stream Not Found" },
1347 { 0xfffffd2c, "(-724) DClient Unavailable" },
1348 { 0xfffffd2b, "(-725) MASV No Access" },
1349 { 0xfffffd2a, "(-726) MASV Invalid Request" },
1350 { 0xfffffd29, "(-727) MASV Failure" },
1351 { 0xfffffd28, "(-728) MASV Already Exists" },
1352 { 0xfffffd27, "(-729) MASV Not Found" },
1353 { 0xfffffd26, "(-730) MASV Bad Range" },
1354 { 0xfffffd25, "(-731) Value Data" },
1355 { 0xfffffd24, "(-732) Database Locked" },
1356 { 0xfffffd21, "(-735) Nothing to Abort" },
1357 { 0xfffffd20, "(-736) End of Stream" },
1358 { 0xfffffd1f, "(-737) No Such Template" },
1359 { 0xfffffd1e, "(-738) SAS Locked" },
1360 { 0xfffffd1d, "(-739) Invalid SAS Version" },
1361 { 0xfffffd1c, "(-740) SAS Already Registered" },
1362 { 0xfffffd1b, "(-741) Name Type Not Supported" },
1363 { 0xfffffd1a, "(-742) Wrong DS Version" },
1364 { 0xfffffd19, "(-743) Invalid Control Function" },
1365 { 0xfffffd18, "(-744) Invalid Control State" },
1366 { 0xfffffd17, "(-745) Cache in Use" },
1367 { 0xfffffd16, "(-746) Zero Creation Time" },
1368 { 0xfffffd15, "(-747) Would Block" },
1369 { 0xfffffd14, "(-748) Connection Timeout" },
1370 { 0xfffffd13, "(-749) Too Many Referrals" },
1371 { 0xfffffd12, "(-750) Operation Cancelled" },
1372 { 0xfffffd11, "(-751) Unknown Target" },
1373 { 0xfffffd10, "(-752) GUID Failure" },
1374 { 0xfffffd0f, "(-753) Incompatible OS" },
1375 { 0xfffffd0e, "(-754) Callback Cancel" },
1376 { 0xfffffd0d, "(-755) Invalid Synchronization Data" },
1377 { 0xfffffd0c, "(-756) Stream Exists" },
1378 { 0xfffffd0b, "(-757) Auxiliary Has Containment" },
1379 { 0xfffffd0a, "(-758) Auxiliary Not Container" },
1380 { 0xfffffd09, "(-759) Auxiliary Not Effective" },
1381 { 0xfffffd08, "(-760) Auxiliary On Alias" },
1382 { 0xfffffd07, "(-761) Have Seen State" },
1383 { 0xfffffd06, "(-762) Verb Locked" },
1384 { 0xfffffd05, "(-763) Verb Exceeds Table Length" },
1385 { 0xfffffd04, "(-764) BOF Hit" },
1386 { 0xfffffd03, "(-765) EOF Hit" },
1387 { 0xfffffd02, "(-766) Incompatible Replica Version" },
1388 { 0xfffffd01, "(-767) Query Timeout" },
1389 { 0xfffffd00, "(-768) Query Maximum Count" },
1390 { 0xfffffcff, "(-769) Duplicate Naming" },
1391 { 0xfffffcfe, "(-770) No Transaction Active" },
1392 { 0xfffffcfd, "(-771) Transaction Active" },
1393 { 0xfffffcfc, "(-772) Illegal Transaction Operation" },
1394 { 0xfffffcfb, "(-773) Iterator Syntax" },
1395 { 0xfffffcfa, "(-774) Repairing DIB" },
1396 { 0xfffffcf9, "(-775) Invalid OID Format" },
1397 { 0xfffffcf8, "(-776) Attempted to perform an NDS operation, and the DS agent on this server is closing" },
1398 { 0xfffffcf7, "(-777) Attempted to modify an object's attribute that is not stored on the sparse replica" },
1399 { 0xfffffcf6, "(-778) VpVector and VpvUser which must be correlated, are out of sync" },
1400 { 0xfffffcf5, "(-779) Error Cannot Go Remote" },
1401 { 0xfffffcf4, "(-780) Request not Supported" },
1402 { 0xfffffcf3, "(-781) Entry Not Local" },
1403 { 0xfffffcf2, "(-782) Root Unreachable" },
1404 { 0xfffffcf1, "(-783) VRDIM Not Initialized" },
1405 { 0xfffffcf0, "(-784) Wait Timeout" },
1406 { 0xfffffcef, "(-785) DIB Error" },
1407 { 0xfffffcee, "(-786) DIB IO Failure" },
1408 { 0xfffffced, "(-787) Illegal Schema Attribute" },
1409 { 0xfffffcec, "(-788) Error Schema Partition" },
1410 { 0xfffffceb, "(-789) Invalid Template" },
1411 { 0xfffffcea, "(-790) Error Opening File" },
1412 { 0xfffffce9, "(-791) Error Direct Opening File" },
1413 { 0xfffffce8, "(-792) Error Creating File" },
1414 { 0xfffffce7, "(-793) Error Direct Creating File" },
1415 { 0xfffffce6, "(-794) Error Reading File" },
1416 { 0xfffffce5, "(-795) Error Direct Reading File" },
1417 { 0xfffffce4, "(-796) Error Writing File" },
1418 { 0xfffffce3, "(-797) Error Direct Writing File" },
1419 { 0xfffffce2, "(-798) Error Positioning in File" },
1420 { 0xfffffce1, "(-799) Error Getting File Size" },
1421 { 0xffffe88f, "(-6001) Error Truncating File" },
1422 { 0xffffe88e, "(-6002) Error Parsing File Name" },
1423 { 0xffffe88d, "(-6003) Error Closing File" },
1424 { 0xffffe88c, "(-6004) Error Getting File Info" },
1425 { 0xffffe88b, "(-6005) Error Expanding File" },
1426 { 0xffffe88a, "(-6006) Error Getting Free Blocks" },
1427 { 0xffffe889, "(-6007) Error Checking File Existence" },
1428 { 0xffffe888, "(-6008) Error Deleting File" },
1429 { 0xffffe887, "(-6009) Error Renaming File" },
1430 { 0xffffe886, "(-6010) Error Initializing IO System" },
1431 { 0xffffe885, "(-6011) Error Flushing File" },
1432 { 0xffffe884, "(-6012) Error Setting Up for Read" },
1433 { 0xffffe883, "(-6013) Error Setting up for Write" },
1434 { 0xffffe882, "(-6014) Error Old View" },
1435 { 0xffffe881, "(-6015) Server in Skulk" },
1436 { 0xffffe880, "(-6016) Error Returning Partial Results" },
1437 { 0xffffe87f, "(-6017) No Such Schema" },
1438 { 0xffffe87e, "(-6018) Serial Number Mismatch" },
1439 { 0xffffe87d, "(-6019) Bad Referal Database Serial Number" },
1440 { 0xffffe87c, "(-6020) Bad Referal Serial Number" },
1441 { 0xffffe87b, "(-6021) Invalid File Sequence" },
1442 { 0xffffe87a, "(-6022) Error Referal Trans Gap" },
1443 { 0xffffe879, "(-6023) Bad Referal File Number" },
1444 { 0xffffe878, "(-6024) Referal File Not Found" },
1445 { 0xffffe877, "(-6025) Error Backup Active" },
1446 { 0xffffe876, "(-6026) Referal Device Full" },
1447 { 0xffffe875, "(-6027) Unsupported Version" },
1448 { 0xffffe874, "(-6028) Error Must Wait Checkpoint" },
1449 { 0xffffe873, "(-6029) Attribute Maintenance in Progress" },
1450 { 0xffffe872, "(-6030) Error Abort Transaction" },
1451 { 0xffff0000, "Ok" },
1456 #define NDS_PTYPE_IPX 0x00000000
1457 #define NDS_PTYPE_IP 0x00000001
1458 #define NDS_PTYPE_SDLC 0x00000002
1459 #define NDS_PTYPE_TR_ON_ETH 0x00000003
1460 #define NDS_PTYPE_OSI 0x00000004
1461 #define NDS_PTYPE_APPLETALK 0x00000005
1462 #define NDS_PTYPE_NETBEUI 0x00000006
1463 #define NDS_PTYPE_SOCKETADDRESS 0x00000007
1464 #define NDS_PTYPE_UDP 0x00000008
1465 #define NDS_PTYPE_TCP 0x00000009
1466 #define NDS_PTYPE_UDPv6 0x0000000a
1467 #define NDS_PTYPE_TCPv6 0x0000000b
1468 #define NDS_PTYPE_INTERNAL 0x0000000c
1469 #define NDS_PTYPE_URL 0x0000000d
1470 #define NDS_PTYPE_DNS 0x0000000e
1472 static const value_string nds_protocol_type[] = {
1473 { NDS_PTYPE_IPX, "(IPX Protocol)" },
1474 { NDS_PTYPE_IP, "(IP Protocol)" },
1475 { NDS_PTYPE_SDLC, "(SDLC Protocol)" },
1476 { NDS_PTYPE_TR_ON_ETH, "(TokenRing on Ethernet Protocol)" },
1477 { NDS_PTYPE_OSI, "(OSI Protocol)" },
1478 { NDS_PTYPE_APPLETALK, "(AppleTalk Protocol)" },
1479 { NDS_PTYPE_NETBEUI, "(NetBEUI Protocol)" },
1480 { NDS_PTYPE_SOCKETADDRESS, "(Socket Address Protocol)" },
1481 { NDS_PTYPE_UDP, "(UDP Protocol)" },
1482 { NDS_PTYPE_TCP, "(TCP Protocol)" },
1483 { NDS_PTYPE_UDPv6, "(UDP v6 Protocol)" },
1484 { NDS_PTYPE_TCPv6, "(TCP v6 Protocol)" },
1485 { NDS_PTYPE_INTERNAL, "(Internal Protocol)" },
1486 { NDS_PTYPE_URL, "(URL Protocol)" },
1487 { NDS_PTYPE_DNS, "(DNS Protocol)" },
1492 static const value_string nds_syntax[] = {
1493 { 0x00000000, "Unknown Syntax" },
1494 { 0x00000001, "Distinguished Name" },
1495 { 0x00000002, "Case Sensitive Unicode String" },
1496 { 0x00000003, "Non Case Sensitive Unicode String" },
1497 { 0x00000004, "Printable String" },
1498 { 0x00000005, "Numeric String" },
1499 { 0x00000006, "Case Insensitive List" },
1500 { 0x00000007, "Boolean" },
1501 { 0x00000008, "Signed Integer" },
1502 { 0x00000009, "Binary String" },
1503 { 0x0000000a, "Telephone Number" },
1504 { 0x0000000b, "Fax Number" },
1505 { 0x0000000c, "Network Address" },
1506 { 0x0000000d, "Binary String List" },
1507 { 0x0000000e, "Email Address" },
1508 { 0x0000000f, "File System Path" },
1509 { 0x00000010, "Replica Pointer" },
1510 { 0x00000011, "Object ACL" },
1511 { 0x00000012, "Postal Address" },
1512 { 0x00000013, "Time Stamp" },
1513 { 0x00000014, "Class Name" },
1514 { 0x00000015, "Stream" },
1515 { 0x00000016, "Counter" },
1516 { 0x00000017, "Back Link" },
1517 { 0x00000018, "Time" },
1518 { 0x00000019, "Typed Name" },
1519 { 0x0000001a, "Hold" },
1520 { 0x0000001b, "Interval" },
1524 static const value_string name_space_type[] = {
1525 { 0x00000000, "DOS Name Space" },
1526 { 0x00000001, "MAC Name Space" },
1527 { 0x00000002, "NFS Name Space" },
1528 { 0x00000003, "FTAM Name Space" },
1529 { 0x00000004, "OS/2, Long Name Space" },
1534 static const value_string nds_replica_state[] = {
1537 { 0x0002, "Dying" },
1538 { 0x0003, "Locked" },
1539 { 0x0004, "Create Master State 0" },
1540 { 0x0005, "Create Master State 1" },
1541 { 0x0006, "Transition On" },
1542 { 0x0007, "Dead Replica" },
1543 { 0x0008, "Begin Add" },
1544 { 0x000b, "Master Start" },
1545 { 0x000c, "Master Done" },
1546 { 0x0017, "Federated" },
1547 { 0x0030, "Split State 0" },
1548 { 0x0031, "Split State 1" },
1549 { 0x0040, "Join State 0" },
1550 { 0x0041, "Join State 1" },
1551 { 0x0042, "Join State 2" },
1552 { 0x0050, "Move Subtree State 0" },
1553 { 0x0051, "Move Subtree State 1" },
1557 static const value_string nds_replica_type[] = {
1558 { 0x0000, "Master" },
1559 { 0x0001, "Secondary" },
1560 { 0x0002, "Read Only" },
1561 { 0x0003, "Sub Ref" },
1565 static const value_string class_def_type[] = {
1566 { 0x0000, "Return Class Name" },
1567 { 0x0001, "Return Class Name, Flag, and Definition" },
1568 { 0x0002, "Return Class Name, Flag, Definition, and Super Class" },
1569 { 0x0003, "Return Class Name, Flag, and ASN.1 identifier" },
1570 { 0x0004, "Return Class Name, Flag, Definition, Super Class, and ACL" },
1571 { 0x0005, "Return Class Name, Flag, Creation Timestamp, Modification Timestamp, Definition, and ACL" },
1575 static const value_string nds_search_scope[] = {
1576 { 0x0000, "Examine the base object only" },
1577 { 0x0001, "Search the immediate subordinates of the base object" },
1578 { 0x0002, "Search the base object and all its subordinates" },
1579 { 0x0003, "Search the base objects and all objects in its partition (Implemented in NDS 8)" },
1583 static const value_string nds_verb2b_flag_vals[] = {
1584 { 0, "Request Flags (0x0000) - Retain old object name" },
1585 { 1, "Request Flags (0x0001) - Delete old object name" },
1590 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
1591 int *req_cond_results, gboolean really_decode,
1592 const ncp_record *ncp_rec);
1594 /* NCP packets come in request/reply pairs. The request packets tell the type
1595 * of NCP request and give a sequence ID. The response, unfortunately, only
1596 * identifies itself via the sequence ID; you have to know what type of NCP
1597 * request the request packet contained in order to successfully parse the NCP
1598 * response. A global method for doing this does not exist in wireshark yet
1599 * (NFS also requires it), so for now the NCP section will keep its own hash
1600 * table keeping track of NCP packet types.
1602 * We construct a conversation specified by the client and server
1603 * addresses and the connection number; the key representing the unique
1604 * NCP request then is composed of the pointer to the conversation
1605 * structure, cast to a "guint" (which may throw away the upper 32
1606 * bits of the pointer on a P64 platform, but the low-order 32 bits
1607 * are more likely to differ between conversations than the upper 32 bits),
1608 * and the sequence number.
1610 * The value stored in the hash table is the ncp_req_hash_value pointer. This
1611 * struct tells us the NCP type and gives the ncp2222_record pointer, if
1612 * ncp_type == 0x2222.
1615 conversation_t *conversation;
1622 } ncp_req_eid_hash_key;
1625 ncp_req_eid_hash_key *nds_eid;
1626 char object_name[256];
1628 } ncp_req_eid_hash_value;
1630 static GHashTable *ncp_req_hash = NULL;
1631 static GHashTable *ncp_req_eid_hash = NULL;
1632 static GMemChunk *ncp_req_eid_hash_keys = NULL;
1633 static GMemChunk *ncp_req_eid_hash_values = NULL;
1634 static GMemChunk *ncp_req_hash_keys = NULL;
1635 static GMemChunk *ncp_req_hash_values = NULL;
1637 /* Hash Functions */
1639 ncp_equal(gconstpointer v, gconstpointer v2)
1641 const ncp_req_hash_key *val1 = (const ncp_req_hash_key*)v;
1642 const ncp_req_hash_key *val2 = (const ncp_req_hash_key*)v2;
1644 if (val1->conversation == val2->conversation &&
1645 val1->nw_sequence == val2->nw_sequence ) {
1652 ncp_eid_equal(gconstpointer v, gconstpointer v2)
1654 const ncp_req_eid_hash_key *val1 = (const ncp_req_eid_hash_key*)v;
1655 const ncp_req_eid_hash_key *val2 = (const ncp_req_eid_hash_key*)v2;
1657 if (val1->nw_eid == val2->nw_eid ) {
1664 ncp_hash(gconstpointer v)
1666 const ncp_req_hash_key *ncp_key = (const ncp_req_hash_key*)v;
1667 return GPOINTER_TO_UINT(ncp_key->conversation) + ncp_key->nw_sequence;
1671 ncp_eid_hash(gconstpointer v)
1673 const ncp_req_eid_hash_key *ncp_eid_key = (const ncp_req_eid_hash_key*)v;
1674 return GPOINTER_TO_UINT(ncp_eid_key->nw_eid);
1677 /* Frees memory used by the ncp_req_hash_value's */
1679 ncp_req_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
1681 ncp_req_hash_value *request_value = (ncp_req_hash_value*) value;
1683 if (request_value->req_cond_results) {
1684 g_free(request_value->req_cond_results);
1688 /* Frees memory used by the ncp_req_hash_value's */
1690 ncp_req_eid_hash_cleanup(gpointer key _U_, gpointer value, gpointer user_data _U_)
1692 ncp_req_eid_hash_value *request_eid_value = (ncp_req_eid_hash_value*) value;
1694 if (request_eid_value->object_class) {
1695 g_free(request_eid_value->object_name);
1699 /* Initializes the hash table and the mem_chunk area each time a new
1700 * file is loaded or re-loaded in wireshark */
1702 ncp_init_protocol(void)
1707 fragment_table_init(&nds_fragment_table);
1708 reassembled_table_init(&nds_reassembled_table);
1710 for (i = 0; i < 99; i++) {
1711 frags[i].nds_frag = 0xfffffff0;
1715 g_hash_table_foreach(ncp_req_hash, ncp_req_hash_cleanup, NULL);
1716 g_hash_table_destroy(ncp_req_hash);
1718 if (ncp_req_eid_hash) {
1719 g_hash_table_foreach(ncp_req_eid_hash, ncp_req_eid_hash_cleanup, NULL);
1720 g_hash_table_destroy(ncp_req_eid_hash);
1722 if (ncp_req_hash_keys)
1723 g_mem_chunk_destroy(ncp_req_hash_keys);
1724 if (ncp_req_hash_values)
1725 g_mem_chunk_destroy(ncp_req_hash_values);
1726 if (ncp_req_eid_hash_keys)
1727 g_mem_chunk_destroy(ncp_req_eid_hash_keys);
1728 if (ncp_req_eid_hash_values)
1729 g_mem_chunk_destroy(ncp_req_eid_hash_values);
1731 ncp_req_hash = g_hash_table_new(ncp_hash, ncp_equal);
1732 ncp_req_eid_hash = g_hash_table_new(ncp_eid_hash, ncp_eid_equal);
1733 ncp_req_hash_keys = g_mem_chunk_new("ncp_req_hash_keys",
1734 sizeof(ncp_req_hash_key),
1735 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_key),
1737 ncp_req_hash_values = g_mem_chunk_new("ncp_req_hash_values",
1738 sizeof(ncp_req_hash_value),
1739 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_hash_value),
1741 ncp_req_eid_hash_keys = g_mem_chunk_new("ncp_req_eid_hash_keys",
1742 sizeof(ncp_req_eid_hash_key),
1743 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_key),
1745 ncp_req_eid_hash_values = g_mem_chunk_new("ncp_req_eid_hash_values",
1746 sizeof(ncp_req_eid_hash_value),
1747 NCP_PACKET_INIT_COUNT * sizeof(ncp_req_eid_hash_value),
1751 /* After the sequential run, we don't need the ncp_request hash and keys
1752 * anymore; the lookups have already been done and the vital info
1753 * saved in the reply-packets' private_data in the frame_data struct. */
1755 ncp_postseq_cleanup(void)
1758 /* Destroy the hash, but don't clean up request_condition data. */
1759 /*g_hash_table_destroy(ncp_req_hash);
1760 ncp_req_hash = NULL;*/
1762 if (ncp_req_hash_keys) {
1763 /*g_mem_chunk_destroy(ncp_req_hash_keys);
1764 ncp_req_hash_keys = NULL;*/
1766 /* Don't free the ncp_req_hash_values or EID_hash_table, as they're
1767 * needed during random-access processing of the proto_tree.*/
1770 static ncp_req_hash_value*
1771 ncp_hash_insert(conversation_t *conversation, guint8 nw_sequence,
1772 const ncp_record *ncp_rec)
1774 ncp_req_hash_key *request_key;
1775 ncp_req_hash_value *request_value;
1777 /* Now remember the request, so we can find it if we later
1779 request_key = g_mem_chunk_alloc(ncp_req_hash_keys);
1780 request_key->conversation = conversation;
1781 request_key->nw_sequence = nw_sequence;
1783 request_value = g_mem_chunk_alloc(ncp_req_hash_values);
1784 request_value->ncp_rec = ncp_rec;
1785 request_value->req_cond_results = NULL;
1786 request_value->req_nds_flags = 0;
1787 request_value->nds_request_verb = 0;
1788 request_value->nds_version = 0;
1789 g_strlcpy(request_value->object_name, " ", 256);
1790 request_value->nds_frag = TRUE;
1792 g_hash_table_insert(ncp_req_hash, request_key, request_value);
1794 return request_value;
1797 static ncp_req_eid_hash_value*
1798 ncp_eid_hash_insert(guint32 nw_eid)
1800 ncp_req_eid_hash_key *request_eid_key;
1801 ncp_req_eid_hash_value *request_eid_value;
1803 /* Now remember the request, so we can find it if we later
1805 request_eid_key = g_mem_chunk_alloc(ncp_req_eid_hash_keys);
1806 request_eid_key->nw_eid = nw_eid;
1808 request_eid_value = g_mem_chunk_alloc(ncp_req_eid_hash_values);
1809 g_strlcpy(request_eid_value->object_name, " ", 256);
1810 request_eid_value->object_class = NULL;
1812 g_hash_table_insert(ncp_req_eid_hash, request_eid_key, request_eid_value);
1814 return request_eid_value;
1817 /* Returns the ncp_rec*, or NULL if not found. */
1818 static ncp_req_hash_value*
1819 ncp_hash_lookup(conversation_t *conversation, guint8 nw_sequence)
1821 ncp_req_hash_key request_key;
1823 request_key.conversation = conversation;
1824 request_key.nw_sequence = nw_sequence;
1826 return g_hash_table_lookup(ncp_req_hash, &request_key);
1829 /* Returns the value_rec* for needed EID, or NULL if not found. */
1830 static ncp_req_eid_hash_value*
1831 ncp_eid_hash_lookup(conversation_t *conversation _U_, guint32 nw_eid)
1833 ncp_req_eid_hash_key request_eid_key;
1835 request_eid_key.nw_eid = nw_eid;
1837 return g_hash_table_lookup(ncp_req_eid_hash, &request_eid_key);
1840 /* Does NCP func require a subfunction code? */
1842 ncp_requires_subfunc(guint8 func)
1844 const guint8 *ncp_func_requirement = ncp_func_requires_subfunc;
1846 while (*ncp_func_requirement != 0) {
1847 if (*ncp_func_requirement == func) {
1850 ncp_func_requirement++;
1855 /* Does the NCP func have a length parameter? */
1857 ncp_has_length_parameter(guint8 func)
1859 const guint8 *ncp_func_requirement = ncp_func_has_no_length_parameter;
1861 while (*ncp_func_requirement != 0) {
1862 if (*ncp_func_requirement == func) {
1865 ncp_func_requirement++;
1871 /* Return a ncp_record* based on func and possibly subfunc */
1872 static const ncp_record *
1873 ncp_record_find(guint8 func, guint8 subfunc)
1875 const ncp_record *ncp_rec = ncp_packets;
1877 while(ncp_rec->func != 0 || ncp_rec->subfunc != 0 ||
1878 ncp_rec->name != NULL ) {
1879 if (ncp_rec->func == func) {
1880 if (ncp_rec->has_subfunc) {
1881 if (ncp_rec->subfunc == subfunc) {
1895 /* Given a proto_item*, assume it contains an integer value
1896 * and return a guint from it. */
1898 get_finfo_value_integer(field_info *finfo)
1900 /* XXX the fvalue functions are no longer safe to call directly
1901 since we sometimes fake the entries to speed things up.
1902 this dissector should not call fvalue_ functions directly.
1904 if(!finfo->value.ftype->get_value_uinteger){
1907 return fvalue_get_uinteger(&finfo->value);
1910 get_item_value(proto_item *item)
1912 return get_finfo_value_integer(PITEM_FINFO(item));
1917 get_finfo_length(field_info *finfo)
1919 return fvalue_length(&finfo->value);
1924 get_finfo_value_string(field_info *finfo)
1926 return fvalue_get(&finfo->value);
1930 get_item_string(proto_item *item)
1932 return get_finfo_value_string(PITEM_FINFO(item));
1937 get_item_name(proto_item *item)
1939 return PITEM_FINFO(item)->hfinfo->name;
1943 typedef proto_item* (*padd_func_t)(ptvcursor_t*, const ptvc_record*);
1946 * XXX - are these just DOS-format dates and times?
1948 * Should we put code to understand various date and time formats (UNIX,
1949 * DOS, SMB weird mutant UNIX, NT, Mac, etc. into libwireshark, and have
1950 * the "display" member of an HF_ABSOLUTE_TIME field specify whether
1951 * it's DOS date/DOS time, DOS time/DOS date, NT time, UNIX time_t,
1952 * UNIX "struct timeval", NFSv3/NFSv4 seconds/nanoseconds, Mac, etc.?
1954 * What about hijacking the "bitmask" field to specify the precision of
1955 * the time stamp, or putting a combination of precision and format
1956 * into the "display" member?
1958 * What about relative times? Should they have units (seconds, milliseconds,
1959 * microseconds, nanoseconds, etc.), precision, and format in there?
1977 #define VTYPE_NONE 0 /* no value */
1978 #define VTYPE_UINT8 1
1979 #define VTYPE_UINT16 2
1980 #define VTYPE_UINT32 3
1981 #define VTYPE_STRING 4
1982 #define VTYPE_BITFIELD 5
1983 #define VTYPE_MULTIVALUE_UINT32 6
1984 #define VTYPE_BYTES 7
1985 #define VTYPE_BOOLEAN 8
1986 #define VTYPE_ITEM 9
1988 #define MVTYPE_ATTR_REQUEST 1
1989 #define MVTYPE_ATTR_REPLY 2
1990 #define MVTYPE_ATTR_REQUEST2 3
1991 #define MVTYPE_READ_CLASS_REQ 4
1992 #define MVTYPE_READ_REPLICAS 5
1993 #define MVTYPE_MODIFY_ATTR_REQUEST 6
1994 #define MVTYPE_ADDR_REFERRAL_REQUEST 7
1995 #define MVTYPE_ADDR_REFERRAL_REPLY 8
1996 #define MVTYPE_LOC_ADDR_REFERRAL_REPLY 9
1997 #define MVTYPE_PROC_ENTRY_SPECIFIERS 10
1998 #define MVTYPE_PRINT_TIMESTAMP 11
1999 #define MVTYPE_LIST_PARTITIONS 12
2000 #define MVTYPE_CLASS_NAMES 13
2001 #define MVTYPE_MODIFY_CLASS 14
2002 #define MVTYPE_ADD_ATTR_REQUEST 15
2003 #define MVTYPE_PROCESS_TAGS 16
2004 #define MVTYPE_PROCESS_ITERATOR 17
2033 guint32 bit10hfname;
2035 guint32 bit11hfname;
2037 guint32 bit12hfname;
2039 guint32 bit13hfname;
2041 guint32 bit14hfname;
2043 guint32 bit15hfname;
2045 guint32 bit16hfname;
2048 guint32 nds_version;
2052 /* Given an integer, fill in a nw_date_t struct. */
2054 uint_to_nwdate(guint data, nw_date_t *nwdate)
2056 nwdate->day = data & 0x001f;
2057 nwdate->month = (data & 0x01e0) >> 5;
2058 nwdate->year = ((data & 0xfe00) >> 9) + 1980;
2061 /* Given an integer, fill in a nw_time_t struct. */
2063 uint_to_nwtime(guint data, nw_time_t *nwtime)
2065 /* 2-second resolution */
2066 nwtime->second = (data & 0x001f) * 2;
2067 nwtime->minute = ((data & 0x07e0) >> 5);
2068 nwtime->hour = ((data & 0xf800) >> 11);
2072 padd_normal(ptvcursor_t *ptvc, const ptvc_record *rec)
2075 ptvcursor_add(ptvc, *rec->hf_ptr,
2076 rec->length, rec->endianness);
2080 padd_date(ptvcursor_t *ptvc, const ptvc_record *rec)
2086 offset = ptvcursor_current_offset(ptvc);
2088 item = ptvcursor_add(ptvc, *rec->hf_ptr,
2089 rec->length, rec->endianness);
2092 uint_to_nwdate(get_item_value(item), &nw_date);
2094 proto_item_set_text(item, "%s", get_item_name(item));
2095 proto_item_append_text(item, ": %04u/%02u/%02u",
2096 nw_date.year, nw_date.month, nw_date.day);
2102 padd_time(ptvcursor_t *ptvc, const ptvc_record *rec)
2108 offset = ptvcursor_current_offset(ptvc);
2110 item = ptvcursor_add(ptvc, *rec->hf_ptr,
2111 rec->length, rec->endianness);
2114 uint_to_nwtime(get_item_value(item), &nw_time);
2116 proto_item_set_text(item, "%s", get_item_name(item));
2117 proto_item_append_text(item, ": %02u:%02u:%02u",
2118 nw_time.hour, nw_time.minute, nw_time.second);
2124 /* Convert a string from little-endian unicode to ascii. At the moment we
2125 fake it by taking every odd byte. )-: The caller must free the
2128 padd_uni(ptvcursor_t *ptvc, const ptvc_record *rec)
2134 nw_uni.buffer[0] = '\0';
2135 offset = ptvcursor_current_offset(ptvc);
2137 item = ptvcursor_add(ptvc, *rec->hf_ptr,
2138 rec->length, rec->endianness);
2141 proto_item_set_text(item, "%s", get_item_name(item));
2142 proto_item_append_text(item, " %s",
2149 /* Add a value for a ptvc_record, and process the sub-ptvc_record
2150 * that it points to. */
2152 process_bitfield_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
2153 gboolean really_decode)
2156 proto_tree *sub_tree;
2157 const ptvc_record *sub_rec;
2160 ptvcursor_t *sub_ptvc;
2162 if (really_decode) {
2163 /* Save the current offset */
2164 current_offset = ptvcursor_current_offset(ptvc);
2167 item = ptvcursor_add(ptvc, *rec->hf_ptr, rec->length,
2170 ett = *rec->sub_ptvc_rec->ett;
2172 /* Make a new protocol sub-tree */
2173 sub_tree = proto_item_add_subtree(item, ett);
2175 /* Make a new ptvcursor */
2176 sub_ptvc = ptvcursor_new(sub_tree, ptvcursor_tvbuff(ptvc),
2180 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
2181 while(sub_rec->hf_ptr != NULL) {
2182 DISSECTOR_ASSERT(!sub_rec->sub_ptvc_rec);
2183 ptvcursor_add_no_advance(sub_ptvc, *sub_rec->hf_ptr,
2184 sub_rec->length, sub_rec->endianness);
2189 ptvcursor_free(sub_ptvc);
2192 DISSECTOR_ASSERT(rec->length > 0 &&
2193 proto_registrar_get_nth(*rec->hf_ptr)->type != FT_UINT_STRING);
2194 ptvcursor_advance(ptvc, rec->length);
2198 /* Process a sub-ptvc_record that points to a "struct" ptvc_record. */
2200 process_struct_sub_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
2201 int *req_cond_results, gboolean really_decode,
2202 const ncp_record *ncp_rec)
2204 const ptvc_record *sub_rec;
2206 proto_tree *old_tree=NULL, *new_tree;
2207 proto_item *item=NULL;
2210 /* Create a sub-proto_tree? */
2211 if (rec->sub_ptvc_rec->descr) {
2212 ett = *rec->sub_ptvc_rec->ett;
2213 old_tree = ptvcursor_tree(ptvc);
2214 offset = ptvcursor_current_offset(ptvc);
2215 item = proto_tree_add_text(old_tree, ptvcursor_tvbuff(ptvc),
2216 offset, PROTO_LENGTH_UNTIL_END,
2217 rec->sub_ptvc_rec->descr);
2218 new_tree = proto_item_add_subtree(item, ett);
2219 ptvcursor_set_tree(ptvc, new_tree);
2222 /* Get the ptvc_record for the struct and call our caller
2224 sub_rec = rec->sub_ptvc_rec->ptvc_rec;
2225 process_ptvc_record(ptvc, sub_rec, req_cond_results, really_decode, ncp_rec);
2227 /* Re-set the tree */
2228 if (rec->sub_ptvc_rec->descr) {
2229 if (ptvcursor_current_offset(ptvc) <= offset)
2230 THROW(ReportedBoundsError);
2232 proto_item_set_len(item, ptvcursor_current_offset(ptvc) - offset);
2233 ptvcursor_set_tree(ptvc, old_tree);
2237 /* Run through the table of ptvc_record's and add info to the tree. This
2238 * is the work-horse of process_ptvc_record(). */
2240 _process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
2241 int *req_cond_results, gboolean really_decode,
2242 const ncp_record *ncp_rec)
2245 guint i, repeat_count;
2246 padd_func_t func = NULL;
2248 if (rec->sub_ptvc_rec) {
2250 if (rec->repeat_index == NO_REPEAT) {
2251 if (rec->hf_ptr == PTVC_STRUCT) {
2252 process_struct_sub_ptvc_record(ptvc, rec,
2253 req_cond_results, really_decode,
2257 process_bitfield_sub_ptvc_record(ptvc, rec,
2262 repeat_count = repeat_vars[rec->repeat_index];
2263 for (i = 0; i < repeat_count; i++ ) {
2264 if (rec->hf_ptr == PTVC_STRUCT) {
2265 process_struct_sub_ptvc_record(ptvc, rec,
2266 req_cond_results, really_decode,
2270 process_bitfield_sub_ptvc_record(ptvc, rec,
2277 /* If we can't repeat this field, we might use it
2278 * to set a 'var'. */
2279 if (rec->repeat_index == NO_REPEAT) {
2280 if (really_decode) {
2281 /* Handle any special formatting. */
2282 switch(rec->special_fmt) {
2286 case NCP_FMT_NW_DATE:
2289 case NCP_FMT_NW_TIME:
2292 case NCP_FMT_UNICODE:
2296 DISSECTOR_ASSERT_NOT_REACHED();
2298 item = func(ptvc, rec);
2300 /* Set the value as a 'var' ? */
2301 if (rec->var_index != NO_VAR) {
2302 repeat_vars[rec->var_index] = get_item_value(item);
2306 /* If we don't decode the field, we
2307 * better not use the value to set a var.
2308 * Actually, we could, as long as we don't
2309 * *use* that var; for now keep this assert in
2311 DISSECTOR_ASSERT(rec->var_index == NO_VAR);
2313 /* This had better not be variable-length,
2315 DISSECTOR_ASSERT(rec->length > 0 &&
2316 proto_registrar_get_nth(*rec->hf_ptr)->type != FT_UINT_STRING);
2317 ptvcursor_advance(ptvc, rec->length);
2321 /* We do repeat this field. */
2322 repeat_count = repeat_vars[rec->repeat_index];
2323 if (really_decode) {
2324 /* Handle any special formatting. */
2325 switch(rec->special_fmt) {
2329 case NCP_FMT_NW_DATE:
2332 case NCP_FMT_NW_TIME:
2335 case NCP_FMT_UNICODE:
2339 DISSECTOR_ASSERT_NOT_REACHED();
2341 for (i = 0; i < repeat_count; i++ ) {
2346 for (i = 0; i < repeat_count; i++ ) {
2347 DISSECTOR_ASSERT(rec->length > 0 &&
2348 proto_registrar_get_nth(*rec->hf_ptr)->type != FT_UINT_STRING);
2349 ptvcursor_advance(ptvc, rec->length);
2356 /* Run through the table of ptvc_record's and add info to the tree.
2357 * Honor a request condition result. */
2359 process_ptvc_record(ptvcursor_t *ptvc, const ptvc_record *rec,
2360 int *req_cond_results, gboolean really_decode,
2361 const ncp_record *ncp_rec)
2365 while(rec->hf_ptr != NULL) {
2366 decode = really_decode;
2367 /* If we're supposed to decode, check the request condition
2368 * results to see if we should override this and *not* decode. */
2369 if (decode && req_cond_results) {
2370 if (rec->req_cond_index != NO_REQ_COND) {
2371 if (req_cond_results[rec->req_cond_index] == FALSE) {
2376 if (decode || ncp_rec->req_cond_size_type == REQ_COND_SIZE_CONSTANT) {
2377 _process_ptvc_record(ptvc, rec, req_cond_results, decode, ncp_rec);
2385 /* Clear the repeat_vars array. */
2387 clear_repeat_vars(void)
2391 for (i = 0 ; i < NUM_REPEAT_VARS; i++ ) {
2397 /* Given an error_equivalency table and a completion code, return
2398 * the string representing the error. */
2400 ncp_error_string(const error_equivalency *errors, guint8 completion_code)
2403 while (errors->ncp_error_index != -1) {
2404 if (errors->error_in_packet == completion_code) {
2405 return ncp_errors[errors->ncp_error_index];
2410 return "Unknown Error Code";
2413 static const ncp_record ncp1111_request =
2414 { 0x1, 0x00, NO_SUBFUNC, "Create Connection Service", NCP_GROUP_CONNECTION,
2415 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
2417 static const ncp_record ncp5555_request =
2418 { 0x5, 0x00, NO_SUBFUNC, "Destroy Connection Service", NCP_GROUP_CONNECTION,
2419 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
2421 static const ncp_record ncpbbbb_request =
2422 { 0xb, 0x00, NO_SUBFUNC, "Server Broadcast Message", NCP_GROUP_CONNECTION,
2423 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
2425 static const ncp_record ncplip_echo =
2426 { 0x1f, 0x00, NO_SUBFUNC, "LIP Echo Packet", NCP_GROUP_CONNECTION,
2427 NULL, NULL, ncp_0x2_errors, NULL, NO_REQ_COND_SIZE, NULL };
2429 /* Wrapper around proto_tree_free() */
2430 static void free_proto_tree(void *tree)
2433 proto_tree_free((proto_tree*) tree);
2438 align_4(tvbuff_t *tvb, guint32 aoffset)
2440 if(tvb_length_remaining(tvb, aoffset) > 4 )
2448 get_string(tvbuff_t* tvb, guint offset, guint str_length, char *dest_buf)
2452 gint length_remaining = 0;
2454 length_remaining = tvb_length_remaining(tvb, offset);
2455 if((gint)str_length > length_remaining)
2457 THROW(ReportedBoundsError);
2464 for ( i = 0; i < (gint)str_length; i++ )
2466 c_char = tvb_get_guint8(tvb, offset );
2467 if (c_char<0x20 || c_char>0x7e)
2472 dest_buf[i] = c_char & 0xff;
2482 dest_buf[i] = c_char & 0xff;
2487 if(length_remaining==1)
2489 dest_buf[i+1] = '\0';
2492 if (i >= 1023) { /* Don't process beyond the size of our varible */
2493 break; /* If string is too long just return the first 1K. */
2504 uni_to_string(char * data, guint32 str_length, char *dest_buf)
2508 gint length_remaining = 0;
2510 length_remaining = str_length;
2516 for ( i = 0; i < (gint) str_length; i++ )
2519 if (c_char<0x20 || c_char>0x7e)
2524 dest_buf[i] = c_char & 0xff;
2534 dest_buf[i] = c_char & 0xff;
2538 if(length_remaining==0)
2540 dest_buf[i+1] = '\0';
2551 /*************************************
2552 * Return based on % format in request
2553 * %d = integer in decimal format = 0
2554 * %x = integer in hex format = 1
2556 **************************************/
2558 get_info_type(const gchar* check_string)
2564 length = strlen(check_string);
2566 for (i = 0 ; i < length-1 ; i++ ) {
2567 char_val = check_string[i+1];
2568 if (check_string[i] == 0x25 && check_string[i+1] == 0x64) { /* %d Digits*/
2571 if ( check_string[i] == 0x78 && check_string[i+1] == 0x25 && check_string[i+2] == 0x73) { /* x%s Bytes*/
2575 return 2; /* Normal String */
2579 process_bitfield(proto_tree *ncp_tree, tvbuff_t *tvb, nds_val *values)
2581 gchar flags_str[512];
2584 proto_tree *flags_tree;
2588 bvalue = 0x00000001;
2591 for (i = 0 ; i < (values->vlength*8); i++ ) {
2592 if (values->vvalue & bvalue)
2594 g_strlcat(flags_str, sep, 512);
2597 g_strlcat(flags_str, values->bit1, 512);
2600 g_strlcat(flags_str, values->bit2, 512);
2603 g_strlcat(flags_str, values->bit3, 512);
2606 g_strlcat(flags_str, values->bit4, 512);
2609 g_strlcat(flags_str, values->bit5, 512);
2612 g_strlcat(flags_str, values->bit6, 512);
2615 g_strlcat(flags_str, values->bit7, 512);
2618 g_strlcat(flags_str, values->bit8, 512);
2621 g_strlcat(flags_str, values->bit9, 512);
2624 g_strlcat(flags_str, values->bit10, 512);
2627 g_strlcat(flags_str, values->bit11, 512);
2630 g_strlcat(flags_str, values->bit12, 512);
2633 g_strlcat(flags_str, values->bit13, 512);
2636 g_strlcat(flags_str, values->bit14, 512);
2639 g_strlcat(flags_str, values->bit15, 512);
2642 g_strlcat(flags_str, values->bit16, 512);
2651 if(values->vlength==4)
2653 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
2654 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%08x",
2655 values->vdesc, values->vvalue);
2659 tinew = proto_tree_add_uint_format(ncp_tree, values->hfname,
2660 tvb, values->voffset, values->vlength, values->vvalue, "%s 0x%04x",
2661 values->vdesc, values->vvalue);
2663 if (flags_str[0] != '\0')
2664 proto_item_append_text(tinew, " - (%s)", flags_str);
2666 flags_tree = proto_item_add_subtree(tinew, ett_nds);
2668 bvalue = 0x00000001;
2670 for (i = 0 ; i < (values->vlength*8); i++ ) {
2671 if (values->vvalue & bvalue)
2676 proto_tree_add_item(flags_tree, values->bit1hfname, tvb, values->voffset, values->vlength, TRUE);
2679 proto_tree_add_item(flags_tree, values->bit2hfname, tvb, values->voffset, values->vlength, TRUE);
2682 proto_tree_add_item(flags_tree, values->bit3hfname, tvb, values->voffset, values->vlength, TRUE);
2685 proto_tree_add_item(flags_tree, values->bit4hfname, tvb, values->voffset, values->vlength, TRUE);
2688 proto_tree_add_item(flags_tree, values->bit5hfname, tvb, values->voffset, values->vlength, TRUE);
2691 proto_tree_add_item(flags_tree, values->bit6hfname, tvb, values->voffset, values->vlength, TRUE);
2694 proto_tree_add_item(flags_tree, values->bit7hfname, tvb, values->voffset, values->vlength, TRUE);
2697 proto_tree_add_item(flags_tree, values->bit8hfname, tvb, values->voffset, values->vlength, TRUE);
2700 proto_tree_add_item(flags_tree, values->bit9hfname, tvb, values->voffset, values->vlength, TRUE);
2703 proto_tree_add_item(flags_tree, values->bit10hfname, tvb, values->voffset, values->vlength, TRUE);
2706 proto_tree_add_item(flags_tree, values->bit11hfname, tvb, values->voffset, values->vlength, TRUE);
2709 proto_tree_add_item(flags_tree, values->bit12hfname, tvb, values->voffset, values->vlength, TRUE);
2712 proto_tree_add_item(flags_tree, values->bit13hfname, tvb, values->voffset, values->vlength, TRUE);
2715 proto_tree_add_item(flags_tree, values->bit14hfname, tvb, values->voffset, values->vlength, TRUE);
2718 proto_tree_add_item(flags_tree, values->bit15hfname, tvb, values->voffset, values->vlength, TRUE);
2721 proto_tree_add_item(flags_tree, values->bit16hfname, tvb, values->voffset, values->vlength, TRUE);
2731 /* NCP data from python code can't be accessed directly. Parse the ncp tree and find the items
2732 * and their associated values. Store results in passed buffer.
2735 build_expert_data(proto_tree *ncp_tree, char *hf_name, char *buffer, int repeat_lookup, gboolean search_structs)
2737 proto_tree *tree_pointer;
2738 proto_tree *tree_loc;
2739 proto_tree *struct_tree_pointer = NULL;
2740 char temp_buffer[256]="\0";
2741 gboolean in_struct=FALSE;
2743 tree_loc = ncp_tree->first_child;
2744 for (tree_pointer=tree_loc; tree_pointer!=NULL; tree_pointer=tree_pointer->next)
2746 /* We currently only go one structure deep in our search for values */
2747 if (tree_pointer->first_child && !in_struct && search_structs) {
2748 struct_tree_pointer = tree_pointer;
2749 tree_pointer = tree_pointer->first_child;
2752 if (strcmp(tree_pointer->finfo->hfinfo->abbrev, hf_name)==0)
2754 switch (tree_pointer->finfo->hfinfo->type)
2757 case 4: /* uint16 */
2758 g_snprintf(buffer, get_finfo_length(tree_pointer->finfo)*4, "%d", get_finfo_value_integer(tree_pointer->finfo));
2761 case 6: /* uint32 */
2762 g_snprintf(buffer, get_finfo_length(tree_pointer->finfo)*4, "%08x", get_finfo_value_integer(tree_pointer->finfo));
2767 case 20: /* string */
2768 uni_to_string(get_finfo_value_string(tree_pointer->finfo), get_finfo_length(tree_pointer->finfo), buffer);
2769 if (repeat_lookup > 0) {
2770 if (strlen(temp_buffer) + strlen(buffer) < 250) {
2771 g_strlcat(temp_buffer, buffer, 256);
2773 if (repeat_lookup == 0) {
2774 g_strlcpy(buffer, temp_buffer, 256);
2779 g_strlcat(temp_buffer, "/", 256);
2793 case 22: /* Bytes */
2794 g_snprintf(buffer, (get_finfo_length(tree_pointer->finfo))*4, "%s", bytes_to_str(get_finfo_value_string(tree_pointer->finfo), get_finfo_length(tree_pointer->finfo)));
2796 default: /* Dont currently handle. Only need string, integers, and bytes */
2797 buffer = "Unsupported Expert Type\0";
2800 if (repeat_lookup ==0) {
2804 if (tree_pointer->next==NULL && in_struct && search_structs) {
2805 tree_pointer = struct_tree_pointer;
2809 if (strlen(buffer)==0) {
2810 buffer = "No Value\0";
2815 /* Some NCP data may be desirable to echo to the expert table.
2816 * But to extract we must have visability to the tree
2817 * This means that to extract the data we can only perform
2818 * this code path on the first dissection or a redissect.
2820 * Should the dissector store this info in memory so that
2821 * the data can be reported wihout a complete redissection?
2824 trap_for_expert_event(proto_tree *ncp_tree, packet_info *pinfo, const ncp_record *ncp_rec, int request_reply)
2826 if (ncp_rec == NULL)
2828 /* Request == 0, Reply == 1 */
2829 if (request_reply==0) {
2830 if (ncp_echo_file) {
2831 /* The following allows for Update file handle rights echoed to expert tap. */
2832 if (ncp_rec->func == 66) {
2833 char p_filehandle[15]="\0";
2835 build_expert_data(ncp_tree, "ncp.file_handle", p_filehandle, 0, FALSE);
2837 expert_add_info_format(pinfo, NULL, PI_REQUEST_CODE, PI_CHAT, "Close file handle %s", p_filehandle);
2839 /* The following allows for oplock level 1 file opens echoed to expert tap. */
2840 if ((ncp_rec->func == 89 || ncp_rec->func == 87) && (ncp_rec->subfunc == 1 || ncp_rec->subfunc == 30 || ncp_rec->subfunc == 32 || ncp_rec->subfunc == 33)) {
2841 char oaction[2]="\0";
2842 char p_filename[256]="\0";
2843 char p_rights[2]="\0";
2844 char p_path_count[2]="\0";
2846 build_expert_data(ncp_tree, "ncp.open_create_mode", oaction, 0, FALSE);
2847 build_expert_data(ncp_tree, "ncp.desired_access_rights", p_rights, 0, FALSE);
2848 build_expert_data(ncp_tree, "ncp.path_count", p_path_count, 0, FALSE);
2850 if (ncp_rec->func == 87) {
2851 build_expert_data(ncp_tree, "ncp.path", p_filename, atoi(p_path_count), FALSE);
2855 build_expert_data(ncp_tree, "ncp.path16", p_filename, atoi(p_path_count), FALSE);
2858 expert_add_info_format(pinfo, NULL, PI_REQUEST_CODE, PI_CHAT, "%s: %s, Rights:(%s)", match_strval((atoi(oaction) & 0xeb), open_create_mode_vals), p_filename, match_strval((atoi(p_rights) & 0x5f), ncp_rights_vals));
2860 /* The following allows for oplock ack's and level 2 request echoed to expert tap. */
2861 if (ncp_rec->func == 87 && ncp_rec->subfunc == 34) {
2862 char cc_function[2]="\0";
2863 char p_filehandle[15]="\0";
2865 build_expert_data(ncp_tree, "ncp.cc_file_handle", p_filehandle, 0, FALSE);
2866 build_expert_data(ncp_tree, "ncp.cc_function", cc_function, 0, FALSE);
2868 expert_add_info_format(pinfo, NULL, PI_REQUEST_CODE, PI_CHAT, "Op-lock on handle %s - %s", p_filehandle, match_strval(atoi(cc_function), ncp_cc_function_vals));
2870 /* The following allows for Update file handle rights echoed to expert tap. */
2871 if (ncp_rec->func == 87 && ncp_rec->subfunc == 44) {
2872 char p_rights[20]="\0";
2873 char n_rights[20]="\0";
2874 char p_filehandle[15]="\0";
2876 build_expert_data(ncp_tree, "ncp.file_handle", p_filehandle, 0, FALSE);
2877 build_expert_data(ncp_tree, "ncp.access_rights_mask_word", p_rights, 0, FALSE);
2878 build_expert_data(ncp_tree, "ncp.new_access_rights_mask", n_rights, 0, FALSE);
2879 expert_add_info_format(pinfo, NULL, PI_REQUEST_CODE, PI_CHAT, "Change handle %s rights from:(%s) to:(%s)", p_filehandle, match_strval((atoi(p_rights) & 0x1ff), access_rights_vals), match_strval((atoi(n_rights) & 0x1ff), access_rights_vals));
2886 if (ncp_echo_file) { /* Echo File System Data */
2887 /* The following allows for oplock level 1 file opens echoed to expert tap. */
2888 if ((ncp_rec->func == 89 || ncp_rec->func == 87) && (ncp_rec->subfunc == 32 || ncp_rec->subfunc == 1)) {
2889 char oaction[2]="\0";
2890 char oplockflg[2]="\0";
2891 char p_filehandle[15]="\0";
2893 build_expert_data(ncp_tree, "ncp.open_create_action", oaction, 0, FALSE);
2894 build_expert_data(ncp_tree, "ncp.file_handle", p_filehandle, 0, FALSE);
2896 if (ncp_rec->subfunc == 1) {
2897 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "%s - File handle %s", match_strval((atoi(oaction) & 0x8f), open_create_action_vals), p_filehandle);
2901 build_expert_data(ncp_tree, "ncp.o_c_ret_flags", oplockflg, 0, FALSE);
2902 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "%s - File handle %s, %s", match_strval((atoi(oaction) & 0x8f), open_create_action_vals), p_filehandle, match_strval(atoi(oplockflg), ncp_o_c_ret_flags_vals));
2905 /* The following allows for Update file handle rights echoed to expert tap. */
2906 if (ncp_rec->func == 87 && ncp_rec->subfunc == 44) {
2907 char p_rights[20]="\0";
2908 char p_filehandle[15]="\0";
2910 build_expert_data(ncp_tree, "ncp.file_handle", p_filehandle, 0, FALSE);
2911 build_expert_data(ncp_tree, "ncp.effective_rights", p_rights, 0, FALSE);
2912 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "Handle %s effective rights:(%s)", p_filehandle, match_strval((atoi(p_rights) & 0x1ff), access_rights_vals));
2915 /* The following allows for specific NCP server info to be echoed to the expert tap. */
2916 if (ncp_rec->func == 23 && ncp_rec->subfunc == 17 && ncp_echo_server) {
2917 char fsname[50]="\0";
2918 char p_maj_ver[3]="\0";
2919 char p_min_ver[3]="\0";
2921 char p_lang[3]="\0";
2923 /* Get Server name and version info */
2924 build_expert_data(ncp_tree, "ncp.server_name", fsname, 0, FALSE);
2925 build_expert_data(ncp_tree, "ncp.product_major_version", p_maj_ver, 0, FALSE);
2926 build_expert_data(ncp_tree, "ncp.product_minor_version", p_min_ver, 0, FALSE);
2927 build_expert_data(ncp_tree, "ncp.product_revision_version", p_rev, 0, FALSE);
2928 build_expert_data(ncp_tree, "ncp.os_language_id", p_lang, 0, FALSE);
2929 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "Server %s, version %s.%s, support pack %s, language %s", fsname,
2930 p_maj_ver, p_min_ver, p_rev, p_lang);
2937 print_nds_values(proto_tree *vtree, tvbuff_t *tvb, guint32 syntax_type, nds_val *vvalues)
2944 guint32 voffset = 0, oldvoffset;
2946 guint32 number_of_values = 0;
2947 guint32 number_of_items = 0;
2953 const char *valuestr = NULL;
2958 gint length_remaining;
2960 gboolean entry_rights = FALSE;
2961 nds_val temp_values;
2963 voffset = vvalues->voffset;
2964 if(tvb_get_guint8(tvb, voffset) == 0x00)
2966 voffset = voffset+2;
2969 number_of_values = tvb_get_letohl(tvb, voffset);
2971 vitem = proto_tree_add_uint_format(vtree, hf_nds_uint32value, tvb, voffset,
2972 4, number_of_values, "Number of Values: %u", number_of_values);
2974 nvtree = proto_item_add_subtree(vitem, ett_nds);
2976 oldvoffset = voffset;
2977 voffset = voffset + 4;
2979 for (icounter = 1 ; icounter <= number_of_values; icounter++ )
2981 if (oldvoffset >= voffset) {
2982 proto_tree_add_text(nvtree, tvb, 0, 0, "[ Invalid offset: %u ]", voffset);
2983 THROW(ReportedBoundsError);
2985 oldvoffset = voffset;
2988 case 0x00000006: /* Case Insensitive List */
2989 case 0x00000012: /* Postal Address */
2990 voffset += align_4(tvb, voffset);
2991 voffset = voffset+4;
2992 number_of_items = tvb_get_letohl(tvb, voffset);
2993 voffset = voffset+4;
2994 for (r=1; r<=number_of_items; r++)
2996 value1 = tvb_get_letohl(tvb, voffset);
2997 voffset = voffset + 4;
2998 get_string(tvb, voffset, value1, vvalues->vstring);
2999 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3000 value1, vvalues->vstring);
3001 voffset = voffset + value1;
3002 voffset += align_4(tvb, voffset);
3005 case 0x00000007: /* Boolean */
3006 voffset+=4; /* this is always just a parameter count of 1, so ignore */
3007 value1 = tvb_get_guint8(tvb, voffset); /* Boolean value */
3010 vvalues->vstring = "False";
3014 vvalues->vstring = "True";
3016 tvb_ensure_bytes_exist(tvb, voffset, 1);
3017 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3018 1, vvalues->vstring);
3020 voffset += align_4(tvb, voffset);
3022 case 0x00000009: /* Binary String */
3023 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3024 length_remaining = tvb_length_remaining(tvb, voffset);
3025 if(length_remaining == -1 || value1 > (guint32) length_remaining)
3030 tvb_ensure_bytes_exist(tvb, voffset, value1);
3031 proto_tree_add_bytes(nvtree, hf_value_bytes, tvb, voffset, value1, tvb_get_ptr(tvb, voffset, value1));
3033 voffset += (value1%2);
3035 case 0x0000000d: /* Binary String List */
3036 value1 = tvb_get_letohl(tvb, voffset); /* Overall length of field list */
3037 length_remaining = tvb_length_remaining(tvb, voffset);
3038 if(length_remaining == -1 || value1 > (guint32) length_remaining)
3043 tvb_ensure_bytes_exist(tvb, voffset, value1);
3044 number_of_items = tvb_get_letohl(tvb, voffset);
3045 voffset = voffset+4;
3046 for (r=1; r<=number_of_items; r++)
3048 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3049 length_remaining = tvb_length_remaining(tvb, voffset);
3050 if(length_remaining == -1 || value1 > (guint32) length_remaining)
3055 tvb_ensure_bytes_exist(tvb, voffset, value1);
3056 proto_tree_add_bytes(nvtree, hf_value_bytes, tvb, voffset, value1, tvb_get_ptr(tvb, voffset, value1));
3058 voffset += (value1%2);
3061 case 0x00000015: /* Stream */
3062 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3063 length_remaining = tvb_length_remaining(tvb, voffset);
3064 if(length_remaining == -1 || value1 > (guint32) length_remaining)
3068 proto_tree_add_text(nvtree, tvb, voffset, 4, "No value, Open stream file for data.");
3071 voffset += (value1%2);
3073 case 0x00000008: /* Signed Integer */
3074 case 0x00000016: /* Counter */
3075 case 0x0000001b: /* Interval */
3076 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3077 voffset = voffset+4;
3078 value2 = tvb_get_letohl(tvb, voffset); /* Value */
3079 tvb_ensure_bytes_exist(tvb, voffset, value1);
3080 if (strcmp(vvalues->vstring, "zendmSearchType")==0) {
3081 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3082 value1, value2, "Value (%d) = %s", value2, match_strval(value2, zensearchenum));
3086 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3087 value1, value2, "Value %d", value2);
3089 voffset = voffset+4;
3091 case 0x0000000b: /* Fax Number */
3092 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3093 voffset = voffset+4;
3094 get_string(tvb, voffset, value1, vvalues->vstring);
3095 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3096 value1, vvalues->vstring);
3097 voffset = voffset + value1;
3098 voffset += align_4(tvb, voffset);
3100 case 0x0000000c: /* Network Address */
3101 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3102 voffset = voffset + 4;
3103 value2 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
3104 valuestr = match_strval(value2, nds_protocol_type);
3105 if (valuestr == NULL)
3107 valuestr="(Undefined Protocol)";
3109 tvb_ensure_bytes_exist(tvb, voffset, value1);
3110 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3111 value1, value2, valuestr, value2);
3112 voffset = voffset+4;
3113 value3 = tvb_get_letohl(tvb, voffset); /* length of address */
3114 voffset = voffset+4;
3118 proto_tree_add_item(nvtree, hf_nds_net, tvb, voffset, 4, FALSE);
3119 proto_tree_add_item(nvtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
3120 proto_tree_add_item(nvtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
3124 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
3127 proto_tree_add_item(nvtree, hf_add_ref_ip, tvb, voffset, 4, FALSE);
3131 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
3134 proto_tree_add_item(nvtree, hf_add_ref_udp, tvb, voffset, 4, FALSE);
3137 proto_tree_add_item(nvtree, hf_nds_port, tvb, voffset, 2, FALSE);
3138 proto_tree_add_item(nvtree, hf_add_ref_tcp, tvb, voffset+2, 4, FALSE);
3142 get_string(tvb, voffset, value3, vvalues->vstring);
3143 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3144 value3, vvalues->vstring);
3149 voffset = voffset + value3;
3150 voffset += align_4(tvb, voffset);
3152 case 0x0000000f: /* File System Path */
3153 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3154 voffset = voffset + 4;
3155 value2 = tvb_get_letohl(tvb, voffset); /* Name Space */
3156 valuestr = match_strval(value2, name_space_type);
3157 if (valuestr == NULL)
3159 valuestr = "Unknown Name Space";
3161 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3163 voffset = voffset+4;
3164 value3 = tvb_get_letohl(tvb, voffset); /* Length of Volume name */
3165 voffset = voffset+4;
3166 get_string(tvb, voffset, value3, vvalues->vstring);
3167 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3168 value3, vvalues->vstring);
3169 voffset = voffset+value3;
3170 voffset += align_4(tvb, voffset);
3171 value4 = tvb_get_letohl(tvb, voffset); /* Length of Path name */
3172 voffset = voffset+4;
3173 get_string(tvb, voffset, value4, vvalues->vstring);
3174 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3175 value4, vvalues->vstring);
3176 voffset = voffset+value4;
3177 voffset += align_4(tvb, voffset);
3179 case 0x00000010: /* Replica Pointer */
3180 value1 = tvb_get_letohl(tvb, voffset); /* length of field */
3181 voffset = voffset + 4;
3182 value2 = tvb_get_letohl(tvb, voffset); /* Length of Server name */
3183 voffset = voffset+4;
3184 get_string(tvb, voffset, value2, vvalues->vstring);
3185 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3186 value2, vvalues->vstring);
3187 voffset = voffset+value2;
3188 voffset += align_4(tvb, voffset);
3189 rtype = tvb_get_letohs(tvb, voffset); /* replica type */
3190 valuestr = match_strval(rtype, nds_replica_type);
3191 if (valuestr == NULL)
3193 valuestr="(Unknown Replica Type)";
3195 proto_tree_add_string(nvtree, hf_replica_type, tvb, voffset,
3197 voffset = voffset+2;
3198 rstate = tvb_get_letohs(tvb, voffset); /* replica state */
3199 valuestr = match_strval(rstate, nds_replica_state);
3200 if (valuestr == NULL)
3202 valuestr="(Unknown Replica State)";
3204 proto_tree_add_string(nvtree, hf_replica_state, tvb, voffset,
3206 voffset = voffset+2;
3207 value3 = tvb_get_letohl(tvb, voffset); /* Replica number */
3208 proto_tree_add_uint_format(nvtree, hf_replica_number, tvb, voffset,
3209 4, value3, "Replica Number %d", value3);
3210 voffset = voffset+4;
3211 number_of_items = tvb_get_letohl(tvb, voffset); /* Number of Addresses */
3212 aditem = proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3213 4, number_of_items, "Number of Addresses: %u", number_of_items);
3215 adtree = proto_item_add_subtree(aditem, ett_nds);
3216 voffset = voffset+4;
3217 for (r=1; r <= number_of_items; r++)
3219 voffset += align_4(tvb, voffset);
3220 value4 = tvb_get_letohl(tvb, voffset); /* type of Protocol */
3221 valuestr = match_strval(value4, nds_protocol_type);
3222 if (valuestr == NULL)
3224 valuestr="(Undefined Protocol)";
3226 proto_tree_add_uint_format(adtree, hf_nds_uint32value, tvb, voffset,
3227 4, value4, valuestr, value4);
3228 voffset = voffset+4;
3229 value5 = tvb_get_letohl(tvb, voffset); /* length of address */
3230 voffset = voffset+4;
3234 proto_tree_add_item(adtree, hf_nds_net, tvb, voffset, 4, FALSE);
3235 proto_tree_add_item(adtree, hf_nds_node, tvb, voffset+4, 6, FALSE);
3236 proto_tree_add_item(adtree, hf_nds_socket, tvb, voffset+10, 2, FALSE);
3239 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
3240 proto_tree_add_item(adtree, hf_add_ref_ip, tvb, voffset+2, 4, FALSE);
3243 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
3244 proto_tree_add_item(adtree, hf_add_ref_udp, tvb, voffset+2, 4, FALSE);
3247 proto_tree_add_item(adtree, hf_nds_port, tvb, voffset, 2, FALSE);
3248 proto_tree_add_item(adtree, hf_add_ref_tcp, tvb, voffset+2, 4, FALSE);
3252 get_string(tvb, voffset, value5, vvalues->vstring);
3253 proto_tree_add_string(adtree, hf_value_string, tvb, voffset,
3254 value5, vvalues->vstring);
3259 voffset = voffset + value5;
3261 voffset += align_4(tvb, voffset);
3263 case 0x00000011: /* Object ACL */
3264 value1 = tvb_get_letohl(tvb, voffset); /* Length of Field */
3265 voffset = voffset + 4;
3266 value2 = tvb_get_letohl(tvb, voffset);
3267 voffset = voffset + 4;
3268 get_string(tvb, voffset, value2, vvalues->vstring); /* Unicode String */
3269 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3270 value2, vvalues->vstring);
3271 if (strcmp(vvalues->vstring, "[Entry Rights]")) {
3278 voffset = voffset + value2;
3279 voffset += align_4(tvb, voffset);
3280 value3 = tvb_get_letohl(tvb, voffset);
3281 voffset = voffset + 4;
3282 get_string(tvb, voffset, value3, vvalues->vstring); /* Unicode Subject Name */
3283 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3284 value3, vvalues->vstring);
3285 voffset = voffset + value3;
3286 voffset += align_4(tvb, voffset);
3287 temp_values.vvalue = tvb_get_letohl(tvb, voffset); /* Entry or Attribute Privileges */
3288 temp_values.vlength = 2;
3289 temp_values.hfname = hf_nds_vflags;
3290 temp_values.voffset = voffset;
3291 temp_values.vdesc = "Privileges";
3293 /* if Entries then use these bits */
3294 temp_values.bit1 = "Compare Attributes";
3295 temp_values.bit1hfname = hf_nds_compare_attributes;
3296 temp_values.bit2 = "Read Attribute";
3297 temp_values.bit2hfname = hf_nds_read_attribute;
3298 temp_values.bit3 = "Write, Add, Delete Attribute";
3299 temp_values.bit3hfname = hf_nds_write_add_delete_attribute;
3300 temp_values.bit4 = "Add/Delete Self";
3301 temp_values.bit4hfname = hf_nds_add_delete_self;
3302 temp_values.bit5 = "Attribute Privilege Not Defined";
3303 temp_values.bit5hfname = hf_nds_privilege_not_defined;
3304 temp_values.bit6 = "Supervisor";
3305 temp_values.bit6hfname = hf_nds_supervisor;
3306 temp_values.bit7 = "Inheritance Control";
3307 temp_values.bit7hfname = hf_nds_inheritance_control;
3308 temp_values.bit8 = "Not Defined";
3309 temp_values.bit8hfname = hf_bit8vflags;
3310 temp_values.bit9 = "Not Defined";
3311 temp_values.bit9hfname = hf_bit9vflags;
3312 temp_values.bit10 = "Not Defined";
3313 temp_values.bit10hfname = hf_bit10vflags;
3314 temp_values.bit11 = "Not Defined";
3315 temp_values.bit11hfname = hf_bit11vflags;
3316 temp_values.bit12 = "Not Defined";
3317 temp_values.bit12hfname = hf_bit12vflags;
3318 temp_values.bit13 = "Not Defined";
3319 temp_values.bit13hfname = hf_bit13vflags;
3320 temp_values.bit14 = "Not Defined";
3321 temp_values.bit14hfname = hf_bit14vflags;
3322 temp_values.bit15 = "Not Defined";
3323 temp_values.bit15hfname = hf_bit15vflags;
3324 temp_values.bit16 = "Not Defined";
3325 temp_values.bit16hfname = hf_bit16vflags;
3329 /* if attribute rights then do these bits */
3330 temp_values.bit1 = "Browse";
3331 temp_values.bit1hfname = hf_nds_browse_entry;
3332 temp_values.bit2 = "Add";
3333 temp_values.bit2hfname = hf_nds_add_entry;
3334 temp_values.bit3 = "Delete";
3335 temp_values.bit3hfname = hf_nds_delete_entry;
3336 temp_values.bit4 = "Rename";
3337 temp_values.bit4hfname = hf_nds_rename_entry;
3338 temp_values.bit5 = "Supervisor";
3339 temp_values.bit5hfname = hf_nds_supervisor_entry;
3340 temp_values.bit6 = "Entry Privilege Not Defined";
3341 temp_values.bit6hfname = hf_nds_entry_privilege_not_defined;
3342 temp_values.bit7 = "Inheritance Control";
3343 temp_values.bit7hfname = hf_nds_inheritance_control;
3344 temp_values.bit8 = "Not Defined";
3345 temp_values.bit8hfname = hf_bit8vflags;
3346 temp_values.bit9 = "Not Defined";
3347 temp_values.bit9hfname = hf_bit9vflags;
3348 temp_values.bit10 = "Not Defined";
3349 temp_values.bit10hfname = hf_bit10vflags;
3350 temp_values.bit11 = "Not Defined";
3351 temp_values.bit11hfname = hf_bit11vflags;
3352 temp_values.bit12 = "Not Defined";
3353 temp_values.bit12hfname = hf_bit12vflags;
3354 temp_values.bit13 = "Not Defined";
3355 temp_values.bit13hfname = hf_bit13vflags;
3356 temp_values.bit14 = "Not Defined";
3357 temp_values.bit14hfname = hf_bit14vflags;
3358 temp_values.bit15 = "Not Defined";
3359 temp_values.bit15hfname = hf_bit15vflags;
3360 temp_values.bit16 = "Not Defined";
3361 temp_values.bit16hfname = hf_bit16vflags;
3363 process_bitfield(nvtree, tvb, &temp_values);
3364 voffset = voffset+4;
3365 voffset += align_4(tvb, voffset);
3367 case 0x00000013: /* Time Stamp */
3368 value1 = tvb_get_letohl(tvb, voffset); /* Seconds */
3369 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3370 4, value1, "Length of Record: %d", value1);
3371 voffset = voffset+4;
3372 ns.secs = tvb_get_letohl(tvb, voffset);
3374 proto_tree_add_time_format(nvtree, hf_nds_ds_time, tvb, voffset, 4, &ns, "Timestamp: %s", abs_time_to_str(&ns));
3375 voffset = voffset + 4;
3376 rnum = tvb_get_letohs(tvb, voffset); /* replica number */
3377 proto_tree_add_uint_format(nvtree, hf_nds_rnum, tvb, voffset,
3378 2, rnum, "Replica Number: %d", rnum);
3379 voffset = voffset+2;
3380 revent = tvb_get_letohs(tvb, voffset); /* Event */
3381 proto_tree_add_uint_format(nvtree, hf_nds_revent, tvb, voffset,
3382 2, revent, "Event: %d", revent);
3383 voffset = voffset+2;
3384 voffset += align_4(tvb, voffset);
3386 case 0x00000017: /* Back Link */
3387 value1 = tvb_get_letohl(tvb, voffset); /* Length */
3388 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3389 4, value1, "Length of Record %08x", value1);
3390 voffset = voffset+4;
3391 value2 = tvb_get_letohl(tvb, voffset); /* Remote ID */
3392 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3393 4, value2, "Remote ID %08x", value2);
3394 voffset = voffset+4;
3395 value3 = tvb_get_letohl(tvb, voffset); /* Length of string */
3396 voffset = voffset+4;
3397 get_string(tvb, voffset, value3, vvalues->vstring);
3398 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
3399 value3, vvalues->vstring,
3400 "Server Distinguished Name - %s", vvalues->vstring);
3401 voffset = voffset+value3;
3402 voffset += align_4(tvb, voffset);
3404 case 0x00000018: /* Time */
3405 voffset += 4; /* This is the length of the time data no need to decode, always 4 bytes */
3406 ns.secs = tvb_get_letohl(tvb, voffset);
3408 proto_tree_add_time_format(nvtree, hf_nds_ds_time, tvb, voffset, 4, &ns, "Time: %s", abs_time_to_str(&ns));
3409 voffset = voffset + 4;
3411 case 0x00000019: /* Typed Name */
3412 value1 = tvb_get_letohl(tvb, voffset); /* Length */
3413 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3414 4, value1, "Length of Record %08x", value1);
3415 voffset = voffset+4;
3416 value2 = tvb_get_letohl(tvb, voffset); /* Level */
3417 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3418 4, value2, "Level %d", value2);
3419 voffset = voffset+4;
3420 value3 = tvb_get_letohl(tvb, voffset); /* Interval */
3421 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3422 4, value3, "Interval %d", value3);
3423 voffset = voffset+4;
3424 value4 = tvb_get_letohl(tvb, voffset); /* Distinguished Name */
3425 voffset = voffset+4;
3426 get_string(tvb, voffset, value4, vvalues->vstring);
3427 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
3428 value4, vvalues->vstring,
3429 "Distinguished Name - %s", vvalues->vstring);
3430 voffset = voffset+value4;
3431 voffset += align_4(tvb, voffset);
3433 case 0x0000001a: /* Hold */
3434 value1 = tvb_get_letohl(tvb, voffset); /* Length */
3435 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3436 4, value1, "Length of Record %08x", value1);
3437 voffset = voffset+4;
3438 value2 = tvb_get_letohl(tvb, voffset); /* Amount */
3439 proto_tree_add_uint_format(nvtree, hf_nds_uint32value, tvb, voffset,
3440 4, value2, "Amount %d", value2);
3441 voffset = voffset+4;
3442 value3 = tvb_get_letohl(tvb, voffset); /* Subject */
3443 voffset = voffset+4;
3444 get_string(tvb, voffset, value3, vvalues->vstring);
3445 proto_tree_add_string_format(nvtree, hf_value_string, tvb, voffset,
3446 value3, vvalues->vstring,
3447 "Subject - %s", vvalues->vstring);
3448 voffset = voffset+value3;
3449 voffset += align_4(tvb, voffset);
3451 case 0x00000001: /* Distinguished Name */
3452 case 0x00000002: /* Case Sensitive Unicode String */
3453 case 0x00000003: /* Non Case Sensitive Unicode String */
3454 case 0x00000004: /* Printable String */
3455 case 0x00000005: /* Numeric String */
3456 case 0x0000000a: /* Telephone Number */
3457 case 0x0000000e: /* Email Address */
3458 case 0x00000014: /* Class Name */
3460 value1 = tvb_get_letohl(tvb, voffset);
3461 voffset = voffset + 4;
3462 if (strcmp(vvalues->vstring, "zendmSearchOrder")==0) {
3463 get_string(tvb, voffset, value1, vvalues->vstring);
3464 if (strcmp(vvalues->vstring, "0")==0) {
3465 vvalues->vstring = "Value (0) = Object";
3467 if (strcmp(vvalues->vstring, "1")==0) {
3468 vvalues->vstring = "Value (1) = Group";
3470 if (strcmp(vvalues->vstring, "2")==0) {
3471 vvalues->vstring = "Value (2) = Container";
3473 if (strcmp(vvalues->vstring, "01")==0) {
3474 vvalues->vstring = "Value (01) = Object, Group";
3476 if (strcmp(vvalues->vstring, "02")==0) {
3477 vvalues->vstring = "Value (02) = Object, Container";
3479 if (strcmp(vvalues->vstring, "10")==0) {
3480 vvalues->vstring = "Value (10) = Group, Object";
3482 if (strcmp(vvalues->vstring, "12")==0) {
3483 vvalues->vstring = "Value (12) = Group, Container";
3485 if (strcmp(vvalues->vstring, "20")==0) {
3486 vvalues->vstring = "Value (20) = Container, Object";
3488 if (strcmp(vvalues->vstring, "21")==0) {
3489 vvalues->vstring = "Value (21) = Container, Group";
3491 if (strcmp(vvalues->vstring, "012")==0) {
3492 vvalues->vstring = "Value (012) = Object, Group, Container";
3494 if (strcmp(vvalues->vstring, "021")==0) {
3495 vvalues->vstring = "Value (021) = Object, Container, Group";
3497 if (strcmp(vvalues->vstring, "102")==0) {
3498 vvalues->vstring = "Value (102) = Group, Object, Container";
3500 if (strcmp(vvalues->vstring, "120")==0) {
3501 vvalues->vstring = "Value (120) = Group, Container, Object";
3503 if (strcmp(vvalues->vstring, "201")==0) {
3504 vvalues->vstring = "Value (201) = Container, Object, Group";
3506 if (strcmp(vvalues->vstring, "210")==0) {
3507 vvalues->vstring = "Value (210) = Container, Group, Object";
3512 get_string(tvb, voffset, value1, vvalues->vstring);
3514 proto_tree_add_string(nvtree, hf_value_string, tvb, voffset,
3515 value1, vvalues->vstring);
3516 voffset = voffset + value1;
3517 voffset += align_4(tvb, voffset);
3520 voffset += align_4(tvb, voffset);
3522 vvalues->voffset=voffset;
3527 print_es_type(proto_tree *estree, tvbuff_t *tvb, nds_val *values, guint32 vtype, guint32 ioffset)
3534 guint32 number_of_referrals;
3537 guint16 replica_num;
3540 proto_tree *nestree;
3541 proto_item *nesitem;
3542 proto_tree *sub1tree;
3543 proto_item *sub1item;
3544 proto_tree *sub2tree;
3545 proto_item *sub2item;
3546 const char *vstring="";
3549 mval_buf.buffer[0] = '\0';
3553 case 0: /* No Specifier Type */
3554 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3555 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
3557 ioffset = ioffset + 4;
3559 case 1: /* Unicode String */
3560 value1 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3561 ioffset = ioffset + 4;
3562 get_string(tvb, ioffset, value1, mval_buf.buffer);
3563 values->vstring = mval_buf.buffer;
3564 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
3565 value1, values->vstring, "Delimeter ->%s", values->vstring);
3566 ioffset=ioffset + value1;
3567 ioffset += align_4(tvb, ioffset);
3568 value2 = tvb_get_letohl(tvb, ioffset);
3569 ioffset = ioffset + 4;
3570 get_string(tvb, ioffset, value2, mval_buf.buffer);
3571 values->vstring = mval_buf.buffer;
3572 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
3573 value2, values->vstring);
3574 values->voffset=ioffset + value2;
3575 ioffset = values->voffset;
3576 ioffset += align_4(tvb, ioffset);
3579 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3580 vstring = match_strval(value1, es_type);
3581 if (vstring == NULL)
3583 vstring = "No ES Type Found";
3585 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
3586 4, vstring, "Base Context Type - %s", vstring);
3587 nestree = proto_item_add_subtree(nesitem, ett_nds);
3588 ioffset = ioffset + 4;
3591 case 0: /* No Specifier Type */
3592 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3593 proto_tree_add_item(nestree, hf_es_value, tvb, ioffset,
3595 ioffset = ioffset + 4;
3597 case 1: /* Unicode String */
3598 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3599 ioffset = ioffset + 4;
3600 get_string(tvb, ioffset, value2, mval_buf.buffer);
3601 values->vstring = mval_buf.buffer;
3602 proto_tree_add_string_format(nestree, hf_mv_string, tvb, ioffset,
3603 value2, values->vstring, "Delimeter ->%s", values->vstring);
3604 ioffset=ioffset + value2;
3605 ioffset += align_4(tvb, ioffset);
3606 value3 = tvb_get_letohl(tvb, ioffset);
3607 ioffset = ioffset + 4;
3608 get_string(tvb, ioffset, value3, mval_buf.buffer);
3609 values->vstring = mval_buf.buffer;
3610 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
3611 value3, values->vstring);
3612 values->voffset=ioffset + value3;
3613 ioffset = values->voffset;
3614 ioffset += align_4(tvb, ioffset);
3618 case 3: /* Hinted */
3621 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
3622 proto_tree_add_item(nestree, hf_es_rdn_count, tvb, ioffset,
3624 ioffset = ioffset + 4;
3625 for (r = 1 ; r <= value2; r++ )
3627 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
3629 proto_tree_add_time_format(nestree, hf_es_seconds, tvb, ioffset,
3630 4, &ns, "Timestamp: %s", abs_time_to_str(&ns));
3631 ioffset = ioffset + 4;
3632 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3633 proto_tree_add_item(nestree, hf_nds_replica_num, tvb, ioffset,
3635 ioffset = ioffset + 2;
3636 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3637 proto_tree_add_item(nestree, hf_nds_event_num, tvb, ioffset,
3639 ioffset = ioffset + 2;
3641 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3642 ioffset = ioffset + 4;
3643 get_string(tvb, ioffset, value4, mval_buf.buffer);
3644 values->vstring = mval_buf.buffer;
3645 proto_tree_add_string(nestree, hf_mv_string, tvb, ioffset,
3646 value4, values->vstring);
3647 ioffset=ioffset + value4;
3648 ioffset += align_4(tvb, ioffset);
3649 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
3650 ioffset = ioffset + 4;
3651 get_string(tvb, ioffset, value5, mval_buf.buffer);
3652 values->vstring = mval_buf.buffer;
3653 proto_tree_add_string(nestree, hf_rdn_string, tvb, ioffset,
3654 value5, values->vstring);
3655 ioffset=ioffset + value5;
3656 ioffset += align_4(tvb, ioffset);
3662 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3663 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
3665 ioffset = ioffset + 4;
3668 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3669 vstring = match_strval(value1, es_type);
3670 if (vstring == NULL)
3672 vstring = "No ES Type Found";
3674 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
3675 4, vstring, "Object Name Type - %s", vstring);
3676 nestree = proto_item_add_subtree(nesitem, ett_nds);
3677 ioffset = ioffset + 4;
3680 case 0: /* No Specifier Type */
3681 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3682 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
3684 ioffset = ioffset + 4;
3686 case 1: /* Unicode String */
3687 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3688 ioffset = ioffset + 4;
3689 get_string(tvb, ioffset, value2, mval_buf.buffer);
3690 values->vstring = mval_buf.buffer;
3691 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
3692 value2, values->vstring, "Delimeter ->%s", values->vstring);
3693 ioffset=ioffset + value2;
3694 ioffset += align_4(tvb, ioffset);
3695 value3 = tvb_get_letohl(tvb, ioffset);
3696 ioffset = ioffset + 4;
3697 get_string(tvb, ioffset, value3, mval_buf.buffer);
3698 values->vstring = mval_buf.buffer;
3699 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
3700 value3, values->vstring);
3701 values->voffset=ioffset + value3;
3702 ioffset = values->voffset;
3703 ioffset += align_4(tvb, ioffset);
3707 case 3: /* Hinted */
3710 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
3711 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
3713 ioffset = ioffset + 4;
3714 for (r = 1 ; r <= value2; r++ )
3716 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
3718 proto_tree_add_time_format(estree, hf_es_seconds, tvb, ioffset,
3719 4, &ns, "Timestamp: %s", abs_time_to_str(&ns));
3720 ioffset = ioffset + 4;
3721 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3722 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
3724 ioffset = ioffset + 2;
3725 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3726 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
3728 ioffset = ioffset + 2;
3730 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3731 ioffset = ioffset + 4;
3732 get_string(tvb, ioffset, value4, mval_buf.buffer);
3733 values->vstring = mval_buf.buffer;
3734 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
3735 value4, values->vstring);
3736 ioffset=ioffset + value4;
3737 ioffset += align_4(tvb, ioffset);
3738 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
3739 ioffset = ioffset + 4;
3740 get_string(tvb, ioffset, value5, mval_buf.buffer);
3741 values->vstring = mval_buf.buffer;
3742 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
3743 value5, values->vstring);
3744 ioffset=ioffset + value5;
3745 ioffset += align_4(tvb, ioffset);
3751 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3752 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
3754 ioffset = ioffset + 4;
3758 case 3: /* Hinted */
3759 number_of_referrals = tvb_get_letohl(tvb, ioffset);
3761 for (r = 1 ; r <= number_of_referrals; r++ )
3763 sub1item = proto_tree_add_uint_format(estree, hf_referral_record, tvb, 6, 0,
3764 r, "NDS Referral Record #%u", r);
3765 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
3767 value1 = tvb_get_letohl(tvb, ioffset);
3769 proto_tree_add_uint_format(sub1tree, hf_referral_addcount, tvb, ioffset, 4,
3770 value1, "Number of Addresses in Referral - %d", value1);
3772 ioffset = ioffset + 4;
3773 for (i = 1 ; i <= value1; i++ )
3775 value2 = tvb_get_letohl(tvb, ioffset);
3776 values->vstring =(char *)match_strval(value2, nds_protocol_type);
3777 if (values->vstring == NULL)
3779 values->vstring="(Undefined Protocol)";
3781 proto_tree_add_uint_format(sub1tree, hf_nds_uint32value, tvb, ioffset,
3782 4, value2, vstring, value2);
3783 ioffset = ioffset+4;
3784 value3 = tvb_get_letohl(tvb, ioffset);
3785 ioffset = ioffset+4;
3789 proto_tree_add_item(sub1tree, hf_nds_net, tvb, ioffset, 4, FALSE);
3790 proto_tree_add_item(sub1tree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
3791 proto_tree_add_item(sub1tree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
3794 proto_tree_add_item(sub1tree, hf_nds_port, tvb, ioffset, 2, FALSE);
3795 proto_tree_add_item(sub1tree, hf_add_ref_ip, tvb, ioffset+2, 4, FALSE);
3798 proto_tree_add_item(sub1tree, hf_nds_port, tvb, ioffset, 2, FALSE);
3799 proto_tree_add_item(sub1tree, hf_add_ref_udp, tvb, ioffset+2, 4, FALSE);
3802 proto_tree_add_item(sub1tree, hf_nds_port, tvb, ioffset, 2, FALSE);
3803 proto_tree_add_item(sub1tree, hf_add_ref_tcp, tvb, ioffset+2, 4, FALSE);
3807 get_string(tvb, ioffset, value3, values->vstring);
3808 proto_tree_add_string(sub1tree, hf_value_string, tvb, ioffset,
3809 value3, values->vstring);
3814 ioffset = ioffset + value3;
3815 ioffset += align_4(tvb, ioffset);
3819 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3820 vstring = match_strval(value1, es_type);
3821 if (vstring == NULL)
3823 vstring = "No ES Type Found";
3825 nesitem = proto_tree_add_string_format(estree, hf_es_type, tvb, ioffset,
3826 4, vstring, "Object Name Type - %s", vstring);
3827 nestree = proto_item_add_subtree(nesitem, ett_nds);
3828 ioffset = ioffset + 4;
3831 case 0: /* No Specifier Type */
3832 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3833 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
3835 ioffset = ioffset + 4;
3837 case 1: /* Unicode String */
3838 value2 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3839 ioffset = ioffset + 4;
3840 get_string(tvb, ioffset, value2, mval_buf.buffer);
3841 values->vstring = mval_buf.buffer;
3842 proto_tree_add_string_format(estree, hf_mv_string, tvb, ioffset,
3843 value2, values->vstring, "Delimeter ->%s", values->vstring);
3844 ioffset=ioffset + value2;
3845 ioffset += align_4(tvb, ioffset);
3846 value3 = tvb_get_letohl(tvb, ioffset);
3847 ioffset = ioffset + 4;
3848 get_string(tvb, ioffset, value3, mval_buf.buffer);
3849 values->vstring = mval_buf.buffer;
3850 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
3851 value3, values->vstring);
3852 values->voffset=ioffset + value3;
3853 ioffset = values->voffset;
3854 ioffset += align_4(tvb, ioffset);
3858 case 3: /* Hinted */
3861 value2 = tvb_get_letohl(tvb, ioffset); /* Count */
3862 proto_tree_add_item(estree, hf_es_rdn_count, tvb, ioffset,
3864 ioffset = ioffset + 4;
3865 for (r = 1 ; r <= value2; r++ )
3867 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
3869 proto_tree_add_time_format(estree, hf_es_seconds, tvb, ioffset,
3870 4, &ns, "Timestamp: %s", abs_time_to_str(&ns));
3871 ioffset = ioffset + 4;
3872 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3873 proto_tree_add_item(estree, hf_nds_replica_num, tvb, ioffset,
3875 ioffset = ioffset + 2;
3876 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3877 proto_tree_add_item(estree, hf_nds_event_num, tvb, ioffset,
3879 ioffset = ioffset + 2;
3881 value4 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3882 ioffset = ioffset + 4;
3883 get_string(tvb, ioffset, value4, mval_buf.buffer);
3884 values->vstring = mval_buf.buffer;
3885 proto_tree_add_string(estree, hf_mv_string, tvb, ioffset,
3886 value4, values->vstring);
3887 ioffset=ioffset + value4;
3888 ioffset += align_4(tvb, ioffset);
3889 value5 = tvb_get_letohl(tvb, ioffset); /* RDN */
3890 ioffset = ioffset + 4;
3891 get_string(tvb, ioffset, value5, mval_buf.buffer);
3892 values->vstring = mval_buf.buffer;
3893 proto_tree_add_string(estree, hf_rdn_string, tvb, ioffset,
3894 value5, values->vstring);
3895 ioffset=ioffset + value5;
3896 ioffset += align_4(tvb, ioffset);
3902 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3903 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
3905 ioffset = ioffset + 4;
3910 value1 = tvb_get_letohl(tvb, ioffset);
3911 sub1item = proto_tree_add_uint_format(estree, hf_es_rdn_count, tvb, ioffset,
3912 4, value1, "Number of RDN Items %d", value1);
3913 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
3914 ioffset = ioffset + 4;
3915 for (r = 1 ; r <= value1; r++ )
3917 sub2item = proto_tree_add_text(sub1tree, tvb, ioffset, 0, "Item %d", r);
3918 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
3920 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
3922 proto_tree_add_time_format(sub2tree, hf_es_seconds, tvb, ioffset,
3923 4, &ns, "Timestamp: %s", abs_time_to_str(&ns));
3924 ioffset = ioffset + 4;
3925 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
3926 proto_tree_add_item(sub2tree, hf_nds_replica_num, tvb, ioffset,
3928 ioffset = ioffset + 2;
3929 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
3930 proto_tree_add_item(sub2tree, hf_nds_event_num, tvb, ioffset,
3932 ioffset = ioffset + 2;
3934 value3 = tvb_get_letohl(tvb, ioffset); /* Delimeter Set */
3935 ioffset = ioffset + 4;
3936 get_string(tvb, ioffset, value3, mval_buf.buffer);
3937 values->vstring = mval_buf.buffer;
3938 proto_tree_add_string(sub1tree, hf_mv_string, tvb, ioffset,
3939 value3, values->vstring);
3940 ioffset=ioffset + value3;
3941 ioffset += align_4(tvb, ioffset);
3942 value4 = tvb_get_letohl(tvb, ioffset); /* RDN */
3943 ioffset = ioffset + 4;
3944 get_string(tvb, ioffset, value4, mval_buf.buffer);
3945 values->vstring = mval_buf.buffer;
3946 proto_tree_add_string(sub1tree, hf_rdn_string, tvb, ioffset,
3947 value4, values->vstring);
3948 ioffset=ioffset + value4;
3949 ioffset += align_4(tvb, ioffset);
3955 value1 = tvb_get_letohl(tvb, ioffset); /* ES Type */
3956 proto_tree_add_item(estree, hf_es_value, tvb, ioffset,
3958 ioffset = ioffset + 4;
3965 static void process_set_filter(proto_tree* , tvbuff_t*, packet_info*, nds_val*);
3968 process_search_expression(proto_tree *it_tree, tvbuff_t *tvb, nds_val *values)
3970 guint32 search_tag, ioffset;
3971 char *search_string;
3973 ioffset = values->voffset;
3974 search_tag = tvb_get_letohl(tvb, ioffset); /* Get next search operation tag */
3975 search_string = (char *)match_strval(search_tag, itersearchenum);
3976 if(search_string == NULL)
3978 search_string = "(No Search Operation Type Found!)";
3980 proto_tree_add_uint_format(it_tree, hf_iter_search, tvb, ioffset, 4,
3981 search_tag, "Search Operation Type: %d, (0x%04x), %s",
3982 search_tag, search_tag, search_string);
3986 case NDS_SEARCH_EQUAL:
3987 case NDS_SEARCH_GREATER_OR_EQUAL:
3988 case NDS_SEARCH_LESS_OR_EQUAL:
3989 case NDS_SEARCH_APPROX:
3990 case NDS_SEARCH_ATTR_FLAGS:
3991 case NDS_SEARCH_ATTR_HAS_FLAG:
3992 /* start of DCWPutAttribute */
3993 values->vvalue = tvb_get_letohl(tvb, ioffset);
3994 ioffset = ioffset + 4;
3995 get_string(tvb, ioffset, values->vvalue, values->vstring);
3996 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
3997 values->vvalue, values->vstring);
3998 ioffset += values->vvalue;
3999 /* end of DCWPutAttribute */
4001 ioffset += align_4(tvb, ioffset);
4003 /* start of DCWPutValue */
4004 values->vvalue = tvb_get_letohl(tvb, ioffset);
4005 values->vstring = (char *)match_strval(values->vvalue, nds_syntax);
4006 if (values->vstring == NULL)
4008 values->vstring = "No Syntax Found";
4010 proto_tree_add_string(it_tree, hf_nds_syntax, tvb, ioffset,
4011 4, values->vstring);
4012 ioffset = ioffset + 4;
4013 values->vvalue = tvb_get_letohl(tvb, ioffset);
4014 ioffset = ioffset + 4;
4015 get_string(tvb, ioffset, values->vvalue, values->vstring);
4016 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4017 values->vvalue, values->vstring);
4018 ioffset += values->vvalue;
4019 /* end of DCWPutValue */
4022 case NDS_SEARCH_PRESENT:
4023 /* start of DCWPutAttribute */
4024 values->vvalue = tvb_get_letohl(tvb, ioffset);
4025 ioffset = ioffset + 4;
4026 get_string(tvb, ioffset, values->vvalue, values->vstring);
4027 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4028 values->vvalue, values->vstring);
4029 ioffset = ioffset + values->vvalue;
4030 /* end of DCWPutAttribute */
4033 case NDS_SEARCH_RDN:
4034 /* print the relative distinguished name. This includes context info... */
4035 /*if (err = DCWPutRDN(context, cur, limit, item->data))
4038 values->vvalue = tvb_get_letohl(tvb, ioffset);
4039 ioffset = ioffset + 4;
4040 get_string(tvb, ioffset, values->vvalue, values->vstring);
4041 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4042 values->vvalue, values->vstring);
4043 ioffset += values->vvalue;
4045 case NDS_SEARCH_BASE_CLASS:
4046 case NDS_SEARCH_ENTRY_FLAGS:
4047 case NDS_SEARCH_ENTRY_HAS_FLAG:
4048 case NDS_SEARCH_VALUE_FLAGS:
4049 case NDS_SEARCH_VALUE_HAS_FLAG:
4050 /* start of DCWPutValue */
4051 /*values->vvalue = tvb_get_letohl(tvb, ioffset);
4052 values->vstring = (char *)match_strval(values->vvalue, nds_syntax);
4053 if (values->vstring == NULL)
4055 values->vstring = "No Syntax Found";
4057 proto_tree_add_string(it_tree, hf_nds_syntax, tvb, ioffset,
4058 4, values->vstring);
4059 ioffset = ioffset + 4;*/
4060 values->vvalue = tvb_get_letohl(tvb, ioffset);
4061 ioffset = ioffset + 4;
4062 get_string(tvb, ioffset, values->vvalue, values->vstring);
4063 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4064 values->vvalue, values->vstring);
4065 ioffset += values->vvalue;
4066 /* end of DCWPutValue */
4068 case DCS_VALUE_GE_WITH_ATTR: /* Deprecated, use DS_SEARCH_VALUE_MTS_GE */
4069 case NDS_SEARCH_VALUE_MTS_GE:
4070 case NDS_SEARCH_VALUE_MTS_G:
4071 case NDS_SEARCH_VALUE_MTS_LE:
4072 case NDS_SEARCH_VALUE_MTS_L:
4073 case NDS_SEARCH_VALUE_MTS_EQ:
4074 case NDS_SEARCH_VALUE_MTS_EQ_APPROX:
4075 case NDS_SEARCH_VALUE_CTS_GE:
4076 case NDS_SEARCH_VALUE_CTS_G:
4077 case NDS_SEARCH_VALUE_CTS_LE:
4078 case NDS_SEARCH_VALUE_CTS_L:
4079 case NDS_SEARCH_VALUE_CTS_EQ:
4080 case NDS_SEARCH_VALUE_CTS_EQ_APPROX:
4081 /* start of DCWPutAttribute */
4082 values->vvalue = tvb_get_letohl(tvb, ioffset);
4083 ioffset = ioffset + 4;
4084 get_string(tvb, ioffset, values->vvalue, values->vstring);
4085 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4086 values->vvalue, values->vstring);
4087 ioffset += values->vvalue;
4088 /* end of DCWPutAttribute */
4090 ioffset += align_4(tvb, ioffset);
4092 /* start of DCWPutValue */
4093 values->vvalue = tvb_get_letohl(tvb, ioffset);
4094 values->vstring = (char *)match_strval(values->vvalue, nds_syntax);
4095 if (values->vstring == NULL)
4097 values->vstring = "No Syntax Found";
4099 proto_tree_add_string(it_tree, hf_nds_syntax, tvb, ioffset,
4100 4, values->vstring);
4101 ioffset = ioffset + 4;
4102 values->vvalue = tvb_get_letohl(tvb, ioffset);
4103 ioffset = ioffset + 4;
4104 get_string(tvb, ioffset, values->vvalue, values->vstring);
4105 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4106 values->vvalue, values->vstring);
4107 ioffset += values->vvalue;
4108 /* end of DCWPutValue */
4110 case DCS_MOD_GE_WITH_ATTR: /* Deprecated, use DS_SEARCH_ENTRY_MTS */
4111 case NDS_SEARCH_ENTRY_MTS_GE:
4112 case NDS_SEARCH_ENTRY_MTS_G:
4113 case NDS_SEARCH_ENTRY_MTS_LE:
4114 case NDS_SEARCH_ENTRY_MTS_L:
4115 case NDS_SEARCH_ENTRY_MTS_EQ:
4116 case NDS_SEARCH_ENTRY_MTS_EQ_APPROX:
4117 case NDS_SEARCH_ENTRY_CTS_GE:
4118 case NDS_SEARCH_ENTRY_CTS_G:
4119 case NDS_SEARCH_ENTRY_CTS_LE:
4120 case NDS_SEARCH_ENTRY_CTS_L:
4121 case NDS_SEARCH_ENTRY_CTS_EQ:
4122 case NDS_SEARCH_ENTRY_CTS_EQ_APPROX:
4123 /* start of DCWPutAttribute */
4124 values->vvalue = tvb_get_letohl(tvb, ioffset);
4125 ioffset = ioffset + 4;
4126 get_string(tvb, ioffset, values->vvalue, values->vstring);
4127 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4128 values->vvalue, values->vstring);
4129 ioffset += values->vvalue;
4130 /* end of DCWPutAttribute */
4132 ioffset += align_4(tvb, ioffset);
4134 /* start of DCWPutValue */
4135 values->vvalue = tvb_get_letohl(tvb, ioffset);
4136 values->vstring = (char *)match_strval(values->vvalue, nds_syntax);
4137 if (values->vstring == NULL)
4139 values->vstring = "No Syntax Found";
4141 proto_tree_add_string(it_tree, hf_nds_syntax, tvb, ioffset,
4142 4, values->vstring);
4143 ioffset = ioffset + 4;
4144 values->vvalue = tvb_get_letohl(tvb, ioffset);
4145 ioffset = ioffset + 4;
4146 get_string(tvb, ioffset, values->vvalue, values->vstring);
4147 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4148 values->vvalue, values->vstring);
4149 ioffset += values->vvalue;
4150 /* end of DCWPutValue */
4153 case NDS_SEARCH_EID:
4154 case NDS_SEARCH_ENTRY_SUBCOUNT_GE:
4155 case NDS_SEARCH_ENTRY_SUBCOUNT_G:
4156 case NDS_SEARCH_ENTRY_SUBCOUNT_LE:
4157 case NDS_SEARCH_ENTRY_SUBCOUNT_L:
4158 case NDS_SEARCH_ENTRY_SUBCOUNT_EQ:
4159 /* start of DCWPutValue */
4160 values->vvalue = tvb_get_letohl(tvb, ioffset);
4161 values->vstring = (char *)match_strval(values->vvalue, nds_syntax);
4162 if (values->vstring == NULL)
4164 values->vstring = "No Syntax Found";
4166 proto_tree_add_string(it_tree, hf_nds_syntax, tvb, ioffset,
4167 4, values->vstring);
4168 ioffset = ioffset + 4;
4169 values->vvalue = tvb_get_letohl(tvb, ioffset);
4170 ioffset = ioffset + 4;
4171 get_string(tvb, ioffset, values->vvalue, values->vstring);
4172 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4173 values->vvalue, values->vstring);
4174 ioffset += values->vvalue;
4175 /* end of DCWPutValue */
4179 default: /* Unknown Iteration search Item type */
4180 if (tvb_length_remaining(tvb, ioffset) < 4) {
4181 THROW(ReportedBoundsError);
4185 ioffset += align_4(tvb, ioffset);
4186 values->voffset = ioffset;
4191 process_search_subexpression(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, nds_val *values)
4193 proto_tree *it_subtree, *it_subtree1;
4194 proto_item *it_subitem, *it_subitem1;
4195 guint32 i, ioffset, number_of_items;
4197 ioffset = values->voffset;
4198 if (values->vvalue != NDS_SEARCH_NOT) {
4199 number_of_items = tvb_get_letohl(tvb, ioffset);
4200 it_subitem = proto_tree_add_item(it_tree, hf_this_count, tvb, ioffset, 4, TRUE);
4201 it_subtree = proto_item_add_subtree(it_subitem, ett_nds);
4203 for (i = 0; i < number_of_items; i++)
4205 it_subitem1 = proto_tree_add_text(it_subtree, tvb, ioffset, -1, "Item #: %d", i+1);
4206 it_subtree1 = proto_item_add_subtree(it_subitem1, ett_nds);
4208 values->voffset = ioffset;
4209 process_set_filter(it_subtree1, tvb, pinfo, values);
4210 ioffset = values->voffset;
4212 if (tvb_length_remaining(tvb, ioffset) < 4) {
4213 THROW(ReportedBoundsError);
4219 values->voffset = ioffset;
4224 process_search_match(proto_tree *it_tree, tvbuff_t *tvb, nds_val *values)
4228 ioffset = values->voffset;
4230 values->vvalue = tvb_get_letohl(tvb, ioffset);
4232 proto_tree_add_item(it_tree, hf_nds_oid, tvb, ioffset, values->vvalue, TRUE);
4233 ioffset += values->vvalue;
4235 ioffset += align_4(tvb, ioffset);
4237 proto_tree_add_item(it_tree, hf_iter_ans, tvb, ioffset, 4, TRUE);
4240 ioffset += align_4(tvb, ioffset);
4242 /* start of DCWPutAttribute */
4243 values->vvalue = tvb_get_letohl(tvb, ioffset);
4244 ioffset = ioffset + 4;
4245 get_string(tvb, ioffset, values->vvalue, values->vstring);
4246 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4247 values->vvalue, values->vstring);
4248 ioffset = ioffset + values->vvalue;
4249 /* end of DCWPutAttribute */
4251 ioffset += align_4(tvb, ioffset);
4253 /* start of DCWPutValue */
4254 values->vvalue = tvb_get_letohl(tvb, ioffset);
4255 values->vstring = (char *)match_strval(values->vvalue, nds_syntax);
4256 if (values->vstring == NULL)
4258 values->vstring = "No Syntax Found";
4260 proto_tree_add_string(it_tree, hf_nds_syntax, tvb, ioffset,
4261 4, values->vstring);
4262 ioffset = ioffset + 4;
4263 values->vvalue = tvb_get_letohl(tvb, ioffset);
4264 ioffset = ioffset + 4;
4265 get_string(tvb, ioffset, values->vvalue, values->vstring);
4266 proto_tree_add_string(it_tree, hf_mv_string, tvb, ioffset,
4267 values->vvalue, values->vstring);
4268 ioffset += values->vvalue;
4269 /* end of DCWPutValue */
4271 ioffset += align_4(tvb, ioffset);
4273 values->voffset = ioffset;
4278 process_set_filter(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, nds_val *values)
4280 guint32 search_tag, ioffset = values->voffset;
4281 char *search_string;
4283 search_tag = tvb_get_letohl(tvb, ioffset);
4284 search_string = (char *)match_strval(search_tag, itersearchenum);
4285 if(search_string == NULL)
4287 search_string = "(No Search Tag Found)";
4289 proto_tree_add_uint_format(it_tree, hf_iter_search, tvb, ioffset, 4,
4290 search_tag, "Type of Search: Tag = %d, (0x%04x), %s",
4291 search_tag, search_tag, search_string);
4293 values->voffset = ioffset;
4297 case NDS_SEARCH_ITEM:
4298 /* DCWPutSearchExp */
4299 process_search_expression(it_tree, tvb, values);
4302 case NDS_SEARCH_EXTENSIBLE:
4303 /*err = DCWPutSearchExtMatch(context, syncFormat, cur, limit, sexp->u.extMatch);*/
4304 process_search_match(it_tree, tvb, values);
4308 case NDS_SEARCH_AND:
4309 case NDS_SEARCH_NOT:
4310 /* DCWPutSearchSubExp = process_search_subexpression */
4311 process_search_subexpression(it_tree, tvb, pinfo, values);
4313 default: /* Unknown Iteration search type */
4314 if (tvb_length_remaining(tvb, ioffset) < 4) {
4315 THROW(ReportedBoundsError);
4319 ioffset = values->voffset;
4324 process_entry_info(proto_tree *it_tree, tvbuff_t *tvb, nds_val *values)
4326 guint32 iter_flags, ioffset = values->voffset;
4327 guint16 replica_num, event_num;
4328 char temp_string[256];
4331 values->vstring = temp_string;
4332 ioffset += align_4(tvb, ioffset);
4333 iter_flags = tvb_get_letohl(tvb, ioffset);
4336 if (iter_flags & DSI_OUTPUT_FIELDS) { /* Output Flags */
4337 values->vvalue = tvb_get_letohs(tvb, ioffset);
4338 values->vdesc = "Return Information Flags (low) Byte:";
4339 values->vlength = 2;
4340 values->hfname = hf_nds_rflags;
4341 values->voffset = ioffset;
4342 values->bit1 = "Output Flags";
4343 values->bit1hfname = hf_bit1infoflagsl;
4344 values->bit2 = "Entry ID";
4345 values->bit2hfname = hf_bit2infoflagsl;
4346 values->bit3 = "Entry Flags";
4347 values->bit3hfname = hf_bit3infoflagsl;
4348 values->bit4 = "Subordinate Count";
4349 values->bit4hfname = hf_bit4infoflagsl;
4350 values->bit5 = "Modification Time";
4351 values->bit5hfname = hf_bit5infoflagsl;
4352 values->bit6 = "Modification Timestamp";
4353 values->bit6hfname = hf_bit6infoflagsl;
4354 values->bit7 = "Creation Timestamp";
4355 values->bit7hfname = hf_bit7infoflagsl;
4356 values->bit8 = "Partition Root ID";
4357 values->bit8hfname = hf_bit8infoflagsl;
4358 values->bit9 = "Parent ID";
4359 values->bit9hfname = hf_bit9infoflagsl;
4360 values->bit10 = "Revision Count";
4361 values->bit10hfname = hf_bit10infoflagsl;
4362 values->bit11 = "Replica Type";
4363 values->bit11hfname = hf_bit11infoflagsl;
4364 values->bit12 = "Base Class";
4365 values->bit12hfname = hf_bit12infoflagsl;
4366 values->bit13 = "Relative Distinguished Name";
4367 values->bit13hfname = hf_bit13infoflagsl;
4368 values->bit14 = "Distinguished Name";
4369 values->bit14hfname = hf_bit14infoflagsl;
4370 values->bit15 = "Root Distinguished Name";
4371 values->bit15hfname = hf_bit15infoflagsl;
4372 values->bit16 = "Parent Distinguished Name";
4373 values->bit16hfname = hf_bit16infoflagsl;
4374 process_bitfield(it_tree, tvb, values);
4375 ioffset = ioffset+2;
4377 values->vvalue = tvb_get_letohs(tvb, ioffset);
4378 values->vtype = VTYPE_BITFIELD;
4379 values->vdesc = "Return Information Flags (high) Byte:";
4380 values->vlength = 2;
4381 values->hfname= hf_nds_rflags;
4382 values->voffset = ioffset;
4383 values->bit1 = "Purge Time";
4384 values->bit1hfname = hf_bit1infoflagsh;
4385 values->bit2 = "Dereference Base Class";
4386 values->bit2hfname = hf_bit2infoflagsh;
4387 values->bit3 = "Replica Number";
4388 values->bit3hfname = hf_bit3infoflagsh;
4389 values->bit4 = "Replica State";
4390 values->bit4hfname = hf_bit4infoflagsh;
4391 values->bit5 = "Federation Boundary";
4392 values->bit5hfname = hf_bit5infoflagsh;
4393 values->bit6 = "Schema Boundary";
4394 values->bit6hfname = hf_bit6infoflagsh;
4395 values->bit7 = "Federation Boundary ID";
4396 values->bit7hfname = hf_bit7infoflagsh;
4397 values->bit8 = "Schema Boundary ID";
4398 values->bit8hfname = hf_bit8infoflagsh;
4399 values->bit9 = "Current Subcount";
4400 values->bit9hfname = hf_bit9infoflagsh;
4401 values->bit10 = "Local Entry Flags";
4402 values->bit10hfname = hf_bit10infoflagsh;
4403 values->bit11 = "Not Defined";
4404 values->bit11hfname = hf_bit11infoflagsh;
4405 values->bit12 = "Not Defined";
4406 values->bit12hfname = hf_bit12infoflagsh;
4407 values->bit13 = "Not Defined";
4408 values->bit13hfname = hf_bit13infoflagsh;
4409 values->bit14 = "Not Defined";
4410 values->bit14hfname = hf_bit14infoflagsh;
4411 values->bit15 = "Not Defined";
4412 values->bit15hfname = hf_bit15infoflagsh;
4413 values->bit16 = "Not Defined";
4414 values->bit16hfname = hf_bit16infoflagsh;
4415 process_bitfield(it_tree, tvb, values);
4416 ioffset = ioffset+2;
4418 if (iter_flags & DSI_ENTRY_ID) { /* Entry ID */
4419 values->vvalue = tvb_get_letohl(tvb, ioffset);
4420 proto_tree_add_uint_format(it_tree, hf_nds_eid, tvb, ioffset,
4421 4, values->vvalue, "Entry ID 0x%08x", values->vvalue);
4422 ioffset = ioffset + 4;
4424 if (iter_flags & DSI_ENTRY_FLAGS) { /* Entry Flags */
4425 values->vvalue = tvb_get_letohl(tvb, ioffset);
4426 values->vtype = VTYPE_BITFIELD;
4427 values->vdesc = "Entry Flags:";
4428 values->vlength = 2;
4429 values->hfname= hf_nds_eflags;
4430 values->voffset = ioffset;
4431 values->bit1 = "Alias Entry";
4432 values->bit1hfname = hf_bit1eflags;
4433 values->bit2 = "Partition Root";
4434 values->bit2hfname = hf_bit2eflags;
4435 values->bit3 = "Container Entry";
4436 values->bit3hfname = hf_bit3eflags;
4437 values->bit4 = "Container Alias";
4438 values->bit4hfname = hf_bit4eflags;
4439 values->bit5 = "Matches List Filter";
4440 values->bit5hfname = hf_bit5eflags;
4441 values->bit6 = "Reference Entry";
4442 values->bit6hfname = hf_bit6eflags;
4443 values->bit7 = "40x Reference Entry";
4444 values->bit7hfname = hf_bit7eflags;
4445 values->bit8 = "Back Linked";
4446 values->bit8hfname = hf_bit8eflags;
4447 values->bit9 = "New Entry";
4448 values->bit9hfname = hf_bit9eflags;
4449 values->bit10 = "Temporary Reference";
4450 values->bit10hfname = hf_bit10eflags;
4451 values->bit11 = "Audited";
4452 values->bit11hfname = hf_bit11eflags;
4453 values->bit12 = "Entry Not Present";
4454 values->bit12hfname = hf_bit12eflags;
4455 values->bit13 = "Entry Verify CTS";
4456 values->bit13hfname = hf_bit13eflags;
4457 values->bit14 = "Entry Damaged";
4458 values->bit14hfname = hf_bit14eflags;
4459 values->bit15 = "Not Defined";
4460 values->bit15hfname = hf_bit15eflags;
4461 values->bit16 = "Not Defined";
4462 values->bit16hfname = hf_bit16eflags;
4463 process_bitfield(it_tree, tvb, values);
4464 ioffset = ioffset+4;
4466 if (iter_flags & DSI_SUBORDINATE_COUNT) { /* Subordinate Count */
4467 proto_tree_add_item(it_tree, hf_sub_count, tvb, ioffset, 4, TRUE);
4470 if (iter_flags & DSI_MODIFICATION_TIME) { /* Modification Time */
4471 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
4473 proto_tree_add_time_format(it_tree, hf_es_seconds, tvb, ioffset,
4474 4, &ns, "Modification Time: %s", abs_time_to_str(&ns));
4475 ioffset = ioffset + 4;
4477 if (iter_flags & DSI_MODIFICATION_TIMESTAMP) { /* Modification Timestamp */
4478 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
4480 proto_tree_add_time_format(it_tree, hf_es_seconds, tvb, ioffset,
4481 4, &ns, "Modification Timestamp: %s", abs_time_to_str(&ns));
4482 ioffset = ioffset + 4;
4483 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
4484 proto_tree_add_item(it_tree, hf_nds_replica_num, tvb, ioffset,
4486 ioffset = ioffset + 2;
4487 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
4488 proto_tree_add_item(it_tree, hf_nds_event_num, tvb, ioffset,
4490 ioffset = ioffset + 2;
4492 if (iter_flags & DSI_CREATION_TIMESTAMP) { /* Creation Timestamp */
4493 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
4495 proto_tree_add_time_format(it_tree, hf_es_seconds, tvb, ioffset,
4496 4, &ns, "Creation Timestamp: %s", abs_time_to_str(&ns));
4497 ioffset = ioffset + 4;
4498 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
4499 proto_tree_add_item(it_tree, hf_nds_replica_num, tvb, ioffset,
4501 ioffset = ioffset + 2;
4502 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
4503 proto_tree_add_item(it_tree, hf_nds_event_num, tvb, ioffset,
4505 ioffset = ioffset + 2;
4507 if (iter_flags & DSI_PARTITION_ROOT_ID) { /* Partition Root ID */
4508 values->vvalue = tvb_get_letohl(tvb, ioffset);
4509 proto_tree_add_uint_format(it_tree, hf_nds_local_partition, tvb, ioffset,
4510 4, values->vvalue, "Partition Root ID %08x", values->vvalue);
4511 ioffset = ioffset + 4;
4513 if (iter_flags & DSI_PARENT_ID) { /* Parent ID */
4514 values->vvalue = tvb_get_letohl(tvb, ioffset);
4515 proto_tree_add_uint_format(it_tree, hf_nds_local_partition, tvb, ioffset,
4516 4, values->vvalue, "Parent ID %08x", values->vvalue);
4517 ioffset = ioffset + 4;
4519 if (iter_flags & DSI_REVISION_COUNT) { /* Revision Count */
4520 values->vvalue = tvb_get_letohl(tvb, ioffset);
4521 proto_tree_add_uint_format(it_tree, hf_nds_local_partition, tvb, ioffset,
4522 4, values->vvalue, "Revision count %08x", values->vvalue);
4523 ioffset = ioffset + 4;
4525 if (iter_flags & DSI_REPLICA_TYPE) { /* Replica Type */
4526 values->vvalue = tvb_get_letohl(tvb, ioffset) & 0x00ff;
4527 values->vstring = (char *)match_strval(values->vvalue, nds_replica_type);
4528 if (values->vstring == NULL)
4530 values->vstring = "No Replica Type Found";
4532 proto_tree_add_string(it_tree, hf_replica_type, tvb, ioffset,
4533 4, values->vstring);
4534 values->vvalue = tvb_get_letohl(tvb, ioffset) & 0xff00;
4535 values->vstring = (char *)match_strval(values->vvalue, nds_replica_state);
4536 if (values->vstring == NULL)
4538 values->vstring = "No Replica State Found";
4540 proto_tree_add_string(it_tree, hf_replica_state, tvb, ioffset,
4541 4, values->vstring);
4542 ioffset = ioffset + 4;
4544 if (iter_flags & DSI_BASE_CLASS) { /* Base Class */
4545 values->vvalue = tvb_get_letohl(tvb, ioffset); /* Length of string */
4546 ioffset = ioffset+4;
4547 get_string(tvb, ioffset, values->vvalue, values->vstring);
4548 proto_tree_add_string_format(it_tree, hf_value_string, tvb, ioffset,
4549 values->vvalue, temp_string,
4550 "Base Class: - %s", temp_string);
4551 ioffset = ioffset+values->vvalue;
4552 ioffset += align_4(tvb, ioffset);
4554 if (iter_flags & DSI_ENTRY_RDN) { /* Relative Distiguished Name */
4555 values->vvalue = tvb_get_letohl(tvb, ioffset); /* Length of string */
4556 ioffset = ioffset+4;
4557 get_string(tvb, ioffset, values->vvalue, values->vstring);
4558 proto_tree_add_string_format(it_tree, hf_value_string, tvb, ioffset,
4559 values->vvalue, temp_string,
4560 "Relative Distinguished Name - %s", temp_string);
4561 ioffset = ioffset+values->vvalue;
4562 ioffset += align_4(tvb, ioffset);
4564 if (iter_flags & DSI_ENTRY_DN) { /* Distinguished Name */
4565 values->vvalue = tvb_get_letohl(tvb, ioffset); /* Length of string */
4566 ioffset = ioffset+4;
4567 get_string(tvb, ioffset, values->vvalue, values->vstring);
4568 proto_tree_add_string_format(it_tree, hf_value_string, tvb, ioffset,
4569 values->vvalue, temp_string,
4570 "Distinguished Name - %s", temp_string);
4571 ioffset = ioffset+values->vvalue;
4572 ioffset += align_4(tvb, ioffset);
4574 if (iter_flags & DSI_PARTITION_ROOT_DN) { /* Root Distinguished Name */
4575 values->vvalue = tvb_get_letohl(tvb, ioffset); /* Length of string */
4576 ioffset = ioffset+4;
4577 get_string(tvb, ioffset, values->vvalue, values->vstring);
4578 proto_tree_add_string_format(it_tree, hf_value_string, tvb, ioffset,
4579 values->vvalue, temp_string,
4580 "Root Distinguished Name - %s", temp_string);
4581 ioffset = ioffset+values->vvalue;
4582 ioffset += align_4(tvb, ioffset);
4584 if (iter_flags & DSI_PARENT_DN) { /* Parent Distinguished Name */
4585 values->vvalue = tvb_get_letohl(tvb, ioffset); /* Length of string */
4586 ioffset = ioffset+4;
4587 get_string(tvb, ioffset, values->vvalue, values->vstring);
4588 proto_tree_add_string_format(it_tree, hf_value_string, tvb, ioffset,
4589 values->vvalue, temp_string,
4590 "Parent Distinguished Name - %s", temp_string);
4591 ioffset = ioffset+values->vvalue;
4592 ioffset += align_4(tvb, ioffset);
4594 if (iter_flags & DSI_PURGE_TIME) { /* Purge Time */
4595 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
4597 proto_tree_add_time_format(it_tree, hf_nds_purge, tvb, ioffset,
4598 4, &ns, "Purge Time: %s", abs_time_to_str(&ns));
4599 ioffset = ioffset + 4;
4601 if (iter_flags & DSI_DEREFERENCED_BASE_CLASS) { /* Dereference Base Class */
4602 values->vvalue = tvb_get_letohl(tvb, ioffset);
4603 ioffset = ioffset + 4;
4604 get_string(tvb, ioffset, values->vvalue, values->vstring);
4605 proto_tree_add_string(it_tree, hf_deref_base, tvb, ioffset,
4606 values->vvalue, temp_string);
4607 ioffset = ioffset + values->vvalue;
4609 if (iter_flags & DSI_REPLICA_NUMBER) { /* Replica Number */
4610 values->vvalue = tvb_get_letohl(tvb, ioffset); /* Replica number */
4611 proto_tree_add_uint_format(it_tree, hf_replica_number, tvb, ioffset,
4612 4, values->vvalue, "Replica Number %d", values->vvalue);
4613 ioffset = ioffset+4;
4615 if (iter_flags & DSI_REPLICA_STATE) { /* Replica State */
4616 values->vvalue = tvb_get_letohl(tvb, ioffset) & 0xff00;
4617 values->vstring = (char *)match_strval(values->vvalue, nds_replica_state);
4618 if (values->vstring == NULL)
4620 values->vstring = "No Replica State Found";
4622 proto_tree_add_string(it_tree, hf_replica_state, tvb, ioffset,
4623 4, values->vstring);
4624 ioffset = ioffset + 2;
4626 if (iter_flags & DSI_FEDERATION_BOUNDARY) { /* Federation Boundary */
4627 values->vvalue = tvb_get_letohl(tvb, ioffset);
4628 proto_tree_add_uint_format(it_tree, hf_nds_uint32value, tvb, ioffset,
4629 4, values->vvalue, "Federation Boundary %d", values->vvalue);
4630 ioffset = ioffset+4;
4632 if (iter_flags & DSI_SCHEMA_BOUNDARY) { /* Schema Boundary */
4633 values->vvalue = tvb_get_letohl(tvb, ioffset);
4634 proto_tree_add_uint_format(it_tree, hf_nds_uint32value, tvb, ioffset,
4635 4, values->vvalue, "Schema Boundary %d", values->vvalue);
4636 ioffset = ioffset+4;
4638 if (iter_flags & DSI_FEDERATION_BOUNDARY_ID) { /* Federation Boundary ID */
4639 values->vvalue = tvb_get_letohl(tvb, ioffset);
4640 proto_tree_add_uint_format(it_tree, hf_nds_uint32value, tvb, ioffset,
4641 4, values->vvalue, "Federation Boundary ID %d", values->vvalue);
4642 ioffset = ioffset+4;
4644 if (iter_flags & DSI_SCHEMA_BOUNDARY_ID) { /* Schema Boundary ID*/
4645 values->vvalue = tvb_get_letohl(tvb, ioffset);
4646 proto_tree_add_uint_format(it_tree, hf_nds_uint32value, tvb, ioffset,
4647 4, values->vvalue, "Schema Boundary ID %d", values->vvalue);
4648 ioffset = ioffset+4;
4650 if (iter_flags & DSI_CUR_SUBCOUNT) { /* Current Subcount */
4651 values->vvalue = tvb_get_letohl(tvb, ioffset);
4652 proto_tree_add_uint_format(it_tree, hf_nds_uint32value, tvb, ioffset,
4653 4, values->vvalue, "Current Subcount %d", values->vvalue);
4654 ioffset = ioffset+4;
4656 if (iter_flags & DSI_LOCAL_ENTRY_FLAGS) { /* Local Entry Flags */
4657 values->vvalue = tvb_get_letohl(tvb, ioffset);
4658 values->vtype = VTYPE_BITFIELD;
4659 values->vdesc = "Local Entry Flags:";
4660 values->vlength = 2;
4661 values->hfname= hf_nds_eflags;
4662 values->voffset = ioffset;
4663 values->bit1 = "Alias Entry";
4664 values->bit1hfname = hf_bit1eflags;
4665 values->bit2 = "Partition Root";
4666 values->bit2hfname = hf_bit2eflags;
4667 values->bit3 = "Container Entry";
4668 values->bit3hfname = hf_bit3eflags;
4669 values->bit4 = "Container Alias";
4670 values->bit4hfname = hf_bit4eflags;
4671 values->bit5 = "Matches List Filter";
4672 values->bit5hfname = hf_bit5eflags;
4673 values->bit6 = "Reference Entry";
4674 values->bit6hfname = hf_bit6eflags;
4675 values->bit7 = "40x Reference Entry";
4676 values->bit7hfname = hf_bit7eflags;
4677 values->bit8 = "Back Linked";
4678 values->bit8hfname = hf_bit8eflags;
4679 values->bit9 = "New Entry";
4680 values->bit9hfname = hf_bit9eflags;
4681 values->bit10 = "Temporary Reference";
4682 values->bit10hfname = hf_bit10eflags;
4683 values->bit11 = "Audited";
4684 values->bit11hfname = hf_bit11eflags;
4685 values->bit12 = "Entry Not Present";
4686 values->bit12hfname = hf_bit12eflags;
4687 values->bit13 = "Entry Verify CTS";
4688 values->bit13hfname = hf_bit13eflags;
4689 values->bit14 = "Entry Damaged";
4690 values->bit14hfname = hf_bit14eflags;
4691 values->bit15 = "Not Defined";
4692 values->bit15hfname = hf_bit15eflags;
4693 values->bit16 = "Not Defined";
4694 values->bit16hfname = hf_bit16eflags;
4695 process_bitfield(it_tree, tvb, values);
4696 ioffset = ioffset+4;
4698 values->voffset = ioffset;
4703 dissect_nds_iterator(proto_tree *it_tree, tvbuff_t *tvb, packet_info *pinfo, guint32 it_verb, guint32 request_flags, guint32 ioffset, gboolean request_reply)
4705 guint32 rcode, i, number_of_items, number_to_get;
4706 char *error_string, *verb_string;
4708 proto_tree *it_subtree, *it_subtree1;
4709 proto_item *it_subitem, *it_subitem1;
4716 values.vdesc = "\0";
4717 values.vstring = "\0";
4723 verb_string = (char *)match_strval(it_verb, iterator_subverbs);
4724 if(verb_string == NULL)
4726 verb_string = "(No Iteration Verb Found)";
4728 it_subitem = proto_tree_add_uint_format(it_tree, hf_ncp_nds_iterverb, tvb, ioffset-4, 4,
4729 it_verb, "Iterator Verb: %d, (0x%04x), %s",
4730 it_verb, it_verb, verb_string);
4732 it_subtree = proto_item_add_subtree(it_subitem, ett_nds);
4734 if (request_reply) { /* Request packets */
4744 proto_tree_add_item(it_subtree, hf_timelimit, tvb, ioffset, 4, TRUE);
4746 proto_tree_add_item(it_subtree, hf_max_entries, tvb, ioffset, 4, TRUE);
4748 proto_tree_add_item(it_subtree, hf_move_position, tvb, ioffset, 4, TRUE);
4757 proto_tree_add_item(it_subtree, hf_timelimit, tvb, ioffset, 4, TRUE);
4760 case IT_GETPOSITION:
4761 case IT_ISPOSITIONABLE:
4764 proto_tree_add_item(it_subtree, hf_timelimit, tvb, ioffset, 4, TRUE);
4769 proto_tree_add_item(it_subtree, hf_timelimit, tvb, ioffset, 4, TRUE);
4771 proto_tree_add_item(it_subtree, hf_num_to_get, tvb, ioffset, 4, TRUE);
4775 proto_tree_add_item(it_subtree, hf_iter_position, tvb, ioffset, 4, TRUE);
4777 proto_tree_add_item(it_subtree, hf_timelimit, tvb, ioffset, 4, TRUE);
4780 case IT_POSITION_IT:
4781 proto_tree_add_item(it_subtree, hf_iter_other, tvb, ioffset, 4, TRUE);
4785 proto_tree_add_item(it_subtree, hf_nds_number_of_items, tvb, ioffset, 4, TRUE);
4786 number_of_items = tvb_get_letohl(tvb, ioffset);
4788 for (i=0; i < number_of_items; i++) {
4789 /* Process the attribute tag */
4790 values.vvalue = tvb_get_letohl(tvb, ioffset);
4791 values.vstring = (char *)match_strval(values.vvalue, nds_tags);
4792 if(values.vstring == NULL)
4794 values.vstring = "No Tags Set";
4796 proto_tree_add_string(it_subtree, hf_nds_tag_string, tvb, ioffset, 4, values.vstring);
4797 ioffset = ioffset + 4;
4799 /* start of DCWPutAttribute */
4800 values.vvalue = tvb_get_letohl(tvb, ioffset);
4801 ioffset = ioffset + 4;
4802 get_string(tvb, ioffset, values.vvalue, values.vstring);
4803 proto_tree_add_string(it_subtree, hf_mv_string, tvb, ioffset,
4804 values.vvalue, values.vstring);
4805 ioffset = ioffset + values.vvalue;
4806 /* end of DCWPutAttribute */
4808 ioffset += align_4(tvb, ioffset);
4809 if (tvb_length_remaining(tvb, ioffset) < 4) {
4810 THROW(ReportedBoundsError);
4817 values.voffset = ioffset;
4819 /* DCWPutSearchExp = process_set_filter() */
4820 process_set_filter(it_subtree, tvb, pinfo, &values);
4822 ioffset = values.voffset;
4823 ioffset += align_4(tvb, ioffset);
4826 proto_tree_add_item(it_subtree, hf_timelimit, tvb, ioffset, 4, TRUE);
4828 proto_tree_add_item(it_subtree, hf_num_to_skip, tvb, ioffset, 4, TRUE);
4832 proto_tree_add_item(it_subtree, hf_num_to_get, tvb, ioffset, 4, TRUE);
4833 number_to_get = tvb_get_letohl(tvb, ioffset);
4835 if (number_to_get == 0) {
4836 values.vvalue = tvb_get_letohl(tvb, ioffset);
4837 values.vstring = (char *)match_strval(values.vvalue, nds_tags);
4838 if(values.vstring == NULL)
4840 values.vstring = "No Tags Set";
4842 proto_tree_add_string(it_tree, hf_nds_tag_string, tvb, ioffset, 4, values.vstring);
4843 ioffset = ioffset + 4;
4846 values.vvalue = tvb_get_letohl(tvb, ioffset);
4847 ioffset = ioffset + 4;
4848 get_string(tvb, ioffset, values.vvalue, values.vstring);
4849 proto_tree_add_string(it_subtree, hf_mv_string, tvb, ioffset,
4850 values.vvalue, values.vstring);
4851 ioffset = ioffset + values.vvalue;
4852 ioffset += align_4(tvb, ioffset);
4855 if (tvb_length_remaining(tvb, ioffset) < 4) {
4856 THROW(ReportedBoundsError);
4861 else /* Reply Packets */
4862 { /* All replies include a completion code first */
4863 rcode = tvb_get_letohl(tvb, ioffset);
4864 error_string = (char *)match_strval(rcode, nds_reply_errors);
4865 if (error_string == NULL) {
4866 error_string = (char *)"Unknown Interation Verb Completion Code";
4868 expert_item = proto_tree_add_uint_format(it_subtree, hf_iter_verb_completion_code, tvb, ioffset,
4869 4, rcode, "Completion Code: 0x%08x, %s",
4870 rcode, error_string );
4872 if (rcode != 0 && ncp_echo_err) {
4873 expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "Iteration Verb Error: 0x%08x %s", rcode, error_string);
4882 proto_tree_add_item(it_subtree, hf_iter_ans, tvb, ioffset, 4, TRUE);
4888 proto_tree_add_item(it_subtree, hf_iter_copy, tvb, ioffset, 4, TRUE);
4892 proto_tree_add_item(it_subtree, hf_this_count, tvb, ioffset, 4, TRUE);
4896 proto_tree_add_item(it_subtree, hf_nds_iterator, tvb, ioffset, 4, TRUE);
4904 values.vvalue = tvb_get_letohl(tvb, ioffset);
4905 values.vstring = (char *)match_strval(values.vvalue, nds_info_type);
4906 if(values.vstring == NULL)
4908 values.vstring = "No Info Type Set";
4910 proto_tree_add_string(it_subtree, hf_nds_info_type, tvb, ioffset, 4, values.vstring);
4911 ioffset = ioffset + 4;
4912 proto_tree_add_item(it_subtree, hf_data_size, tvb, ioffset, 4, TRUE);
4914 number_of_items = tvb_get_letohl(tvb, ioffset);
4915 proto_tree_add_item(it_subtree, hf_this_count, tvb, ioffset, 4, TRUE);
4917 for (i = 0; i < number_of_items; i++)
4919 it_subitem1 = proto_tree_add_text(it_subtree, tvb, ioffset, -1, "Item #: %d", i+1);
4920 it_subtree1 = proto_item_add_subtree(it_subitem1, ett_nds);
4922 ioffset += align_4(tvb, ioffset);
4924 /* Start WGetAndBufferEntryInfo = process_entry_info() */
4925 values.voffset = ioffset;
4926 values.vflags = request_flags;
4927 process_entry_info(it_subtree1, tvb, &values);
4928 ioffset = values.voffset;
4929 /* End WGetAndBufferEntryInfo */
4931 ioffset += align_4(tvb, ioffset);
4933 /* WGetReadBuffer - This seems to be a count and then size field (2 * guint32) */
4934 /* For now we will just skip this offset. NEED TO ADD LOGIC TO HANDLE */
4937 if (tvb_length_remaining(tvb, ioffset) < 4) {
4945 case IT_GETPOSITION:
4946 proto_tree_add_item(it_subtree, hf_iter_position, tvb, ioffset, 4, TRUE);
4949 case IT_ISPOSITIONABLE:
4950 proto_tree_add_item(it_subtree, hf_positionable, tvb, ioffset, 4, TRUE);
4954 case IT_POSITION_IT:
4959 proto_tree_add_item(it_subtree, hf_iter_index, tvb, ioffset, 4, TRUE);
4963 proto_tree_add_item(it_subtree, hf_num_skipped, tvb, ioffset, 4, TRUE);
4967 if (tvb_length_remaining(tvb, ioffset) < 4) {
4968 THROW(ReportedBoundsError);
4973 it_verb = tvb_get_letohl(tvb, ioffset);
4975 if (it_verb == IT_DONE || tvb_length_remaining(tvb, ioffset) < 4) {
4976 verb_string = (char *)match_strval(it_verb, iterator_subverbs);
4977 if(verb_string == NULL)
4979 verb_string = "Internal error processing NDS iteration verbs";
4981 it_subitem = proto_tree_add_uint_format(it_tree, hf_ncp_nds_iterverb, tvb, ioffset-4, 4,
4982 it_verb, "Iterator Verb: %d, (0x%04x), %s",
4983 it_verb, it_verb, verb_string);
4992 process_multivalues(proto_tree *ncp_tree, tvbuff_t *tvb, packet_info *pinfo, nds_val *values)
4996 guint32 ioffset = 0, oldioffset;
5004 const char *valuestr = "";
5009 guint32 number_of_referrals = 0;
5013 guint16 replica_num = 0;
5014 guint16 event_num = 0;
5016 nds_val temp_values;
5017 proto_tree *sub1tree;
5018 proto_item *sub1item;
5019 proto_tree *sub2tree;
5020 proto_item *sub2item;
5021 gint length_remaining;
5024 mval_buf.buffer[0] = '\0';
5025 mv_resolve_name_string[0] = '\0';
5027 /* Is the value passed a string or UINT32? */
5028 if(values->mvtype != MVTYPE_LIST_PARTITIONS && values->mvtype != MVTYPE_PROCESS_TAGS)
5030 nitem = proto_tree_add_uint_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
5031 values->vlength, values->vvalue, values->vdesc, values->vvalue);
5035 nitem = proto_tree_add_string_format(ncp_tree, values->hfname, tvb, values->voffset+ioffset,
5036 values->vlength, values->vdesc, "%s", values->vdesc);
5038 ioffset = (values->voffset+4);
5040 ntree = proto_item_add_subtree(nitem, ett_nds);
5042 switch (values->mvtype)
5044 case MVTYPE_ATTR_REQUEST: /* Attribute Request */
5045 for (i = 1 ; i <= values->vvalue; i++ )
5047 ioffset += align_4(tvb, ioffset);
5048 value1 = tvb_get_letohl(tvb, ioffset);
5049 ioffset = ioffset + 4;
5050 get_string(tvb, ioffset, value1, mval_buf.buffer);
5051 values->vstring = mval_buf.buffer;
5052 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5053 value1, values->vstring);
5054 ioffset = ioffset + value1;
5058 case MVTYPE_ATTR_REPLY: /* Attribute Reply */
5059 switch(values->vflags)
5062 for (i = 1 ; i <= values->vvalue; i++ )
5064 ioffset += align_4(tvb, ioffset);
5065 value1 = tvb_get_letohl(tvb, ioffset);
5066 ioffset = ioffset + 4;
5067 get_string(tvb, ioffset, value1, mval_buf.buffer);
5068 values->vstring = mval_buf.buffer;
5069 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5070 value1, values->vstring);
5071 ioffset = ioffset + value1;
5075 for (i = 1 ; i <= values->vvalue; i++ )
5077 value1 = tvb_get_letohl(tvb, ioffset);
5078 values->vstring = (char *)match_strval(value1, nds_syntax);
5079 if (values->vstring == NULL)
5081 values->vstring = "No Syntax Found";
5083 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
5084 4, values->vstring);
5085 ioffset = ioffset + 4;
5086 value2 = tvb_get_letohl(tvb, ioffset);
5087 ioffset = ioffset + 4;
5088 get_string(tvb, ioffset, value2, mval_buf.buffer);
5089 values->vstring = mval_buf.buffer;
5090 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5091 value2, values->vstring);
5093 ioffset += align_4(tvb, ioffset);
5094 values->voffset = ioffset;
5096 print_nds_values(ntree, tvb, value1, values);
5097 ioffset = values->voffset;
5101 for (i = 1 ; i <= values->vvalue; i++ )
5103 value1 = tvb_get_letohl(tvb, ioffset);
5104 values->vstring = (char *)match_strval(value1, nds_syntax);
5105 if (values->vstring == NULL)
5107 values->vstring = "No Syntax Found";
5109 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
5110 4, values->vstring);
5111 ioffset = ioffset + 4;
5112 value2 = tvb_get_letohl(tvb, ioffset);
5113 ioffset = ioffset + 4;
5114 get_string(tvb, ioffset, value2, mval_buf.buffer);
5115 values->vstring = mval_buf.buffer;
5116 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5117 value2, values->vstring);
5118 values->voffset=ioffset + value2;
5120 ioffset += align_4(tvb, ioffset);
5121 value3 = tvb_get_letohl(tvb, ioffset);
5123 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
5124 value3, "Number of Values - %d", value3);
5126 ioffset = ioffset + 4;
5127 for (r = 1 ; r <= value3; r++ )
5129 ioffset += 4; /* Length = 4 */
5130 value4 = tvb_get_letohl(tvb, ioffset);
5131 tvb_ensure_bytes_exist(tvb, ioffset, values->vlength);
5132 proto_tree_add_uint(ntree, hf_nds_privileges, tvb, ioffset,
5133 values->vlength, value4);
5135 ioffset = ioffset+4;
5140 for (i = 1 ; i <= values->vvalue; i++ )
5142 value1 = tvb_get_letohl(tvb, ioffset);
5143 values->vstring = (char *)match_strval(value1, nds_syntax);
5144 if (values->vstring == NULL)
5146 values->vstring = "No Syntax Found";
5148 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
5149 4, values->vstring);
5150 ioffset = ioffset + 4;
5151 value2 = tvb_get_letohl(tvb, ioffset);
5152 ioffset = ioffset + 4;
5153 get_string(tvb, ioffset, value2, mval_buf.buffer);
5154 values->vstring = mval_buf.buffer;
5155 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5156 value2, values->vstring);
5157 ioffset = ioffset + value2;
5158 ioffset += align_4(tvb, ioffset);
5159 value3 = tvb_get_letohl(tvb, ioffset);
5161 aitem = proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
5162 value3, "Number of Values - %d", value3);
5164 atree = proto_item_add_subtree(aitem, ett_nds);
5166 ioffset = ioffset + 4;
5167 for (r = 1 ; r <= value3; r++ )
5169 ioffset += align_4(tvb, ioffset);
5170 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
5171 temp_values.vlength = 2;
5172 temp_values.hfname = hf_nds_vflags;
5173 temp_values.voffset = ioffset;
5174 temp_values.vdesc = "Value Flags";
5175 temp_values.bit1 = "Naming";
5176 temp_values.bit1hfname = hf_bit1vflags;
5177 temp_values.bit2 = "Base Class";
5178 temp_values.bit2hfname = hf_bit2vflags;
5179 temp_values.bit3 = "Present";
5180 temp_values.bit3hfname = hf_bit3vflags;
5181 temp_values.bit4 = "Value Damaged";
5182 temp_values.bit4hfname = hf_bit4vflags;
5183 temp_values.bit5 = "Not Defined";
5184 temp_values.bit5hfname = hf_bit5vflags;
5185 temp_values.bit6 = "Not Defined";
5186 temp_values.bit6hfname = hf_bit6vflags;
5187 temp_values.bit7 = "Not Defined";
5188 temp_values.bit7hfname = hf_bit7vflags;
5189 temp_values.bit8 = "Not Defined";
5190 temp_values.bit8hfname = hf_bit8vflags;
5191 temp_values.bit9 = "Not Defined";
5192 temp_values.bit9hfname = hf_bit9vflags;
5193 temp_values.bit10 = "Not Defined";
5194 temp_values.bit10hfname = hf_bit10vflags;
5195 temp_values.bit11 = "Not Defined";
5196 temp_values.bit11hfname = hf_bit11vflags;
5197 temp_values.bit12 = "Not Defined";
5198 temp_values.bit12hfname = hf_bit12vflags;
5199 temp_values.bit13 = "Not Defined";
5200 temp_values.bit13hfname = hf_bit13vflags;
5201 temp_values.bit14 = "Not Defined";
5202 temp_values.bit14hfname = hf_bit14vflags;
5203 temp_values.bit15 = "Not Defined";
5204 temp_values.bit15hfname = hf_bit15vflags;
5205 temp_values.bit16 = "Not Defined";
5206 temp_values.bit16hfname = hf_bit16vflags;
5207 process_bitfield(atree, tvb, &temp_values);
5208 ioffset = ioffset + 4;
5209 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
5211 proto_tree_add_time_format(atree, hf_es_seconds, tvb, ioffset,
5212 4, &ns, "Timestamp: %s", abs_time_to_str(&ns));
5213 ioffset = ioffset + 4;
5214 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
5215 proto_tree_add_item(atree, hf_nds_replica_num, tvb, ioffset,
5217 ioffset = ioffset + 2;
5218 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
5219 proto_tree_add_item(atree, hf_nds_event_num, tvb, ioffset,
5221 ioffset = ioffset + 2;
5222 value5 = tvb_get_letohl(tvb, ioffset); /* length of field */
5223 if(value5 > tvb_length_remaining(tvb, ioffset))
5228 tvb_ensure_bytes_exist(tvb, ioffset, value5);
5229 proto_tree_add_bytes(atree, hf_value_bytes, tvb, ioffset, value5, tvb_get_ptr(tvb, ioffset, value5));
5231 ioffset += (value5%2);
5236 for (i = 1 ; i <= values->vvalue; i++ )
5238 value1 = tvb_get_letohl(tvb, ioffset);
5239 values->vstring = (char *)match_strval(value1, nds_syntax);
5240 if (values->vstring == NULL)
5242 values->vstring = "No Syntax Found";
5244 proto_tree_add_string(ntree, hf_nds_syntax, tvb, ioffset,
5245 4, values->vstring);
5246 ioffset = ioffset + 4;
5247 value2 = tvb_get_letohl(tvb, ioffset);
5248 ioffset = ioffset + 4;
5249 get_string(tvb, ioffset, value2, mval_buf.buffer);
5250 values->vstring = mval_buf.buffer;
5251 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5252 value2, values->vstring);
5253 ioffset = ioffset + value2;
5254 value3 = tvb_get_letohl(tvb, ioffset);
5256 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset, 4,
5257 value3, "Number of Values - %d", value3);
5259 ioffset = ioffset + 4;
5260 for (r = 1 ; r <= value3; r++ )
5262 ioffset += align_4(tvb, ioffset);
5263 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
5264 temp_values.vlength = 2;
5265 temp_values.hfname = hf_nds_vflags;
5266 temp_values.voffset = ioffset;
5267 temp_values.vdesc = "Value Flags";
5268 temp_values.bit1 = "Naming";
5269 temp_values.bit1hfname = hf_bit1vflags;
5270 temp_values.bit2 = "Base Class";
5271 temp_values.bit2hfname = hf_bit2vflags;
5272 temp_values.bit3 = "Present";
5273 temp_values.bit3hfname = hf_bit3vflags;
5274 temp_values.bit4 = "Value Damaged";
5275 temp_values.bit4hfname = hf_bit4vflags;
5276 temp_values.bit5 = "Not Defined";
5277 temp_values.bit5hfname = hf_bit5vflags;
5278 temp_values.bit6 = "Not Defined";
5279 temp_values.bit6hfname = hf_bit6vflags;
5280 temp_values.bit7 = "Not Defined";
5281 temp_values.bit7hfname = hf_bit7vflags;
5282 temp_values.bit8 = "Not Defined";
5283 temp_values.bit8hfname = hf_bit8vflags;
5284 temp_values.bit9 = "Not Defined";
5285 temp_values.bit9hfname = hf_bit9vflags;
5286 temp_values.bit10 = "Not Defined";
5287 temp_values.bit10hfname = hf_bit10vflags;
5288 temp_values.bit11 = "Not Defined";
5289 temp_values.bit11hfname = hf_bit11vflags;
5290 temp_values.bit12 = "Not Defined";
5291 temp_values.bit12hfname = hf_bit12vflags;
5292 temp_values.bit13 = "Not Defined";
5293 temp_values.bit13hfname = hf_bit13vflags;
5294 temp_values.bit14 = "Not Defined";
5295 temp_values.bit14hfname = hf_bit14vflags;
5296 temp_values.bit15 = "Not Defined";
5297 temp_values.bit15hfname = hf_bit15vflags;
5298 temp_values.bit16 = "Not Defined";
5299 temp_values.bit16hfname = hf_bit16vflags;
5300 process_bitfield(ntree, tvb, &temp_values);
5301 ioffset = ioffset + 4;
5302 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
5304 proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset,
5305 4, &ns, "Creation Time: %s", abs_time_to_str(&ns));
5306 ioffset = ioffset + 4;
5307 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
5308 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
5310 ioffset = ioffset + 2;
5311 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
5312 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
5314 ioffset = ioffset + 2;
5315 value1 = tvb_get_letohl(tvb, ioffset);
5316 proto_tree_add_uint(ntree, hf_nds_value_len, tvb, ioffset,
5318 ioffset = ioffset + 4;
5327 case MVTYPE_ATTR_REQUEST2: /* Attribute Request */
5329 for (i = 1 ; i <= values->vvalue; i++ )
5331 if (oldioffset >= ioffset) {
5332 proto_tree_add_text(ntree, tvb, 0, 0, "[ Invalid offset: %u ]", ioffset);
5333 THROW(ReportedBoundsError);
5335 oldioffset = ioffset;
5336 ioffset += align_4(tvb, ioffset);
5337 value1 = tvb_get_letohl(tvb, ioffset);
5338 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
5339 4, value1, "Value %d", value1);
5340 ioffset = ioffset + value1;
5344 case MVTYPE_ADD_ATTR_REQUEST: /* Add Attribute Request */
5345 for (i = 1 ; i <= values->vvalue; i++ )
5347 value1 = tvb_get_letohl(tvb, ioffset);
5348 ioffset = ioffset + 4;
5349 get_string(tvb, ioffset, value1, mval_buf.buffer);
5350 values->vstring = mval_buf.buffer;
5351 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5352 value1, values->vstring);
5353 ioffset = ioffset + value1;
5354 ioffset += align_4(tvb, ioffset);
5355 values->voffset = ioffset;
5356 print_nds_values(ntree, tvb, 9, values);
5357 ioffset = values->voffset;
5361 case MVTYPE_READ_CLASS_REQ: /* Read Class Request */
5362 for (i = 1 ; i <= values->vvalue; i++ )
5364 ioffset += align_4(tvb, ioffset);
5365 value1 = tvb_get_letohl(tvb, ioffset);
5366 ioffset = ioffset + 4;
5367 get_string(tvb, ioffset, value1, mval_buf.buffer);
5368 values->vstring = mval_buf.buffer;
5369 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
5370 value1, values->vstring);
5371 values->mvtype = MVTYPE_ATTR_REQUEST;
5372 ioffset = ioffset + value1;
5376 case MVTYPE_READ_REPLICAS: /* Read Replicas */
5377 for (i = 1 ; i <= values->vvalue; i++ )
5380 bvalue = 0x00000001;
5382 for (r = 0 ; r < 9; r++ )
5385 if (values->vflags & bvalue)
5389 case 0x00000001: /*p3values.bit1 = "Output Flags"*/
5390 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
5391 temp_values.vlength = 2;
5392 temp_values.hfname = hf_nds_rflags;
5393 temp_values.voffset = ioffset;
5394 temp_values.vdesc = "Output Flags";
5395 temp_values.bit1 = values->bit1;
5396 temp_values.bit1hfname = hf_bit1outflags;
5397 temp_values.bit2 = values->bit2;
5398 temp_values.bit2hfname = hf_bit2outflags;
5399 temp_values.bit3 = values->bit3;
5400 temp_values.bit3hfname = hf_bit3outflags;
5401 temp_values.bit4 = values->bit4;
5402 temp_values.bit4hfname = hf_bit4outflags;
5403 temp_values.bit5 = values->bit5;
5404 temp_values.bit5hfname = hf_bit5outflags;
5405 temp_values.bit6 = values->bit6;
5406 temp_values.bit6hfname = hf_bit6outflags;
5407 temp_values.bit7 = values->bit7;
5408 temp_values.bit7hfname = hf_bit7outflags;
5409 temp_values.bit8 = values->bit8;
5410 temp_values.bit8hfname = hf_bit8outflags;
5411 temp_values.bit9 = values->bit9;
5412 temp_values.bit9hfname = hf_bit9outflags;
5413 temp_values.bit10 = "Not Defined";
5414 temp_values.bit10hfname = hf_bit10outflags;
5415 temp_values.bit11 = "Not Defined";
5416 temp_values.bit11hfname = hf_bit11outflags;
5417 temp_values.bit12 = "Not Defined";
5418 temp_values.bit12hfname = hf_bit12outflags;
5419 temp_values.bit13 = "Not Defined";
5420 temp_values.bit13hfname = hf_bit13outflags;
5421 temp_values.bit14 = "Not Defined";
5422 temp_values.bit14hfname = hf_bit14outflags;
5423 temp_values.bit15 = "Not Defined";
5424 temp_values.bit15hfname = hf_bit15outflags;
5425 temp_values.bit16 = "Not Defined";
5426 temp_values.bit16hfname = hf_bit16outflags;
5427 process_bitfield(ntree, tvb, &temp_values);
5428 ioffset = ioffset + 4;
5430 case 0x00000002: /*p3values.bit2 = "Entry ID"*/
5431 value1 = tvb_get_letohl(tvb, ioffset);
5432 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
5433 4, value1, "Entry ID %08x", value1);
5434 ioffset = ioffset + 4;
5436 case 0x00000004: /*p3values.bit3 = "Replica State"*/
5437 value1 = tvb_get_letohl(tvb, ioffset);
5438 temp_values.vstring = (char *)match_strval(value1, nds_replica_state);
5439 if (temp_values.vstring == NULL)
5441 temp_values.vstring = "No Replica State Found";
5443 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
5444 4, temp_values.vstring);
5445 ioffset = ioffset + 4;
5447 case 0x0000008: /*p3values.bit4 = "Modification Timestamp"*/
5448 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
5450 proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset,
5451 4, &ns, "Modification Timestamp: %s", abs_time_to_str(&ns));
5452 ioffset = ioffset + 4;
5453 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
5454 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
5456 ioffset = ioffset + 2;
5457 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
5458 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
5460 ioffset = ioffset + 2;
5462 case 0x00000010: /*p3values.bit5 = "Purge Time"*/
5463 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
5465 proto_tree_add_time_format(ntree, hf_nds_purge, tvb, ioffset,
5466 4, &ns, "Purge Time: %s", abs_time_to_str(&ns));
5467 ioffset = ioffset + 4;
5469 case 0x00000020: /*p3values.bit6 = "Local Partition ID"*/
5470 value1 = tvb_get_letohl(tvb, ioffset);
5471 proto_tree_add_uint_format(ntree, hf_nds_local_partition, tvb, ioffset,
5472 4, value1, "Local Partition ID %08x", value1);
5473 ioffset = ioffset + 4;
5475 case 0x00000040: /*p3values.bit7 = "Distinguished Name"*/
5476 value1 = tvb_get_letohl(tvb, ioffset);
5477 ioffset = ioffset + 4;
5478 get_string(tvb, ioffset, value1, mval_buf.buffer);
5479 temp_values.vstring = mval_buf.buffer;
5480 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
5481 value1, temp_values.vstring);
5482 ioffset = ioffset + value1;
5484 case 0x00000080: /*p3values.bit8 = "Replica Type & State"*/
5485 value1 = tvb_get_letohl(tvb, ioffset);
5486 value2 = value1 & 0x00ff;
5487 temp_values.vstring = (char *)match_strval(value2, nds_replica_type);
5488 if (temp_values.vstring == NULL)
5490 temp_values.vstring = "No Replica Type Found";
5492 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
5493 4, temp_values.vstring);
5494 value3 = value1 & 0xff00;
5495 temp_values.vstring = (char *)match_strval(value3, nds_replica_state);
5496 if (temp_values.vstring == NULL)
5498 temp_values.vstring = "No Replica State Found";
5500 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
5501 4, temp_values.vstring);
5502 ioffset = ioffset + 4;
5504 case 0x00000100: /*p3values.bit9 = "Partition Busy"*/
5505 value1 = tvb_get_letohs(tvb, ioffset);
5506 proto_tree_add_boolean(ntree, hf_partition_busy, tvb, ioffset, 4, value1);
5515 ioffset += align_4(tvb, ioffset);
5516 if(tvb_length_remaining(tvb, ioffset) < 4 )
5521 if(tvb_length_remaining(tvb, ioffset) < 4 )
5528 case MVTYPE_MODIFY_ATTR_REQUEST: /* Modify Attribute Request */
5529 for (i = 0 ; i < values->vvalue; i++ )
5531 ioffset += align_4(tvb, ioffset);
5532 value1 = tvb_get_letohl(tvb, ioffset);
5533 valuestr = match_strval(value1, nds_kind_of_changes);
5534 if (valuestr == NULL)
5536 valuestr="(Kind Change Not Found)";
5538 tvb_ensure_bytes_exist(tvb, ioffset, values->vlength);
5539 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
5540 values->vlength, value1, valuestr, value1);
5541 ioffset = ioffset+4;
5542 value2 = tvb_get_letohl(tvb, ioffset);
5543 ioffset = ioffset + 4;
5544 get_string(tvb, ioffset, value2, mval_buf.buffer); /* Name of Attribute */
5545 temp_values.vstring = mval_buf.buffer;
5546 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
5547 value2, temp_values.vstring);
5548 ioffset = ioffset + value2;
5549 ioffset += align_4(tvb, ioffset);
5550 if(value1 != 1 && value1 != 6)
5552 values->voffset = ioffset;
5553 print_nds_values(ntree, tvb, 9, values);
5554 ioffset = values->voffset;
5559 case MVTYPE_ADDR_REFERRAL_REQUEST: /* Address Referral Request */
5560 for (i = 0 ; i < values->vvalue; i++ )
5563 value1 = tvb_get_letohl(tvb, ioffset);
5564 valuestr = match_strval(value1, nds_protocol_type);
5565 if (valuestr == NULL)
5567 valuestr="(Undefined Protocol)";
5569 tvb_ensure_bytes_exist(tvb, ioffset, values->vlength);
5570 proto_tree_add_uint_format(ntree, hf_nds_uint32value, tvb, ioffset,
5571 values->vlength, value1, valuestr, value1);
5572 ioffset = ioffset+4;
5576 case MVTYPE_ADDR_REFERRAL_REPLY: /* Address Referral Reply */
5577 number_of_referrals = values->vvalue;
5579 for (r = 1 ; r <= number_of_referrals; r++ )
5581 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, 6, 0,
5582 r, "NDS Referral Record #%u", r);
5583 atree = proto_item_add_subtree(aitem, ett_nds);
5585 value1 = tvb_get_letohl(tvb, ioffset);
5587 proto_tree_add_uint_format(atree, hf_referral_addcount, tvb, ioffset, 4,
5588 value1, "Number of Addresses in Referral - %d", value1);
5590 ioffset = ioffset + 4;
5591 for (i = 1 ; i <= value1; i++ )
5593 value2 = tvb_get_letohl(tvb, ioffset);
5594 valuestr = match_strval(value2, nds_protocol_type);
5595 if (valuestr == NULL)
5597 valuestr="(Undefined Protocol)";
5599 tvb_ensure_bytes_exist(tvb, ioffset, values->vlength);
5600 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
5601 values->vlength, value2, valuestr, value2);
5602 ioffset = ioffset+4;
5603 value3 = tvb_get_letohl(tvb, ioffset);
5604 ioffset = ioffset+4;
5608 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
5609 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
5610 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
5613 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
5614 proto_tree_add_item(atree, hf_add_ref_ip, tvb, ioffset+2, 4, FALSE);
5617 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
5618 proto_tree_add_item(atree, hf_add_ref_udp, tvb, ioffset+2, 4, FALSE);
5621 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
5622 proto_tree_add_item(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, FALSE);
5626 get_string(tvb, ioffset, value3, values->vstring);
5627 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
5628 value3, values->vstring);
5633 ioffset = ioffset + value3;
5634 ioffset += align_4(tvb, ioffset);
5640 case MVTYPE_LOC_ADDR_REFERRAL_REPLY: /* Local Address Referral Reply */
5641 number_of_referrals = values->vvalue;
5643 for (r = 1 ; r <= number_of_referrals; r++ )
5645 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, 6, 0,
5646 r, "NDS Referral Record #%u", r);
5647 atree = proto_item_add_subtree(aitem, ett_nds);
5649 value2 = tvb_get_letohl(tvb, ioffset);
5650 valuestr = match_strval(value2, nds_protocol_type);
5651 if (valuestr == NULL)
5653 valuestr="(Undefined Protocol)";
5655 tvb_ensure_bytes_exist(tvb, ioffset, values->vlength);
5656 proto_tree_add_uint_format(atree, hf_nds_uint32value, tvb, ioffset,
5657 values->vlength, value2, valuestr, value2);
5658 ioffset = ioffset+4;
5659 value3 = tvb_get_letohl(tvb, ioffset);
5660 ioffset = ioffset+4;
5665 proto_tree_add_item(atree, hf_nds_net, tvb, ioffset, 4, FALSE);
5666 proto_tree_add_item(atree, hf_nds_node, tvb, ioffset+4, 6, FALSE);
5667 proto_tree_add_item(atree, hf_nds_socket, tvb, ioffset+10, 2, FALSE);
5670 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
5671 proto_tree_add_item(atree, hf_add_ref_ip, tvb, ioffset+2, 4, FALSE);
5674 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
5675 proto_tree_add_item(atree, hf_add_ref_udp, tvb, ioffset+2, 4, FALSE);
5678 proto_tree_add_item(atree, hf_nds_port, tvb, ioffset, 2, FALSE);
5679 proto_tree_add_item(atree, hf_add_ref_tcp, tvb, ioffset+2, 4, FALSE);
5683 get_string(tvb, ioffset, value3, values->vstring);
5684 proto_tree_add_string(atree, hf_value_string, tvb, ioffset,
5685 value3, values->vstring);
5690 ioffset = ioffset + value3;
5691 ioffset += align_4(tvb, ioffset);
5695 case MVTYPE_PROC_ENTRY_SPECIFIERS: /* Process Entry Specifiers */
5696 value2 = tvb_get_letohl(tvb, ioffset); /* ES Type */
5697 values->vstring = (char *)match_strval(value2, es_type);
5698 if (values->vstring == NULL)
5700 values->vstring = "No ES Type Found";
5702 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
5703 4, values->vstring, "Output Entry Specifier - %s", values->vstring);
5704 estree = proto_item_add_subtree(esitem, ett_nds);
5705 ioffset = ioffset + 4;
5706 ioffset = print_es_type(estree, tvb, values, value2, ioffset);
5707 value3 = tvb_get_letohl(tvb, ioffset); /* ES Type */
5708 values->vstring = (char *)match_strval(value3, es_type);
5709 if (values->vstring == NULL)
5711 values->vstring = "No ES Type Found";
5713 esitem = proto_tree_add_string_format(ntree, hf_es_type, tvb, ioffset,
5714 4, values->vstring, "Input Entry Specifier - %s", values->vstring);
5715 estree = proto_item_add_subtree(esitem, ett_nds);
5716 ioffset = ioffset + 4;
5717 ioffset = print_es_type(estree, tvb, values, value3, ioffset);
5718 /* values.vstring is being overwritten. So store the resolve name to a global value */
5719 g_strlcpy(mv_resolve_name_string, values->vstring, 128);
5720 value4 = tvb_get_letohl(tvb, ioffset);
5721 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, ioffset, 4,
5722 value4, "Referral Protocols - %d", value4);
5723 atree = proto_item_add_subtree(aitem, ett_nds);
5725 for (i = 0 ; i < value4; i++ )
5727 value5 = tvb_get_letohl(tvb, ioffset);
5728 valuestr = match_strval(value5, nds_protocol_type);
5729 if (valuestr == NULL)
5731 valuestr="(Undefined Protocol)";
5733 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
5734 4, valuestr, "Protocol -> %s", valuestr);
5735 ioffset = ioffset+4;
5737 value6 = tvb_get_letohl(tvb, ioffset);
5738 aitem = proto_tree_add_uint_format(ntree, hf_referral_record, tvb, ioffset, 4,
5739 value6, "Tree Walking Protocols - %d", value6);
5740 atree = proto_item_add_subtree(aitem, ett_nds);
5742 for (i = 0 ; i < value6; i++ )
5744 value7 = tvb_get_letohl(tvb, ioffset);
5745 valuestr = match_strval(value7, nds_protocol_type);
5746 if (valuestr == NULL)
5748 valuestr="(Undefined Protocol)";
5750 proto_tree_add_string_format(atree, hf_value_string, tvb, ioffset,
5751 4, valuestr, "Protocol -> %s", valuestr);
5752 ioffset = ioffset+4;
5754 values->vstring = " ";
5757 case MVTYPE_PRINT_TIMESTAMP: /* Print Timestamp */
5758 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
5759 proto_tree_add_item(ncp_tree, hf_nds_replica_num, tvb, ioffset,
5761 ioffset = ioffset + 2;
5762 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
5763 proto_tree_add_item(ncp_tree, hf_nds_event_num, tvb, ioffset,
5765 ioffset = ioffset + 2;
5768 case MVTYPE_LIST_PARTITIONS: /* List Partitions */
5769 number_of_referrals = values->vvalue;
5770 /* A bad packet could put us in a tight loop so trap for anything
5771 * over 256 referals.
5773 if (number_of_referrals > 256) {
5774 proto_tree_add_text(ntree, tvb, 0, 0, "[ Bad referal at offset: %u ]", ioffset);
5775 THROW(ReportedBoundsError);
5778 for (i = 0; i < number_of_referrals; i++)
5780 bvalue = 0x00000001;
5782 for (r = 0 ; r < 32; r++ )
5784 oldioffset = ioffset;
5785 if (values->vflags & bvalue)
5789 case 0x00000001: /* Information Flags */
5790 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
5791 temp_values.vtype = VTYPE_BITFIELD;
5792 temp_values.vstring = mval_buf.buffer;
5793 temp_values.vdesc = "Information Flags (low) Byte:";
5794 temp_values.vlength = 2;
5795 temp_values.hfname= hf_nds_rflags;
5796 temp_values.voffset = ioffset;
5797 temp_values.bit1 = "Output Flags";
5798 temp_values.bit1hfname = hf_bit1infoflagsl;
5799 temp_values.bit2 = "Entry ID";
5800 temp_values.bit2hfname = hf_bit2infoflagsl;
5801 temp_values.bit3 = "Entry Flags";
5802 temp_values.bit3hfname = hf_bit3infoflagsl;
5803 temp_values.bit4 = "Subordinate Count";
5804 temp_values.bit4hfname = hf_bit4infoflagsl;
5805 temp_values.bit5 = "Modification Time";
5806 temp_values.bit5hfname = hf_bit5infoflagsl;
5807 temp_values.bit6 = "Modification Timestamp";
5808 temp_values.bit6hfname = hf_bit6infoflagsl;
5809 temp_values.bit7 = "Creation Timestamp";
5810 temp_values.bit7hfname = hf_bit7infoflagsl;
5811 temp_values.bit8 = "Partition Root ID";
5812 temp_values.bit8hfname = hf_bit8infoflagsl;
5813 temp_values.bit9 = "Parent ID";
5814 temp_values.bit9hfname = hf_bit9infoflagsl;
5815 temp_values.bit10 = "Revision Count";
5816 temp_values.bit10hfname = hf_bit10infoflagsl;
5817 temp_values.bit11 = "Replica Type";
5818 temp_values.bit11hfname = hf_bit11infoflagsl;
5819 temp_values.bit12 = "Base Class";
5820 temp_values.bit12hfname = hf_bit12infoflagsl;
5821 temp_values.bit13 = "Relative Distinguished Name";
5822 temp_values.bit13hfname = hf_bit13infoflagsl;
5823 temp_values.bit14 = "Distinguished Name";
5824 temp_values.bit14hfname = hf_bit14infoflagsl;
5825 temp_values.bit15 = "Root Distinguished Name";
5826 temp_values.bit15hfname = hf_bit15infoflagsl;
5827 temp_values.bit16 = "Parent Distinguished Name";
5828 temp_values.bit16hfname = hf_bit16infoflagsl;
5829 process_bitfield(ntree, tvb, &temp_values);
5830 ioffset = ioffset+2;
5831 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
5832 temp_values.vtype = VTYPE_BITFIELD;
5833 temp_values.vstring = mval_buf.buffer;
5834 temp_values.vdesc = "Information Flags (high) Byte:";
5835 temp_values.vlength = 2;
5836 temp_values.hfname= hf_nds_rflags;
5837 temp_values.voffset = ioffset;
5838 temp_values.bit1 = "Purge Time";
5839 temp_values.bit1hfname = hf_bit1infoflagsh;
5840 temp_values.bit2 = "Dereference Base Class";
5841 temp_values.bit2hfname = hf_bit2infoflagsh;
5842 temp_values.bit3 = "Not Defined";
5843 temp_values.bit3hfname = hf_bit3infoflagsh;
5844 temp_values.bit4 = "Not Defined";
5845 temp_values.bit4hfname = hf_bit4infoflagsh;
5846 temp_values.bit5 = "Not Defined";
5847 temp_values.bit5hfname = hf_bit5infoflagsh;
5848 temp_values.bit6 = "Not Defined";
5849 temp_values.bit6hfname = hf_bit6infoflagsh;
5850 temp_values.bit7 = "Not Defined";
5851 temp_values.bit7hfname = hf_bit7infoflagsh;
5852 temp_values.bit8 = "Not Defined";
5853 temp_values.bit8hfname = hf_bit8infoflagsh;
5854 temp_values.bit9 = "Not Defined";
5855 temp_values.bit9hfname = hf_bit9infoflagsh;
5856 temp_values.bit10 = "Not Defined";
5857 temp_values.bit10hfname = hf_bit10infoflagsh;
5858 temp_values.bit11 = "Not Defined";
5859 temp_values.bit11hfname = hf_bit11infoflagsh;
5860 temp_values.bit12 = "Not Defined";
5861 temp_values.bit12hfname = hf_bit12infoflagsh;
5862 temp_values.bit13 = "Not Defined";
5863 temp_values.bit13hfname = hf_bit13infoflagsh;
5864 temp_values.bit14 = "Not Defined";
5865 temp_values.bit14hfname = hf_bit14infoflagsh;
5866 temp_values.bit15 = "Not Defined";
5867 temp_values.bit15hfname = hf_bit15infoflagsh;
5868 temp_values.bit16 = "Not Defined";
5869 temp_values.bit16hfname = hf_bit16infoflagsh;
5870 process_bitfield(ntree, tvb, &temp_values);
5871 ioffset = ioffset+2;
5873 case 0x00000002: /* Entry ID */
5874 value1 = tvb_get_letohl(tvb, ioffset);
5875 proto_tree_add_uint_format(ntree, hf_nds_eid, tvb, ioffset,
5876 4, value1, "Entry ID %08x", value1);
5877 ioffset = ioffset + 4;
5879 case 0x00000004: /* Entry Flags */
5880 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
5881 temp_values.vtype = VTYPE_BITFIELD;
5882 temp_values.vstring = mval_buf.buffer;
5883 temp_values.vdesc = "Entry Flags:";
5884 temp_values.vlength = 2;
5885 temp_values.hfname= hf_nds_eflags;
5886 temp_values.voffset = ioffset;
5887 temp_values.bit1 = "Alias Entry";
5888 temp_values.bit1hfname = hf_bit1eflags;
5889 temp_values.bit2 = "Partition Root";
5890 temp_values.bit2hfname = hf_bit2eflags;
5891 temp_values.bit3 = "Container Entry";
5892 temp_values.bit3hfname = hf_bit3eflags;
5893 temp_values.bit4 = "Container Alias";
5894 temp_values.bit4hfname = hf_bit4eflags;
5895 temp_values.bit5 = "Matches List Filter";
5896 temp_values.bit5hfname = hf_bit5eflags;
5897 temp_values.bit6 = "Reference Entry";
5898 temp_values.bit6hfname = hf_bit6eflags;
5899 temp_values.bit7 = "40x Reference Entry";
5900 temp_values.bit7hfname = hf_bit7eflags;
5901 temp_values.bit8 = "Back Linked";
5902 temp_values.bit8hfname = hf_bit8eflags;
5903 temp_values.bit9 = "New Entry";
5904 temp_values.bit9hfname = hf_bit9eflags;
5905 temp_values.bit10 = "Temporary Reference";
5906 temp_values.bit10hfname = hf_bit10eflags;
5907 temp_values.bit11 = "Audited";
5908 temp_values.bit11hfname = hf_bit11eflags;
5909 temp_values.bit12 = "Entry Not Present";
5910 temp_values.bit12hfname = hf_bit12eflags;
5911 temp_values.bit13 = "Entry Verify CTS";
5912 temp_values.bit13hfname = hf_bit13eflags;
5913 temp_values.bit14 = "Entry Damaged";
5914 temp_values.bit14hfname = hf_bit14eflags;
5915 temp_values.bit15 = "Not Defined";
5916 temp_values.bit15hfname = hf_bit15eflags;
5917 temp_values.bit16 = "Not Defined";
5918 temp_values.bit16hfname = hf_bit16eflags;
5919 process_bitfield(ntree, tvb, &temp_values);
5920 ioffset = ioffset+4;
5922 case 0x0000008: /* Subordinate Count */
5923 value1 = tvb_get_letohl(tvb, ioffset);
5924 proto_tree_add_uint_format(ntree, hf_sub_count, tvb, ioffset,
5925 4, value1, "Subordinate Count %d", value1);
5926 ioffset = ioffset + 4;
5928 case 0x0000010: /* Modification Time */
5929 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
5931 proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset,
5932 4, &ns, "Modification Time: %s", abs_time_to_str(&ns));
5933 ioffset = ioffset + 4;
5935 case 0x0000020: /* Modification Timestamp */
5936 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
5938 proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset,
5939 4, &ns, "Modification Timestamp: %s", abs_time_to_str(&ns));
5940 ioffset = ioffset + 4;
5941 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
5942 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
5944 ioffset = ioffset + 2;
5945 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
5946 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
5948 ioffset = ioffset + 2;
5950 case 0x0000040: /* Creation Timestamp */
5951 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
5953 proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset,
5954 4, &ns, "Creation Timestamp: %s", abs_time_to_str(&ns));
5955 ioffset = ioffset + 4;
5956 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
5957 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
5959 ioffset = ioffset + 2;
5960 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
5961 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
5963 ioffset = ioffset + 2;
5965 case 0x00000080: /* Partition Root ID */
5966 value1 = tvb_get_letohl(tvb, ioffset);
5967 proto_tree_add_uint_format(ntree, hf_nds_partition_root_id, tvb, ioffset,
5968 4, value1, "Partition Root ID %08x", value1);
5969 ioffset = ioffset + 4;
5971 case 0x00000100: /* Parent ID */
5972 value1 = tvb_get_letohl(tvb, ioffset);
5973 proto_tree_add_uint_format(ntree, hf_nds_parent, tvb, ioffset,
5974 4, value1, "Parent ID %08x", value1);
5975 ioffset = ioffset + 4;
5977 case 0x00000200: /* Revision Count */
5978 value1 = tvb_get_letohl(tvb, ioffset);
5979 proto_tree_add_uint_format(ntree, hf_nds_revision, tvb, ioffset,
5980 4, value1, "Revision Count %d", value1);
5981 ioffset = ioffset + 4;
5983 case 0x00000400: /* Replica Type & State */
5984 value1 = tvb_get_letohl(tvb, ioffset);
5985 value2 = value1 & 0x00ff;
5986 temp_values.vstring = (char *)match_strval(value2, nds_replica_type);
5987 if (temp_values.vstring == NULL)
5989 temp_values.vstring = "No Replica Type Found";
5991 proto_tree_add_string(ntree, hf_replica_type, tvb, ioffset,
5992 4, temp_values.vstring);
5993 value3 = value1 & 0xff00;
5994 temp_values.vstring = (char *)match_strval(value3, nds_replica_state);
5995 if (temp_values.vstring == NULL)
5997 temp_values.vstring = "No Replica State Found";
5999 proto_tree_add_string(ntree, hf_replica_state, tvb, ioffset,
6000 4, temp_values.vstring);
6001 ioffset = ioffset + 4;
6003 case 0x00000800: /* Base Class */
6004 value1 = tvb_get_letohl(tvb, ioffset);
6005 ioffset = ioffset + 4;
6006 get_string(tvb, ioffset, value1, mval_buf.buffer);
6007 temp_values.vstring = mval_buf.buffer;
6008 proto_tree_add_string(ntree, hf_nds_base, tvb, ioffset,
6009 value1, temp_values.vstring);
6010 ioffset = ioffset + value1;
6012 case 0x00001000: /* Relative Distinguished Name */
6013 value1 = tvb_get_letohl(tvb, ioffset);
6014 ioffset = ioffset + 4;
6015 get_string(tvb, ioffset, value1, mval_buf.buffer);
6016 temp_values.vstring = mval_buf.buffer;
6017 proto_tree_add_string(ntree, hf_nds_relative_dn, tvb, ioffset,
6018 value1, temp_values.vstring);
6019 ioffset = ioffset + value1;
6021 case 0x00002000: /* Distinguished Name */
6022 value1 = tvb_get_letohl(tvb, ioffset);
6023 ioffset = ioffset + 4;
6024 get_string(tvb, ioffset, value1, mval_buf.buffer);
6025 temp_values.vstring = mval_buf.buffer;
6026 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
6027 value1, temp_values.vstring);
6028 ioffset = ioffset + value1;
6030 case 0x00004000: /* Root Distinguished Name */
6031 value1 = tvb_get_letohl(tvb, ioffset);
6032 ioffset = ioffset + 4;
6033 get_string(tvb, ioffset, value1, mval_buf.buffer);
6034 temp_values.vstring = mval_buf.buffer;
6035 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
6036 value1, temp_values.vstring);
6037 ioffset = ioffset + value1;
6039 case 0x00008000: /* Parent Distinguished Name */
6040 value1 = tvb_get_letohl(tvb, ioffset);
6041 ioffset = ioffset + 4;
6042 get_string(tvb, ioffset, value1, mval_buf.buffer);
6043 temp_values.vstring = mval_buf.buffer;
6044 proto_tree_add_string(ntree, hf_nds_name, tvb, ioffset,
6045 value1, temp_values.vstring);
6046 ioffset = ioffset + value1;
6048 case 0x00010000: /* Purge Time */
6049 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
6051 proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset,
6052 4, &ns, "Purge Time: %s", abs_time_to_str(&ns));
6053 ioffset = ioffset + 4;
6055 case 0x00020000: /* Dereference Base Class */
6056 value1 = tvb_get_letohl(tvb, ioffset);
6057 ioffset = ioffset + 4;
6058 get_string(tvb, ioffset, value1, mval_buf.buffer);
6059 temp_values.vstring = mval_buf.buffer;
6060 proto_tree_add_string(ntree, hf_deref_base, tvb, ioffset,
6061 value1, temp_values.vstring);
6062 ioffset = ioffset + value1;
6068 ioffset += align_4(tvb, ioffset);
6071 /* We could loop forever so check to see if bvalue has wrapped to 0.
6072 * if so then just abort loop.
6077 if(tvb_length_remaining(tvb, ioffset) < 4 )
6082 if(tvb_length_remaining(tvb, ioffset) < 4 )
6089 case MVTYPE_CLASS_NAMES: /* Class Names */
6090 number_of_referrals = values->vvalue;
6091 for (i = 0; i < number_of_referrals; i++)
6093 ioffset += align_4(tvb, ioffset);
6094 value1 = tvb_get_letohl(tvb, ioffset);
6095 ioffset = ioffset + 4;
6096 get_string(tvb, ioffset, value1, mval_buf.buffer);
6097 temp_values.vstring = mval_buf.buffer;
6098 sub1item = proto_tree_add_string(ntree, hf_nds_base_class, tvb, ioffset,
6099 value1, temp_values.vstring);
6100 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
6101 ioffset = ioffset + value1;
6102 ioffset += align_4(tvb, ioffset);
6103 if(values->vflags != 0)
6105 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
6106 temp_values.vtype = VTYPE_BITFIELD;
6107 temp_values.vstring = mval_buf.buffer;
6108 temp_values.vdesc = "Class Flags:";
6109 temp_values.vlength = 2;
6110 temp_values.hfname= hf_nds_cflags;
6111 temp_values.voffset = ioffset;
6112 temp_values.bit1 = "Container";
6113 temp_values.bit1hfname = hf_bit1cflags;
6114 temp_values.bit2 = "Effective";
6115 temp_values.bit2hfname = hf_bit2cflags;
6116 temp_values.bit3 = "Class Definition Cannot be Removed";
6117 temp_values.bit3hfname = hf_bit3cflags;
6118 temp_values.bit4 = "Ambiguous Naming";
6119 temp_values.bit4hfname = hf_bit4cflags;
6120 temp_values.bit5 = "Ambiguous Containment";
6121 temp_values.bit5hfname = hf_bit5cflags;
6122 temp_values.bit6 = "Auxiliary";
6123 temp_values.bit6hfname = hf_bit6cflags;
6124 temp_values.bit7 = "Operational";
6125 temp_values.bit7hfname = hf_bit7cflags;
6126 temp_values.bit8 = "Sparse Required";
6127 temp_values.bit8hfname = hf_bit8cflags;
6128 temp_values.bit9 = "Sparse Operational";
6129 temp_values.bit9hfname = hf_bit9cflags;
6130 temp_values.bit10 = "Not Defined";
6131 temp_values.bit10hfname = hf_bit10cflags;
6132 temp_values.bit11 = "Not Defined";
6133 temp_values.bit11hfname = hf_bit11cflags;
6134 temp_values.bit12 = "Not Defined";
6135 temp_values.bit12hfname = hf_bit12cflags;
6136 temp_values.bit13 = "Not Defined";
6137 temp_values.bit13hfname = hf_bit13cflags;
6138 temp_values.bit14 = "Not Defined";
6139 temp_values.bit14hfname = hf_bit14cflags;
6140 temp_values.bit15 = "Not Defined";
6141 temp_values.bit15hfname = hf_bit15cflags;
6142 temp_values.bit16 = "Not Defined";
6143 temp_values.bit16hfname = hf_bit16cflags;
6144 process_bitfield(sub1tree, tvb, &temp_values);
6145 ioffset = ioffset+4;
6146 if(values->vflags != 5)
6148 value1 = tvb_get_letohl(tvb, ioffset); /* length of field */
6149 length_remaining = tvb_length_remaining(tvb, ioffset);
6150 if(length_remaining == -1 || value1 > (guint32) length_remaining)
6155 tvb_ensure_bytes_exist(tvb, ioffset, value1);
6156 proto_tree_add_bytes(sub1tree, hf_nds_asn1, tvb, ioffset, value1, tvb_get_ptr(tvb, ioffset, value1));
6158 ioffset += (value1%2);
6160 if(values->vflags == 1 || values->vflags == 2 || values->vflags == 4)
6162 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
6163 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6164 4, value1, "Super Classes %d", value1);
6165 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6166 ioffset = ioffset + 4;
6167 for (r = 0; r < value1; r++)
6169 value2 = tvb_get_letohl(tvb, ioffset);
6170 ioffset = ioffset + 4;
6171 get_string(tvb, ioffset, value2, mval_buf.buffer);
6172 temp_values.vstring = mval_buf.buffer;
6173 proto_tree_add_string(sub2tree, hf_nds_super, tvb, ioffset,
6174 value2, temp_values.vstring);
6175 ioffset = ioffset + value2;
6176 ioffset += align_4(tvb, ioffset);
6178 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
6179 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6180 4, value1, "Containment Classes %d", value1);
6181 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6182 ioffset = ioffset + 4;
6183 for (r = 0; r < value1; r++)
6185 value2 = tvb_get_letohl(tvb, ioffset);
6186 ioffset = ioffset + 4;
6187 get_string(tvb, ioffset, value2, mval_buf.buffer);
6188 temp_values.vstring = mval_buf.buffer;
6189 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
6190 value2, temp_values.vstring);
6191 ioffset = ioffset + value2;
6192 ioffset += align_4(tvb, ioffset);
6194 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
6195 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6196 4, value1, "Naming Attributes %d", value1);
6197 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6198 ioffset = ioffset + 4;
6199 for (r = 0; r < value1; r++)
6201 value2 = tvb_get_letohl(tvb, ioffset);
6202 ioffset = ioffset + 4;
6203 get_string(tvb, ioffset, value2, mval_buf.buffer);
6204 temp_values.vstring = mval_buf.buffer;
6205 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6206 value2, temp_values.vstring);
6207 ioffset = ioffset + value2;
6208 ioffset += align_4(tvb, ioffset);
6210 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
6211 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6212 4, value1, "Mandatory Attributes %d", value1);
6213 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6214 ioffset = ioffset + 4;
6215 for (r = 0; r < value1; r++)
6217 value2 = tvb_get_letohl(tvb, ioffset);
6218 ioffset = ioffset + 4;
6219 get_string(tvb, ioffset, value2, mval_buf.buffer);
6220 temp_values.vstring = mval_buf.buffer;
6221 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6222 value2, temp_values.vstring);
6223 ioffset = ioffset + value2;
6224 ioffset += align_4(tvb, ioffset);
6226 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
6227 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6228 4, value1, "Optional Attributes %d", value1);
6229 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6230 ioffset = ioffset + 4;
6231 for (r = 0; r < value1; r++)
6233 ioffset += align_4(tvb, ioffset);
6234 value2 = tvb_get_letohl(tvb, ioffset);
6235 ioffset = ioffset + 4;
6236 get_string(tvb, ioffset, value2, mval_buf.buffer);
6237 temp_values.vstring = mval_buf.buffer;
6238 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6239 value2, temp_values.vstring);
6240 ioffset = ioffset + value2;
6241 if(tvb_length_remaining(tvb, ioffset) < 4 )
6247 /*if(values->vflags == 2 || values->vflags == 4)*/ /* Class Definitions of Super Classes */
6248 if(values->vflags == 4) /* Class Definitions of Super Classes */
6250 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
6251 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6252 4, value1, "Containment Classes %d", value1);
6253 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6254 ioffset = ioffset + 4;
6255 for (r = 0; r < value1; r++)
6257 value2 = tvb_get_letohl(tvb, ioffset);
6258 ioffset = ioffset + 4;
6259 get_string(tvb, ioffset, value2, mval_buf.buffer);
6260 temp_values.vstring = mval_buf.buffer;
6261 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
6262 value2, temp_values.vstring);
6263 ioffset = ioffset + value2;
6264 ioffset += align_4(tvb, ioffset);
6266 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
6267 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6268 4, value1, "Naming Attributes %d", value1);
6269 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6270 ioffset = ioffset + 4;
6271 for (r = 0; r < value1; r++)
6273 value2 = tvb_get_letohl(tvb, ioffset);
6274 ioffset = ioffset + 4;
6275 get_string(tvb, ioffset, value2, mval_buf.buffer);
6276 temp_values.vstring = mval_buf.buffer;
6277 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6278 value2, temp_values.vstring);
6279 ioffset = ioffset + value2;
6280 ioffset += align_4(tvb, ioffset);
6282 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
6283 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6284 4, value1, "Mandatory Attributes %d", value1);
6285 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6286 ioffset = ioffset + 4;
6287 for (r = 0; r < value1; r++)
6289 value2 = tvb_get_letohl(tvb, ioffset);
6290 ioffset = ioffset + 4;
6291 get_string(tvb, ioffset, value2, mval_buf.buffer);
6292 temp_values.vstring = mval_buf.buffer;
6293 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6294 value2, temp_values.vstring);
6295 ioffset = ioffset + value2;
6296 ioffset += align_4(tvb, ioffset);
6298 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
6299 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6300 4, value1, "Optional Attributes %d", value1);
6301 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6302 ioffset = ioffset + 4;
6303 for (r = 0; r < value1; r++)
6305 value2 = tvb_get_letohl(tvb, ioffset);
6306 ioffset = ioffset + 4;
6307 get_string(tvb, ioffset, value2, mval_buf.buffer);
6308 temp_values.vstring = mval_buf.buffer;
6309 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6310 value2, temp_values.vstring);
6311 ioffset = ioffset + value2;
6312 ioffset += align_4(tvb, ioffset);
6314 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
6315 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
6316 4, value1, "Default ACL %08x", value1);
6317 ioffset = ioffset + 4;
6318 if(tvb_length_remaining(tvb, ioffset) < 4 )
6323 if(values->vflags == 5) /* Base Class Definitions */
6325 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
6327 proto_tree_add_time_format(sub1tree, hf_es_seconds, tvb, ioffset,
6328 4, &ns, "Creation Timestamp: %s", abs_time_to_str(&ns));
6329 ioffset = ioffset + 4;
6330 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
6331 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
6333 ioffset = ioffset + 2;
6334 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
6335 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
6337 ioffset = ioffset + 2;
6338 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
6340 proto_tree_add_time_format(sub1tree, hf_es_seconds, tvb, ioffset,
6341 4, &ns, "Modification Timestamp: %s", abs_time_to_str(&ns));
6342 ioffset = ioffset + 4;
6343 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
6344 proto_tree_add_item(sub1tree, hf_nds_replica_num, tvb, ioffset,
6346 ioffset = ioffset + 2;
6347 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
6348 proto_tree_add_item(sub1tree, hf_nds_event_num, tvb, ioffset,
6350 ioffset = ioffset + 2;
6351 /* Class Definition */
6352 value1 = tvb_get_letohl(tvb, ioffset); /* Super Classes */
6353 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6354 4, value1, "Super Classes %d", value1);
6355 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6356 ioffset = ioffset + 4;
6357 for (r = 0; r < value1; r++)
6359 value2 = tvb_get_letohl(tvb, ioffset);
6360 ioffset = ioffset + 4;
6361 get_string(tvb, ioffset, value2, mval_buf.buffer);
6362 temp_values.vstring = mval_buf.buffer;
6363 proto_tree_add_string(sub2tree, hf_nds_super, tvb, ioffset,
6364 value2, temp_values.vstring);
6365 ioffset = ioffset + value2;
6366 ioffset += align_4(tvb, ioffset);
6368 value1 = tvb_get_letohl(tvb, ioffset); /* Containment Classes */
6369 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6370 4, value1, "Containment Classes %d", value1);
6371 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6372 ioffset = ioffset + 4;
6373 for (r = 0; r < value1; r++)
6375 value2 = tvb_get_letohl(tvb, ioffset);
6376 ioffset = ioffset + 4;
6377 get_string(tvb, ioffset, value2, mval_buf.buffer);
6378 temp_values.vstring = mval_buf.buffer;
6379 proto_tree_add_string(sub2tree, hf_nds_base_class, tvb, ioffset,
6380 value2, temp_values.vstring);
6381 ioffset = ioffset + value2;
6382 ioffset += align_4(tvb, ioffset);
6384 value1 = tvb_get_letohl(tvb, ioffset); /* Naming Attributes */
6385 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6386 4, value1, "Naming Attributes %d", value1);
6387 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6388 ioffset = ioffset + 4;
6389 for (r = 0; r < value1; r++)
6391 value2 = tvb_get_letohl(tvb, ioffset);
6392 ioffset = ioffset + 4;
6393 get_string(tvb, ioffset, value2, mval_buf.buffer);
6394 temp_values.vstring = mval_buf.buffer;
6395 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6396 value2, temp_values.vstring);
6397 ioffset = ioffset + value2;
6398 ioffset += align_4(tvb, ioffset);
6400 value1 = tvb_get_letohl(tvb, ioffset); /* Mandatory Attributes */
6401 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6402 4, value1, "Mandatory Attributes %d", value1);
6403 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6404 ioffset = ioffset + 4;
6405 for (r = 0; r < value1; r++)
6407 value2 = tvb_get_letohl(tvb, ioffset);
6408 ioffset = ioffset + 4;
6409 get_string(tvb, ioffset, value2, mval_buf.buffer);
6410 temp_values.vstring = mval_buf.buffer;
6411 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6412 value2, temp_values.vstring);
6413 ioffset = ioffset + value2;
6414 ioffset += align_4(tvb, ioffset);
6416 value1 = tvb_get_letohl(tvb, ioffset); /* Optional Attributes */
6417 sub2item = proto_tree_add_uint_format(sub1tree, hf_nds_number_of_items, tvb, ioffset,
6418 4, value1, "Optional Attributes %d", value1);
6419 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6420 ioffset = ioffset + 4;
6421 for (r = 0; r < value1; r++)
6423 value2 = tvb_get_letohl(tvb, ioffset);
6424 ioffset = ioffset + 4;
6425 get_string(tvb, ioffset, value2, mval_buf.buffer);
6426 temp_values.vstring = mval_buf.buffer;
6427 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6428 value2, temp_values.vstring);
6429 ioffset = ioffset + value2;
6430 ioffset += align_4(tvb, ioffset);
6432 value1 = tvb_get_letohl(tvb, ioffset); /* Default ACL */
6433 proto_tree_add_uint_format(sub1tree, hf_nds_eid, tvb, ioffset,
6434 4, value1, "Default ACL %08x", value1);
6435 ioffset = ioffset + 4;
6436 if(tvb_length_remaining(tvb, ioffset) < 4 )
6445 case MVTYPE_MODIFY_CLASS: /* Modify Class */
6446 for (i = 1 ; i <= values->vvalue; i++ ) /* Attribute Names to add*/
6448 ioffset += align_4(tvb, ioffset);
6449 value1 = tvb_get_letohl(tvb, ioffset);
6450 ioffset = ioffset + 4;
6451 get_string(tvb, ioffset, value1, mval_buf.buffer);
6452 values->vstring = mval_buf.buffer;
6453 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
6454 value1, values->vstring);
6455 ioffset = ioffset + value1;
6457 if(tvb_length_remaining(tvb, ioffset) < 4 )
6461 ioffset += align_4(tvb, ioffset);
6462 value1 = tvb_get_letohl(tvb, ioffset);
6463 proto_tree_add_uint_format(ntree, hf_nds_att_del, tvb, ioffset,
6464 4, value1, "Attribute Names to Delete %d", value1);
6465 ioffset = ioffset + 4;
6466 for (i = 1 ; i <= value1; i++ ) /* Attribute Names to delete*/
6468 ioffset += align_4(tvb, ioffset);
6469 value2 = tvb_get_letohl(tvb, ioffset);
6470 ioffset = ioffset + 4;
6471 get_string(tvb, ioffset, value2, mval_buf.buffer);
6472 values->vstring = mval_buf.buffer;
6473 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
6474 value2, values->vstring);
6475 ioffset = ioffset + value2;
6477 if(tvb_length_remaining(tvb, ioffset) < 4 )
6481 ioffset += align_4(tvb, ioffset);
6482 value1 = tvb_get_letohl(tvb, ioffset);
6483 proto_tree_add_uint_format(ntree, hf_nds_acl_add, tvb, ioffset,
6484 4, value1, "ACL Templates to Add %d", value1);
6485 ioffset = ioffset + 4;
6486 for (i = 1 ; i <= value1; i++ ) /* ACL templates to add*/
6488 ioffset += align_4(tvb, ioffset);
6489 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
6490 ioffset = ioffset + 4;
6491 get_string(tvb, ioffset, value2, mval_buf.buffer);
6492 values->vstring = mval_buf.buffer;
6493 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
6494 value2, values->vstring);
6495 ioffset = ioffset + value2;
6496 ioffset += align_4(tvb, ioffset);
6497 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
6498 ioffset = ioffset + 4;
6499 get_string(tvb, ioffset, value2, mval_buf.buffer);
6500 values->vstring = mval_buf.buffer;
6501 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
6502 value2, values->vstring);
6503 ioffset = ioffset + value2;
6504 ioffset += align_4(tvb, ioffset);
6505 value1 = tvb_get_letohl(tvb, ioffset);
6506 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
6507 4, value1, "Privileges 0x%08x", value1);
6508 ioffset = ioffset + 4;
6510 if(tvb_length_remaining(tvb, ioffset) < 4 )
6514 ioffset += align_4(tvb, ioffset);
6515 value1 = tvb_get_letohl(tvb, ioffset);
6516 proto_tree_add_uint_format(ntree, hf_nds_acl_del, tvb, ioffset,
6517 4, value1, "ACL Templates to Delete %d", value1);
6518 ioffset = ioffset + 4;
6519 for (i = 1 ; i <= value1; i++ ) /* ACL templates to delete*/
6521 ioffset += align_4(tvb, ioffset);
6522 value2 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
6523 ioffset = ioffset + 4;
6524 get_string(tvb, ioffset, value2, mval_buf.buffer);
6525 values->vstring = mval_buf.buffer;
6526 proto_tree_add_string(ntree, hf_nds_attribute_dn, tvb, ioffset,
6527 value2, values->vstring);
6528 ioffset = ioffset + value2;
6529 ioffset += align_4(tvb, ioffset);
6530 value2 = tvb_get_letohl(tvb, ioffset); /* DN of Trustee */
6531 ioffset = ioffset + 4;
6532 get_string(tvb, ioffset, value2, mval_buf.buffer);
6533 values->vstring = mval_buf.buffer;
6534 proto_tree_add_string(ntree, hf_nds_trustee_dn, tvb, ioffset,
6535 value2, values->vstring);
6536 ioffset = ioffset + value2;
6537 ioffset += align_4(tvb, ioffset);
6538 value1 = tvb_get_letohl(tvb, ioffset); /* Privileges */
6539 proto_tree_add_uint_format(ntree, hf_nds_privileges, tvb, ioffset,
6540 4, value1, "Privileges 0x%08x", value1);
6541 ioffset = ioffset + 4;
6544 case MVTYPE_PROCESS_TAGS: /* Process tags and paths depending on name type returned. */
6545 switch (values->vflags) {
6547 case 8: /* Tuned Name */
6548 proto_tree_add_item(ntree, hf_nds_tune_mark, tvb, ioffset, 2, FALSE);
6550 value1 = tvb_get_letohs(tvb, ioffset);
6551 valuestr = match_strval(value1, nds_tuned_tags);
6552 if (valuestr == NULL)
6554 valuestr="(Undefined Tuned Name Tag)";
6556 proto_tree_add_string_format(ntree, hf_value_string, tvb, ioffset,
6557 2, valuestr, "Tuned Name Tag -> %s", valuestr);
6559 ioffset += align_4(tvb, ioffset);
6560 if (value1 == 0) { /* RDN Hint - really just returns the dist name + timestamp info */
6561 value2 = tvb_get_letohl(tvb, ioffset); /* Distinguished Name Len, String[len]*/
6562 ioffset = ioffset + 4;
6563 get_string(tvb, ioffset, value2, mval_buf.buffer);
6564 values->vstring = mval_buf.buffer;
6565 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
6566 value2, values->vstring);
6568 ioffset += align_4(tvb, ioffset);
6569 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
6571 proto_tree_add_time_format(ntree, hf_es_seconds, tvb, ioffset,
6572 4, &ns, "Creation Timestamp: %s", abs_time_to_str(&ns));
6574 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
6575 proto_tree_add_item(ntree, hf_nds_replica_num, tvb, ioffset,
6577 ioffset = ioffset + 2;
6578 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
6579 proto_tree_add_item(ntree, hf_nds_event_num, tvb, ioffset,
6581 ioffset = ioffset + 2;
6583 else /* Process the full RDN history including ancestors */
6585 value1 = tvb_get_letohl(tvb, ioffset);
6586 sub1item = proto_tree_add_uint_format(ntree, hf_nds_acl_del, tvb, ioffset,
6587 4, value1, "Number of RDN Items %d", value1);
6588 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
6589 ioffset = ioffset + 4;
6590 for (i=1; i <= value1; i++) {
6592 sub2item = proto_tree_add_text(sub1tree, tvb, ioffset, 0, "Item %d", i);
6593 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6594 ioffset += align_4(tvb, ioffset);
6596 value5 = tvb_get_letohl(tvb, ioffset);
6597 valuestr = match_strval(value5, nds_tuned_item_tags);
6598 if (valuestr == NULL)
6600 valuestr="(Undefined Tuned Name Tag)";
6602 if (value5 == 0) { /* Items are timestamp + Distinguished name (0 value == one entry)*/
6603 proto_tree_add_string_format(sub2tree, hf_value_string, tvb, ioffset,
6604 4, valuestr, "Item Tag -> %s", valuestr);
6606 ns.secs = tvb_get_letohl(tvb, ioffset); /* Seconds */
6608 proto_tree_add_time_format(sub2tree, hf_es_seconds, tvb, ioffset,
6609 4, &ns, "Timestamp: %s", abs_time_to_str(&ns));
6611 replica_num = tvb_get_letohs(tvb, ioffset); /* Replica */
6612 proto_tree_add_item(sub2tree, hf_nds_replica_num, tvb, ioffset,
6614 ioffset = ioffset + 2;
6615 event_num = tvb_get_letohs(tvb, ioffset); /* Event */
6616 proto_tree_add_item(sub2tree, hf_nds_event_num, tvb, ioffset,
6618 ioffset = ioffset + 2;
6619 value2 = tvb_get_letohl(tvb, ioffset); /* Distinguished Name Len, String[len]*/
6620 ioffset = ioffset + 4;
6621 get_string(tvb, ioffset, value2, mval_buf.buffer);
6622 values->vstring = mval_buf.buffer;
6623 proto_tree_add_string(sub2tree, hf_mv_string, tvb, ioffset,
6624 value2, values->vstring);
6629 values->voffset=ioffset;
6631 default: /* All other name types are just a string */
6632 get_string(tvb, ioffset, values->vlength, mval_buf.buffer);
6633 values->vstring = mval_buf.buffer;
6634 proto_tree_add_string(ntree, hf_mv_string, tvb, ioffset,
6635 values->vlength, values->vstring);
6636 values->voffset=ioffset + values->vlength;
6637 ioffset = values->voffset;
6638 ioffset += align_4(tvb, ioffset);
6644 case MVTYPE_PROCESS_ITERATOR: /* Process Iterator subverbs. */
6645 temp_values.vvalue = tvb_get_letohl(tvb, ioffset);
6647 temp_values.vstring = (char *)match_strval(temp_values.vvalue, nds_info_type);
6648 if(temp_values.vstring == NULL)
6650 temp_values.vstring = "No Info Type Set";
6653 proto_tree_add_string(ntree, hf_nds_info_type, tvb, ioffset, 4, temp_values.vstring);
6654 ioffset = ioffset + 4;
6655 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
6656 value5 = tvb_get_letohl(tvb, ioffset);
6657 temp_values.vdesc = "Information Flags (low) Byte:";
6658 temp_values.vlength = 2;
6659 temp_values.hfname = hf_nds_rflags;
6660 temp_values.voffset = ioffset;
6661 temp_values.bit1 = "Output Flags";
6662 temp_values.bit1hfname = hf_bit1infoflagsl;
6663 temp_values.bit2 = "Entry ID";
6664 temp_values.bit2hfname = hf_bit2infoflagsl;
6665 temp_values.bit3 = "Entry Flags";
6666 temp_values.bit3hfname = hf_bit3infoflagsl;
6667 temp_values.bit4 = "Subordinate Count";
6668 temp_values.bit4hfname = hf_bit4infoflagsl;
6669 temp_values.bit5 = "Modification Time";
6670 temp_values.bit5hfname = hf_bit5infoflagsl;
6671 temp_values.bit6 = "Modification Timestamp";
6672 temp_values.bit6hfname = hf_bit6infoflagsl;
6673 temp_values.bit7 = "Creation Timestamp";
6674 temp_values.bit7hfname = hf_bit7infoflagsl;
6675 temp_values.bit8 = "Partition Root ID";
6676 temp_values.bit8hfname = hf_bit8infoflagsl;
6677 temp_values.bit9 = "Parent ID";
6678 temp_values.bit9hfname = hf_bit9infoflagsl;
6679 temp_values.bit10 = "Revision Count";
6680 temp_values.bit10hfname = hf_bit10infoflagsl;
6681 temp_values.bit11 = "Replica Type";
6682 temp_values.bit11hfname = hf_bit11infoflagsl;
6683 temp_values.bit12 = "Base Class";
6684 temp_values.bit12hfname = hf_bit12infoflagsl;
6685 temp_values.bit13 = "Relative Distinguished Name";
6686 temp_values.bit13hfname = hf_bit13infoflagsl;
6687 temp_values.bit14 = "Distinguished Name";
6688 temp_values.bit14hfname = hf_bit14infoflagsl;
6689 temp_values.bit15 = "Root Distinguished Name";
6690 temp_values.bit15hfname = hf_bit15infoflagsl;
6691 temp_values.bit16 = "Parent Distinguished Name";
6692 temp_values.bit16hfname = hf_bit16infoflagsl;
6693 process_bitfield(ntree, tvb, &temp_values);
6694 ioffset = ioffset+2;
6695 temp_values.vvalue = tvb_get_letohs(tvb, ioffset);
6696 temp_values.vtype = VTYPE_BITFIELD;
6697 temp_values.vdesc = "Information Flags (high) Byte:";
6698 temp_values.vlength = 2;
6699 temp_values.hfname= hf_nds_rflags;
6700 temp_values.voffset = ioffset;
6701 temp_values.bit1 = "Purge Time";
6702 temp_values.bit1hfname = hf_bit1infoflagsh;
6703 temp_values.bit2 = "Dereference Base Class";
6704 temp_values.bit2hfname = hf_bit2infoflagsh;
6705 temp_values.bit3 = "Replica Number";
6706 temp_values.bit3hfname = hf_bit3infoflagsh;
6707 temp_values.bit4 = "Replica State";
6708 temp_values.bit4hfname = hf_bit4infoflagsh;
6709 temp_values.bit5 = "Federation Boundary";
6710 temp_values.bit5hfname = hf_bit5infoflagsh;
6711 temp_values.bit6 = "Schema Boundary";
6712 temp_values.bit6hfname = hf_bit6infoflagsh;
6713 temp_values.bit7 = "Federation Boundary ID";
6714 temp_values.bit7hfname = hf_bit7infoflagsh;
6715 temp_values.bit8 = "Schema Boundary ID";
6716 temp_values.bit8hfname = hf_bit8infoflagsh;
6717 temp_values.bit9 = "Current Subcount";
6718 temp_values.bit9hfname = hf_bit9infoflagsh;
6719 temp_values.bit10 = "Local Entry Flags";
6720 temp_values.bit10hfname = hf_bit10infoflagsh;
6721 temp_values.bit11 = "Not Defined";
6722 temp_values.bit11hfname = hf_bit11infoflagsh;
6723 temp_values.bit12 = "Not Defined";
6724 temp_values.bit12hfname = hf_bit12infoflagsh;
6725 temp_values.bit13 = "Not Defined";
6726 temp_values.bit13hfname = hf_bit13infoflagsh;
6727 temp_values.bit14 = "Not Defined";
6728 temp_values.bit14hfname = hf_bit14infoflagsh;
6729 temp_values.bit15 = "Not Defined";
6730 temp_values.bit15hfname = hf_bit15infoflagsh;
6731 temp_values.bit16 = "Not Defined";
6732 temp_values.bit16hfname = hf_bit16infoflagsh;
6733 ioffset = ioffset+2;
6734 process_bitfield(ntree, tvb, &temp_values);
6736 proto_tree_add_item(ntree, hf_nds_time_filter, tvb, ioffset, 4, FALSE);
6738 proto_tree_add_item(ntree, hf_nds_all_attr, tvb, ioffset, 4, FALSE);
6740 value2 = tvb_get_letohl(tvb, ioffset);
6741 sub1item = proto_tree_add_uint_format(ntree, hf_nds_number_of_items, tvb, ioffset,
6742 4, value2, "Number of Attributes %d", value2);
6743 sub1tree = proto_item_add_subtree(sub1item, ett_nds);
6745 for (i=1; i<=value2; i++) {
6746 sub2item = proto_tree_add_text(sub1tree, tvb, ioffset, 0, "Attribute %d", i);
6747 sub2tree = proto_item_add_subtree(sub2item, ett_nds);
6748 ioffset += align_4(tvb, ioffset);
6749 value3 = tvb_get_letohl(tvb, ioffset); /* Attribute Name */
6750 ioffset = ioffset + 4;
6751 get_string(tvb, ioffset, value3, mval_buf.buffer);
6752 values->vstring = mval_buf.buffer;
6753 proto_tree_add_string(sub2tree, hf_nds_attribute_dn, tvb, ioffset,
6754 value3, values->vstring);
6755 ioffset = ioffset + value3;
6757 if(tvb_length_remaining(tvb, ioffset) < 4 )
6762 ioffset += align_4(tvb, ioffset);
6763 value4 = tvb_get_letohl(tvb, ioffset);
6764 values->vstring = (char *)match_strval(value4, iterator_subverbs);
6765 if(values->vstring == NULL)
6767 values->vstring = "(No Iteration Verb Found)";
6770 dissect_nds_iterator(ntree, tvb, pinfo, value4, value5, ioffset, TRUE);
6772 g_strlcpy(mval_buf.buffer, " (", 1024);
6773 g_strlcat(mval_buf.buffer, values->vstring, 1024);
6774 g_strlcat(mval_buf.buffer, ") ", 1024);
6775 values->vstring = mval_buf.buffer;
6782 static void dissect_ncp_89_6_request(tvbuff_t *tvb, proto_tree *volatile ncp_tree, guint32 offset)
6784 guint32 string_len, datatype, count, i;
6786 datatype = tvb_get_letohl(tvb, offset);
6787 proto_tree_add_item(ncp_tree, hf_ncp_data_type_flag, tvb, offset, 1, TRUE);
6789 proto_tree_add_item(ncp_tree, hf_ncp_reserved5, tvb, offset, 5, TRUE);
6791 count = tvb_get_guint8(tvb, offset);
6792 proto_tree_add_item(ncp_tree, hf_ncp_path_count, tvb, offset, 1, TRUE);
6794 for (i=0; i < count; i++) {
6795 if (datatype == 0) {
6796 string_len = (tvb_get_guint8(tvb, offset))+1;
6797 proto_tree_add_item(ncp_tree, hf_ncp_directory_path, tvb, offset+1, string_len-1, TRUE);
6801 string_len = (tvb_get_letohs(tvb, offset))+2;
6802 proto_tree_add_item(ncp_tree, hf_ncp_directory_path, tvb, offset+2, string_len-2, TRUE);
6804 offset += string_len;
6805 if(tvb_length_remaining(tvb, offset) < 4 )
6814 dissect_ncp_123_11_reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree, ncp_req_hash_value *request_value)
6816 int string_len, loffset;
6819 if (request_value->length == 7) {
6820 /* Undocumented, if request value length is 7 then the reply is offset by 8 bytes.
6821 * Unknown what these 8 bytes represent */
6824 string_len = tvb_get_guint8(tvb, loffset);
6825 proto_tree_add_item(ncp_tree, hf_ncp_file_name_12, tvb, loffset+1, string_len, TRUE);
6826 loffset += string_len+1;
6827 string_len = tvb_get_guint8(tvb, loffset);
6828 proto_tree_add_item(ncp_tree, hf_ncp_name12, tvb, loffset+1, string_len, TRUE);
6829 loffset += string_len+1;
6830 string_len = tvb_get_guint8(tvb, loffset);
6831 proto_tree_add_item(ncp_tree, hf_ncp_copyright, tvb, loffset+1, string_len, TRUE);
6835 dissect_ncp_123_17_reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree)
6839 guint32 loffset, number_of_items, addr_type;
6842 number_of_items = tvb_get_letohl(tvb, 36);
6843 proto_tree_add_item(ncp_tree, hf_ncp_items_in_packet, tvb, 36, 4, TRUE);
6845 for (x = 1; x <= number_of_items; x++)
6847 aitem = proto_tree_add_text(ncp_tree, tvb, loffset, -1, "Network Address - %d", x);
6848 atree = proto_item_add_subtree(aitem, ett_ncp);
6850 addr_type = tvb_get_guint8(tvb, loffset);
6851 proto_tree_add_item(atree, hf_ncp_transport_type, tvb, loffset, 1, TRUE);
6852 /* The address type is one byte of a 4 byte value. The next 4 bytes are
6853 * the length of the address. Since we already know the length based upon
6854 * the type of address, we can skip this value. So set the offset accourdingly */
6860 proto_tree_add_item(atree, hf_nds_net, tvb, loffset, 4, FALSE);
6861 proto_tree_add_item(atree, hf_nds_node, tvb, loffset+4, 6, FALSE);
6862 proto_tree_add_item(atree, hf_nds_socket, tvb, loffset+10, 2, FALSE);
6866 proto_tree_add_item(atree, hf_nds_port, tvb, loffset, 2, FALSE);
6867 proto_tree_add_item(atree, hf_add_ref_udp, tvb, loffset+2, 4, FALSE);
6871 proto_tree_add_item(atree, hf_nds_port, tvb, loffset, 2, FALSE);
6872 proto_tree_add_item(atree, hf_add_ref_tcp, tvb, loffset+2, 4, FALSE);
6876 proto_tree_add_text(atree, tvb, loffset, -1, "Unknown Address Type");
6877 /* unknown type so read the length field and then
6878 * just skip the record and move on to the next */
6879 loffset += tvb_get_letohl(tvb, loffset - 4);
6882 proto_item_set_end(aitem, tvb, loffset);
6883 if(tvb_length_remaining(tvb, loffset) < 4 )
6891 dissect_ncp_23_26_reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree)
6893 /* For an IP-only server, the 4-byte IP address is placed into the 4-byte NetworkAddress
6894 * field of the NetworkAddressStruct, while the NetworkNodeAddress and NetworkSocket
6895 * fields are left blank. */
6896 if (tvb_get_letohl(tvb, 12)==0) {
6898 proto_tree_add_item(ncp_tree, hf_ncp_ip_address, tvb, 8, 4, FALSE);
6903 proto_tree_add_item(ncp_tree, hf_nds_net, tvb, 8, 4, FALSE);
6904 proto_tree_add_item(ncp_tree, hf_nds_node, tvb, 12, 6, FALSE);
6905 proto_tree_add_item(ncp_tree, hf_nds_socket, tvb, 18, 2, FALSE);
6907 proto_tree_add_item(ncp_tree, hf_ncp_connection_type, tvb, 20, 1, TRUE);
6911 dissect_ncp_8x20reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree,
6912 const ncp_record *ncp_rec, ncp_req_hash_value *request_value)
6915 guint32 loffset, number_of_items, str_length;
6916 ptvcursor_t *ptvc = NULL;
6917 proto_tree *atree, *btree;
6918 proto_item *aitem, *bitem;
6920 aitem = proto_tree_add_text(ncp_tree, tvb, 8, 9, "Search Sequence:");
6921 atree = proto_item_add_subtree(aitem, ett_ncp);
6923 proto_tree_add_item(atree, hf_ncp_volume_number, tvb, 8, 1, TRUE);
6924 proto_tree_add_item(atree, hf_ncp_directory_entry_number, tvb, 9, 4, TRUE);
6925 proto_tree_add_item(atree, hf_ncp_sequence_number, tvb, 13, 4, TRUE);
6927 proto_tree_add_item(ncp_tree, hf_ncp_more_flag, tvb, 17, 1, TRUE);
6928 number_of_items = tvb_get_letohs(tvb, 18);
6929 proto_tree_add_item(ncp_tree, hf_ncp_info_count, tvb, 18, 2, TRUE);
6931 for (x = 1; x <= number_of_items; x++ )
6933 aitem = proto_tree_add_text(ncp_tree, tvb, loffset, -1, "Information Item %d", x);
6934 atree = proto_item_add_subtree(aitem, ett_ncp);
6935 /* Data Stream Space Allocated */
6936 if (request_value->req_mask & 0x0002) {
6937 proto_tree_add_item(atree, hf_ncp_data_stream_space_alloc, tvb, loffset, 4, TRUE);
6942 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
6947 if (request_value->req_mask & 0x0004) {
6948 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Attributes");
6949 btree = proto_item_add_subtree(bitem, ett_ncp);
6950 ptvc = ptvcursor_new(btree, tvb, loffset);
6951 process_ptvc_record(ptvc, ptvc_struct_attributes_struct,
6952 NULL, TRUE, ncp_rec);
6953 ptvcursor_free(ptvc);
6955 proto_item_set_end(bitem, tvb, loffset);
6959 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
6963 /* Data Stream Size */
6964 if (request_value->req_mask & 0x0008) {
6965 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Data Stream Size");
6966 btree = proto_item_add_subtree(bitem, ett_ncp);
6967 proto_tree_add_item(btree, hf_ncp_data_stream_size, tvb, loffset, 4, TRUE);
6969 proto_item_set_end(bitem, tvb, loffset);
6973 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
6977 /* Total Stream Size */
6978 if (request_value->req_mask & 0x0010) {
6979 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Total Stream Size");
6980 btree = proto_item_add_subtree(bitem, ett_ncp);
6981 proto_tree_add_item(btree, hf_ncp_ttl_ds_disk_space_alloc, tvb, loffset, 4, TRUE);
6982 proto_tree_add_item(btree, hf_ncp_number_of_data_streams, tvb, loffset+4, 2, TRUE);
6984 proto_item_set_end(bitem, tvb, loffset);
6988 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
6992 /* Extended Attributes new style location*/
6993 if (request_value->req_mask & 0x0020 && ncp_newstyle) {
6994 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Extended Attributes");
6995 btree = proto_item_add_subtree(bitem, ett_ncp);
6996 ptvc = ptvcursor_new(btree, tvb, loffset);
6997 process_ptvc_record(ptvc, ptvc_struct_ea_info_struct,
6998 NULL, TRUE, ncp_rec);
6999 ptvcursor_free(ptvc);
7001 proto_item_set_end(bitem, tvb, loffset);
7005 if ((request_value->req_mask_ext & 0x8000)==FALSE && ncp_newstyle) {
7009 /* Creation Information old style location */
7010 if (request_value->req_mask & 0x0100 && !ncp_newstyle) {
7011 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Creation");
7012 btree = proto_item_add_subtree(bitem, ett_ncp);
7013 ptvc = ptvcursor_new(btree, tvb, loffset);
7014 process_ptvc_record(ptvc, ptvc_struct_creation_info_struct,
7015 NULL, TRUE, ncp_rec);
7016 ptvcursor_free(ptvc);
7018 proto_item_set_end(bitem, tvb, loffset);
7022 if ((request_value->req_mask_ext & 0x8000)==FALSE && !ncp_newstyle) {
7026 /* Modification Information */
7027 if (request_value->req_mask & 0x0080) {
7028 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Modification");
7029 btree = proto_item_add_subtree(bitem, ett_ncp);
7030 ptvc = ptvcursor_new(btree, tvb, loffset);
7031 process_ptvc_record(ptvc, ptvc_struct_modify_info_struct,
7032 NULL, TRUE, ncp_rec);
7033 ptvcursor_free(ptvc);
7035 proto_item_set_end(bitem, tvb, loffset);
7039 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
7043 /* Creation Information new style location */
7044 if (request_value->req_mask & 0x0100 && ncp_newstyle) {
7045 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Creation");
7046 btree = proto_item_add_subtree(bitem, ett_ncp);
7047 ptvc = ptvcursor_new(btree, tvb, loffset);
7048 process_ptvc_record(ptvc, ptvc_struct_creation_info_struct,
7049 NULL, TRUE, ncp_rec);
7050 ptvcursor_free(ptvc);
7052 proto_item_set_end(bitem, tvb, loffset);
7056 if ((request_value->req_mask_ext & 0x8000)==FALSE && ncp_newstyle) {
7060 /* Archive Information */
7061 if (request_value->req_mask & 0x0040) {
7062 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Archive");
7063 btree = proto_item_add_subtree(bitem, ett_ncp);
7064 ptvc = ptvcursor_new(btree, tvb, loffset);
7065 process_ptvc_record(ptvc, ptvc_struct_archive_info_struct,
7066 NULL, TRUE, ncp_rec);
7067 ptvcursor_free(ptvc);
7069 proto_item_set_end(bitem, tvb, loffset);
7073 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
7077 /* Rights Information */
7078 if (request_value->req_mask & 0x0800) {
7079 ptvc = ptvcursor_new(atree, tvb, loffset);
7080 process_ptvc_record(ptvc, ptvc_struct_rights_info_struct,
7081 NULL, TRUE, ncp_rec);
7082 ptvcursor_free(ptvc);
7087 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
7091 /* Directory Entry */
7092 if (request_value->req_mask & 0x0400) {
7093 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Directory Entry");
7094 btree = proto_item_add_subtree(bitem, ett_ncp);
7095 ptvc = ptvcursor_new(btree, tvb, loffset);
7096 process_ptvc_record(ptvc, ptvc_struct_dir_entry_struct,
7097 NULL, TRUE, ncp_rec);
7098 ptvcursor_free(ptvc);
7100 proto_item_set_end(bitem, tvb, loffset);
7104 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
7108 /* Extended Attributes oldstyle location*/
7109 if (request_value->req_mask & 0x0020 && !ncp_newstyle) {
7110 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Extended Attributes");
7111 btree = proto_item_add_subtree(bitem, ett_ncp);
7112 ptvc = ptvcursor_new(btree, tvb, loffset);
7113 process_ptvc_record(ptvc, ptvc_struct_ea_info_struct,
7114 NULL, TRUE, ncp_rec);
7115 ptvcursor_free(ptvc);
7117 proto_item_set_end(bitem, tvb, loffset);
7121 if ((request_value->req_mask_ext & 0x8000)==FALSE && !ncp_newstyle) {
7125 /* Name Space Information */
7126 if (request_value->req_mask & 0x0200) {
7127 proto_tree_add_item(atree, hf_ncp_creator_name_space_number, tvb, loffset, 1, TRUE);
7132 if ((request_value->req_mask_ext & 0x8000)==FALSE) {
7136 if (request_value->req_mask & 0x1000) {
7137 proto_tree_add_item(atree, hf_ncp_curr_ref_id, tvb, loffset, 2, TRUE);
7140 if (request_value->req_mask & 0x2000) {
7141 proto_tree_add_item(atree, hf_ncp_attr_def_32, tvb, loffset, 1, TRUE);
7144 if (request_value->req_mask & 0x4000) {
7145 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Actual");
7146 btree = proto_item_add_subtree(bitem, ett_ncp);
7147 proto_tree_add_item(btree, hf_ncp_data_stream_num_long, tvb, loffset, 4, TRUE);
7148 proto_tree_add_item(btree, hf_ncp_data_stream_fat_blks, tvb, loffset+4, 4, TRUE);
7150 proto_item_set_end(bitem, tvb, loffset);
7152 if (request_value->req_mask & 0x8000) {
7153 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Logical");
7154 btree = proto_item_add_subtree(bitem, ett_ncp);
7155 proto_tree_add_item(btree, hf_ncp_data_stream_num_long, tvb, loffset, 4, TRUE);
7156 proto_tree_add_item(btree, hf_ncp_data_stream_size, tvb, loffset+4, 4, TRUE);
7158 proto_item_set_end(bitem, tvb, loffset);
7160 if (request_value->req_mask_ext & 0x0001 && ncp_newstyle) {
7161 proto_tree_add_item(atree, hf_ncp_sec_rel_to_y2k, tvb, loffset, 4, TRUE);
7164 if (request_value->req_mask_ext & 0x0002 && ncp_newstyle) {
7165 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "DOS Name");
7166 btree = proto_item_add_subtree(bitem, ett_ncp);
7167 if (ncp_rec->func == 0x57) {
7168 str_length = tvb_get_guint8(tvb, loffset);
7173 str_length = tvb_get_letohs(tvb, loffset);
7176 proto_tree_add_item(btree, hf_ncp_file_name_12, tvb, loffset, str_length, FALSE);
7177 loffset += str_length;
7178 proto_item_set_end(bitem, tvb, loffset);
7180 if (request_value->req_mask_ext & 0x0004 && ncp_newstyle) {
7181 ptvc = ptvcursor_new(atree, tvb, loffset);
7182 process_ptvc_record(ptvc, ptvc_struct_flush_time_struct,
7183 NULL, TRUE, ncp_rec);
7184 ptvcursor_free(ptvc);
7187 if (request_value->req_mask_ext & 0x0008 && ncp_newstyle) {
7188 proto_tree_add_item(atree, hf_ncp_parent_base_id, tvb, loffset, 4, TRUE);
7191 if (request_value->req_mask_ext & 0x0010 && ncp_newstyle) {
7192 proto_tree_add_item(atree, hf_ncp_mac_finder_info, tvb, loffset, 32, TRUE);
7195 if (request_value->req_mask_ext & 0x0020 && ncp_newstyle) {
7196 proto_tree_add_item(atree, hf_ncp_sibling_count, tvb, loffset, 4, TRUE);
7199 if (request_value->req_mask_ext & 0x0040 && ncp_newstyle) {
7200 proto_tree_add_item(atree, hf_ncp_effective_rights, tvb, loffset, 1, TRUE);
7203 if (request_value->req_mask_ext & 0x0080 && ncp_newstyle) {
7204 bitem = proto_tree_add_text(atree, tvb, loffset, -1, "Mac Date");
7205 btree = proto_item_add_subtree(bitem, ett_ncp);
7206 ptvc = ptvcursor_new(btree, tvb, loffset);
7207 process_ptvc_record(ptvc, ptvc_struct_mac_time_struct,
7208 NULL, TRUE, ncp_rec);
7209 ptvcursor_free(ptvc);
7211 proto_item_set_end(bitem, tvb, loffset);
7213 if (request_value->req_mask_ext & 0x0100 && ncp_newstyle) {
7214 ptvc = ptvcursor_new(atree, tvb, loffset);
7215 process_ptvc_record(ptvc, ptvc_struct_last_access_time_struct,
7216 NULL, TRUE, ncp_rec);
7217 ptvcursor_free(ptvc);
7220 if (request_value->req_mask_ext & 0x0400 && ncp_newstyle) {
7221 proto_tree_add_item(atree, hf_ncp_f_size_64bit, tvb, loffset, 8, TRUE);
7224 /* We always return the file name */
7225 if (ncp_rec->func == 0x57) {
7226 str_length = tvb_get_guint8(tvb, loffset);
7231 str_length = tvb_get_letohs(tvb, loffset);
7234 proto_tree_add_item(atree, hf_ncp_file_name_12, tvb, loffset, str_length, FALSE);
7235 loffset += str_length;
7237 proto_item_set_end(aitem, tvb, loffset);
7239 if(tvb_length_remaining(tvb, loffset) < 4 )
7247 dissect_ncp_123_62_reply(tvbuff_t *tvb, proto_tree *volatile ncp_tree)
7249 char value_format[2]="\0";
7250 char param_string[256]="\0";
7252 build_expert_data(ncp_tree, "ncp.set_cmd_type", value_format, 0, FALSE);
7253 build_expert_data(ncp_tree, "ncp.set_cmd_name", param_string, 0, FALSE);
7254 switch (atoi(value_format)) {
7255 case 0: /* { 0x00, "Numeric Value" }, */
7256 case 2: /* { 0x02, "Ticks Value" }, */
7257 case 4: /* { 0x04, "Time Value" }, */
7258 case 6: /* { 0x06, "Trigger Value" }, */
7259 case 7: /* { 0x07, "Numeric Value" }, */
7260 proto_tree_add_item(ncp_tree, hf_srvr_param_number, tvb, 37+strlen(param_string), 4, TRUE);
7262 case 1: /* { 0x01, "Boolean Value" }, */
7263 proto_tree_add_item(ncp_tree, hf_srvr_param_boolean, tvb, 37+strlen(param_string), 1, TRUE);
7265 case 5: /* { 0x05, "String Value" }, */
7266 proto_tree_add_item(ncp_tree, hf_srvr_param_string, tvb, 37+strlen(param_string), -1, TRUE);
7276 * NDS fragment not being set to 0xffffffff indicates we are inside or at the
7277 * beginning of a fragment. But when the end of the fragment
7278 * is encounterd the flag is set to 0xffffffff. So we must mark what the
7279 * frame number is of the end fragment so that we will be
7280 * able to redissect if the user clicks on the packet
7281 * or resorts/filters the trace.
7283 * Once we are certain that we are in a fragment sequence
7284 * then we can just process each fragment in this conversation
7285 * until we reach the fragment == 0xffffffff packet.
7287 * We will be able to easily determine if a conversation is a fragment
7288 * with the exception of the last packet in the fragment. So remember
7289 * the last fragment packet number.
7291 * Also the NDS dissection requires the values of NDS Verb, Version, and Flags.
7292 * Without this values being remembered from the first request packet then
7293 * we will be unable to dissect the reply packet. For this reason we remember
7294 * these values on the first fragment and then populate the values in the final
7295 * fragment. We only do this on the first dissection.
7298 nds_defrag(tvbuff_t *tvb, packet_info *pinfo, guint32 nw_connection, guint8 sequence, guint16 type, proto_tree *tree, struct novell_tap *ncp_tap)
7300 int i, frag_count=0;
7303 tvbuff_t *frag_tvb = NULL;
7304 fragment_data *fd_head;
7305 ncp_req_hash_value *request_value = NULL;
7306 conversation_t *conversation;
7309 for (i = 0; i < 99; i++) {
7310 if (!frags[i].nds_fragmented)
7312 frags[i].nds_frag = 0xfffffff0;
7315 /* Check to see if defragmentation is enabeled in the dissector */
7316 if (!nds_defragment) {
7317 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7320 /* Has this already been dissected? */
7321 if (!pinfo->fd->flags.visited) {
7322 /* Find the conversation whence the request would have come. */
7323 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
7324 PT_NCP, nw_connection, nw_connection, 0);
7325 if (conversation != NULL) {
7326 /* find the record telling us the request made that caused
7328 request_value = ncp_hash_lookup(conversation, sequence);
7329 if (!request_value) {
7330 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7333 p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
7335 /* else... we haven't seen an NCP Request for that conversation and sequence. */
7338 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7343 request_value = p_get_proto_data(pinfo->fd, proto_ncp);
7344 if (!request_value) {
7345 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7349 /* Validate that this is an NDS packet */
7350 /* If this isn't an NDS packet then just return */
7351 if (!request_value->ncp_rec ||
7352 request_value->ncp_rec->func!=104 || request_value->ncp_rec->subfunc!=2) {
7353 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7356 /* Check to see if there is at least enough packet info to get the fragment flag */
7357 if (tvb_reported_length_remaining(tvb, 12) < 4) {
7358 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7361 /* Get the fragment flag */
7362 nds_frag = tvb_get_letohl(tvb, 12);
7364 /* Now we need to find if this is a new fragment or already one defined. */
7365 /* We currently limit the maximum number of simultaneous fragments to 100. */
7366 for (i=0; i<100; i++)
7368 if (frags[i].nds_frag == nds_frag || frags[i].nds_frag == 0xfffffff0)
7370 if (frags[i].nds_frag == 0xfffffff0)
7372 frags[i].nds_length = 0;
7373 frags[i].nds_frag = nds_frag;
7374 frags[i].nds_fragmented = TRUE;
7384 /* is this the end of an existing fragment or just another reply */
7385 if (nds_frag == 0xffffffff && request_value->nds_frag_num == 0xffffffff)
7387 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7391 /* Now we process the fragments */
7392 if (request_value->nds_frag || (request_value->nds_end_frag == pinfo->fd->num))
7394 /* Check to see of this is a fragment. If so then mark as a fragment. */
7395 if (frags[frag_count].nds_frag==0xffffffff) {
7396 request_value->nds_frag = FALSE;
7397 /* nds_length of 0 means start of fragment */
7398 frags[frag_count].nds_length = 0;
7402 if (frags[frag_count].nds_length == 0)
7404 frags[frag_count].nds_length = tvb_get_letohl(tvb, 0);
7411 tid = (pinfo->srcport+pinfo->destport);
7412 len = tvb_reported_length(tvb);
7413 if (len > 0 && tvb_bytes_exist(tvb, 0, len))
7415 if (frags[frag_count].nds_length > len)
7417 /* This is the first fragment so remember the verb, version, and flags. */
7418 frags[frag_count].nds_frag_verb = request_value->nds_request_verb;
7419 frags[frag_count].nds_frag_version = request_value->nds_version;
7420 frags[frag_count].nds_frag_flags = request_value->req_nds_flags;
7421 frags[frag_count].nds_frag_prot_flags = request_value->req_nds_prot_flags;
7422 fd_head = fragment_add_seq_next(tvb, 0, pinfo, tid, nds_fragment_table, nds_reassembled_table, len, request_value->nds_frag);
7423 frags[frag_count].nds_length = 1;
7427 /* Subsequent fragments should be offset by 16 since we do not need */
7428 /* the additional fragment handle and size fields in our composite data */
7429 fd_head = fragment_add_seq_next(tvb, 16, pinfo, tid, nds_fragment_table, nds_reassembled_table, len-16, request_value->nds_frag);
7431 if (fd_head != NULL)
7433 /* Is this the last fragment? nds_frag will indicate */
7434 if (fd_head->next != NULL && !request_value->nds_frag)
7436 frag_tvb = tvb_new_real_data(fd_head->data,
7437 fd_head->len, fd_head->len);
7438 tvb_set_child_real_data_tvbuff(tvb,
7440 add_new_data_source(pinfo,
7443 /* Show all fragments. */
7446 proto_item *frag_tree_item;
7447 show_fragment_seq_tree(fd_head,
7450 frag_tvb, &frag_tree_item);
7454 if (!pinfo->fd->flags.visited)
7456 /* Now we need to find the original fragment number. */
7457 /* Get the fragment flag */
7458 nds_frag = tvb_get_letohl(frag_tvb, 12);
7459 for (i=0; i<100; i++)
7461 if (frags[i].nds_frag == nds_frag)
7468 if (frags[i].nds_frag == 0xffffffff)
7470 /* Error can't find fragment */
7471 /*DISSECTOR_ASSERT(0);*/
7474 /* Remember this fragment information so we can dissect.
7475 * Only do this on the first dissection. After the first
7476 * dissection we will just read the memory values.
7478 request_value->nds_end_frag = pinfo->fd->num;
7479 request_value->nds_request_verb = frags[frag_count].nds_frag_verb;
7480 request_value->nds_version = frags[frag_count].nds_frag_version;
7481 request_value->req_nds_flags = frags[frag_count].nds_frag_flags;
7482 request_value->req_nds_prot_flags = frags[frag_count].nds_frag_prot_flags;
7488 /* This is either a beggining or middle fragment on second dissection */
7489 frag_tvb = tvb_new_subset(tvb, 0, -1, -1);
7490 if (check_col(pinfo->cinfo, COL_INFO))
7492 if (request_value->nds_frag)
7494 col_add_fstr(pinfo->cinfo, COL_INFO, "[NDS Fragment %08x]", frags[frag_count].nds_frag);
7501 /* Fragment from first pass of dissection */
7502 if (check_col(pinfo->cinfo, COL_INFO))
7504 if (request_value->nds_frag)
7506 col_add_fstr(pinfo->cinfo, COL_INFO, "[NDS Fragment %08x]", frags[frag_count].nds_frag);
7515 * There are no bytes so Dissect this
7517 frag_tvb = tvb_new_subset(tvb, 0, -1, -1);
7519 if (frag_tvb == NULL)
7521 /* This is a fragment packet */
7522 frag_tvb = tvb_new_subset (tvb, 0, -1, -1);
7523 nds_data_handle = find_dissector("data");
7524 call_dissector(nds_data_handle, frag_tvb, pinfo, tree);
7528 /* This is the end fragment so dissect */
7529 if (!request_value->nds_frag) {
7530 frags[frag_count].nds_length = 0;
7531 dissect_ncp_reply(frag_tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7537 /* This is not any fragment packet */
7538 frags[frag_count].nds_length = 0;
7539 request_value->nds_frag = FALSE;
7540 dissect_ncp_reply(tvb, pinfo, nw_connection, sequence, type, tree, ncp_tap);
7545 dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo,
7546 guint32 nw_connection, guint8 sequence,
7547 guint16 type, proto_tree *volatile ncp_tree)
7549 volatile guint8 func=0;
7550 volatile guint8 subfunc = 0;
7551 gboolean requires_subfunc = FALSE;
7552 gboolean has_length = FALSE;
7553 ncp_req_hash_value *volatile request_value = NULL;
7554 const ncp_record *volatile ncp_rec = NULL;
7555 conversation_t *conversation;
7556 ptvcursor_t *volatile ptvc = NULL;
7557 proto_tree *temp_tree = NULL;
7558 volatile gboolean run_req_cond = FALSE;
7559 volatile gboolean run_info_str = FALSE;
7560 guint32 length_remaining;
7562 volatile unsigned long except_code;
7563 const char *volatile message;
7566 /* Determine which ncp_record to use. */
7568 case NCP_ALLOCATE_SLOT:
7569 length_remaining = tvb_length_remaining(tvb, 4);
7570 if (length_remaining > 4)
7572 testvar = tvb_get_ntohl(tvb, 4);
7573 if( testvar == 0x4c495020)
7575 ncp_rec = &ncplip_echo;
7579 ncp_rec = &ncp1111_request;
7580 if (ncp_echo_conn) {
7581 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "Connection Request");
7587 ncp_rec = &ncp1111_request;
7588 if (ncp_echo_conn) {
7589 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "Connection Request");
7593 case NCP_SERVICE_REQUEST:
7594 func = tvb_get_guint8(tvb, 6);
7595 requires_subfunc = ncp_requires_subfunc(func);
7596 has_length = ncp_has_length_parameter(func);
7597 if (requires_subfunc) {
7599 subfunc = tvb_get_guint8(tvb, 9);
7602 subfunc = tvb_get_guint8(tvb, 7);
7605 ncp_rec = ncp_record_find(func, subfunc);
7607 case NCP_DEALLOCATE_SLOT:
7608 ncp_rec = &ncp5555_request;
7609 if (ncp_echo_conn) {
7610 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "Destroy Connection %d Request", nw_connection);
7613 case NCP_BROADCAST_SLOT:
7614 ncp_rec = &ncpbbbb_request;
7617 ncp_rec = &ncplip_echo;
7624 /* Fill in the INFO column. */
7625 if (check_col(pinfo->cinfo, COL_INFO)) {
7627 col_add_fstr(pinfo->cinfo, COL_INFO, "C %s", ncp_rec->name);
7628 if (ncp_rec->req_info_str) {
7629 /* We want to add more stuff to the Info
7631 run_info_str = TRUE;
7635 if (requires_subfunc) {
7636 col_add_fstr(pinfo->cinfo, COL_INFO,
7637 "C Unknown Function %u %u (0x%02X/0x%02x)",
7638 func, subfunc, func, subfunc);
7642 col_add_fstr(pinfo->cinfo, COL_INFO,
7643 "C Unknown Function %u (0x%02x)",
7649 if (!pinfo->fd->flags.visited) {
7650 /* This is the first time we've looked at this packet.
7651 Keep track of the address and connection whence the request
7652 came, and the address and connection to which the request
7653 is being sent, so that we can match up calls with replies.
7654 (We don't include the sequence number, as we may want
7655 to have all packets over the same connection treated
7656 as being part of a single conversation so that we can
7657 let the user select that conversation to be displayed.) */
7658 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
7659 PT_NCP, nw_connection, nw_connection, 0);
7661 if (conversation == NULL) {
7662 /* It's not part of any conversation - create a new one. */
7663 conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
7664 PT_NCP, nw_connection, nw_connection, 0);
7666 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
7667 request_value->req_frame_num = pinfo->fd->num;
7668 request_value->req_frame_time = pinfo->fd->abs_ts;
7670 /* If this is the first time we're examining the packet,
7671 * check to see if this NCP type uses a "request condition".
7672 * If so, we have to build a proto_tree because request conditions
7673 * use display filters to work, and without a proto_tree,
7674 * display filters can't possibly work. */
7676 if (ncp_rec->req_cond_indexes) {
7677 run_req_cond = TRUE;
7682 /* If we have to handle a request condition, or have to
7683 add to the Info column, we need to construct a protocol
7684 tree. If we already have a proto_tree, then wonderful.
7685 If we don't, we need to build one. */
7686 if ((run_info_str || run_req_cond) && !ncp_tree) {
7689 temp_tree = proto_tree_create_root();
7690 proto_tree_set_visible(temp_tree, FALSE);
7691 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
7692 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
7696 /* If the dissection throws an exception, be sure to free
7697 * the temporary proto_tree that was created. Because of the
7698 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
7699 * block; it has to be in the same scope as the terminating
7700 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
7701 * call CLEANUP_POP and friends, but the value of temp_tree is
7702 * NULL if no cleanup is needed, and non-null if cleanup is needed. */
7703 CLEANUP_PUSH(free_proto_tree, temp_tree);
7705 #ifdef FAKE_TREE_IS_VISIBLE
7706 PTREE_DATA(ncp_tree)->visible=1;
7709 /* Before the dissection, if we're saving data for a request
7710 * condition, we have to prime the proto tree using the
7711 * dfilter information */
7716 needed = ncp_rec->req_cond_indexes;
7718 while (*needed != -1) {
7719 dfilter = req_conds[*needed].dfilter;
7720 /* Prime the proto_tree with "interesting fields". */
7721 dfilter_prime_proto_tree(dfilter, ncp_tree);
7726 /* Before the dissection, if we need a field for the info_str,
7727 * prime the tree. */
7729 proto_tree_prime_hfid(ncp_tree, *ncp_rec->req_info_str->hf_ptr);
7733 case NCP_BROADCAST_SLOT:
7737 case NCP_SERVICE_REQUEST:
7738 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
7739 func, "Function: %u (0x%02X), %s",
7740 func, func, ncp_rec ? ncp_rec->name : "Unknown");
7747 if (request_value) {
7748 request_value->length = 0;
7750 if (requires_subfunc) {
7752 if (request_value && func==123) {
7753 request_value->length = tvb_get_ntohs(tvb, 7);
7755 proto_tree_add_item(ncp_tree, hf_ncp_length, tvb, 7,
7757 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 9, 1,
7758 subfunc, "SubFunction: %u (0x%02x)",
7760 ptvc = ptvcursor_new(ncp_tree, tvb, 10);
7763 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
7764 subfunc, "SubFunction: %u (0x%02x)",
7766 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
7770 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
7773 /* The group is not part of the packet, but it's useful
7774 * information to display anyway. Put it in the tree for filtering and tap use*/
7776 proto_tree_add_uint_format(ncp_tree, hf_ncp_group, tvb, 0, 0, ncp_rec->group, "Group: %s", ncp_groups[ncp_rec->group]);
7781 if (ncp_rec && ncp_rec->request_ptvc) {
7782 clear_repeat_vars();
7784 * We need to remember the results even if we
7785 * throw an exception dissecting this request,
7786 * so that we can properly dissect the reply.
7787 * We catch any exceptions thrown when
7788 * dissecting the request, and re-throw them
7789 * after saving the results of any conditional
7793 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
7795 except_code = EXCEPT_CODE;
7796 message = GET_MESSAGE;
7800 ptvcursor_free(ptvc);
7801 /* SecretStore packets are dessected in packet-ncp-sss.c */
7802 if (func == 0x5c && ncp_tree) {
7803 dissect_sss_request(tvb, pinfo, ncp_tree, request_value);
7805 /* NMAS packets are dessected in packet-ncp-nmas.c */
7806 if (func == 0x5e && ncp_tree) {
7807 dissect_nmas_request(tvb, pinfo, ncp_tree, request_value);
7810 /* Now that the dissection is done, do we need to run
7811 * some display filters on the resulting tree in order
7812 * to save results for "request conditions" ? */
7818 results = g_new0(gboolean, NUM_REQ_CONDS);
7819 needed = ncp_rec->req_cond_indexes;
7821 while (*needed != -1) {
7822 /* ncp_tree is not a root proto_tree, but
7823 * dfilters will still work on it. */
7824 dfilter = req_conds[*needed].dfilter;
7825 results[*needed] = dfilter_apply(dfilter, ncp_tree);
7829 /* Save the results so the reply packet dissection
7831 request_value->req_cond_results = results;
7833 /* Construct the info string if necessary */
7837 char non_uni_string[1024];
7844 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
7845 PT_NCP, nw_connection, nw_connection, 0);
7846 if (conversation != NULL) {
7847 /* find the record telling us the request made that caused
7849 request_value = ncp_hash_lookup(conversation, sequence);
7851 if (!conversation || !request_value)
7857 parray = proto_get_finfo_ptr_array(ncp_tree,
7858 *ncp_rec->req_info_str->hf_ptr);
7859 len = g_ptr_array_len(parray);
7863 col_set_str(pinfo->cinfo, COL_INFO, "C ");
7865 finfo = g_ptr_array_index(parray, 0);
7867 info_type = get_info_type((const gchar*) ncp_rec->req_info_str->first_string);
7869 if (info_type != 0) { /* Is this a string or not? */
7871 if (info_type == 1) { /* Is this bytes? */
7872 byte_string = bytes_to_str(get_finfo_value_string(finfo), get_finfo_length(finfo));
7873 col_append_fstr(pinfo->cinfo, COL_INFO,
7874 (const gchar*) ncp_rec->req_info_str->first_string,
7879 if (info_type == 2) { /* Is this a String? */
7880 uni_to_string(get_finfo_value_string(finfo), get_finfo_length(finfo), non_uni_string);
7881 col_append_fstr(pinfo->cinfo, COL_INFO,
7882 (const gchar*) ncp_rec->req_info_str->first_string,
7887 col_append_fstr(pinfo->cinfo, COL_INFO,
7888 (const gchar*) ncp_rec->req_info_str->first_string,
7889 get_finfo_value_string(finfo));
7895 col_append_fstr(pinfo->cinfo, COL_INFO,
7896 (const gchar*) ncp_rec->req_info_str->first_string,
7897 get_finfo_value_integer(finfo));
7901 for (i = 1; i < len; i++) {
7902 non_uni_string[0]='\0';
7903 finfo = g_ptr_array_index(parray, i);
7904 info_type = get_info_type((const gchar*) ncp_rec->req_info_str->repeat_string);
7906 if (info_type != 0) { /* Is this a string or not? */
7908 { /* Is this bytes? */
7909 byte_string = bytes_to_str(get_finfo_value_string(finfo), get_finfo_length(finfo));
7910 col_append_fstr(pinfo->cinfo, COL_INFO,
7911 (const gchar*) ncp_rec->req_info_str->repeat_string,
7916 if (info_type == 2) { /* Is this a String? */
7917 uni_to_string(get_finfo_value_string(finfo), get_finfo_length(finfo), non_uni_string);
7918 col_append_fstr(pinfo->cinfo, COL_INFO,
7919 (const gchar*) ncp_rec->req_info_str->repeat_string,
7924 col_append_fstr(pinfo->cinfo, COL_INFO,
7925 (const gchar*) ncp_rec->req_info_str->repeat_string,
7926 get_finfo_value_string(finfo));
7932 col_append_fstr(pinfo->cinfo, COL_INFO,
7933 (const gchar*) ncp_rec->req_info_str->repeat_string,
7934 get_finfo_value_integer(finfo));
7939 /* Store NCP request specific flags for manual dissection */
7940 if ((func == 0x57 || func == 0x59) && subfunc == 0x14 && ncp_tree && request_value) {
7941 char ret_info_string[16];
7942 char ret_info_string_ext[16];
7944 build_expert_data(ncp_tree, "ncp.ret_info_mask", ret_info_string, 0, FALSE);
7945 request_value->req_mask = atoi(ret_info_string);
7946 build_expert_data(ncp_tree, "ncp.ext_info", ret_info_string_ext, 0, FALSE);
7947 request_value->req_mask_ext = atoi(ret_info_string_ext);
7949 /* NCP function 89/6 passes either ASCII or UTF8 data */
7950 /* Decode manually since it is not possible to SREC the request */
7951 /* packets from the python code */
7952 if (func == 0x59 && subfunc == 0x6) {
7953 dissect_ncp_89_6_request(tvb, ncp_tree, 22);
7955 /* Check to see if we need to report to the expert table */
7956 trap_for_expert_event(ncp_tree, pinfo, ncp_rec, 0);
7957 /* Free the temporary proto_tree */
7958 CLEANUP_CALL_AND_POP;
7960 /* Re-throw any exception. */
7961 if (except_code != 0)
7962 THROW_MESSAGE(except_code, message);
7967 dissect_nds_ping_reply(tvbuff_t *tvb, packet_info *pinfo _U_,
7968 proto_tree *ncp_tree, ncp_req_hash_value *request_value)
7970 nw_uni_t reply_buffer;
7971 guint8 ping_version;
7972 guint32 nds_string_len;
7980 reply_buffer.buffer[0] = '\0';
7982 ping_version = tvb_get_guint8(tvb, 8);
7983 proto_tree_add_item(ncp_tree, hf_ping_version, tvb, 8, 1, TRUE);
7984 if (ping_version == 9) {
7985 nds_string_len = tvb_get_ntohl(tvb, 9);
7986 nds_offset = nds_string_len+16;
7987 tvb_ensure_bytes_exist(tvb, 16, nds_string_len);
7988 proto_tree_add_item(ncp_tree, hf_nds_tree_name, tvb, 16, nds_string_len, FALSE);
7989 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, FALSE);
7990 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, (nds_offset+4), 4, FALSE);
7991 proto_tree_add_item(ncp_tree, hf_nds_reply_flags, tvb, (nds_offset+8), 4, TRUE);
7995 nds_flags = request_value->req_nds_flags;
7996 bvalue = 0x00000001;
7998 for (i = 0 ; i < 32; i++ ) {
7999 if (nds_flags & bvalue)
8003 case 0x00000001: /* Supported Fields */
8004 pvalues[0].vvalue = tvb_get_letohs(tvb, nds_offset);
8005 pvalues[0].vtype = VTYPE_BITFIELD;
8006 pvalues[0].vstring = "";
8007 pvalues[0].vdesc = "Ping (low) Flags:";
8008 pvalues[0].vlength = 2;
8009 pvalues[0].hfname= hf_nds_rflags;
8010 pvalues[0].voffset = nds_offset;
8011 pvalues[0].bit1 = "Supported Fields";
8012 pvalues[0].bit1hfname = hf_bit1pingflags1;
8013 pvalues[0].bit2 = "Depth";
8014 pvalues[0].bit2hfname = hf_bit2pingflags1;
8015 pvalues[0].bit3 = "Build Number";
8016 pvalues[0].bit3hfname = hf_bit3pingflags1;
8017 pvalues[0].bit4 = "Flags";
8018 pvalues[0].bit4hfname = hf_bit4pingflags1;
8019 pvalues[0].bit5 = "Verification Flags";
8020 pvalues[0].bit5hfname = hf_bit5pingflags1;
8021 pvalues[0].bit6 = "Letter Version";
8022 pvalues[0].bit6hfname = hf_bit6pingflags1;
8023 pvalues[0].bit7 = "OS Version";
8024 pvalues[0].bit7hfname = hf_bit7pingflags1;
8025 pvalues[0].bit8 = "License Flags";
8026 pvalues[0].bit8hfname = hf_bit8pingflags1;
8027 pvalues[0].bit9 = "DS Time";
8028 pvalues[0].bit9hfname = hf_bit9pingflags1;
8029 pvalues[0].bit10 = "Server Time";
8030 pvalues[0].bit10hfname = hf_bit10pingflags1;
8031 pvalues[0].bit11 = "Create Time";
8032 pvalues[0].bit11hfname = hf_bit11pingflags1;
8033 pvalues[0].bit12 = "Not Defined";
8034 pvalues[0].bit12hfname = hf_bit12pingflags1;
8035 pvalues[0].bit13 = "Not Defined";
8036 pvalues[0].bit13hfname = hf_bit13pingflags1;
8037 pvalues[0].bit14 = "Not Defined";
8038 pvalues[0].bit14hfname = hf_bit14pingflags1;
8039 pvalues[0].bit15 = "Not Defined";
8040 pvalues[0].bit15hfname = hf_bit15pingflags1;
8041 pvalues[0].bit16 = "Not Defined";
8042 pvalues[0].bit16hfname = hf_bit16pingflags1;
8044 process_bitfield(ncp_tree, tvb, &pvalues[0]);
8047 pvalues[0].vvalue = tvb_get_letohs(tvb, nds_offset);
8048 pvalues[0].vtype = VTYPE_BITFIELD;
8049 pvalues[0].vstring = "";
8050 pvalues[0].vdesc = "Ping (high) Flags:";
8051 pvalues[0].vlength = 2;
8052 pvalues[0].hfname= hf_nds_rflags;
8053 pvalues[0].voffset = nds_offset;
8054 pvalues[0].bit1 = "Sap Name";
8055 pvalues[0].bit1hfname = hf_bit1pingflags2;
8056 pvalues[0].bit2 = "Tree Name";
8057 pvalues[0].bit2hfname = hf_bit2pingflags2;
8058 pvalues[0].bit3 = "OS Name";
8059 pvalues[0].bit3hfname = hf_bit3pingflags2;
8060 pvalues[0].bit4 = "Hardware Name";
8061 pvalues[0].bit4hfname = hf_bit4pingflags2;
8062 pvalues[0].bit5 = "Vendor Name";
8063 pvalues[0].bit5hfname = hf_bit5pingflags2;
8064 pvalues[0].bit6 = "Not Defined";
8065 pvalues[0].bit6hfname = hf_bit6pingflags2;
8066 pvalues[0].bit7 = "Not Defined";
8067 pvalues[0].bit7hfname = hf_bit7pingflags2;
8068 pvalues[0].bit8 = "Not Defined";
8069 pvalues[0].bit8hfname = hf_bit8pingflags2;
8070 pvalues[0].bit9 = "Not Defined";
8071 pvalues[0].bit9hfname = hf_bit9pingflags2;
8072 pvalues[0].bit10 = "Not Defined";
8073 pvalues[0].bit10hfname = hf_bit10pingflags2;
8074 pvalues[0].bit11 = "Not Defined";
8075 pvalues[0].bit11hfname = hf_bit11pingflags2;
8076 pvalues[0].bit12 = "Not Defined";
8077 pvalues[0].bit12hfname = hf_bit12pingflags2;
8078 pvalues[0].bit13 = "Not Defined";
8079 pvalues[0].bit13hfname = hf_bit13pingflags2;
8080 pvalues[0].bit14 = "Not Defined";
8081 pvalues[0].bit14hfname = hf_bit14pingflags2;
8082 pvalues[0].bit15 = "Not Defined";
8083 pvalues[0].bit15hfname = hf_bit15pingflags2;
8084 pvalues[0].bit16 = "Not Defined";
8085 pvalues[0].bit16hfname = hf_bit16pingflags2;
8087 process_bitfield(ncp_tree, tvb, &pvalues[0]);
8091 proto_tree_add_item(ncp_tree, hf_nds_reply_depth, tvb, nds_offset, 4, TRUE);
8095 proto_tree_add_item(ncp_tree, hf_nds_reply_rev, tvb, nds_offset, 4, TRUE);
8099 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8100 pvalues[0].vtype = VTYPE_BITFIELD;
8101 pvalues[0].vstring = "";
8102 pvalues[0].vdesc = "Pong Data Flags:";
8103 pvalues[0].vlength = 4;
8104 pvalues[0].hfname= hf_nds_rflags;
8105 pvalues[0].voffset = nds_offset;
8106 pvalues[0].bit1 = "Root Most Master Replica";
8107 pvalues[0].bit1hfname = hf_bit1pingpflags1;
8108 pvalues[0].bit2 = "Time Synchronized?";
8109 pvalues[0].bit2hfname = hf_bit2pingpflags1;
8110 pvalues[0].bit3 = "Time Valid?";
8111 pvalues[0].bit3hfname = hf_bit3pingpflags1;
8112 pvalues[0].bit4 = "DS Time Synchronized?";
8113 pvalues[0].bit4hfname = hf_bit4pingpflags1;
8114 pvalues[0].bit5 = "Agent Has All Replicas?";
8115 pvalues[0].bit5hfname = hf_bit5pingpflags1;
8116 pvalues[0].bit6 = "Not Defined";
8117 pvalues[0].bit6hfname = hf_bit6pingpflags1;
8118 pvalues[0].bit7 = "Not Defined";
8119 pvalues[0].bit7hfname = hf_bit7pingpflags1;
8120 pvalues[0].bit8 = "Not Defined";
8121 pvalues[0].bit8hfname = hf_bit8pingpflags1;
8122 pvalues[0].bit9 = "Not Defined";
8123 pvalues[0].bit9hfname = hf_bit9pingpflags1;
8124 pvalues[0].bit10 = "Not Defined";
8125 pvalues[0].bit10hfname = hf_bit10pingpflags1;
8126 pvalues[0].bit11 = "Not Defined";
8127 pvalues[0].bit11hfname = hf_bit11pingpflags1;
8128 pvalues[0].bit12 = "Not Defined";
8129 pvalues[0].bit12hfname = hf_bit12pingpflags1;
8130 pvalues[0].bit13 = "Not Defined";
8131 pvalues[0].bit13hfname = hf_bit13pingpflags1;
8132 pvalues[0].bit14 = "Not Defined";
8133 pvalues[0].bit14hfname = hf_bit14pingpflags1;
8134 pvalues[0].bit15 = "Not Defined";
8135 pvalues[0].bit15hfname = hf_bit15pingpflags1;
8136 pvalues[0].bit16 = "Not Defined";
8137 pvalues[0].bit16hfname = hf_bit16pingpflags1;
8139 process_bitfield(ncp_tree, tvb, &pvalues[0]);
8143 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8144 pvalues[0].vtype = VTYPE_BITFIELD;
8145 pvalues[0].vstring = "";
8146 pvalues[0].vdesc = "Verification Flags:";
8147 pvalues[0].vlength = 4;
8148 pvalues[0].hfname= hf_nds_rflags;
8149 pvalues[0].voffset = nds_offset;
8150 pvalues[0].bit1 = "Checksum Verification";
8151 pvalues[0].bit1hfname = hf_bit1pingvflags1;
8152 pvalues[0].bit2 = "CRC32 Verification";
8153 pvalues[0].bit2hfname = hf_bit2pingvflags1;
8154 pvalues[0].bit3 = "Server Verification Enforced";
8155 pvalues[0].bit3hfname = hf_bit3pingvflags1;
8156 pvalues[0].bit4 = "Not Defined";
8157 pvalues[0].bit4hfname = hf_bit4pingvflags1;
8158 pvalues[0].bit5 = "Not Defined";
8159 pvalues[0].bit5hfname = hf_bit5pingvflags1;
8160 pvalues[0].bit6 = "Not Defined";
8161 pvalues[0].bit6hfname = hf_bit6pingvflags1;
8162 pvalues[0].bit7 = "Not Defined";
8163 pvalues[0].bit7hfname = hf_bit7pingvflags1;
8164 pvalues[0].bit8 = "Not Defined";
8165 pvalues[0].bit8hfname = hf_bit8pingvflags1;
8166 pvalues[0].bit9 = "Not Defined";
8167 pvalues[0].bit9hfname = hf_bit9pingvflags1;
8168 pvalues[0].bit10 = "Not Defined";
8169 pvalues[0].bit10hfname = hf_bit10pingvflags1;
8170 pvalues[0].bit11 = "Not Defined";
8171 pvalues[0].bit11hfname = hf_bit11pingvflags1;
8172 pvalues[0].bit12 = "Not Defined";
8173 pvalues[0].bit12hfname = hf_bit12pingvflags1;
8174 pvalues[0].bit13 = "Not Defined";
8175 pvalues[0].bit13hfname = hf_bit13pingvflags1;
8176 pvalues[0].bit14 = "Not Defined";
8177 pvalues[0].bit14hfname = hf_bit14pingvflags1;
8178 pvalues[0].bit15 = "Not Defined";
8179 pvalues[0].bit15hfname = hf_bit15pingvflags1;
8180 pvalues[0].bit16 = "Not Defined";
8181 pvalues[0].bit16hfname = hf_bit16pingvflags1;
8183 process_bitfield(ncp_tree, tvb, &pvalues[0]);
8187 proto_tree_add_item(ncp_tree, hf_nds_letter_ver, tvb, nds_offset, 4, TRUE);
8191 proto_tree_add_item(ncp_tree, hf_nds_os_majver, tvb, nds_offset, 4, TRUE);
8193 proto_tree_add_item(ncp_tree, hf_nds_os_minver, tvb, nds_offset, 4, TRUE);
8195 proto_tree_add_item(ncp_tree, hf_ncp_os_revision, tvb, nds_offset, 4, TRUE);
8199 proto_tree_add_item(ncp_tree, hf_nds_lic_flags, tvb, nds_offset, 4, TRUE);
8203 ns.secs = tvb_get_letohl(tvb, nds_offset);
8205 proto_tree_add_time(ncp_tree, hf_nds_ds_time, tvb, nds_offset, 4, &ns);
8209 ns.secs = tvb_get_letohl(tvb, nds_offset);
8211 proto_tree_add_time(ncp_tree, hf_nds_svr_time, tvb, nds_offset, 4, &ns);
8215 ns.secs = tvb_get_letohl(tvb, nds_offset);
8217 proto_tree_add_time(ncp_tree, hf_nds_crt_time, tvb, nds_offset, 4, &ns);
8221 if(tvb_get_guint8(tvb, nds_offset) == 0x00)
8225 nds_string_len = tvb_get_letohl(tvb, nds_offset);
8227 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
8228 tvb_ensure_bytes_exist(tvb, nds_offset, nds_string_len);
8229 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "SAP Name: %s", reply_buffer.buffer);
8230 nds_offset += nds_string_len;
8231 nds_offset += align_4(tvb, nds_offset);
8234 if(tvb_get_guint8(tvb, nds_offset) == 0x00)
8238 nds_string_len = tvb_get_letohl(tvb, nds_offset);
8240 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
8241 tvb_ensure_bytes_exist(tvb, nds_offset, nds_string_len);
8242 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "NDS Tree Name: %s", reply_buffer.buffer);
8243 nds_offset += nds_string_len;
8244 nds_offset += align_4(tvb, nds_offset);
8247 if(tvb_get_guint8(tvb, nds_offset) == 0x00)
8251 nds_string_len = tvb_get_letohl(tvb, nds_offset);
8253 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
8254 tvb_ensure_bytes_exist(tvb, nds_offset, nds_string_len);
8255 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "OS Name: %s", reply_buffer.buffer);
8256 nds_offset += nds_string_len;
8257 nds_offset += align_4(tvb, nds_offset);
8260 if(tvb_get_guint8(tvb, nds_offset) == 0x00)
8264 nds_string_len = tvb_get_letohl(tvb, nds_offset);
8266 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
8267 tvb_ensure_bytes_exist(tvb, nds_offset, nds_string_len);
8268 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "Hardware Name: %s", reply_buffer.buffer);
8269 nds_offset += nds_string_len;
8270 nds_offset += align_4(tvb, nds_offset);
8273 if(tvb_get_guint8(tvb, nds_offset) == 0x00)
8277 nds_string_len = tvb_get_letohl(tvb, nds_offset);
8279 get_string(tvb, nds_offset, nds_string_len, reply_buffer.buffer);
8280 tvb_ensure_bytes_exist(tvb, nds_offset, nds_string_len);
8281 proto_tree_add_text(ncp_tree, tvb, nds_offset, nds_string_len, "Vendor Name: %s", reply_buffer.buffer);
8282 nds_offset += nds_string_len;
8283 nds_offset += align_4(tvb, nds_offset);
8295 dissect_nds_reply(tvbuff_t *tvb, packet_info *pinfo,
8296 proto_tree *ncp_tree, guint32 nds_error_code,
8297 const char *nds_error_string, ncp_req_hash_value *request_value,
8298 conversation_t *conversation)
8301 guint32 nds_reply_buffer;
8303 const char *verb_string;
8305 char string_buffer[9][1024];
8306 gboolean resolve_eid=FALSE;
8307 guint32 global_eid=0;
8308 gboolean add_eid = FALSE;
8309 char global_object_name[256];
8310 ncp_req_eid_hash_value *request_eid_value = NULL;
8313 global_object_name[0] = '\0';
8317 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
8318 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_size, tvb, nds_offset,
8319 4, nds_reply_buffer);
8321 nds_frag = tvb_get_letohl(tvb, nds_offset);
8322 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, nds_offset,
8326 * Is the possibly-reassembled reply large enough to have a completion
8327 * code? (We can't check the fragment size as this might just be the
8330 if (tvb_reported_length_remaining(tvb, nds_offset) >= 4)
8332 /* Yes - process the completion code. */
8333 expert_item = proto_tree_add_uint_format(ncp_tree, hf_nds_reply_error, tvb, nds_offset,
8334 4, nds_error_code, "NDS Completion Code: 0x%08x, %s",
8335 nds_error_code, nds_error_string);
8337 if (nds_error_code != 0 && ncp_echo_err) {
8338 expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "NDS Error: 0x%08x %s", nds_error_code, nds_error_string);
8341 if (request_value && nds_error_code == 0x00000000)
8344 for (i = 0; i < 9; i++) {
8345 pvalues[i].vtype = 0;
8346 pvalues[i].vvalue = 0;
8347 pvalues[i].vlength = 0;
8348 pvalues[i].voffset = 0;
8349 pvalues[i].hfname = 0;
8350 pvalues[i].vdesc = "";
8351 string_buffer[i][0] = '\0';
8352 pvalues[i].vstring = string_buffer[i];
8353 pvalues[i].mvtype = 0;
8355 verb_string = val_to_str(request_value->nds_request_verb,
8356 ncp_nds_verb_vals, "Continuation Fragment");
8357 if(request_value->req_nds_prot_flags & 0x4000)
8359 /* CRC is included in the NDS header so justify the offset */
8360 proto_tree_add_item(ncp_tree, hf_nds_crc, tvb, nds_offset, 4, TRUE);
8363 switch (request_value->nds_request_verb)
8366 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8367 pvalues[0].vstring = (char *)match_strval(pvalues[0].vvalue, nds_tags);
8368 if(pvalues[0].vstring == NULL)
8370 pvalues[0].vstring = "No Tags Set";
8372 pvalues[0].vtype = VTYPE_STRING;
8373 pvalues[0].vdesc = "Tag: %s";
8374 pvalues[0].vlength = 4;
8375 pvalues[0].voffset = nds_offset;
8376 pvalues[0].hfname = hf_nds_tag_string;
8377 nds_offset = nds_offset+pvalues[0].vlength;
8378 switch(pvalues[0].vvalue)
8380 case NDS_TAG_NO_SUCH_ENTRY:
8382 case NDS_TAG_LOCAL_ENTRY:
8383 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8384 pvalues[1].vtype = VTYPE_UINT32;
8385 pvalues[1].vdesc = "Entry ID: 0x%08x";
8388 g_strlcpy(global_object_name, request_value->object_name, 256);
8389 global_eid = pvalues[1].vvalue;
8390 pvalues[1].vlength = 4;
8391 pvalues[1].voffset = nds_offset;
8392 pvalues[1].hfname = hf_nds_eid;
8393 nds_offset = nds_offset+pvalues[1].vlength;
8394 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
8395 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
8396 pvalues[2].vdesc = "Referral Records: %u";
8397 pvalues[2].vlength = 4;
8398 pvalues[2].voffset = nds_offset;
8399 pvalues[2].hfname = hf_nds_referrals;
8400 pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
8402 case NDS_TAG_REMOTE_ENTRY:
8403 nds_offset += 4; /* GUINT32 reserved field */
8404 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8405 pvalues[1].vtype = VTYPE_UINT32;
8406 pvalues[1].vdesc = "Entry ID: 0x%08x";
8407 pvalues[1].vlength = 4;
8408 pvalues[1].voffset = nds_offset;
8409 pvalues[1].hfname = hf_nds_eid;
8410 nds_offset = nds_offset+pvalues[1].vlength;
8411 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
8412 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
8413 pvalues[2].vdesc = "Referral Records: %u";
8414 pvalues[2].vlength = 4;
8415 pvalues[2].voffset = nds_offset;
8416 pvalues[2].hfname = hf_nds_referrals;
8417 pvalues[2].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
8419 case NDS_TAG_ALIAS_ENTRY:
8420 pvalues[1].vtype = VTYPE_STRING;
8421 pvalues[1].vdesc = "Alias Name: %s";
8422 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
8423 pvalues[1].vvalue = 0;
8424 pvalues[1].vlength = 256;
8425 pvalues[1].vlength = tvb_get_letohl(tvb, nds_offset);
8426 if (pvalues[1].vlength == 0x00)
8428 pvalues[1].vtype = VTYPE_NONE;
8431 pvalues[1].voffset = nds_offset+4;
8433 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, pvalues[1].vstring);
8434 nds_offset += pvalues[1].vlength;
8435 nds_offset += align_4(tvb, nds_offset);
8436 pvalues[1].hfname= hf_nds_name;
8438 case NDS_TAG_REFERRAL_INFORMATION:
8439 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8440 pvalues[1].vtype = VTYPE_UINT32;
8441 pvalues[1].vdesc = "Distance Object is From Root: 0x%08x";
8442 pvalues[1].vlength = 4;
8443 pvalues[1].voffset = nds_offset;
8444 pvalues[1].hfname = hf_nds_eid;
8445 nds_offset = nds_offset+pvalues[1].vlength;
8446 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
8447 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
8448 pvalues[2].vdesc = "Referral Records: %u";
8449 pvalues[2].vlength = 4;
8450 pvalues[2].voffset = nds_offset;
8451 pvalues[2].hfname = hf_nds_depth;
8452 pvalues[2].mvtype = MVTYPE_ADDR_REFERRAL_REPLY;
8454 case NDS_TAG_ENTRY_AND_REFERRALS:
8455 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8456 pvalues[1].vtype = VTYPE_UINT32;
8457 pvalues[1].vdesc = "Result Flags: 0x%08x";
8458 pvalues[1].vlength = 4;
8459 pvalues[1].voffset = nds_offset;
8460 pvalues[1].hfname = hf_nds_result_flags;
8461 nds_offset = nds_offset+pvalues[1].vlength;
8462 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
8463 pvalues[2].vtype = VTYPE_UINT32;
8464 pvalues[2].vdesc = "Entry ID: 0x%08x";
8467 global_eid = pvalues[2].vvalue;
8468 g_strlcpy(global_object_name, request_value->object_name, 256);
8469 pvalues[2].vlength = 4;
8470 pvalues[2].voffset = nds_offset;
8471 pvalues[2].hfname = hf_nds_eid;
8472 nds_offset = nds_offset+pvalues[2].vlength;
8473 pvalues[3].vvalue = tvb_get_letohl(tvb, nds_offset);
8474 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
8475 pvalues[3].vdesc = "Referral Records: %u";
8476 pvalues[3].vlength = 4;
8477 pvalues[3].voffset = nds_offset;
8478 pvalues[3].mvtype = MVTYPE_ADDR_REFERRAL_REPLY;
8479 pvalues[3].hfname = hf_nds_referrals;
8487 pvalues[0].vvalue = 1;
8488 pvalues[0].vtype = VTYPE_MULTIVALUE_UINT32;
8489 pvalues[0].vdesc = "Entry Information";
8490 pvalues[0].vlength = 0;
8491 pvalues[0].voffset = nds_offset;
8492 pvalues[0].hfname = hf_nds_name;
8493 pvalues[0].mvtype = MVTYPE_LIST_PARTITIONS;
8494 pvalues[0].vflags = request_value->req_nds_flags;
8497 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8498 pvalues[0].vtype = VTYPE_UINT32;
8499 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
8500 pvalues[0].vlength = 4;
8501 pvalues[0].voffset = nds_offset;
8502 pvalues[0].hfname = hf_nds_iteration;
8503 nds_offset = nds_offset+pvalues[0].vlength;
8504 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8505 pvalues[1].vstring = (char *)match_strval(pvalues[1].vvalue, nds_info_type);
8506 if(pvalues[1].vstring == NULL)
8508 pvalues[1].vstring = "No Info Type Set";
8510 pvalues[1].vtype = VTYPE_STRING;
8511 pvalues[1].vdesc = "Info Type: %s";
8512 pvalues[1].vlength = 4;
8513 pvalues[1].voffset = nds_offset;
8514 pvalues[1].hfname = hf_nds_info_type;
8515 nds_offset = nds_offset+pvalues[1].vlength;
8516 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
8517 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
8518 pvalues[2].vdesc = "Number of Attributes: %u";
8519 pvalues[2].vlength = 4;
8520 pvalues[2].voffset = nds_offset;
8521 pvalues[2].hfname = hf_nds_attr;
8522 pvalues[2].mvtype = MVTYPE_ATTR_REPLY;
8523 pvalues[2].vflags = request_value->req_nds_flags;
8524 pvalues[2].nds_version = request_value->nds_version;
8527 pvalues[0].vvalue = tvb_get_guint8(tvb, nds_offset);
8528 if (pvalues[0].vvalue == 0)
8530 pvalues[0].vstring = "Did Not Match";
8534 pvalues[0].vstring = "Matched";
8536 pvalues[0].vtype = VTYPE_STRING;
8537 pvalues[0].vdesc = "Compare Values Returned - %s";
8538 pvalues[0].vlength = 1;
8539 pvalues[0].voffset = nds_offset;
8540 pvalues[0].mvtype = 0;
8541 pvalues[0].hfname= hf_nds_compare_results;
8542 nds_offset += pvalues[0].vlength;
8545 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8546 pvalues[0].vtype = VTYPE_UINT32;
8547 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
8548 pvalues[0].vlength = 4;
8549 pvalues[0].voffset = nds_offset;
8550 pvalues[0].hfname = hf_nds_iteration;
8551 nds_offset = nds_offset+pvalues[0].vlength;
8552 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8553 pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
8554 pvalues[1].vdesc = "Entry Information";
8555 pvalues[1].vlength = 0;
8556 pvalues[1].voffset = nds_offset;
8557 pvalues[1].hfname = hf_nds_name;
8558 pvalues[1].mvtype = MVTYPE_LIST_PARTITIONS;
8559 pvalues[1].vflags = request_value->req_nds_flags;
8580 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8581 pvalues[0].vtype = VTYPE_UINT32;
8582 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
8583 pvalues[0].vlength = 4;
8584 pvalues[0].voffset = nds_offset;
8585 pvalues[0].hfname = hf_nds_iteration;
8586 nds_offset = nds_offset+pvalues[0].vlength;
8587 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8588 pvalues[1].vstring = (char *)match_strval(pvalues[1].vvalue, class_def_type);
8589 if(pvalues[1].vstring == NULL)
8591 pvalues[1].vstring = "No Class Definition Type Set";
8593 pvalues[1].vtype = VTYPE_STRING;
8594 pvalues[1].vdesc = "Class Definition Type: %s";
8595 pvalues[1].vlength = 4;
8596 pvalues[1].voffset = nds_offset;
8597 pvalues[1].mvtype = 0;
8598 pvalues[1].hfname= hf_nds_class_def_type;
8599 nds_offset = nds_offset + pvalues[1].vlength;
8600 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);;
8601 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
8602 pvalues[2].vdesc = "Class Definitions %u";
8603 pvalues[2].vlength = 0;
8604 pvalues[2].voffset = nds_offset;
8605 pvalues[2].hfname = hf_nds_classes;
8606 pvalues[2].mvtype = MVTYPE_CLASS_NAMES;
8607 pvalues[2].vflags = request_value->req_nds_flags;
8614 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8615 pvalues[0].vtype = VTYPE_UINT32;
8616 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
8617 pvalues[0].vlength = 4;
8618 pvalues[0].voffset = nds_offset;
8619 pvalues[0].hfname = hf_nds_iteration;
8620 nds_offset = nds_offset+pvalues[0].vlength;
8621 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8622 pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
8623 pvalues[1].vdesc = "Classes: %u";
8624 pvalues[1].vlength = 4;
8625 pvalues[1].voffset = nds_offset;
8626 pvalues[1].mvtype = MVTYPE_READ_CLASS_REQ;
8627 pvalues[1].hfname= hf_nds_classes;
8630 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8631 pvalues[0].vtype = VTYPE_UINT32;
8632 pvalues[0].vdesc = "Privileges: 0x%08x";
8633 pvalues[0].vlength = 4;
8634 pvalues[0].voffset = nds_offset;
8635 pvalues[0].hfname = hf_nds_privileges;
8636 nds_offset = nds_offset+pvalues[0].vlength;
8643 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8644 pvalues[0].vtype = VTYPE_UINT32;
8645 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
8646 pvalues[0].vlength = 4;
8647 pvalues[0].voffset = nds_offset;
8648 pvalues[0].hfname = hf_nds_iteration;
8649 nds_offset = nds_offset+pvalues[0].vlength;
8650 pvalues[1].vtype = VTYPE_STRING;
8651 pvalues[1].vdesc = "Server Distinguished Name: %s";
8652 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
8653 pvalues[1].vvalue = 0;
8654 pvalues[1].vlength = 256;
8655 pvalues[1].vlength = tvb_get_letohl(tvb, nds_offset);
8656 if (pvalues[1].vlength == 0x00)
8658 pvalues[1].vtype = VTYPE_NONE;
8661 pvalues[1].voffset = nds_offset+4;
8663 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, pvalues[1].vstring);
8664 nds_offset += pvalues[1].vlength;
8665 nds_offset += align_4(tvb, nds_offset);
8666 pvalues[1].hfname= hf_nds_name;
8667 nds_offset += align_4(tvb, nds_offset);
8668 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
8669 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
8670 pvalues[2].vdesc = "Replicas: %u";
8671 pvalues[2].vlength = 4;
8672 pvalues[2].voffset = nds_offset;
8673 pvalues[2].hfname = hf_nds_replicas;
8674 pvalues[2].mvtype = MVTYPE_READ_REPLICAS;
8675 pvalues[2].bit1 = "Output Flags";
8676 pvalues[2].bit2 = "Entry ID";
8677 pvalues[2].bit3 = "Replica State";
8678 pvalues[2].bit4 = "Modification Timestamp";
8679 pvalues[2].bit5 = "Purge Time";
8680 pvalues[2].bit6 = "Local Partition ID";
8681 pvalues[2].bit7 = "Distinguished Name";
8682 pvalues[2].bit8 = "Replica Type";
8683 pvalues[2].bit9 = "Partition Busy";
8684 pvalues[2].vflags = request_value->req_nds_flags;
8695 pvalues[0].vvalue = tvb_get_ntohl(tvb, nds_offset);
8696 pvalues[0].vtype = VTYPE_UINT32;
8697 pvalues[0].vdesc = "File Handle: 0x%08x";
8698 pvalues[0].vlength = 4;
8699 pvalues[0].voffset = nds_offset;
8700 pvalues[0].hfname = hf_nds_file_handle;
8701 nds_offset = nds_offset+pvalues[0].vlength;
8702 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8703 pvalues[1].vtype = VTYPE_UINT32;
8704 pvalues[1].vdesc = "File Size: %u";
8705 pvalues[1].vlength = 4;
8706 pvalues[1].voffset = nds_offset;
8707 pvalues[1].hfname = hf_nds_file_size;
8708 nds_offset = nds_offset+pvalues[1].vlength;
8761 pvalues[0].vtype = VTYPE_MULTIVALUE_UINT32;
8762 pvalues[0].vdesc = "Server Name";
8763 pvalues[0].mvtype = MVTYPE_PROCESS_TAGS;
8764 pvalues[0].vflags = request_value->req_nds_flags;
8765 pvalues[0].hfname = hf_nds_svr_dst_name;
8766 pvalues[0].vlength = tvb_get_letohl(tvb, nds_offset);
8767 if (pvalues[0].vlength == 0x00)
8769 pvalues[0].vtype = VTYPE_NONE;
8772 pvalues[0].voffset = nds_offset;
8773 nds_offset += pvalues[0].vlength + 4;
8774 nds_offset += align_4(tvb, nds_offset);
8775 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8776 pvalues[1].vtype = VTYPE_MULTIVALUE_UINT32;
8777 pvalues[1].vdesc = "Referral Records: %u";
8778 pvalues[1].vlength = 4;
8779 pvalues[1].voffset = nds_offset;
8780 pvalues[1].hfname = hf_nds_referrals;
8781 pvalues[1].mvtype = MVTYPE_LOC_ADDR_REFERRAL_REPLY;
8790 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8791 pvalues[1].vtype = VTYPE_UINT32;
8792 pvalues[1].vdesc = "Entry ID: 0x%08x";
8795 g_strlcpy(global_object_name, request_value->object_name, 256);
8796 global_eid = pvalues[1].vvalue;
8797 pvalues[1].vlength = 4;
8798 pvalues[1].voffset = nds_offset;
8799 pvalues[1].hfname = hf_nds_eid;
8800 nds_offset = nds_offset+pvalues[1].vlength;
8843 pvalues[0].vvalue = tvb_get_letohl(tvb, nds_offset);
8844 pvalues[0].vtype = VTYPE_UINT32;
8845 pvalues[0].vdesc = "Iteration Handle: 0x%08x";
8846 pvalues[0].vlength = 4;
8847 pvalues[0].voffset = nds_offset;
8848 pvalues[0].hfname= hf_nds_iteration;
8849 nds_offset = nds_offset+pvalues[0].vlength;
8850 pvalues[1].vvalue = tvb_get_letohl(tvb, nds_offset);
8851 pvalues[1].vtype = VTYPE_NONE;
8852 pvalues[1].vdesc = "Iteration Completion Code: 0x%08x";
8853 pvalues[1].vlength = 4;
8854 pvalues[1].voffset = nds_offset;
8855 pvalues[1].hfname = hf_iter_completion_code;
8856 expert_item = proto_tree_add_uint_format(ncp_tree, pvalues[1].hfname, tvb, nds_offset,
8857 4, pvalues[1].vvalue, "NDS Iteration Completion Code: 0x%08x, %s",
8858 pvalues[1].vvalue, match_strval(pvalues[1].vvalue, nds_reply_errors));
8860 if (pvalues[1].vvalue != 0 && ncp_echo_err) {
8861 expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "NDS Iteration Error: 0x%08x %s", pvalues[1].vvalue, match_strval(pvalues[1].vvalue, nds_reply_errors));
8863 nds_offset = nds_offset+pvalues[1].vlength;
8864 pvalues[2].vvalue = tvb_get_letohl(tvb, nds_offset);
8865 pvalues[2].vtype = VTYPE_ITEM;
8866 pvalues[2].vlength = 4;
8867 pvalues[2].voffset = nds_offset;
8868 pvalues[2].mvtype = MVTYPE_PROCESS_ITERATOR;
8869 pvalues[2].hfname = hf_ncp_nds_iterverb;
8870 nds_offset = nds_offset + pvalues[2].vlength;
8875 if(request_value->nds_request_verb != 0)
8877 proto_tree_add_uint_format(ncp_tree,
8878 hf_ncp_nds_verb, tvb, 6, 0,
8879 request_value->nds_request_verb,
8881 request_value->nds_request_verb, verb_string);
8883 /* NDS Entry ID's (EID) is identified in the reply
8884 * packet of an NDS resolve name. We need to store
8885 * this EID and its associated name into our hash
8886 * so that we can resolve the name for other NDS
8888 if (!pinfo->fd->flags.visited) {
8891 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
8892 if (!request_eid_value) {
8893 request_eid_value = ncp_eid_hash_insert(global_eid);
8894 g_strlcpy(request_eid_value->object_name, global_object_name, 256);
8898 /* Echo EID data to expert Chat window */
8899 if (add_eid && nds_echo_eid) {
8900 expert_add_info_format(pinfo, NULL,
8901 PI_RESPONSE_CODE, PI_CHAT,
8902 "EID (%08x) = %s", global_eid, global_object_name);
8904 /* For NDS requests with just an EID, resolve name
8905 * from hash table. */
8908 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
8909 if (request_eid_value) {
8910 g_strlcpy(global_object_name, request_eid_value->object_name, 256);
8911 proto_tree_add_string_format(ncp_tree,
8912 hf_nds_name, tvb, 6, 0,
8914 "NDS Name for EID - %s",
8915 global_object_name);
8918 for (i = 0; i < 9; i++) {
8919 switch (pvalues[i].vtype) {
8921 case VTYPE_NONE: /* no value */
8925 if (pvalues[i].mvtype == MVTYPE_PROCESS_ITERATOR)
8927 dissect_nds_iterator(ncp_tree, tvb, pinfo, pvalues[i].vvalue, 0, nds_offset, FALSE);
8931 proto_tree_add_item(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8932 pvalues[i].vlength, TRUE);
8936 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8937 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
8942 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8943 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
8948 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8949 pvalues[i].vlength, pvalues[i].vvalue, pvalues[i].vdesc,
8954 proto_tree_add_string_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
8955 pvalues[i].vlength, pvalues[i].vstring, pvalues[i].vdesc,
8956 pvalues[i].vstring);
8959 case VTYPE_BITFIELD:
8960 process_bitfield(ncp_tree, tvb, &pvalues[i]);
8963 case VTYPE_MULTIVALUE_UINT32:
8964 process_multivalues(ncp_tree, tvb, pinfo, &pvalues[i]);
8968 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, pvalues[i].voffset,
8969 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
8978 dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo,
8979 guint32 nw_connection, guint8 sequence, guint16 type,
8980 proto_tree *ncp_tree, struct novell_tap *ncp_tap)
8982 conversation_t *conversation = NULL;
8983 ncp_req_hash_value *request_value = NULL;
8984 const ncp_record *ncp_rec = NULL;
8985 int *req_cond_results;
8986 guint8 completion_code=0;
8987 ptvcursor_t *ptvc = NULL;
8988 const char *error_string;
8989 guint32 nds_offset = 0;
8990 guint32 nds_error_code = 0;
8991 guint32 nds_reply_buffer = 0;
8992 const char *nds_error_string = NULL;
8995 #ifdef FAKE_TREE_IS_VISIBLE
8997 PTREE_DATA(ncp_tree)->visible=1;
9001 if (!pinfo->fd->flags.visited) {
9002 /* Find the conversation whence the request would have come. */
9003 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
9004 PT_NCP, nw_connection, nw_connection, 0);
9005 if (conversation != NULL) {
9006 /* find the record telling us the request made that caused
9008 request_value = ncp_hash_lookup(conversation, sequence);
9009 if (request_value) {
9010 ncp_rec = request_value->ncp_rec;
9012 p_add_proto_data(pinfo->fd, proto_ncp, (void*) request_value);
9014 /* else... we haven't seen an NCP Request for that conversation
9016 Create Service request packets do not contain nw_connection.
9017 The initial value is set to 65535 or 0. The reply packet has the
9018 valid connection. So, we can't find the request packet in
9019 our conversation list. To trap for this we can just perform
9020 the search again with 65535 to see if we can locate the
9021 proper request packet. */
9023 conversation = find_conversation(pinfo->fd->num,
9024 &pinfo->src, &pinfo->dst, PT_NCP, 65535, 65535, 0);
9025 if (conversation != NULL) {
9026 /* find the record telling us the request made
9027 that caused this reply */
9028 request_value = ncp_hash_lookup(conversation,
9030 if (request_value) {
9031 ncp_rec = request_value->ncp_rec;
9033 p_add_proto_data(pinfo->fd, proto_ncp,
9034 (void*) request_value);
9037 conversation = find_conversation(pinfo->fd->num,
9038 &pinfo->src, &pinfo->dst, PT_NCP, 0, 0, 0);
9039 if (conversation != NULL) {
9040 /* find the record telling us the request made
9041 that caused this reply */
9042 request_value = ncp_hash_lookup(conversation,
9044 if (request_value) {
9045 ncp_rec = request_value->ncp_rec;
9047 p_add_proto_data(pinfo->fd, proto_ncp,
9048 (void*) request_value);
9050 /* else... we haven't seen an NCP Request for that
9051 conversation and sequence. */
9056 request_value = p_get_proto_data(pinfo->fd, proto_ncp);
9057 if (request_value) {
9058 ncp_rec = request_value->ncp_rec;
9063 * Tap the packet before the dissectors are called so we
9064 * still get the tap listener called even if there is an
9067 tap_queue_packet(ncp_tap->stat, pinfo, request_value);
9069 if (check_col(pinfo->cinfo, COL_PROTOCOL)) {
9070 if (ncp_rec && ncp_rec->func==0x68 &&
9071 (ncp_rec->subfunc==0x02 || ncp_rec->subfunc==0x01)) {
9072 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
9076 /* A completion code of 0 always means OK. Non-zero means failure,
9077 * but each non-zero value has a different meaning. And the same value
9078 * can have different meanings, depending on the ncp.func (and ncp.subfunc)
9080 completion_code = tvb_get_guint8(tvb, 6);
9081 if (completion_code == 0) {
9082 if(type == NCP_POSITIVE_ACK)
9084 error_string = "Server Busy, Request Being Processed";
9088 error_string = "OK";
9091 if (ncp_rec && ncp_rec->errors) {
9092 error_string = ncp_error_string(ncp_rec->errors, completion_code);
9095 error_string = "Original Request Packet not Found";
9098 if (type == NCP_SERVICE_REPLY && ncp_rec && ncp_rec->func==0x68 &&
9099 ncp_rec->subfunc==0x02 && (tvb_reported_length_remaining(tvb, 8) >= 8))
9102 nds_reply_buffer = tvb_get_letohl(tvb, nds_offset);
9104 nds_frag = tvb_get_letohl(tvb, nds_offset);
9107 * Is the possibly-reassembled reply large enough to have
9108 * a completion code? (We can't check the fragment size
9109 * as this might just be the last fragment.)
9111 if (tvb_reported_length_remaining(tvb, nds_offset) >= 4)
9113 /* Yes - process the completion code. */
9114 nds_error_code = tvb_get_letohl(tvb, nds_offset);
9115 nds_error_string = match_strval(nds_error_code, nds_reply_errors);
9116 if (nds_error_string == NULL)
9118 nds_error_string = "NDS Error - No Definition Found";
9122 if (check_col(pinfo->cinfo, COL_INFO)) {
9123 col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
9124 type == NCP_SERVICE_REPLY ? "R" : "ACK",
9125 nds_error_string ? nds_error_string : error_string);
9130 if (request_value) {
9133 proto_tree_add_uint(ncp_tree, hf_ncp_req_frame_num, tvb, 0, 0,
9134 request_value->req_frame_num);
9135 nstime_delta(&ns, &pinfo->fd->abs_ts, &request_value->req_frame_time);
9136 proto_tree_add_time(ncp_tree, hf_ncp_req_frame_time, tvb, 0, 0, &ns);
9139 /* Put the func (and maybe subfunc) from the request packet
9140 * in the proto tree, but hidden. That way filters on ncp.func
9141 * or ncp.subfunc will find both the requests and the replies.
9144 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 0,
9145 ncp_rec->func, "Function: %u (0x%02X), %s",
9146 ncp_rec->func, ncp_rec->func, ncp_rec->name);
9147 if (ncp_requires_subfunc(ncp_rec->func)) {
9148 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 6, 0,
9149 ncp_rec->subfunc, "SubFunction: %u (0x%02x)",
9150 ncp_rec->subfunc, ncp_rec->subfunc);
9155 expert_item = proto_tree_add_uint_format(ncp_tree, hf_ncp_completion_code, tvb, 6, 1,
9156 completion_code, "Completion Code: %d (0x89%02x), %s",
9157 completion_code, completion_code, error_string);
9158 if ((completion_code != 0 || type == NCP_POSITIVE_ACK) && ncp_echo_err) {
9159 expert_add_info_format(pinfo, expert_item,
9160 PI_RESPONSE_CODE, PI_ERROR,
9161 "Error: %d (0x89%02x) %s", completion_code,
9162 completion_code, error_string);
9168 conn_stat = tvb_get_guint8(tvb, 7);
9169 expert_item = proto_tree_add_item(ncp_tree, hf_ncp_connection_status, tvb,
9171 if (conn_stat != 0 && conn_stat != 0x40 ) {
9172 if (check_col(pinfo->cinfo, COL_INFO)) {
9173 col_set_str(pinfo->cinfo, COL_INFO,
9174 "Error: Bad Connection Status");
9177 expert_add_info_format(pinfo, expert_item,
9178 PI_RESPONSE_CODE, PI_ERROR,
9179 "Error: Bad Connection Status");
9185 * Unless this is a successful reply, that's all there
9188 if (type != NCP_SERVICE_REPLY || completion_code != 0)
9192 /* Dissect SSS Reply packets */
9193 if (ncp_rec->func == 0x5c && request_value)
9195 dissect_sss_reply(tvb, pinfo, ncp_tree, ncp_rec->subfunc, request_value);
9197 /* Dissect NMAS Reply packets */
9198 if (ncp_rec->func == 0x5e && request_value)
9200 dissect_nmas_reply(tvb, pinfo, ncp_tree, ncp_rec->func, ncp_rec->subfunc, request_value);
9202 /* Dissect NDS Ping packets */
9203 if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x01)
9205 dissect_nds_ping_reply(tvb, pinfo, ncp_tree,
9208 /* Dissect NDS Reply packets */
9209 if (ncp_rec->func == 0x68 && ncp_rec->subfunc == 0x02)
9211 dissect_nds_reply(tvb, pinfo, ncp_tree, nds_error_code,
9212 nds_error_string, request_value, conversation);
9214 /* Due to lack of group repeat fields in reply structure, decode this ncp 87/20 reply manually here. */
9215 if ((ncp_rec->func == 0x57 || ncp_rec->func == 0x59) && ncp_rec->subfunc == 0x14) {
9216 dissect_ncp_8x20reply(tvb, ncp_tree, ncp_rec, request_value);
9218 /* Process ncp 23/26 address records manually to format correctly. */
9219 if (ncp_rec->func == 0x17 && ncp_rec->subfunc == 0x1a) {
9220 dissect_ncp_23_26_reply(tvb, ncp_tree);
9222 if (ncp_rec->func == 5 && ncp_echo_conn) {
9223 expert_add_info_format(pinfo, NULL, PI_RESPONSE_CODE, PI_CHAT, "Connection Destroyed");
9225 if (ncp_rec->reply_ptvc) {
9226 /* If we're not building a protocol tree, quit;
9227 * "process_ptvc_record()" assumes we're building
9228 * a protocol tree, and we don't support putting
9229 * stuff in the Info column in replies, and no
9230 * state information is currently updated for
9231 * replies by "process_ptvc_record()", so we
9232 * can't, and don't have a reason to, dissect
9233 * any further if we're not building a protocol
9238 /* If a non-zero completion code was found, it is
9239 * legal to not have any fields, even if the packet
9240 * type is defined as having fields.
9242 * XXX - we already know that the completion code
9243 * is 0, as we checked it above. Is there any
9244 * reason why we'd want to do a full dissection
9245 * if the completion code isn't 0? */
9246 if (completion_code != 0 && tvb_length(tvb) == 8) {
9250 /* Any request condition results? */
9251 if (request_value) {
9252 req_cond_results = request_value->req_cond_results;
9255 req_cond_results = NULL;
9257 clear_repeat_vars();
9258 ptvc = ptvcursor_new(ncp_tree, tvb, 8);
9259 process_ptvc_record(ptvc, ncp_rec->reply_ptvc,
9260 req_cond_results, TRUE, ncp_rec);
9261 ptvcursor_free(ptvc);
9263 /* Echo the NDS EID and name for NCP 22,51 replies to expert tap */
9264 if (!pinfo->fd->flags.visited && ncp_rec->func == 0x16 && ncp_rec->subfunc == 0x33) {
9266 char eid_string[10];
9267 char global_object_name[256];
9269 build_expert_data(ncp_tree, "ncp.directory_services_object_id", eid_string, 0, TRUE);
9270 build_expert_data(ncp_tree, "ncp.volume_name_len", global_object_name, 0, FALSE);
9272 /* Echo EID data to expert Chat window */
9274 expert_add_info_format(pinfo, NULL,
9275 PI_RESPONSE_CODE, PI_CHAT,
9276 "EID (%s) = %s", eid_string, global_object_name);
9279 /* Process ncp 123/17 address records manually to format correctly. */
9280 if (ncp_rec->func == 0x7b && ncp_rec->subfunc == 0x11) {
9281 dissect_ncp_123_17_reply(tvb, ncp_tree);
9283 /* Process ncp 123/11 NLM names manually to format correctly. */
9284 if (ncp_rec->func == 0x7b && ncp_rec->subfunc == 0x0b && request_value) {
9285 dissect_ncp_123_11_reply(tvb, ncp_tree, request_value);
9287 /* Process ncp 123/62 server set parameter values manually to format correctly. */
9288 if (ncp_rec->func == 0x7b && ncp_rec->subfunc == 0x3e) {
9289 dissect_ncp_123_62_reply(tvb, ncp_tree);
9292 /* Check to see if we need to report to the expert table */
9293 trap_for_expert_event(ncp_tree, pinfo, ncp_rec, 1);
9295 if (tvb_length(tvb) > 8) {
9296 expert_item = proto_tree_add_text(ncp_tree, tvb, 8, -1,
9297 "No request record found. Parsing is impossible.");
9299 expert_add_info_format(pinfo, expert_item, PI_SEQUENCE, PI_NOTE, "No request record found.");
9306 dissect_nds_request(tvbuff_t *tvb, packet_info *pinfo,
9307 guint32 nw_connection, guint8 sequence,
9308 guint16 type, proto_tree *ncp_tree)
9310 guint8 func, subfunc = 0;
9311 ncp_req_hash_value *request_value = NULL;
9312 ncp_req_eid_hash_value *request_eid_value = NULL;
9313 const ncp_record *ncp_rec = NULL;
9314 conversation_t *conversation;
9315 ptvcursor_t *ptvc = NULL;
9316 proto_tree *temp_tree = NULL;
9317 gboolean run_req_cond = FALSE;
9318 gboolean run_info_str = FALSE;
9319 guint8 nds_verb = 0;
9320 const char *verb_string = "";
9321 guint32 nds_frag = 0;
9322 gboolean added_arrow;
9323 nds_val pvalues[9], prot_flags[1];
9324 char string_buffer[9][1024];
9325 guint8 nds_version = 0;
9326 guint32 foffset = 0;
9327 nw_uni_t req_buffer;
9328 char global_object_name[256];
9329 guint32 global_eid=0;
9330 gboolean resolve_eid=FALSE;
9331 guint32 global_flags=0, nds_prot_flags=0;
9334 for (i = 0; i < 9; i++) {
9335 pvalues[i].vtype = 0;
9336 pvalues[i].vvalue = 0;
9337 pvalues[i].vlength = 0;
9338 pvalues[i].voffset = 0;
9339 pvalues[i].hfname = 0;
9340 pvalues[i].vdesc = "";
9341 string_buffer[i][0] = '\0';
9342 pvalues[i].vstring = string_buffer[i];
9343 pvalues[i].mvtype = 0;
9344 pvalues[i].vflags = 0;
9347 req_buffer.buffer[0] = '\0';
9348 global_object_name[0] = '\0';
9350 func = tvb_get_guint8(tvb, 6);
9351 subfunc = tvb_get_guint8(tvb, 7);
9353 ncp_rec = ncp_record_find(func, subfunc);
9355 /* Check to see if this is a fragment packet */
9356 nds_frag = tvb_get_letohl(tvb, 8);
9359 if (nds_frag == 0xffffffff) {
9360 /* First fragment or only fragment. */
9361 nds_verb = tvb_get_guint8(tvb, 24);
9362 if (nds_verb == 0xfe)
9364 nds_version = nds_verb;
9365 nds_verb = tvb_get_guint8(tvb, 32);
9373 if (type == NCP_SERVICE_REQUEST) {
9374 proto_tree_add_item(ncp_tree, hf_nds_buffer_size, tvb, foffset,
9377 foffset = foffset+4;
9378 verb_string = val_to_str(nds_verb, ncp_nds_verb_vals,
9379 "Continuation Fragment");
9383 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
9384 pvalues[0].vtype = VTYPE_UINT32;
9385 pvalues[0].vdesc = "Version: %u";
9386 pvalues[0].vlength = 4;
9387 pvalues[0].hfname = hf_nds_ver;
9388 pvalues[0].voffset = foffset;
9389 foffset = foffset+pvalues[0].vlength;
9390 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9391 pvalues[1].vtype = VTYPE_BITFIELD;
9392 pvalues[1].vdesc = "Flags:";
9393 pvalues[1].vlength = 2;
9394 pvalues[1].hfname= hf_nds_nflags;
9395 pvalues[1].voffset = foffset;
9396 pvalues[1].bit1 = "Entry ID";
9397 pvalues[1].bit1hfname = hf_bit1nflags;
9398 pvalues[1].bit2 = "Readable";
9399 pvalues[1].bit2hfname = hf_bit2nflags;
9400 pvalues[1].bit3 = "Writeable";
9401 pvalues[1].bit3hfname = hf_bit3nflags;
9402 pvalues[1].bit4 = "Master";
9403 pvalues[1].bit4hfname = hf_bit4nflags;
9404 pvalues[1].bit5 = "Create ID";
9405 pvalues[1].bit5hfname = hf_bit5nflags;
9406 pvalues[1].bit6 = "Walk Tree";
9407 pvalues[1].bit6hfname = hf_bit6nflags;
9408 pvalues[1].bit7 = "Dereference Alias";
9409 pvalues[1].bit7hfname = hf_bit7nflags;
9410 pvalues[1].bit8 = "Not Defined";
9411 pvalues[1].bit8hfname = hf_bit8nflags;
9412 pvalues[1].bit9 = "Not Defined";
9413 pvalues[1].bit9hfname = hf_bit9nflags;
9414 pvalues[1].bit10 = "Not Defined";
9415 pvalues[1].bit10hfname = hf_bit10nflags;
9416 pvalues[1].bit11= "Not Defined";
9417 pvalues[1].bit11hfname = hf_bit11nflags;
9418 pvalues[1].bit12 = "Not Defined";
9419 pvalues[1].bit12hfname = hf_bit12nflags;
9420 pvalues[1].bit13 = "Not Defined";
9421 pvalues[1].bit13hfname = hf_bit13nflags;
9422 pvalues[1].bit14 = "Prefer Referrals";
9423 pvalues[1].bit14hfname = hf_bit14nflags;
9424 pvalues[1].bit15 = "Prefer Only Referrals";
9425 pvalues[1].bit15hfname = hf_bit15nflags;
9426 pvalues[1].bit16 = "Not Defined";
9427 pvalues[1].bit16hfname = hf_bit16nflags;
9428 foffset = foffset+4;
9429 if (pvalues[0].vvalue == 0 || pvalues[0].vvalue == 1)
9431 pvalues[2].vtype = VTYPE_UINT32;
9432 pvalues[2].vdesc = "Scope: %u";
9433 pvalues[2].vlength = 4;
9434 pvalues[2].voffset = foffset;
9435 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
9436 pvalues[2].hfname= hf_nds_scope;
9437 foffset = foffset+pvalues[2].vlength;
9438 pvalues[3].vtype = VTYPE_STRING;
9439 pvalues[3].vdesc = "Name: %s";
9440 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
9441 pvalues[3].vvalue = 0;
9442 pvalues[3].vlength = 256;
9443 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
9444 if (pvalues[3].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[3].vlength))
9446 pvalues[3].vtype = VTYPE_NONE;
9449 pvalues[3].voffset = foffset+4;
9450 foffset = foffset + 4;
9451 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, req_buffer.buffer);
9452 pvalues[3].vstring = req_buffer.buffer;
9453 g_strlcpy(global_object_name, req_buffer.buffer, 256);
9454 pvalues[3].hfname= hf_nds_name;
9455 foffset = foffset+pvalues[3].vlength;
9456 foffset += align_4(tvb, foffset);
9457 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
9458 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
9459 pvalues[4].vdesc = "Communications Transports: %u";
9460 pvalues[4].vlength = 4;
9461 pvalues[4].hfname= hf_nds_comm_trans;
9462 pvalues[4].voffset = foffset;
9463 pvalues[4].mvtype = MVTYPE_ADDR_REFERRAL_REQUEST;
9464 foffset = foffset + (pvalues[4].vvalue * 4) + 4;
9465 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
9466 pvalues[5].vtype = VTYPE_MULTIVALUE_UINT32;
9467 pvalues[5].vdesc = "Tree Walker Transport Type: %u";
9468 pvalues[5].vlength = 4;
9469 pvalues[5].mvtype = MVTYPE_ADDR_REFERRAL_REQUEST;
9470 pvalues[5].hfname= hf_nds_tree_trans;
9471 pvalues[5].voffset = foffset;
9475 pvalues[2].vtype = VTYPE_UINT32;
9476 pvalues[2].vdesc = "Minimum DS Version: %u";
9477 pvalues[2].vlength = 4;
9478 pvalues[2].voffset = foffset;
9479 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
9480 pvalues[2].hfname= hf_min_nds_ver;
9481 foffset = foffset+pvalues[2].vlength;
9482 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
9483 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
9484 pvalues[3].vdesc = "Number of Versions to Include: %u";
9485 pvalues[3].vlength = 4;
9486 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST2;
9487 pvalues[3].voffset = foffset;
9488 pvalues[3].hfname= hf_nds_ver_include;
9489 foffset += (pvalues[3].vvalue * 4) + 4;
9490 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
9491 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
9492 pvalues[4].vdesc = "Number of Versions to Exclude: %u";
9493 pvalues[4].vlength = 4;
9494 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST2;
9495 pvalues[4].hfname= hf_nds_ver_exclude;
9496 pvalues[4].voffset = foffset;
9498 pvalues[5].vtype = VTYPE_UINT32;
9499 pvalues[5].vdesc = "DN Output Type: %u";
9500 pvalues[5].vlength = 4;
9501 pvalues[5].voffset = foffset;
9502 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
9503 pvalues[5].hfname= hf_nds_dn_output_type;
9504 foffset = foffset+pvalues[5].vlength;
9505 pvalues[6].vtype = VTYPE_UINT32;
9506 pvalues[6].vdesc = "Nested Output Type: %u";
9507 pvalues[6].vlength = 4;
9508 pvalues[6].voffset = foffset;
9509 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset);
9510 pvalues[6].hfname= hf_nds_nested_output_type;
9511 foffset = foffset+pvalues[6].vlength;
9512 pvalues[7].vtype = VTYPE_STRING;
9513 pvalues[7].vdesc = "Output Delimiter: %s";
9514 pvalues[7].mvtype = MVTYPE_ATTR_REQUEST;
9515 pvalues[7].vvalue = 0;
9516 pvalues[7].vlength = 256;
9517 pvalues[7].vlength = tvb_get_letohl(tvb, foffset);
9518 pvalues[7].voffset = foffset+4;
9519 foffset = foffset + 4;
9520 get_string(tvb, pvalues[7].voffset, pvalues[7].vlength, req_buffer.buffer);
9521 pvalues[7].vstring = req_buffer.buffer;
9522 pvalues[7].hfname= hf_nds_output_delimiter;
9523 foffset = foffset+pvalues[7].vlength;
9524 foffset += align_4(tvb, foffset);
9525 pvalues[8].vvalue = tvb_get_letohl(tvb, foffset);
9526 pvalues[8].vtype = VTYPE_MULTIVALUE_UINT32;
9527 pvalues[8].vdesc = "Size of Entry Specifier: %u";
9528 pvalues[8].vlength = 4;
9529 pvalues[8].mvtype = MVTYPE_PROC_ENTRY_SPECIFIERS;
9530 pvalues[8].hfname= hf_nds_output_entry_specifier;
9531 pvalues[8].voffset = foffset;
9535 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
9536 pvalues[0].vtype = VTYPE_UINT32;
9537 pvalues[0].vdesc = "Version: %u";
9538 pvalues[0].vlength = 4;
9539 pvalues[0].voffset = foffset;
9540 pvalues[0].hfname= hf_nds_ver;
9541 foffset = foffset+pvalues[0].vlength;
9542 switch(pvalues[0].vvalue)
9545 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9546 pvalues[1].vtype = VTYPE_UINT32;
9547 pvalues[1].vdesc = "Entry ID: 0x%08x";
9548 pvalues[1].vlength = 4;
9550 global_eid = pvalues[1].vvalue;
9551 pvalues[1].voffset = foffset;
9552 pvalues[1].hfname = hf_nds_eid;
9553 foffset = foffset+pvalues[1].vlength;
9556 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9557 pvalues[1].vtype = VTYPE_BITFIELD;
9558 pvalues[1].vdesc = "Request Flags:";
9559 pvalues[1].vlength = 2;
9560 pvalues[1].hfname= hf_nds_rflags;
9561 pvalues[1].voffset = foffset;
9562 pvalues[1].bit1 = "Typeless";
9563 pvalues[1].bit1hfname = hf_bit1rflags;
9564 pvalues[1].bit2 = "Slashed";
9565 pvalues[1].bit2hfname = hf_bit2rflags;
9566 pvalues[1].bit3 = "Dotted";
9567 pvalues[1].bit3hfname = hf_bit3rflags;
9568 pvalues[1].bit4 = "Tuned";
9569 pvalues[1].bit4hfname = hf_bit4rflags;
9570 pvalues[1].bit5 = "Not Defined";
9571 pvalues[1].bit5hfname = hf_bit5rflags;
9572 pvalues[1].bit6 = "Not Defined";
9573 pvalues[1].bit6hfname = hf_bit6rflags;
9574 pvalues[1].bit7 = "Not Defined";
9575 pvalues[1].bit7hfname = hf_bit7rflags;
9576 pvalues[1].bit8 = "Not Defined";
9577 pvalues[1].bit8hfname = hf_bit8rflags;
9578 pvalues[1].bit9 = "Not Defined";
9579 pvalues[1].bit9hfname = hf_bit9rflags;
9580 pvalues[1].bit10 = "Not Defined";
9581 pvalues[1].bit10hfname = hf_bit10rflags;
9582 pvalues[1].bit11 = "Not Defined";
9583 pvalues[1].bit11hfname = hf_bit11rflags;
9584 pvalues[1].bit12 = "Not Defined";
9585 pvalues[1].bit12hfname = hf_bit12rflags;
9586 pvalues[1].bit13 = "Not Defined";
9587 pvalues[1].bit13hfname = hf_bit13rflags;
9588 pvalues[1].bit14 = "Not Defined";
9589 pvalues[1].bit14hfname = hf_bit14rflags;
9590 pvalues[1].bit15 = "Not Defined";
9591 pvalues[1].bit15hfname = hf_bit15rflags;
9592 pvalues[1].bit16 = "Not Defined";
9593 pvalues[1].bit16hfname = hf_bit16rflags;
9594 if((pvalues[1].vvalue&&0xf000) == 0xc000)
9596 pvalues[2].vtype = VTYPE_STRING;
9597 pvalues[2].vdesc = "Name Type: %s";
9598 pvalues[2].vstring = "Partial";
9599 pvalues[2].mvtype = 0;
9600 pvalues[2].vvalue = 0;
9601 pvalues[2].vlength = 0;
9602 pvalues[2].voffset = 0;
9603 pvalues[2].hfname= hf_nds_name_type;
9607 pvalues[2].vtype = VTYPE_STRING;
9608 pvalues[2].vdesc = "Name Type: %s";
9609 pvalues[2].vstring = "Full";
9610 pvalues[2].vvalue = 0;
9611 pvalues[2].mvtype = 0;
9612 pvalues[2].vlength = 0;
9613 pvalues[2].voffset = 0;
9614 pvalues[2].hfname= hf_nds_name_type;
9616 foffset = foffset+4;
9617 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
9618 pvalues[3].vtype = VTYPE_UINT32;
9619 pvalues[3].vdesc = "Entry ID: 0x%08x";
9620 pvalues[3].vlength = 4;
9621 pvalues[3].voffset = foffset;
9623 global_eid = pvalues[3].vvalue;
9624 pvalues[3].hfname = hf_nds_eid;
9625 foffset = foffset+pvalues[3].vlength;
9628 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9629 pvalues[1].vtype = VTYPE_BITFIELD;
9630 pvalues[1].vdesc = "Request Flags:";
9631 pvalues[1].vlength = 2;
9632 pvalues[1].hfname= hf_nds_rflags;
9633 pvalues[1].voffset = foffset;
9634 pvalues[1].bit1 = "Typeless";
9635 pvalues[1].bit1hfname = hf_bit1rflags;
9636 pvalues[1].bit2 = "Slashed";
9637 pvalues[1].bit2hfname = hf_bit2rflags;
9638 pvalues[1].bit3 = "Dotted";
9639 pvalues[1].bit3hfname = hf_bit3rflags;
9640 pvalues[1].bit4 = "Tuned";
9641 pvalues[1].bit4hfname = hf_bit4rflags;
9642 pvalues[1].bit5 = "Not Defined";
9643 pvalues[1].bit5hfname = hf_bit5rflags;
9644 pvalues[1].bit6 = "Not Defined";
9645 pvalues[1].bit6hfname = hf_bit6rflags;
9646 pvalues[1].bit7 = "Not Defined";
9647 pvalues[1].bit7hfname = hf_bit7rflags;
9648 pvalues[1].bit8 = "Not Defined";
9649 pvalues[1].bit8hfname = hf_bit8rflags;
9650 pvalues[1].bit9 = "Not Defined";
9651 pvalues[1].bit9hfname = hf_bit9rflags;
9652 pvalues[1].bit10 = "Not Defined";
9653 pvalues[1].bit10hfname = hf_bit10rflags;
9654 pvalues[1].bit11 = "Not Defined";
9655 pvalues[1].bit11hfname = hf_bit11rflags;
9656 pvalues[1].bit12 = "Not Defined";
9657 pvalues[1].bit12hfname = hf_bit12rflags;
9658 pvalues[1].bit13 = "Not Defined";
9659 pvalues[1].bit13hfname = hf_bit13rflags;
9660 pvalues[1].bit14 = "Not Defined";
9661 pvalues[1].bit14hfname = hf_bit14rflags;
9662 pvalues[1].bit15 = "Not Defined";
9663 pvalues[1].bit15hfname = hf_bit15rflags;
9664 pvalues[1].bit16 = "Not Defined";
9665 pvalues[1].bit16hfname = hf_bit16rflags;
9666 if((pvalues[1].vvalue&&0xf000) == 0xc000)
9668 pvalues[2].vtype = VTYPE_STRING;
9669 pvalues[2].vdesc = "Name Type: %s";
9670 pvalues[2].vstring = "Return Partion Name";
9671 pvalues[2].vvalue = 0;
9672 pvalues[2].vlength = 4;
9673 pvalues[2].voffset = pvalues[1].voffset;
9674 pvalues[2].mvtype = 0;
9675 pvalues[2].hfname= hf_nds_name_type;
9679 pvalues[2].vtype = VTYPE_STRING;
9680 pvalues[2].vdesc = "Name Type: %s";
9681 pvalues[2].vstring = "Return Full Name";
9682 pvalues[2].vvalue = 0;
9683 pvalues[2].vlength = 4;
9684 pvalues[2].mvtype = 0;
9685 pvalues[2].voffset = pvalues[1].voffset;
9686 pvalues[2].hfname= hf_nds_name_type;
9688 foffset = foffset+4;
9689 pvalues[3].vvalue = tvb_get_letohs(tvb, foffset);
9690 global_flags = tvb_get_letohl(tvb, foffset);
9691 pvalues[3].vtype = VTYPE_BITFIELD;
9692 pvalues[3].vdesc = "Information Flags (low) Byte:";
9693 pvalues[3].vlength = 2;
9694 pvalues[3].hfname= hf_nds_rflags;
9695 pvalues[3].voffset = foffset;
9696 pvalues[3].bit1 = "Output Flags";
9697 pvalues[3].bit1hfname = hf_bit1infoflagsl;
9698 pvalues[3].bit2 = "Entry ID";
9699 pvalues[3].bit2hfname = hf_bit2infoflagsl;
9700 pvalues[3].bit3 = "Entry Flags";
9701 pvalues[3].bit3hfname = hf_bit3infoflagsl;
9702 pvalues[3].bit4 = "Subordinate Count";
9703 pvalues[3].bit4hfname = hf_bit4infoflagsl;
9704 pvalues[3].bit5 = "Modification Time";
9705 pvalues[3].bit5hfname = hf_bit5infoflagsl;
9706 pvalues[3].bit6 = "Modification Timestamp";
9707 pvalues[3].bit6hfname = hf_bit6infoflagsl;
9708 pvalues[3].bit7 = "Creation Timestamp";
9709 pvalues[3].bit7hfname = hf_bit7infoflagsl;
9710 pvalues[3].bit8 = "Partition Root ID";
9711 pvalues[3].bit8hfname = hf_bit8infoflagsl;
9712 pvalues[3].bit9 = "Parent ID";
9713 pvalues[3].bit9hfname = hf_bit9infoflagsl;
9714 pvalues[3].bit10 = "Revision Count";
9715 pvalues[3].bit10hfname = hf_bit10infoflagsl;
9716 pvalues[3].bit11 = "Replica Type";
9717 pvalues[3].bit11hfname = hf_bit11infoflagsl;
9718 pvalues[3].bit12 = "Base Class";
9719 pvalues[3].bit12hfname = hf_bit12infoflagsl;
9720 pvalues[3].bit13 = "Relative Distinguished Name";
9721 pvalues[3].bit13hfname = hf_bit13infoflagsl;
9722 pvalues[3].bit14 = "Distinguished Name";
9723 pvalues[3].bit14hfname = hf_bit14infoflagsl;
9724 pvalues[3].bit15 = "Root Distinguished Name";
9725 pvalues[3].bit15hfname = hf_bit15infoflagsl;
9726 pvalues[3].bit16 = "Parent Distinguished Name";
9727 pvalues[3].bit16hfname = hf_bit16infoflagsl;
9728 foffset = foffset+2;
9729 pvalues[4].vvalue = tvb_get_letohs(tvb, foffset);
9730 pvalues[4].vtype = VTYPE_BITFIELD;
9731 pvalues[4].vdesc = "Information Flags (high) Byte:";
9732 pvalues[4].vlength = 2;
9733 pvalues[4].hfname= hf_nds_rflags;
9734 pvalues[4].voffset = foffset;
9735 pvalues[4].bit1 = "Purge Time";
9736 pvalues[4].bit1hfname = hf_bit1infoflagsh;
9737 pvalues[4].bit2 = "Dereference Base Class";
9738 pvalues[4].bit2hfname = hf_bit2infoflagsh;
9739 pvalues[4].bit3 = "Replica Number";
9740 pvalues[4].bit3hfname = hf_bit3infoflagsh;
9741 pvalues[4].bit4 = "Replica State";
9742 pvalues[4].bit4hfname = hf_bit4infoflagsh;
9743 pvalues[4].bit5 = "Federation Boundary";
9744 pvalues[4].bit5hfname = hf_bit5infoflagsh;
9745 pvalues[4].bit6 = "Schema Boundary";
9746 pvalues[4].bit6hfname = hf_bit6infoflagsh;
9747 pvalues[4].bit7 = "Federation Boundary ID";
9748 pvalues[4].bit7hfname = hf_bit7infoflagsh;
9749 pvalues[4].bit8 = "Schema Boundary ID";
9750 pvalues[4].bit8hfname = hf_bit8infoflagsh;
9751 pvalues[4].bit9 = "Current Subcount";
9752 pvalues[4].bit9hfname = hf_bit9infoflagsh;
9753 pvalues[4].bit10 = "Local Entry Flags";
9754 pvalues[4].bit10hfname = hf_bit10infoflagsh;
9755 pvalues[4].bit11 = "Not Defined";
9756 pvalues[4].bit11hfname = hf_bit11infoflagsh;
9757 pvalues[4].bit12 = "Not Defined";
9758 pvalues[4].bit12hfname = hf_bit12infoflagsh;
9759 pvalues[4].bit13 = "Not Defined";
9760 pvalues[4].bit13hfname = hf_bit13infoflagsh;
9761 pvalues[4].bit14 = "Not Defined";
9762 pvalues[4].bit14hfname = hf_bit14infoflagsh;
9763 pvalues[4].bit15 = "Not Defined";
9764 pvalues[4].bit15hfname = hf_bit15infoflagsh;
9765 pvalues[4].bit16 = "Not Defined";
9766 pvalues[4].bit16hfname = hf_bit16infoflagsh;
9767 foffset = foffset+2;
9768 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
9769 pvalues[5].vtype = VTYPE_UINT32;
9770 pvalues[5].vdesc = "Entry ID: 0x%08x";
9771 pvalues[5].vlength = 4;
9772 pvalues[5].voffset = foffset;
9774 global_eid = pvalues[5].vvalue;
9775 pvalues[5].hfname = hf_nds_eid;
9776 foffset = foffset+pvalues[5].vlength;
9784 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
9785 pvalues[0].vtype = VTYPE_UINT32;
9786 pvalues[0].vdesc = "Version: %u";
9787 pvalues[0].vlength = 4;
9788 pvalues[0].voffset = foffset;
9789 pvalues[0].hfname= hf_nds_ver;
9790 foffset = foffset+pvalues[0].vlength;
9791 if(pvalues[0].vvalue == 0)
9793 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9794 pvalues[1].vtype = VTYPE_UINT32;
9795 pvalues[1].vdesc = "Iteration Handle: 0x%08x";
9796 pvalues[1].vlength = 4;
9797 pvalues[1].voffset = foffset;
9798 pvalues[1].hfname= hf_nds_iteration;
9799 foffset = foffset+pvalues[1].vlength;
9800 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
9801 pvalues[2].vtype = VTYPE_UINT32;
9802 pvalues[2].vdesc = "Entry ID: 0x%08x";
9803 pvalues[2].vlength = 4;
9805 global_eid = pvalues[2].vvalue;
9806 pvalues[2].voffset = foffset;
9807 pvalues[2].hfname= hf_nds_eid;
9808 foffset = foffset+pvalues[2].vlength;
9809 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
9810 pvalues[3].vstring = (char *)match_strval(pvalues[3].vvalue, nds_info_type);
9811 global_flags = pvalues[3].vvalue;
9812 if(pvalues[3].vstring == NULL)
9814 pvalues[3].vstring = "No Info Type Set";
9816 pvalues[3].vtype = VTYPE_STRING;
9817 pvalues[3].vdesc = "Info Type: %s";
9818 pvalues[3].vlength = 4;
9819 pvalues[3].voffset = foffset;
9820 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
9821 pvalues[3].hfname= hf_nds_info_type;
9822 foffset = foffset + pvalues[3].vlength;
9823 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
9824 pvalues[4].vtype = VTYPE_UINT32;
9825 pvalues[4].vdesc = "All Attributes: %u";
9826 pvalues[4].vlength = 4;
9827 pvalues[4].voffset = foffset;
9828 pvalues[4].hfname= hf_nds_all_attr;
9829 foffset = foffset+pvalues[4].vlength;
9830 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
9831 pvalues[5].vtype = VTYPE_MULTIVALUE_UINT32;
9832 pvalues[5].vdesc = "Attributes: %u";
9833 pvalues[5].vlength = 4;
9834 pvalues[5].voffset = foffset;
9835 pvalues[5].mvtype = MVTYPE_ATTR_REQUEST;
9836 pvalues[5].hfname= hf_nds_attr;
9840 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9841 pvalues[1].vtype = VTYPE_UINT32;
9842 pvalues[1].vdesc = "Request Flags: 0x%08x";
9843 pvalues[1].vlength = 4;
9844 pvalues[1].voffset = foffset;
9845 pvalues[1].hfname= hf_nds_req_flags;
9846 foffset = foffset+pvalues[1].vlength;
9847 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
9848 pvalues[2].vtype = VTYPE_UINT32;
9849 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
9850 pvalues[2].vlength = 4;
9851 pvalues[2].voffset = foffset;
9852 pvalues[2].hfname= hf_nds_iteration;
9853 foffset = foffset+pvalues[2].vlength;
9854 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
9855 pvalues[3].vtype = VTYPE_UINT32;
9856 pvalues[3].vdesc = "Entry ID: 0x%08x";
9857 pvalues[3].vlength = 4;
9859 global_eid = pvalues[3].vvalue;
9860 pvalues[3].voffset = foffset;
9861 pvalues[3].hfname= hf_nds_eid;
9862 foffset = foffset+pvalues[3].vlength;
9863 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
9864 pvalues[4].vstring = (char *)match_strval(pvalues[4].vvalue, nds_info_type);
9865 global_flags = pvalues[4].vvalue;
9866 if(pvalues[4].vstring == NULL)
9868 pvalues[4].vstring = "No Info Type Set";
9870 pvalues[4].vtype = VTYPE_STRING;
9871 pvalues[4].vdesc = "Info Type: %s";
9872 pvalues[4].vlength = 4;
9873 pvalues[4].voffset = foffset;
9874 pvalues[4].hfname= hf_nds_info_type;
9875 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST;
9876 foffset = foffset+pvalues[4].vlength;
9877 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
9878 pvalues[5].vtype = VTYPE_UINT32;
9879 pvalues[5].vdesc = "All Attributes: %u";
9880 pvalues[5].vlength = 4;
9881 pvalues[5].voffset = foffset;
9882 pvalues[5].hfname= hf_nds_all_attr;
9883 foffset = foffset+pvalues[5].vlength;
9884 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset);
9885 pvalues[6].vtype = VTYPE_MULTIVALUE_UINT32;
9886 pvalues[6].vdesc = "Attributes: %u";
9887 pvalues[6].vlength = 4;
9888 pvalues[6].voffset = foffset;
9889 pvalues[6].mvtype = MVTYPE_ATTR_REQUEST;
9890 pvalues[6].hfname= hf_nds_attr;
9894 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
9895 pvalues[0].vtype = VTYPE_UINT32;
9896 pvalues[0].vdesc = "Version: %u";
9897 pvalues[0].vlength = 4;
9898 pvalues[0].voffset = foffset;
9899 pvalues[0].hfname= hf_nds_ver;
9900 foffset = foffset+pvalues[0].vlength;
9901 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9902 pvalues[1].vtype = VTYPE_UINT32;
9903 pvalues[1].vdesc = "Entry ID: 0x%08x";
9904 pvalues[1].vlength = 4;
9906 global_eid = pvalues[1].vvalue;
9907 pvalues[1].voffset = foffset;
9908 pvalues[1].hfname = hf_nds_eid;
9909 foffset = foffset+pvalues[1].vlength;
9910 foffset += 4; /* Attribute Count = 1 */
9911 pvalues[2].vtype = VTYPE_STRING;
9912 pvalues[2].vdesc = "Attribute Name Being Compared: %s";
9913 pvalues[2].mvtype = MVTYPE_ATTR_REQUEST;
9914 pvalues[2].vvalue = 0;
9915 pvalues[2].vlength = 256;
9916 pvalues[2].vlength = tvb_get_letohl(tvb, foffset);
9917 if (pvalues[2].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[2].vlength))
9919 pvalues[2].vtype = VTYPE_NONE;
9922 pvalues[2].voffset = foffset+4;
9923 foffset = foffset + 4;
9924 get_string(tvb, pvalues[2].voffset, pvalues[2].vlength, req_buffer.buffer);
9925 pvalues[2].vstring = req_buffer.buffer;
9926 g_strlcpy(global_object_name, req_buffer.buffer, 256);
9927 pvalues[2].hfname= hf_nds_name;
9928 foffset = foffset+pvalues[2].vlength;
9929 foffset += align_4(tvb, foffset);
9930 foffset += 4; /* Attribute Value Count = 1 */
9931 pvalues[3].vtype = VTYPE_STRING;
9932 pvalues[3].vdesc = "Attribute Value: %s";
9933 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
9934 pvalues[3].vvalue = 0;
9935 pvalues[3].vlength = 256;
9936 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
9937 pvalues[3].voffset = foffset+4;
9938 foffset = foffset + 4;
9939 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
9940 pvalues[3].hfname= hf_value_string;
9941 foffset = foffset+pvalues[3].vlength;
9944 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
9945 pvalues[0].vtype = VTYPE_UINT32;
9946 pvalues[0].vdesc = "Version: %u";
9947 pvalues[0].vlength = 4;
9948 pvalues[0].voffset = foffset;
9949 pvalues[0].hfname= hf_nds_ver;
9950 foffset = foffset+pvalues[0].vlength;
9951 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
9952 pvalues[1].vtype = VTYPE_BITFIELD;
9953 pvalues[1].vdesc = "Request Flags:";
9954 pvalues[1].vlength = 2;
9955 pvalues[1].hfname= hf_nds_rflags;
9956 pvalues[1].voffset = foffset;
9957 pvalues[1].bit1 = "List Typeless";
9958 pvalues[1].bit1hfname = hf_bit1lflags;
9959 pvalues[1].bit2 = "List Containers";
9960 pvalues[1].bit2hfname = hf_bit2lflags;
9961 pvalues[1].bit3 = "List Slashed";
9962 pvalues[1].bit3hfname = hf_bit3lflags;
9963 pvalues[1].bit4 = "List Dotted";
9964 pvalues[1].bit4hfname = hf_bit4lflags;
9965 pvalues[1].bit5 = "Dereference Alias";
9966 pvalues[1].bit5hfname = hf_bit5lflags;
9967 pvalues[1].bit6 = "List All Containers";
9968 pvalues[1].bit6hfname = hf_bit6lflags;
9969 pvalues[1].bit7 = "List Obsolete";
9970 pvalues[1].bit7hfname = hf_bit7lflags;
9971 pvalues[1].bit8 = "List Tuned Output";
9972 pvalues[1].bit8hfname = hf_bit8lflags;
9973 pvalues[1].bit9 = "List External Reference";
9974 pvalues[1].bit9hfname = hf_bit9lflags;
9975 pvalues[1].bit10 = "Not Defined";
9976 pvalues[1].bit10hfname = hf_bit10lflags;
9977 pvalues[1].bit11 = "Not Defined";
9978 pvalues[1].bit11hfname = hf_bit11lflags;
9979 pvalues[1].bit12 = "Not Defined";
9980 pvalues[1].bit12hfname = hf_bit12lflags;
9981 pvalues[1].bit13 = "Not Defined";
9982 pvalues[1].bit13hfname = hf_bit13lflags;
9983 pvalues[1].bit14 = "Not Defined";
9984 pvalues[1].bit14hfname = hf_bit14lflags;
9985 pvalues[1].bit15 = "Not Defined";
9986 pvalues[1].bit15hfname = hf_bit15lflags;
9987 pvalues[1].bit16 = "Not Defined";
9988 pvalues[1].bit16hfname = hf_bit16lflags;
9989 foffset = foffset+pvalues[1].vlength;
9991 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
9992 pvalues[2].vtype = VTYPE_UINT32;
9993 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
9994 pvalues[2].vlength = 4;
9995 pvalues[2].voffset = foffset;
9996 pvalues[2].hfname= hf_nds_iteration;
9997 foffset = foffset+pvalues[2].vlength;
9998 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
9999 pvalues[3].vtype = VTYPE_UINT32;
10000 pvalues[3].vdesc = "Parent ID: 0x%08x";
10001 pvalues[3].vlength = 4;
10002 pvalues[3].voffset = foffset;
10003 pvalues[3].hfname= hf_nds_parent;
10004 foffset = foffset+pvalues[3].vlength;
10005 pvalues[4].vvalue = tvb_get_letohs(tvb, foffset);
10006 global_flags = tvb_get_letohl(tvb, foffset);
10007 pvalues[4].vtype = VTYPE_BITFIELD;
10008 pvalues[4].vdesc = "Information Flags (low) Byte:";
10009 pvalues[4].vlength = 2;
10010 pvalues[4].hfname= hf_nds_rflags;
10011 pvalues[4].voffset = foffset;
10012 pvalues[4].bit1 = "Output Flags";
10013 pvalues[4].bit1hfname = hf_bit1infoflagsl;
10014 pvalues[4].bit2 = "Entry ID";
10015 pvalues[4].bit2hfname = hf_bit2infoflagsl;
10016 pvalues[4].bit3 = "Entry Flags";
10017 pvalues[4].bit3hfname = hf_bit3infoflagsl;
10018 pvalues[4].bit4 = "Subordinate Count";
10019 pvalues[4].bit4hfname = hf_bit4infoflagsl;
10020 pvalues[4].bit5 = "Modification Time";
10021 pvalues[4].bit5hfname = hf_bit5infoflagsl;
10022 pvalues[4].bit6 = "Modification Timestamp";
10023 pvalues[4].bit6hfname = hf_bit6infoflagsl;
10024 pvalues[4].bit7 = "Creation Timestamp";
10025 pvalues[4].bit7hfname = hf_bit7infoflagsl;
10026 pvalues[4].bit8 = "Partition Root ID";
10027 pvalues[4].bit8hfname = hf_bit8infoflagsl;
10028 pvalues[4].bit9 = "Parent ID";
10029 pvalues[4].bit9hfname = hf_bit9infoflagsl;
10030 pvalues[4].bit10 = "Revision Count";
10031 pvalues[4].bit10hfname = hf_bit10infoflagsl;
10032 pvalues[4].bit11 = "Replica Type";
10033 pvalues[4].bit11hfname = hf_bit11infoflagsl;
10034 pvalues[4].bit12 = "Base Class";
10035 pvalues[4].bit12hfname = hf_bit12infoflagsl;
10036 pvalues[4].bit13 = "Relative Distinguished Name";
10037 pvalues[4].bit13hfname = hf_bit13infoflagsl;
10038 pvalues[4].bit14 = "Distinguished Name";
10039 pvalues[4].bit14hfname = hf_bit14infoflagsl;
10040 pvalues[4].bit15 = "Root Distinguished Name";
10041 pvalues[4].bit15hfname = hf_bit15infoflagsl;
10042 pvalues[4].bit16 = "Parent Distinguished Name";
10043 pvalues[4].bit16hfname = hf_bit16infoflagsl;
10044 foffset = foffset+2;
10045 pvalues[5].vvalue = tvb_get_letohs(tvb, foffset);
10046 pvalues[5].vtype = VTYPE_BITFIELD;
10047 pvalues[5].vdesc = "Information Flags (high) Byte:";
10048 pvalues[5].vlength = 2;
10049 pvalues[5].hfname= hf_nds_rflags;
10050 pvalues[5].voffset = foffset;
10051 pvalues[5].bit1 = "Purge Time";
10052 pvalues[5].bit1hfname = hf_bit1infoflagsh;
10053 pvalues[5].bit2 = "Dereference Base Class";
10054 pvalues[5].bit2hfname = hf_bit2infoflagsh;
10055 pvalues[5].bit3 = "Not Defined";
10056 pvalues[5].bit3hfname = hf_bit3infoflagsh;
10057 pvalues[5].bit4 = "Not Defined";
10058 pvalues[5].bit4hfname = hf_bit4infoflagsh;
10059 pvalues[5].bit5 = "Not Defined";
10060 pvalues[5].bit5hfname = hf_bit5infoflagsh;
10061 pvalues[5].bit6 = "Not Defined";
10062 pvalues[5].bit6hfname = hf_bit6infoflagsh;
10063 pvalues[5].bit7 = "Not Defined";
10064 pvalues[5].bit7hfname = hf_bit7infoflagsh;
10065 pvalues[5].bit8 = "Not Defined";
10066 pvalues[5].bit8hfname = hf_bit8infoflagsh;
10067 pvalues[5].bit9 = "Not Defined";
10068 pvalues[5].bit9hfname = hf_bit9infoflagsh;
10069 pvalues[5].bit10 = "Not Defined";
10070 pvalues[5].bit10hfname = hf_bit10infoflagsh;
10071 pvalues[5].bit11 = "Not Defined";
10072 pvalues[5].bit11hfname = hf_bit11infoflagsh;
10073 pvalues[5].bit12 = "Not Defined";
10074 pvalues[5].bit12hfname = hf_bit12infoflagsh;
10075 pvalues[5].bit13 = "Not Defined";
10076 pvalues[5].bit13hfname = hf_bit13infoflagsh;
10077 pvalues[5].bit14 = "Not Defined";
10078 pvalues[5].bit14hfname = hf_bit14infoflagsh;
10079 pvalues[5].bit15 = "Not Defined";
10080 pvalues[5].bit15hfname = hf_bit15infoflagsh;
10081 pvalues[5].bit16 = "Not Defined";
10082 pvalues[5].bit16hfname = hf_bit16infoflagsh;
10083 foffset = foffset+2;
10084 pvalues[6].vtype = VTYPE_STRING;
10085 pvalues[6].vdesc = "Name Filter: %s";
10086 pvalues[6].mvtype = MVTYPE_ATTR_REQUEST;
10087 pvalues[6].vvalue = 0;
10088 pvalues[6].vlength = 256;
10089 pvalues[6].vlength = tvb_get_letohl(tvb, foffset);
10090 pvalues[6].voffset = foffset+4;
10091 foffset = foffset + 4;
10092 get_string(tvb, pvalues[6].voffset, pvalues[6].vlength, pvalues[6].vstring);
10093 pvalues[6].hfname= hf_nds_name_filter;
10094 foffset = foffset+pvalues[6].vlength;
10095 if(pvalues[0].vvalue == 0)
10099 foffset += align_4(tvb, foffset);
10100 pvalues[7].vtype = VTYPE_STRING;
10101 pvalues[7].vdesc = "Class Filter: %s";
10102 pvalues[7].mvtype = MVTYPE_ATTR_REQUEST;
10103 pvalues[7].vvalue = 0;
10104 pvalues[7].vlength = 256;
10105 pvalues[7].vlength = tvb_get_letohl(tvb, foffset);
10106 pvalues[7].voffset = foffset+4;
10107 foffset = foffset + 4;
10108 get_string(tvb, pvalues[7].voffset, pvalues[7].vlength, pvalues[7].vstring);
10109 pvalues[7].hfname= hf_nds_class_filter;
10110 foffset = foffset+pvalues[7].vlength;
10111 if(pvalues[0].vvalue == 1)
10115 foffset += align_4(tvb, foffset);
10116 pvalues[8].vvalue = tvb_get_letohl(tvb, foffset);
10117 pvalues[8].vtype = VTYPE_MULTIVALUE_UINT32;
10118 pvalues[8].vdesc = "Seconds: %u";
10119 pvalues[8].vlength = 4;
10120 pvalues[8].mvtype = MVTYPE_PRINT_TIMESTAMP;
10121 pvalues[8].hfname= hf_nds_time_filter;
10122 pvalues[8].voffset = foffset;
10125 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10126 pvalues[0].vstring = "";
10127 pvalues[0].vtype = VTYPE_UINT32;
10128 pvalues[0].vdesc = "Version: %u";
10129 pvalues[0].vlength = 4;
10130 pvalues[0].voffset = foffset;
10131 pvalues[0].hfname= hf_nds_ver;
10132 foffset = foffset+pvalues[0].vlength;
10133 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10134 pvalues[1].vtype = VTYPE_UINT32;
10135 pvalues[1].vstring = "";
10136 pvalues[1].vdesc = "Request Flags: 0x%08x";
10137 pvalues[1].vlength = 4;
10138 pvalues[1].hfname= hf_nds_rflags;
10139 pvalues[1].voffset = foffset;
10140 foffset = foffset+4;
10141 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10142 pvalues[2].vtype = VTYPE_UINT32;
10143 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
10144 pvalues[2].vlength = 4;
10145 pvalues[2].voffset = foffset;
10146 pvalues[2].hfname= hf_nds_iteration;
10147 foffset = foffset+pvalues[2].vlength;
10148 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
10149 pvalues[3].vstring = "";
10150 pvalues[3].vtype = VTYPE_UINT32;
10151 pvalues[3].vdesc = "Base Entry ID: 0x%08x";
10152 pvalues[3].vlength = 4;
10153 resolve_eid = FALSE;
10154 global_eid = pvalues[3].vvalue;
10155 pvalues[3].voffset = foffset;
10156 pvalues[3].hfname= hf_nds_eid;
10157 foffset = foffset+pvalues[3].vlength;
10158 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
10159 pvalues[4].vstring = (char *)match_strval(pvalues[4].vvalue, nds_search_scope);
10160 if(pvalues[4].vstring == NULL)
10162 pvalues[4].vstring = "No Search Scope Defined";
10164 pvalues[4].vtype = VTYPE_STRING;
10165 pvalues[4].vdesc = "Replica Type: %s";
10166 pvalues[4].vlength = 4;
10167 pvalues[4].voffset = foffset;
10168 pvalues[4].mvtype = 0;
10169 pvalues[4].hfname= hf_nds_search_scope;
10170 foffset = foffset + pvalues[4].vlength;
10171 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
10172 pvalues[5].vtype = VTYPE_UINT32;
10173 pvalues[5].vdesc = "Number of Objects to Search: 0x%08x";
10174 pvalues[5].vlength = 4;
10175 pvalues[5].voffset = foffset;
10176 pvalues[5].hfname= hf_nds_num_objects;
10177 foffset = foffset+pvalues[5].vlength;
10178 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset);
10179 pvalues[6].vtype = VTYPE_BITFIELD;
10180 pvalues[6].vdesc = "Information Types:";
10181 pvalues[6].vlength = 2;
10182 pvalues[6].hfname= hf_nds_nflags;
10183 pvalues[6].voffset = foffset;
10184 pvalues[6].bit1 = "Names";
10185 pvalues[6].bit1hfname = hf_bit1siflags;
10186 pvalues[6].bit2 = "Names and Values";
10187 pvalues[6].bit2hfname = hf_bit2siflags;
10188 pvalues[6].bit3 = "Effective Privileges";
10189 pvalues[6].bit3hfname = hf_bit3siflags;
10190 pvalues[6].bit4 = "Value Info";
10191 pvalues[6].bit4hfname = hf_bit4siflags;
10192 pvalues[6].bit5 = "Abbreviated Value";
10193 pvalues[6].bit5hfname = hf_bit5siflags;
10194 pvalues[6].bit6 = "Not Defined";
10195 pvalues[6].bit6hfname = hf_bit6siflags;
10196 pvalues[6].bit7 = "Not Defined";
10197 pvalues[6].bit7hfname = hf_bit7siflags;
10198 pvalues[6].bit8 = "Not Defined";
10199 pvalues[6].bit8hfname = hf_bit8siflags;
10200 pvalues[6].bit9 = "Expanded Class";
10201 pvalues[6].bit9hfname = hf_bit9siflags;
10202 pvalues[6].bit10 = "Not Defined";
10203 pvalues[6].bit10hfname = hf_bit10siflags;
10204 pvalues[6].bit11= "Not Defined";
10205 pvalues[6].bit11hfname = hf_bit11siflags;
10206 pvalues[6].bit12 = "Not Defined";
10207 pvalues[6].bit12hfname = hf_bit12siflags;
10208 pvalues[6].bit13 = "Not Defined";
10209 pvalues[6].bit13hfname = hf_bit13siflags;
10210 pvalues[6].bit14 = "Not Defined";
10211 pvalues[6].bit14hfname = hf_bit14siflags;
10212 pvalues[6].bit15 = "Not Defined";
10213 pvalues[6].bit15hfname = hf_bit15siflags;
10214 pvalues[6].bit16 = "Not Defined";
10215 pvalues[6].bit16hfname = hf_bit16siflags;
10216 foffset = foffset+4;
10217 if(pvalues[0].vvalue != 2)
10219 pvalues[7].vvalue = tvb_get_letohs(tvb, foffset);
10220 global_flags = tvb_get_letohl(tvb, foffset);
10221 pvalues[7].vtype = VTYPE_BITFIELD;
10222 pvalues[7].vdesc = "Information Flags (low) Byte:";
10223 pvalues[7].vlength = 2;
10224 pvalues[7].hfname= hf_nds_rflags;
10225 pvalues[7].voffset = foffset;
10226 pvalues[7].bit1 = "Output Flags";
10227 pvalues[7].bit1hfname = hf_bit1infoflagsl;
10228 pvalues[7].bit2 = "Entry ID";
10229 pvalues[7].bit2hfname = hf_bit2infoflagsl;
10230 pvalues[7].bit3 = "Entry Flags";
10231 pvalues[7].bit3hfname = hf_bit3infoflagsl;
10232 pvalues[7].bit4 = "Subordinate Count";
10233 pvalues[7].bit4hfname = hf_bit4infoflagsl;
10234 pvalues[7].bit5 = "Modification Time";
10235 pvalues[7].bit5hfname = hf_bit5infoflagsl;
10236 pvalues[7].bit6 = "Modification Timestamp";
10237 pvalues[7].bit6hfname = hf_bit6infoflagsl;
10238 pvalues[7].bit7 = "Creation Timestamp";
10239 pvalues[7].bit7hfname = hf_bit7infoflagsl;
10240 pvalues[7].bit8 = "Partition Root ID";
10241 pvalues[7].bit8hfname = hf_bit8infoflagsl;
10242 pvalues[7].bit9 = "Parent ID";
10243 pvalues[7].bit9hfname = hf_bit9infoflagsl;
10244 pvalues[7].bit10 = "Revision Count";
10245 pvalues[7].bit10hfname = hf_bit10infoflagsl;
10246 pvalues[7].bit11 = "Replica Type";
10247 pvalues[7].bit11hfname = hf_bit11infoflagsl;
10248 pvalues[7].bit12 = "Base Class";
10249 pvalues[7].bit12hfname = hf_bit12infoflagsl;
10250 pvalues[7].bit13 = "Relative Distinguished Name";
10251 pvalues[7].bit13hfname = hf_bit13infoflagsl;
10252 pvalues[7].bit14 = "Distinguished Name";
10253 pvalues[7].bit14hfname = hf_bit14infoflagsl;
10254 pvalues[7].bit15 = "Root Distinguished Name";
10255 pvalues[7].bit15hfname = hf_bit15infoflagsl;
10256 pvalues[7].bit16 = "Parent Distinguished Name";
10257 pvalues[7].bit16hfname = hf_bit16infoflagsl;
10258 foffset = foffset+2;
10259 pvalues[8].vvalue = tvb_get_letohs(tvb, foffset);
10260 pvalues[8].vtype = VTYPE_BITFIELD;
10261 pvalues[8].vdesc = "Information Flags (high) Byte:";
10262 pvalues[8].vlength = 2;
10263 pvalues[8].hfname= hf_nds_rflags;
10264 pvalues[8].voffset = foffset;
10265 pvalues[8].bit1 = "Purge Time";
10266 pvalues[8].bit1hfname = hf_bit1infoflagsh;
10267 pvalues[8].bit2 = "Dereference Base Class";
10268 pvalues[8].bit2hfname = hf_bit2infoflagsh;
10269 pvalues[8].bit3 = "Not Defined";
10270 pvalues[8].bit3hfname = hf_bit3infoflagsh;
10271 pvalues[8].bit4 = "Not Defined";
10272 pvalues[8].bit4hfname = hf_bit4infoflagsh;
10273 pvalues[8].bit5 = "Not Defined";
10274 pvalues[8].bit5hfname = hf_bit5infoflagsh;
10275 pvalues[8].bit6 = "Not Defined";
10276 pvalues[8].bit6hfname = hf_bit6infoflagsh;
10277 pvalues[8].bit7 = "Not Defined";
10278 pvalues[8].bit7hfname = hf_bit7infoflagsh;
10279 pvalues[8].bit8 = "Not Defined";
10280 pvalues[8].bit8hfname = hf_bit8infoflagsh;
10281 pvalues[8].bit9 = "Not Defined";
10282 pvalues[8].bit9hfname = hf_bit9infoflagsh;
10283 pvalues[8].bit10 = "Not Defined";
10284 pvalues[8].bit10hfname = hf_bit10infoflagsh;
10285 pvalues[8].bit11 = "Not Defined";
10286 pvalues[8].bit11hfname = hf_bit11infoflagsh;
10287 pvalues[8].bit12 = "Not Defined";
10288 pvalues[8].bit12hfname = hf_bit12infoflagsh;
10289 pvalues[8].bit13 = "Not Defined";
10290 pvalues[8].bit13hfname = hf_bit13infoflagsh;
10291 pvalues[8].bit14 = "Not Defined";
10292 pvalues[8].bit14hfname = hf_bit14infoflagsh;
10293 pvalues[8].bit15 = "Not Defined";
10294 pvalues[8].bit15hfname = hf_bit15infoflagsh;
10295 pvalues[8].bit16 = "Not Defined";
10296 pvalues[8].bit16hfname = hf_bit16infoflagsh;
10297 foffset = foffset+2;
10301 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10302 pvalues[0].vstring = "";
10303 pvalues[0].vtype = VTYPE_UINT32;
10304 pvalues[0].vdesc = "Version: %u";
10305 pvalues[0].vlength = 4;
10306 pvalues[0].voffset = foffset;
10307 pvalues[0].hfname= hf_nds_ver;
10308 foffset = foffset+pvalues[0].vlength;
10309 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10310 pvalues[1].vtype = VTYPE_UINT32;
10311 pvalues[1].vstring = "";
10312 pvalues[1].vdesc = "Request Flags: 0x%08x";
10313 pvalues[1].vlength = 4;
10314 pvalues[1].hfname= hf_nds_rflags;
10315 pvalues[1].voffset = foffset;
10316 foffset = foffset+4;
10317 if(pvalues[0].vvalue == 0)
10319 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10320 pvalues[2].vstring = "";
10321 pvalues[2].vtype = VTYPE_UINT32;
10322 pvalues[2].vdesc = "Parent Entry ID: 0x%08x";
10323 pvalues[2].vlength = 4;
10324 resolve_eid = FALSE;
10325 global_eid = pvalues[2].vvalue;
10326 pvalues[2].voffset = foffset;
10327 pvalues[2].hfname= hf_nds_eid;
10328 foffset = foffset+pvalues[2].vlength;
10329 pvalues[3].vtype = VTYPE_STRING;
10330 pvalues[3].vdesc = "Relative Distinguished Name: %s";
10331 pvalues[3].vstring = "";
10332 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
10333 pvalues[3].vvalue = 0;
10334 pvalues[3].vlength = 256;
10335 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
10336 if (pvalues[3].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[3].vlength))
10338 pvalues[3].vtype = VTYPE_NONE;
10341 pvalues[3].voffset = foffset+4;
10342 foffset = foffset + 4;
10343 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, req_buffer.buffer);
10344 pvalues[3].vstring = req_buffer.buffer;
10345 g_strlcpy(global_object_name, req_buffer.buffer, 256);
10346 pvalues[3].hfname= hf_nds_relative_dn;
10347 foffset = foffset+pvalues[3].vlength;
10348 foffset += align_4(tvb, foffset);
10349 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
10350 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
10351 pvalues[4].vstring = "";
10352 pvalues[4].vdesc = "Attributes: %u";
10353 pvalues[4].vlength = 4;
10354 pvalues[4].voffset = foffset;
10355 pvalues[4].mvtype = MVTYPE_ADD_ATTR_REQUEST;
10356 pvalues[4].hfname= hf_nds_attr;
10360 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10361 pvalues[2].vstring = "";
10362 pvalues[2].vtype = VTYPE_UINT32;
10363 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
10364 pvalues[2].vlength = 4;
10365 pvalues[2].voffset = foffset;
10366 pvalues[2].hfname= hf_nds_iteration;
10367 foffset = foffset+pvalues[2].vlength;
10368 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
10369 pvalues[3].vstring = "";
10370 pvalues[3].vtype = VTYPE_UINT32;
10371 pvalues[3].vdesc = "Parent Entry ID: 0x%08x";
10372 pvalues[3].vlength = 4;
10373 resolve_eid = FALSE;
10374 global_eid = pvalues[3].vvalue;
10375 pvalues[3].voffset = foffset;
10376 pvalues[3].hfname= hf_nds_eid;
10377 foffset = foffset+pvalues[3].vlength;
10378 pvalues[4].vtype = VTYPE_STRING;
10379 pvalues[4].vdesc = "Relative Distinguished Name: %s";
10380 pvalues[4].vstring = "";
10381 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST;
10382 pvalues[4].vvalue = 0;
10383 pvalues[4].vlength = 256;
10384 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
10385 if (pvalues[4].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[4].vlength))
10387 pvalues[4].vtype = VTYPE_NONE;
10390 pvalues[4].voffset = foffset+4;
10391 foffset = foffset + 4;
10392 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, req_buffer.buffer);
10393 pvalues[4].vstring = req_buffer.buffer;
10394 g_strlcpy(global_object_name, req_buffer.buffer, 256);
10395 pvalues[4].hfname= hf_nds_relative_dn;
10396 foffset = foffset+pvalues[4].vlength;
10397 foffset += align_4(tvb, foffset);
10398 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
10399 pvalues[5].vtype = VTYPE_MULTIVALUE_UINT32;
10400 pvalues[5].vstring = "";
10401 pvalues[5].vdesc = "Attributes: %u";
10402 pvalues[5].vlength = 4;
10403 pvalues[5].voffset = foffset;
10404 pvalues[5].mvtype = MVTYPE_ADD_ATTR_REQUEST;
10405 pvalues[5].hfname= hf_nds_attr;
10409 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10410 pvalues[0].vtype = VTYPE_UINT32;
10411 pvalues[0].vdesc = "Version: %u";
10412 pvalues[0].vlength = 4;
10413 pvalues[0].voffset = foffset;
10414 pvalues[0].hfname= hf_nds_ver;
10415 foffset = foffset+pvalues[0].vlength;
10416 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10417 pvalues[1].vtype = VTYPE_UINT32;
10418 pvalues[1].vdesc = "Entry ID: 0x%08x";
10419 pvalues[1].vlength = 4;
10420 resolve_eid = TRUE;
10421 global_eid = pvalues[1].vvalue;
10422 pvalues[1].voffset = foffset;
10423 pvalues[1].hfname= hf_nds_eid;
10424 foffset = foffset+pvalues[1].vlength;
10427 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10428 pvalues[0].vtype = VTYPE_UINT32;
10429 pvalues[0].vdesc = "Version: %u";
10430 pvalues[0].vlength = 4;
10431 pvalues[0].voffset = foffset;
10432 pvalues[0].hfname= hf_nds_ver;
10433 foffset = foffset+pvalues[0].vlength;
10434 if(pvalues[0].vvalue == 0)
10436 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10437 pvalues[1].vtype = VTYPE_UINT32;
10438 pvalues[1].vstring = "";
10439 pvalues[1].vdesc = "Iteration Handle: 0x%08x"; /* always 0 */
10440 pvalues[1].vlength = 4;
10441 pvalues[1].hfname= hf_nds_iteration;
10442 pvalues[1].voffset = foffset;
10443 foffset = foffset+4;
10444 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10445 pvalues[2].vstring = "";
10446 pvalues[2].vtype = VTYPE_UINT32;
10447 pvalues[2].vdesc = "Entry ID: 0x%08x";
10448 pvalues[2].vlength = 4;
10449 pvalues[2].voffset = foffset;
10450 resolve_eid = TRUE;
10451 global_eid = pvalues[2].vvalue;
10452 pvalues[2].hfname = hf_nds_eid;
10453 foffset = foffset+pvalues[2].vlength;
10454 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
10455 pvalues[3].vtype = VTYPE_MULTIVALUE_UINT32;
10456 pvalues[3].vstring = "";
10457 pvalues[3].vdesc = "Number of Attributes to Change %u";
10458 pvalues[3].vlength = 4;
10459 pvalues[3].mvtype = MVTYPE_MODIFY_ATTR_REQUEST;
10460 pvalues[3].hfname= hf_nds_number_of_changes;
10461 pvalues[3].voffset = foffset;
10465 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10466 pvalues[1].vtype = VTYPE_UINT32;
10467 pvalues[1].vstring = "";
10468 pvalues[1].vdesc = "Request Flags: 0x%08x"; /* always 0 */
10469 pvalues[1].vlength = 4;
10470 pvalues[1].hfname= hf_nds_rflags;
10471 pvalues[1].voffset = foffset;
10472 foffset = foffset+4;
10473 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10474 pvalues[2].vtype = VTYPE_UINT32;
10475 pvalues[2].vstring = "";
10476 pvalues[2].vdesc = "Iteration Handle: 0x%08x"; /* always 0 */
10477 pvalues[2].vlength = 4;
10478 pvalues[2].hfname= hf_nds_iteration;
10479 pvalues[2].voffset = foffset;
10480 foffset = foffset+4;
10481 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
10482 pvalues[3].vstring = "";
10483 pvalues[3].vtype = VTYPE_UINT32;
10484 pvalues[3].vdesc = "Entry ID: 0x%08x";
10485 pvalues[3].vlength = 4;
10486 pvalues[3].voffset = foffset;
10487 resolve_eid = TRUE;
10488 global_eid = pvalues[3].vvalue;
10489 pvalues[3].hfname = hf_nds_eid;
10490 foffset = foffset+pvalues[3].vlength;
10491 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
10492 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
10493 pvalues[4].vstring = "";
10494 pvalues[4].vdesc = "Number of Attributes to Change %u";
10495 pvalues[4].vlength = 4;
10496 pvalues[4].mvtype = MVTYPE_MODIFY_ATTR_REQUEST;
10497 pvalues[4].hfname= hf_nds_number_of_changes;
10498 pvalues[4].voffset = foffset;
10502 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10503 pvalues[0].vtype = VTYPE_UINT32;
10504 pvalues[0].vdesc = "Version: %u";
10505 pvalues[0].vlength = 4;
10506 pvalues[0].voffset = foffset;
10507 pvalues[0].hfname= hf_nds_ver;
10508 foffset = foffset+pvalues[0].vlength;
10509 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10510 pvalues[1].vtype = VTYPE_UINT32;
10511 pvalues[1].vdesc = "Entry ID: 0x%08x";
10512 pvalues[1].vlength = 4;
10513 resolve_eid = TRUE;
10514 global_eid = pvalues[1].vvalue;
10515 pvalues[1].voffset = foffset;
10516 pvalues[1].hfname = hf_nds_eid;
10517 foffset = foffset+pvalues[1].vlength;
10518 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10519 pvalues[2].vtype = VTYPE_BOOLEAN;
10520 pvalues[2].vdesc = "Keep Original RDN: %s";
10521 pvalues[2].vlength = 4;
10522 pvalues[2].voffset = foffset;
10523 pvalues[2].mvtype = 0;
10524 pvalues[2].hfname= hf_nds_keep;
10525 foffset = foffset+4;
10526 foffset += align_4(tvb, foffset);
10527 pvalues[3].vtype = VTYPE_STRING;
10528 pvalues[3].vdesc = "New RDN: %s";
10529 pvalues[3].mvtype = 0;
10530 pvalues[3].vvalue = 0;
10531 pvalues[3].vlength = 256;
10532 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
10533 pvalues[3].voffset = foffset+4;
10534 foffset = foffset + 4;
10535 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
10536 pvalues[3].hfname= hf_nds_new_rdn;
10537 foffset = foffset+pvalues[3].vlength;
10540 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10541 pvalues[0].vtype = VTYPE_UINT32;
10542 pvalues[0].vdesc = "Version: %u";
10543 pvalues[0].vlength = 4;
10544 pvalues[0].voffset = foffset;
10545 pvalues[0].hfname= hf_nds_ver;
10546 foffset = foffset+pvalues[0].vlength;
10547 pvalues[1].vvalue = tvb_get_letohs(tvb, foffset);
10548 global_flags = tvb_get_letohl(tvb, foffset);
10549 pvalues[1].vtype = VTYPE_BITFIELD;
10550 pvalues[1].vdesc = "Attribute Constraints:";
10551 pvalues[1].vlength = 2;
10552 pvalues[1].hfname= hf_nds_acflags;
10553 pvalues[1].voffset = foffset;
10554 pvalues[1].bit1 = "Single Valued";
10555 pvalues[1].bit1hfname = hf_bit1acflags;
10556 pvalues[1].bit2 = "Sized";
10557 pvalues[1].bit2hfname = hf_bit2acflags;
10558 pvalues[1].bit3 = "Non-Removable";
10559 pvalues[1].bit3hfname = hf_bit3acflags;
10560 pvalues[1].bit4 = "Read Only";
10561 pvalues[1].bit4hfname = hf_bit4acflags;
10562 pvalues[1].bit5 = "Hidden";
10563 pvalues[1].bit5hfname = hf_bit5acflags;
10564 pvalues[1].bit6 = "String";
10565 pvalues[1].bit6hfname = hf_bit6acflags;
10566 pvalues[1].bit7 = "Synchronize Immediate";
10567 pvalues[1].bit7hfname = hf_bit7acflags;
10568 pvalues[1].bit8 = "Public Read";
10569 pvalues[1].bit8hfname = hf_bit8acflags;
10570 pvalues[1].bit9 = "Server Read";
10571 pvalues[1].bit9hfname = hf_bit9acflags;
10572 pvalues[1].bit10 = "Write Managed";
10573 pvalues[1].bit10hfname = hf_bit10acflags;
10574 pvalues[1].bit11 = "Per Replica";
10575 pvalues[1].bit11hfname = hf_bit11acflags;
10576 pvalues[1].bit12 = "Never Schedule Synchronization";
10577 pvalues[1].bit12hfname = hf_bit12acflags;
10578 pvalues[1].bit13 = "Operational";
10579 pvalues[1].bit13hfname = hf_bit13acflags;
10580 pvalues[1].bit14 = "Not Defined";
10581 pvalues[1].bit14hfname = hf_bit14acflags;
10582 pvalues[1].bit15 = "Not Defined";
10583 pvalues[1].bit15hfname = hf_bit15acflags;
10584 pvalues[1].bit16 = "Not Defined";
10585 pvalues[1].bit16hfname = hf_bit16acflags;
10586 foffset = foffset+4;
10587 pvalues[2].vtype = VTYPE_STRING;
10588 pvalues[2].vdesc = "Attribute Name: %s";
10589 pvalues[2].mvtype = MVTYPE_ATTR_REQUEST;
10590 pvalues[2].vvalue = 0;
10591 pvalues[2].vlength = 256;
10592 pvalues[2].vlength = tvb_get_letohl(tvb, foffset);
10593 if (pvalues[2].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[2].vlength))
10595 pvalues[2].vtype = VTYPE_NONE;
10598 pvalues[2].voffset = foffset+4;
10599 foffset = foffset + 4;
10600 get_string(tvb, pvalues[2].voffset, pvalues[2].vlength, req_buffer.buffer);
10601 pvalues[2].vstring = req_buffer.buffer;
10602 g_strlcpy(global_object_name, req_buffer.buffer, 256);
10603 pvalues[2].hfname= hf_nds_name;
10604 foffset = foffset+pvalues[2].vlength;
10605 foffset += align_4(tvb, foffset);
10606 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
10607 pvalues[3].vstring = (char *)match_strval(pvalues[3].vvalue, nds_syntax);
10608 if(pvalues[3].vstring == NULL)
10610 pvalues[3].vstring = "No Syntax Found";
10612 pvalues[3].vtype = VTYPE_STRING;
10613 pvalues[3].vdesc = "Syntax: %s";
10614 pvalues[3].vlength = 4;
10615 pvalues[3].voffset = foffset;
10616 pvalues[3].hfname= hf_nds_syntax;
10617 pvalues[3].mvtype = 0;
10618 foffset = foffset+pvalues[3].vlength;
10619 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
10620 pvalues[4].vtype = VTYPE_UINT32;
10621 pvalues[4].vdesc = "Lower Limit Value %u";
10622 pvalues[4].vlength = 4;
10623 pvalues[4].voffset = foffset;
10624 pvalues[4].hfname = hf_nds_lower;
10626 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
10627 pvalues[5].vtype = VTYPE_UINT32;
10628 pvalues[5].vdesc = "Upper Limit Value %u";
10629 pvalues[5].vlength = 4;
10630 pvalues[5].voffset = foffset;
10631 pvalues[5].hfname = hf_nds_upper;
10633 pvalues[6].vvalue = tvb_get_letohl(tvb, foffset); /* Length of bytes field */
10635 pvalues[6].vtype = VTYPE_BYTES;
10636 pvalues[6].vdesc = "ASN.1 ID";
10637 pvalues[6].vlength = pvalues[6].vvalue;
10638 pvalues[6].voffset = foffset;
10639 pvalues[6].hfname = hf_nds_asn1;
10642 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
10645 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10646 pvalues[0].vtype = VTYPE_UINT32;
10647 pvalues[0].vdesc = "Version: %u";
10648 pvalues[0].vlength = 4;
10649 pvalues[0].voffset = foffset;
10650 pvalues[0].hfname= hf_nds_ver;
10651 foffset = foffset+pvalues[0].vlength;
10652 pvalues[1].vtype = VTYPE_STRING;
10653 pvalues[1].vdesc = "Attribute Name: %s";
10654 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
10655 pvalues[1].vvalue = 0;
10656 pvalues[1].vlength = 256;
10657 pvalues[1].vlength = tvb_get_letohl(tvb, foffset);
10658 if (pvalues[1].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[1].vlength))
10660 pvalues[1].vtype = VTYPE_NONE;
10663 pvalues[1].voffset = foffset+4;
10664 foffset = foffset + 4;
10665 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, req_buffer.buffer);
10666 pvalues[1].vstring = req_buffer.buffer;
10667 g_strlcpy(global_object_name, req_buffer.buffer, 256);
10668 pvalues[1].hfname= hf_nds_attribute_dn;
10671 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
10674 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10675 pvalues[0].vtype = VTYPE_UINT32;
10676 pvalues[0].vdesc = "Version: %u";
10677 pvalues[0].vlength = 4;
10678 pvalues[0].voffset = foffset;
10679 pvalues[0].hfname= hf_nds_ver;
10680 foffset = foffset+pvalues[0].vlength;
10681 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10682 pvalues[1].vtype = VTYPE_UINT32;
10683 pvalues[1].vdesc = "Iteration Handle: 0x%08x";
10684 pvalues[1].vlength = 4;
10685 pvalues[1].voffset = foffset;
10686 pvalues[1].hfname= hf_nds_iteration;
10687 foffset = foffset+pvalues[1].vlength;
10688 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10689 global_flags = pvalues[2].vvalue;
10690 pvalues[2].vstring = (char *)match_strval(pvalues[2].vvalue, class_def_type);
10691 if(pvalues[2].vstring == NULL)
10693 pvalues[2].vstring = "No Class Definition Type Set";
10695 pvalues[2].vtype = VTYPE_STRING;
10696 pvalues[2].vdesc = "Class Definition Type: %s";
10697 pvalues[2].vlength = 4;
10698 pvalues[2].voffset = foffset;
10699 pvalues[2].mvtype = 0;
10700 pvalues[2].hfname= hf_nds_class_def_type;
10701 foffset = foffset + pvalues[2].vlength;
10702 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
10703 if (pvalues[3].vvalue == 0x00000000)
10705 pvalues[3].vstring = "Do Not Return All Classes";
10706 pvalues[3].mvtype = 0;
10710 pvalues[3].vstring = "Return All Classes";
10711 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
10713 pvalues[3].vtype = VTYPE_STRING;
10714 pvalues[3].vdesc = "%s";
10715 pvalues[3].vlength = 4;
10716 pvalues[3].voffset = foffset;
10717 pvalues[3].hfname= hf_nds_return_all_classes;
10718 foffset = foffset + pvalues[3].vlength;
10719 foffset += align_4(tvb, foffset);
10720 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
10721 pvalues[4].vtype = VTYPE_MULTIVALUE_UINT32;
10722 pvalues[4].vdesc = "Classes: %d";
10723 pvalues[4].vlength = 4;
10724 pvalues[4].voffset = foffset;
10725 pvalues[4].mvtype = MVTYPE_READ_CLASS_REQ;
10726 pvalues[4].hfname= hf_nds_classes;
10729 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10730 pvalues[0].vtype = VTYPE_UINT32;
10731 pvalues[0].vdesc = "Version: %u";
10732 pvalues[0].vlength = 4;
10733 pvalues[0].voffset = foffset;
10734 pvalues[0].hfname= hf_nds_ver;
10735 foffset = foffset+pvalues[0].vlength;
10736 pvalues[1].vtype = VTYPE_STRING;
10737 pvalues[1].vdesc = "Class Name: %s";
10738 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
10739 pvalues[1].vvalue = 0;
10740 pvalues[1].vlength = 256;
10741 pvalues[1].vlength = tvb_get_letohl(tvb, foffset);
10742 if (pvalues[1].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[1].vlength))
10744 pvalues[1].vtype = VTYPE_NONE;
10747 pvalues[1].voffset = foffset+4;
10748 foffset = foffset + 4;
10749 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, req_buffer.buffer);
10750 pvalues[1].vstring = req_buffer.buffer;
10751 g_strlcpy(global_object_name, req_buffer.buffer, 256);
10752 pvalues[1].hfname= hf_nds_base_class;
10753 foffset = foffset+pvalues[1].vlength;
10754 foffset += align_4(tvb, foffset);
10755 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10756 pvalues[2].vtype = VTYPE_MULTIVALUE_UINT32;
10757 pvalues[2].vdesc = "Number of Attributes to Add: %u";
10758 pvalues[2].vlength = 4;
10759 pvalues[2].voffset = foffset;
10760 pvalues[2].mvtype = MVTYPE_MODIFY_CLASS;
10761 pvalues[2].hfname= hf_nds_att_add;
10764 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10765 pvalues[0].vtype = VTYPE_UINT32;
10766 pvalues[0].vdesc = "Version: %u";
10767 pvalues[0].vlength = 4;
10768 pvalues[0].voffset = foffset;
10769 pvalues[0].hfname= hf_nds_ver;
10770 foffset = foffset+pvalues[0].vlength;
10771 pvalues[1].vtype = VTYPE_STRING;
10772 pvalues[1].vdesc = "Class Name: %s";
10773 pvalues[1].mvtype = MVTYPE_ATTR_REQUEST;
10774 pvalues[1].vvalue = 0;
10775 pvalues[1].vlength = 256;
10776 pvalues[1].vlength = tvb_get_letohl(tvb, foffset);
10777 if (pvalues[1].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[1].vlength))
10779 pvalues[1].vtype = VTYPE_NONE;
10782 pvalues[1].voffset = foffset+4;
10783 foffset = foffset + 4;
10784 get_string(tvb, pvalues[1].voffset, pvalues[1].vlength, req_buffer.buffer);
10785 pvalues[1].vstring = req_buffer.buffer;
10786 g_strlcpy(global_object_name, req_buffer.buffer, 256);
10787 pvalues[1].hfname= hf_nds_base;
10790 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10791 pvalues[0].vtype = VTYPE_UINT32;
10792 pvalues[0].vdesc = "Version: %u";
10793 pvalues[0].vlength = 4;
10794 pvalues[0].voffset = foffset;
10795 pvalues[0].hfname= hf_nds_ver;
10796 foffset = foffset+pvalues[0].vlength;
10797 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10798 pvalues[1].vtype = VTYPE_UINT32;
10799 pvalues[1].vdesc = "Iteration Handle: 0x%08x";
10800 pvalues[1].vlength = 4;
10801 pvalues[1].voffset = foffset;
10802 pvalues[1].hfname= hf_nds_iteration;
10803 foffset = foffset+pvalues[1].vlength;
10804 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10805 pvalues[2].vtype = VTYPE_UINT32;
10806 pvalues[2].vdesc = "Entry ID: 0x%08x";
10807 pvalues[2].vlength = 4;
10808 resolve_eid = TRUE;
10809 global_eid = pvalues[2].vvalue;
10810 pvalues[2].voffset = foffset;
10811 pvalues[2].hfname= hf_nds_eid;
10812 foffset = foffset+pvalues[2].vlength;
10815 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10816 pvalues[0].vtype = VTYPE_UINT32;
10817 pvalues[0].vdesc = "Version: %u";
10818 pvalues[0].vlength = 4;
10819 pvalues[0].voffset = foffset;
10820 pvalues[0].hfname= hf_nds_ver;
10821 foffset = foffset+pvalues[0].vlength;
10822 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10823 pvalues[1].vtype = VTYPE_UINT32;
10824 pvalues[1].vdesc = "Entry ID: 0x%08x";
10825 pvalues[1].vlength = 4;
10826 resolve_eid = TRUE;
10827 global_eid = pvalues[1].vvalue;
10828 pvalues[1].voffset = foffset;
10829 pvalues[1].hfname= hf_nds_eid;
10830 foffset = foffset+pvalues[1].vlength;
10831 pvalues[2].vtype = VTYPE_STRING;
10832 pvalues[2].vdesc = "Trustee Name: %s";
10833 pvalues[2].mvtype = MVTYPE_ATTR_REQUEST;
10834 pvalues[2].vvalue = 0;
10835 pvalues[2].vlength = 256;
10836 pvalues[2].vlength = tvb_get_letohl(tvb, foffset);
10837 if (pvalues[2].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[2].vlength))
10839 pvalues[2].vtype = VTYPE_NONE;
10842 pvalues[2].voffset = foffset+4;
10843 foffset = foffset + 4;
10844 get_string(tvb, pvalues[2].voffset, pvalues[2].vlength, req_buffer.buffer);
10845 pvalues[2].vstring = req_buffer.buffer;
10846 pvalues[2].hfname= hf_nds_name;
10847 foffset = foffset+pvalues[2].vlength;
10848 foffset += align_4(tvb, foffset);
10849 pvalues[3].vtype = VTYPE_STRING;
10850 pvalues[3].vdesc = "Attribute to be Checked: %s";
10851 pvalues[3].mvtype = 0;
10852 pvalues[3].vvalue = 0;
10853 pvalues[3].vlength = 256;
10854 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
10855 if (pvalues[3].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[3].vlength))
10857 pvalues[3].vtype = VTYPE_NONE;
10860 pvalues[3].voffset = foffset+4;
10861 foffset = foffset + 4;
10862 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
10863 pvalues[3].hfname= hf_nds_name;
10864 foffset = foffset+pvalues[3].vlength;
10865 foffset += align_4(tvb, foffset);
10866 if(pvalues[0].vvalue != 0)
10868 pvalues[4].vtype = VTYPE_STRING;
10869 pvalues[4].vdesc = "Security Equivalence: %s";
10870 pvalues[4].mvtype = MVTYPE_ATTR_REQUEST;
10871 pvalues[4].vvalue = 0;
10872 pvalues[4].vlength = 256;
10873 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
10874 if (pvalues[4].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[4].vlength))
10876 pvalues[4].vtype = VTYPE_NONE;
10879 pvalues[4].voffset = foffset+4;
10880 foffset = foffset + 4;
10881 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, pvalues[4].vstring);
10882 pvalues[4].hfname= hf_nds_name;
10883 foffset = foffset+pvalues[4].vlength;
10884 foffset += align_4(tvb, foffset);
10888 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
10891 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
10894 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
10895 pvalues[0].vtype = VTYPE_UINT32;
10896 pvalues[0].vdesc = "Version: %u";
10897 pvalues[0].vlength = 4;
10898 pvalues[0].voffset = foffset;
10899 pvalues[0].hfname= hf_nds_ver;
10900 foffset = foffset+pvalues[0].vlength;
10901 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
10902 pvalues[1].vtype = VTYPE_BITFIELD;
10903 pvalues[1].vdesc = "Request Flags:";
10904 pvalues[1].vlength = 2;
10905 pvalues[1].hfname= hf_nds_rflags;
10906 pvalues[1].voffset = foffset;
10907 pvalues[1].bit1 = "Typeless";
10908 pvalues[1].bit1hfname = hf_nds_bit1;
10909 pvalues[1].bit2 = "All Containers";
10910 pvalues[1].bit2hfname = hf_nds_bit2;
10911 pvalues[1].bit3 = "Slashed";
10912 pvalues[1].bit3hfname = hf_nds_bit3;
10913 pvalues[1].bit4 = "Dotted";
10914 pvalues[1].bit4hfname = hf_nds_bit4;
10915 pvalues[1].bit5 = "Tuned";
10916 pvalues[1].bit5hfname = hf_nds_bit5;
10917 pvalues[1].bit6 = "Not Defined";
10918 pvalues[1].bit6hfname = hf_nds_bit6;
10919 pvalues[1].bit7 = "Not Defined";
10920 pvalues[1].bit7hfname = hf_nds_bit7;
10921 pvalues[1].bit8 = "Not Defined";
10922 pvalues[1].bit8hfname = hf_nds_bit8;
10923 pvalues[1].bit9 = "Not Defined";
10924 pvalues[1].bit9hfname = hf_nds_bit9;
10925 pvalues[1].bit10 = "Not Defined";
10926 pvalues[1].bit10hfname = hf_nds_bit10;
10927 pvalues[1].bit11 = "Not Defined";
10928 pvalues[1].bit11hfname = hf_nds_bit11;
10929 pvalues[1].bit12 = "Not Defined";
10930 pvalues[1].bit12hfname = hf_nds_bit12;
10931 pvalues[1].bit13 = "Not Defined";
10932 pvalues[1].bit13hfname = hf_nds_bit13;
10933 pvalues[1].bit14 = "Not Defined";
10934 pvalues[1].bit14hfname = hf_nds_bit14;
10935 pvalues[1].bit15 = "Not Defined";
10936 pvalues[1].bit15hfname = hf_nds_bit15;
10937 pvalues[1].bit16 = "Not Defined";
10938 pvalues[1].bit16hfname = hf_nds_bit16;
10939 foffset = foffset+pvalues[1].vlength;
10940 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
10941 pvalues[2].vtype = VTYPE_UINT32;
10942 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
10943 pvalues[2].vlength = 4;
10944 pvalues[2].voffset = foffset;
10945 pvalues[2].hfname= hf_nds_iteration;
10946 foffset = foffset+pvalues[2].vlength;
10947 if(pvalues[0].vvalue == 0)
10949 global_flags = 0x000000c0;
10952 pvalues[3].vvalue = tvb_get_letohs(tvb, foffset);
10953 pvalues[3].vtype = VTYPE_BITFIELD;
10954 pvalues[3].vdesc = "Information Flags (low) Byte:";
10955 pvalues[3].vlength = 2;
10956 pvalues[3].hfname= hf_nds_rflags;
10957 pvalues[3].voffset = foffset;
10958 pvalues[3].bit1 = "Output Flags";
10959 pvalues[3].bit1hfname = hf_bit1l1flagsl;
10960 pvalues[3].bit2 = "Entry ID";
10961 pvalues[3].bit2hfname = hf_bit2l1flagsl;
10962 pvalues[3].bit3 = "Replica State";
10963 pvalues[3].bit3hfname = hf_bit3l1flagsl;
10964 pvalues[3].bit4 = "Modification Timestamp";
10965 pvalues[3].bit4hfname = hf_bit4l1flagsl;
10966 pvalues[3].bit5 = "Purge Time";
10967 pvalues[3].bit5hfname = hf_bit5l1flagsl;
10968 pvalues[3].bit6 = "Local Partition ID";
10969 pvalues[3].bit6hfname = hf_bit6l1flagsl;
10970 pvalues[3].bit7 = "Distinguished Name";
10971 pvalues[3].bit7hfname = hf_bit7l1flagsl;
10972 pvalues[3].bit8 = "Replica Type";
10973 pvalues[3].bit8hfname = hf_bit8l1flagsl;
10974 pvalues[3].bit9 = "Partition Busy";
10975 pvalues[3].bit9hfname = hf_bit9l1flagsl;
10976 pvalues[3].bit10 = "Not Defined";
10977 pvalues[3].bit10hfname = hf_bit10l1flagsl;
10978 pvalues[3].bit11 = "Not Defined";
10979 pvalues[3].bit11hfname = hf_bit11l1flagsl;
10980 pvalues[3].bit12 = "Not Defined";
10981 pvalues[3].bit12hfname = hf_bit12l1flagsl;
10982 pvalues[3].bit13 = "Not Defined";
10983 pvalues[3].bit13hfname = hf_bit13l1flagsl;
10984 pvalues[3].bit14 = "Not Defined";
10985 pvalues[3].bit14hfname = hf_bit14l1flagsl;
10986 pvalues[3].bit15 = "Not Defined";
10987 pvalues[3].bit15hfname = hf_bit15l1flagsl;
10988 pvalues[3].bit16 = "Not Defined";
10989 pvalues[3].bit16hfname = hf_bit16l1flagsl;
10990 global_flags = pvalues[3].vvalue;
10991 foffset = foffset+2;
10992 pvalues[4].vvalue = tvb_get_letohs(tvb, foffset);
10993 pvalues[4].vtype = VTYPE_BITFIELD;
10994 pvalues[4].vdesc = "Information Flags (high) Byte:";
10995 pvalues[4].vlength = 2;
10996 pvalues[4].hfname= hf_nds_rflags;
10997 pvalues[4].voffset = foffset;
10998 pvalues[4].bit1 = "Not Defined";
10999 pvalues[4].bit1hfname = hf_bit1l1flagsl;
11000 pvalues[4].bit2 = "Not Defined";
11001 pvalues[4].bit2hfname = hf_bit2l1flagsl;
11002 pvalues[4].bit3 = "Not Defined";
11003 pvalues[4].bit3hfname = hf_bit3l1flagsl;
11004 pvalues[4].bit4 = "Not Defined";
11005 pvalues[4].bit4hfname = hf_bit4l1flagsl;
11006 pvalues[4].bit5 = "Not Defined";
11007 pvalues[4].bit5hfname = hf_bit5l1flagsl;
11008 pvalues[4].bit6 = "Not Defined";
11009 pvalues[4].bit6hfname = hf_bit6l1flagsl;
11010 pvalues[4].bit7 = "Not Defined";
11011 pvalues[4].bit7hfname = hf_bit7l1flagsl;
11012 pvalues[4].bit8 = "Not Defined";
11013 pvalues[4].bit8hfname = hf_bit8l1flagsl;
11014 pvalues[4].bit9 = "Not Defined";
11015 pvalues[4].bit9hfname = hf_bit9l1flagsl;
11016 pvalues[4].bit10 = "Not Defined";
11017 pvalues[4].bit10hfname = hf_bit10l1flagsl;
11018 pvalues[4].bit11 = "Not Defined";
11019 pvalues[4].bit11hfname = hf_bit11l1flagsl;
11020 pvalues[4].bit12 = "Not Defined";
11021 pvalues[4].bit12hfname = hf_bit12l1flagsl;
11022 pvalues[4].bit13 = "Not Defined";
11023 pvalues[4].bit13hfname = hf_bit13l1flagsl;
11024 pvalues[4].bit14 = "Not Defined";
11025 pvalues[4].bit14hfname = hf_bit14l1flagsl;
11026 pvalues[4].bit15 = "Not Defined";
11027 pvalues[4].bit15hfname = hf_bit15l1flagsl;
11028 pvalues[4].bit16 = "Not Defined";
11029 pvalues[4].bit16hfname = hf_bit16l1flagsl;
11030 foffset = foffset+2;
11031 if(pvalues[0].vvalue == 1)
11035 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
11036 pvalues[5].vtype = VTYPE_UINT32;
11037 pvalues[5].vdesc = "Partition Root ID: 0x%08x";
11038 pvalues[5].vlength = 4;
11039 pvalues[5].voffset = foffset;
11040 pvalues[5].hfname= hf_nds_partition_root_id;
11041 foffset = foffset+pvalues[5].vlength;
11044 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11045 pvalues[0].vtype = VTYPE_UINT32;
11046 pvalues[0].vdesc = "Version: %u";
11047 pvalues[0].vlength = 4;
11048 pvalues[0].hfname = hf_nds_ver;
11049 pvalues[0].voffset = foffset;
11050 foffset = foffset+pvalues[0].vlength;
11051 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11052 pvalues[1].vtype = VTYPE_UINT32;
11053 pvalues[1].vdesc = "Flags: 0x%08x";
11054 pvalues[1].vlength = 4;
11055 pvalues[1].hfname = hf_nds_req_flags;
11056 pvalues[1].voffset = foffset;
11057 foffset = foffset+pvalues[1].vlength;
11058 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11059 pvalues[2].vtype = VTYPE_UINT32;
11060 pvalues[2].vdesc = "New Partition Root ID: 0x%08x";
11061 pvalues[2].vlength = 4;
11062 pvalues[2].voffset = foffset;
11063 pvalues[2].hfname= hf_nds_new_part_id;
11064 foffset = foffset+pvalues[2].vlength;
11067 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11068 pvalues[0].vtype = VTYPE_UINT32;
11069 pvalues[0].vdesc = "Version: %u";
11070 pvalues[0].vlength = 4;
11071 pvalues[0].hfname = hf_nds_ver;
11072 pvalues[0].voffset = foffset;
11073 foffset = foffset+pvalues[0].vlength;
11074 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11075 pvalues[1].vtype = VTYPE_UINT32;
11076 pvalues[1].vdesc = "Flags: 0x%08x";
11077 pvalues[1].vlength = 4;
11078 pvalues[1].hfname = hf_nds_req_flags;
11079 pvalues[1].voffset = foffset;
11080 foffset = foffset+pvalues[1].vlength;
11081 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11082 pvalues[2].vtype = VTYPE_UINT32;
11083 pvalues[2].vdesc = "Child Partition Root ID: 0x%08x";
11084 pvalues[2].vlength = 4;
11085 pvalues[2].voffset = foffset;
11086 pvalues[2].hfname= hf_nds_child_part_id;
11087 foffset = foffset+pvalues[2].vlength;
11090 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11091 pvalues[0].vtype = VTYPE_UINT32;
11092 pvalues[0].vdesc = "Version: %u";
11093 pvalues[0].vlength = 4;
11094 pvalues[0].hfname = hf_nds_ver;
11095 pvalues[0].voffset = foffset;
11096 foffset = foffset+pvalues[0].vlength;
11097 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11098 pvalues[1].vtype = VTYPE_UINT32;
11099 pvalues[1].vdesc = "Flags: 0x%08x";
11100 pvalues[1].vlength = 4;
11101 pvalues[1].hfname = hf_nds_req_flags;
11102 pvalues[1].voffset = foffset;
11103 foffset = foffset+pvalues[1].vlength;
11104 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11105 pvalues[2].vtype = VTYPE_UINT32;
11106 pvalues[2].vdesc = "Master Partition Root ID: 0x%08x";
11107 pvalues[2].vlength = 4;
11108 pvalues[2].voffset = foffset;
11109 pvalues[2].hfname= hf_nds_master_part_id;
11110 foffset = foffset+pvalues[2].vlength;
11111 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
11112 pvalues[3].vstring = (char *)match_strval(pvalues[3].vvalue, nds_replica_type);
11113 if(pvalues[3].vstring == NULL)
11115 pvalues[3].vstring = "No Replica Type Found";
11117 pvalues[3].vtype = VTYPE_STRING;
11118 pvalues[3].vdesc = "Replica Type: %s";
11119 pvalues[3].vlength = 4;
11120 pvalues[3].voffset = foffset;
11121 pvalues[3].mvtype = 0;
11122 pvalues[3].hfname= hf_replica_type;
11123 foffset = foffset + pvalues[3].vlength;
11124 pvalues[4].vtype = VTYPE_STRING;
11125 pvalues[4].vdesc = "Target Server Name: %s";
11126 pvalues[4].mvtype = 0;
11127 pvalues[4].vvalue = 0;
11128 pvalues[4].vlength = 256;
11129 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
11130 if (pvalues[4].vlength == 0x00 && !tvb_bytes_exist(tvb, foffset, pvalues[4].vlength))
11132 pvalues[4].vtype = VTYPE_NONE;
11135 pvalues[4].voffset = foffset+4;
11136 foffset = foffset + 4;
11137 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, pvalues[4].vstring);
11138 pvalues[4].hfname= hf_nds_target_name;
11141 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11144 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11145 pvalues[0].vtype = VTYPE_UINT32;
11146 pvalues[0].vdesc = "Version: %u";
11147 pvalues[0].vlength = 4;
11148 pvalues[0].hfname = hf_nds_ver;
11149 pvalues[0].voffset = foffset;
11150 foffset = foffset+pvalues[0].vlength;
11151 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11152 pvalues[1].vtype = VTYPE_UINT32;
11153 pvalues[1].vdesc = "Streams Flags: 0x%08x";
11154 pvalues[1].vlength = 4;
11155 pvalues[1].hfname = hf_nds_stream_flags;
11156 pvalues[1].voffset = foffset;
11157 foffset = foffset+pvalues[1].vlength;
11158 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11159 pvalues[2].vtype = VTYPE_UINT32;
11160 pvalues[2].vdesc = "Entry ID: 0x%08x";
11161 pvalues[2].vlength = 4;
11162 resolve_eid = TRUE;
11163 global_eid = pvalues[2].vvalue;
11164 pvalues[2].voffset = foffset;
11165 pvalues[2].hfname= hf_nds_eid;
11166 foffset = foffset+pvalues[2].vlength;
11167 pvalues[3].vtype = VTYPE_STRING;
11168 pvalues[3].vdesc = "Stream Name: %s";
11169 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
11170 pvalues[3].vvalue = 0;
11171 pvalues[3].vlength = 256;
11172 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
11173 if (pvalues[3].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[3].vlength))
11175 pvalues[3].vtype = VTYPE_NONE;
11178 pvalues[3].voffset = foffset+4;
11180 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
11181 foffset += pvalues[3].vlength;
11182 foffset += align_4(tvb, foffset);
11183 pvalues[3].hfname= hf_nds_stream_name;
11186 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11189 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11192 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11195 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11198 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11201 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11204 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11207 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11210 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11213 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11216 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11217 pvalues[0].vtype = VTYPE_UINT32;
11218 pvalues[0].vdesc = "Version: %u";
11219 pvalues[0].vlength = 4;
11220 pvalues[0].hfname = hf_nds_ver;
11221 pvalues[0].voffset = foffset;
11222 foffset = foffset+pvalues[0].vlength;
11223 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11224 pvalues[1].vtype = VTYPE_UINT32;
11225 pvalues[1].vdesc = "Flags: 0x%08x";
11226 pvalues[1].vlength = 4;
11227 pvalues[1].hfname = hf_nds_req_flags;
11228 pvalues[1].voffset = foffset;
11229 foffset = foffset+pvalues[1].vlength;
11230 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11231 pvalues[2].vtype = VTYPE_UINT32;
11232 pvalues[2].vdesc = "Time Delay in Seconds: %u";
11233 pvalues[2].vlength = 4;
11234 pvalues[2].voffset = foffset;
11235 pvalues[2].hfname= hf_nds_time_delay;
11236 foffset = foffset+pvalues[2].vlength;
11237 if(pvalues[0].vvalue == 0)
11239 pvalues[3].vtype = VTYPE_STRING;
11240 pvalues[3].vdesc = "Root Most Object Name: %s";
11241 pvalues[3].mvtype = MVTYPE_ATTR_REQUEST;
11242 pvalues[3].vvalue = 0;
11243 pvalues[3].vlength = 256;
11244 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
11245 if (pvalues[3].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[3].vlength))
11247 pvalues[3].vtype = VTYPE_NONE;
11250 pvalues[3].voffset = foffset+4;
11252 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
11253 foffset += pvalues[3].vlength;
11254 foffset += align_4(tvb, foffset);
11255 pvalues[3].hfname= hf_nds_root_name;
11259 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
11260 pvalues[3].vtype = VTYPE_UINT32;
11261 pvalues[3].vdesc = "Entry ID: 0x%08x";
11262 pvalues[3].vlength = 4;
11263 resolve_eid = TRUE;
11264 global_eid = pvalues[3].vvalue;
11265 pvalues[3].voffset = foffset;
11266 pvalues[3].hfname= hf_nds_eid;
11267 foffset = foffset+pvalues[3].vlength;
11268 resolve_eid = TRUE;
11269 global_eid = pvalues[3].vvalue;
11273 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11276 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11279 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11282 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11283 pvalues[0].vtype = VTYPE_UINT32;
11284 pvalues[0].vdesc = "Version: %u";
11285 pvalues[0].vlength = 4;
11286 pvalues[0].hfname = hf_nds_ver;
11287 pvalues[0].voffset = foffset;
11288 foffset = foffset+pvalues[0].vlength;
11289 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11290 pvalues[1].vtype = VTYPE_UINT32;
11291 pvalues[1].vdesc = "Flags: 0x%08x";
11292 pvalues[1].vlength = 4;
11293 pvalues[1].hfname = hf_nds_req_flags;
11294 pvalues[1].voffset = foffset;
11295 foffset = foffset+pvalues[1].vlength;
11296 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11297 pvalues[2].vtype = VTYPE_UINT32;
11298 pvalues[2].vdesc = "Destination Parent Entry ID: 0x%08x";
11299 pvalues[2].vlength = 4;
11300 resolve_eid = TRUE;
11301 global_eid = pvalues[2].vvalue;
11302 pvalues[2].voffset = foffset;
11303 pvalues[2].hfname= hf_nds_eid;
11304 foffset = foffset+pvalues[2].vlength;
11305 resolve_eid = TRUE;
11306 global_eid = pvalues[2].vvalue;
11307 pvalues[3].vtype = VTYPE_STRING;
11308 pvalues[3].vdesc = "New RDN: %s";
11309 pvalues[3].mvtype = 0;
11310 pvalues[3].vvalue = 0;
11311 pvalues[3].vlength = 256;
11312 pvalues[3].vlength = tvb_get_letohl(tvb, foffset);
11313 pvalues[3].voffset = foffset+4;
11314 foffset = foffset + 4;
11315 get_string(tvb, pvalues[3].voffset, pvalues[3].vlength, pvalues[3].vstring);
11316 pvalues[3].hfname= hf_nds_new_rdn;
11317 foffset = foffset+pvalues[3].vlength;
11318 foffset += align_4(tvb, foffset);
11319 pvalues[4].vtype = VTYPE_STRING;
11320 pvalues[4].vdesc = "Source Server Name: %s";
11321 pvalues[4].mvtype = 0;
11322 pvalues[4].vvalue = 0;
11323 pvalues[4].vlength = 256;
11324 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
11325 if (pvalues[4].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[3].vlength))
11327 pvalues[4].vtype = VTYPE_NONE;
11330 pvalues[4].voffset = foffset+4;
11331 foffset = foffset + 4;
11332 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, pvalues[4].vstring);
11333 pvalues[4].hfname= hf_nds_target_name;
11336 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11337 pvalues[0].vtype = VTYPE_UINT32;
11338 pvalues[0].vdesc = "Version: %u";
11339 pvalues[0].vlength = 4;
11340 pvalues[0].hfname = hf_nds_ver;
11341 pvalues[0].voffset = foffset;
11342 foffset = foffset+pvalues[0].vlength;
11343 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11344 pvalues[1].vtype = VTYPE_UINT32;
11345 pvalues[1].vdesc = (char *)match_strval(pvalues[1].vvalue, nds_verb2b_flag_vals);
11346 if(pvalues[1].vdesc == NULL)
11348 pvalues[1].vdesc = "No Flag Definition Found";
11350 pvalues[1].vlength = 4;
11351 pvalues[1].hfname = hf_nds_verb2b_req_flags;
11352 pvalues[1].voffset = foffset;
11353 foffset = foffset+pvalues[1].vlength;
11354 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11355 pvalues[2].vtype = VTYPE_UINT32;
11356 pvalues[2].vdesc = "Source Entry ID: 0x%08x";
11357 pvalues[2].vlength = 4;
11358 resolve_eid = TRUE;
11359 global_eid = pvalues[2].vvalue;
11360 pvalues[2].voffset = foffset;
11361 pvalues[2].hfname= hf_nds_eid;
11362 foffset = foffset+pvalues[2].vlength;
11363 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
11364 pvalues[3].vtype = VTYPE_UINT32;
11365 pvalues[3].vdesc = "Destination Parent Entry ID: 0x%08x";
11366 pvalues[3].vlength = 4;
11367 pvalues[3].voffset = foffset;
11368 pvalues[3].hfname= hf_nds_eid;
11369 foffset = foffset+pvalues[3].vlength;
11370 pvalues[4].vtype = VTYPE_STRING;
11371 pvalues[4].vdesc = "New RDN: %s";
11372 pvalues[4].mvtype = 0;
11373 pvalues[4].vvalue = 0;
11374 pvalues[4].vlength = 256;
11375 pvalues[4].vlength = tvb_get_letohl(tvb, foffset);
11376 pvalues[4].voffset = foffset+4;
11377 foffset = foffset + 4;
11378 get_string(tvb, pvalues[4].voffset, pvalues[4].vlength, pvalues[4].vstring);
11379 pvalues[4].hfname= hf_nds_new_rdn;
11380 foffset = foffset+pvalues[4].vlength;
11381 foffset += align_4(tvb, foffset);
11382 pvalues[5].vtype = VTYPE_STRING;
11383 pvalues[5].vdesc = "Source Server Name: %s";
11384 pvalues[5].mvtype = 0;
11385 pvalues[5].vvalue = 0;
11386 pvalues[5].vlength = 256;
11387 pvalues[5].vlength = tvb_get_letohl(tvb, foffset);
11388 if (pvalues[5].vlength == 0x00 || !tvb_bytes_exist(tvb, foffset, pvalues[3].vlength))
11390 pvalues[5].vtype = VTYPE_NONE;
11393 pvalues[5].voffset = foffset+4;
11394 foffset = foffset + 4;
11395 get_string(tvb, pvalues[5].voffset, pvalues[5].vlength, pvalues[5].vstring);
11396 pvalues[5].hfname= hf_nds_target_name;
11399 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11402 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11405 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11408 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11411 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11414 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11417 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11418 pvalues[0].vtype = VTYPE_UINT32;
11419 pvalues[0].vdesc = "Version: %u";
11420 pvalues[0].vlength = 4;
11421 pvalues[0].hfname = hf_nds_ver;
11422 pvalues[0].voffset = foffset;
11423 foffset = foffset+pvalues[0].vlength;
11424 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11425 pvalues[2].vtype = VTYPE_UINT32;
11426 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
11427 pvalues[2].vlength = 4;
11428 pvalues[2].voffset = foffset;
11429 pvalues[2].hfname= hf_nds_iteration;
11430 foffset = foffset+pvalues[2].vlength;
11431 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
11432 pvalues[3].vtype = VTYPE_STRING;
11433 pvalues[3].vdesc = "NDS Verb: %s";
11434 pvalues[3].vstring = (char *)match_strval(pvalues[3].vvalue, ncp_nds_verb_vals);
11435 pvalues[3].vlength = 4;
11436 pvalues[3].voffset = foffset;
11437 pvalues[3].hfname= hf_mv_string;
11438 foffset = foffset+pvalues[3].vlength;
11441 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11444 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11447 if (nds_version != 0)
11449 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11450 pvalues[0].vtype = VTYPE_UINT32;
11451 pvalues[0].vdesc = "Version: %u";
11452 pvalues[0].vlength = 4;
11453 pvalues[0].hfname = hf_nds_ver;
11454 pvalues[0].voffset = foffset;
11455 foffset = foffset+pvalues[0].vlength;
11456 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11457 global_flags = pvalues[1].vvalue;
11458 pvalues[1].vtype = VTYPE_BITFIELD;
11459 pvalues[1].vdesc = "Request Flags:";
11460 pvalues[1].vlength = 2;
11461 pvalues[1].hfname= hf_nds_rflags;
11462 pvalues[1].voffset = foffset;
11463 pvalues[1].bit1 = "Typeless";
11464 pvalues[1].bit1hfname = hf_bit1rflags;
11465 pvalues[1].bit2 = "Slashed";
11466 pvalues[1].bit2hfname = hf_bit2rflags;
11467 pvalues[1].bit3 = "Dotted";
11468 pvalues[1].bit3hfname = hf_bit3rflags;
11469 pvalues[1].bit4 = "Tuned";
11470 pvalues[1].bit4hfname = hf_bit4rflags;
11471 pvalues[1].bit5 = "Not Defined";
11472 pvalues[1].bit5hfname = hf_bit5rflags;
11473 pvalues[1].bit6 = "Not Defined";
11474 pvalues[1].bit6hfname = hf_bit6rflags;
11475 pvalues[1].bit7 = "Not Defined";
11476 pvalues[1].bit7hfname = hf_bit7rflags;
11477 pvalues[1].bit8 = "Not Defined";
11478 pvalues[1].bit8hfname = hf_bit8rflags;
11479 pvalues[1].bit9 = "Not Defined";
11480 pvalues[1].bit9hfname = hf_bit9rflags;
11481 pvalues[1].bit10 = "Not Defined";
11482 pvalues[1].bit10hfname = hf_bit10rflags;
11483 pvalues[1].bit11 = "Not Defined";
11484 pvalues[1].bit11hfname = hf_bit11rflags;
11485 pvalues[1].bit12 = "Not Defined";
11486 pvalues[1].bit12hfname = hf_bit12rflags;
11487 pvalues[1].bit13 = "Not Defined";
11488 pvalues[1].bit13hfname = hf_bit13rflags;
11489 pvalues[1].bit14 = "Not Defined";
11490 pvalues[1].bit14hfname = hf_bit14rflags;
11491 pvalues[1].bit15 = "Not Defined";
11492 pvalues[1].bit15hfname = hf_bit15rflags;
11493 pvalues[1].bit16 = "Not Defined";
11494 pvalues[1].bit16hfname = hf_bit16rflags;
11498 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11501 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11504 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11507 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11508 pvalues[0].vtype = VTYPE_UINT32;
11509 pvalues[0].vdesc = "Version: %u";
11510 pvalues[0].vlength = 4;
11511 pvalues[0].voffset = foffset;
11512 pvalues[0].hfname= hf_nds_ver;
11513 foffset = foffset+pvalues[0].vlength;
11514 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11515 pvalues[1].vtype = VTYPE_UINT32;
11516 pvalues[1].vdesc = "Entry ID: 0x%08x";
11517 pvalues[1].vlength = 4;
11518 resolve_eid = TRUE;
11519 global_eid = pvalues[1].vvalue;
11520 pvalues[1].voffset = foffset;
11521 pvalues[1].hfname= hf_nds_eid;
11522 foffset = foffset+pvalues[1].vlength;
11525 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11526 pvalues[0].vtype = VTYPE_UINT32;
11527 pvalues[0].vdesc = "Reply Buffer Size: %u";
11528 pvalues[0].vlength = 4;
11529 pvalues[0].voffset = foffset;
11530 pvalues[0].hfname= hf_nds_buffer_size;
11531 foffset = foffset+pvalues[0].vlength;
11532 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11533 pvalues[1].vtype = VTYPE_UINT32;
11534 pvalues[1].vdesc = "Version: %u";
11535 pvalues[1].vlength = 4;
11536 pvalues[1].voffset = foffset;
11537 pvalues[1].hfname= hf_nds_ver;
11538 foffset = foffset+pvalues[1].vlength;
11539 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11540 pvalues[2].vtype = VTYPE_UINT32;
11541 pvalues[2].vdesc = "Entry ID: 0x%08x";
11542 pvalues[2].vlength = 4;
11543 resolve_eid = TRUE;
11544 global_eid = pvalues[2].vvalue;
11545 pvalues[2].voffset = foffset;
11546 pvalues[2].hfname= hf_nds_eid;
11547 foffset = foffset+pvalues[2].vlength;
11550 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11551 pvalues[0].vtype = VTYPE_UINT32;
11552 pvalues[0].vdesc = "Version: %u";
11553 pvalues[0].vlength = 4;
11554 pvalues[0].voffset = foffset;
11555 pvalues[0].hfname= hf_nds_ver;
11556 foffset = foffset+pvalues[0].vlength;
11557 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11558 pvalues[1].vtype = VTYPE_UINT32;
11559 pvalues[1].vdesc = "Entry ID: 0x%08x";
11560 pvalues[1].vlength = 4;
11561 resolve_eid = TRUE;
11562 global_eid = pvalues[1].vvalue;
11563 pvalues[1].voffset = foffset;
11564 pvalues[1].hfname= hf_nds_eid;
11565 foffset = foffset+pvalues[1].vlength;
11570 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11573 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11576 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11579 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11582 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11585 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11588 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11591 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11594 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11597 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11600 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11603 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11606 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11609 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11612 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11615 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11618 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11621 pvalues[0].vvalue = tvb_get_letohl(tvb, foffset);
11622 pvalues[0].vtype = VTYPE_UINT32;
11623 pvalues[0].vdesc = "Version: %u";
11624 pvalues[0].vlength = 4;
11625 pvalues[0].hfname = hf_nds_ver;
11626 pvalues[0].voffset = foffset;
11627 foffset = foffset+pvalues[0].vlength;
11628 pvalues[1].vvalue = tvb_get_letohl(tvb, foffset);
11629 global_flags = pvalues[1].vvalue;
11630 pvalues[1].vtype = VTYPE_BITFIELD;
11631 pvalues[1].vdesc = "Request Flags:";
11632 pvalues[1].vlength = 2;
11633 pvalues[1].hfname= hf_nds_rflags;
11634 pvalues[1].voffset = foffset;
11635 pvalues[1].bit1 = "Typeless";
11636 pvalues[1].bit1hfname = hf_bit1rflags;
11637 pvalues[1].bit2 = "Slashed";
11638 pvalues[1].bit2hfname = hf_bit2rflags;
11639 pvalues[1].bit3 = "Dotted";
11640 pvalues[1].bit3hfname = hf_bit3rflags;
11641 pvalues[1].bit4 = "Tuned";
11642 pvalues[1].bit4hfname = hf_bit4rflags;
11643 pvalues[1].bit5 = "Not Defined";
11644 pvalues[1].bit5hfname = hf_bit5rflags;
11645 pvalues[1].bit6 = "Not Defined";
11646 pvalues[1].bit6hfname = hf_bit6rflags;
11647 pvalues[1].bit7 = "Not Defined";
11648 pvalues[1].bit7hfname = hf_bit7rflags;
11649 pvalues[1].bit8 = "Not Defined";
11650 pvalues[1].bit8hfname = hf_bit8rflags;
11651 pvalues[1].bit9 = "Not Defined";
11652 pvalues[1].bit9hfname = hf_bit9rflags;
11653 pvalues[1].bit10 = "Not Defined";
11654 pvalues[1].bit10hfname = hf_bit10rflags;
11655 pvalues[1].bit11 = "Not Defined";
11656 pvalues[1].bit11hfname = hf_bit11rflags;
11657 pvalues[1].bit12 = "Not Defined";
11658 pvalues[1].bit12hfname = hf_bit12rflags;
11659 pvalues[1].bit13 = "Not Defined";
11660 pvalues[1].bit13hfname = hf_bit13rflags;
11661 pvalues[1].bit14 = "Not Defined";
11662 pvalues[1].bit14hfname = hf_bit14rflags;
11663 pvalues[1].bit15 = "Not Defined";
11664 pvalues[1].bit15hfname = hf_bit15rflags;
11665 pvalues[1].bit16 = "Not Defined";
11666 pvalues[1].bit16hfname = hf_bit16rflags;
11667 foffset = foffset+pvalues[1].vlength+2;
11668 pvalues[2].vvalue = tvb_get_letohl(tvb, foffset);
11669 pvalues[2].vtype = VTYPE_UINT32;
11670 pvalues[2].vdesc = "Iteration Handle: 0x%08x";
11671 pvalues[2].vlength = 4;
11672 pvalues[2].voffset = foffset;
11673 pvalues[2].hfname= hf_nds_iteration;
11674 foffset = foffset+pvalues[2].vlength;
11675 pvalues[3].vvalue = tvb_get_letohl(tvb, foffset);
11676 pvalues[3].vtype = VTYPE_UINT32;
11677 pvalues[3].vdesc = "Base Entry ID: 0x%08x";
11678 pvalues[3].vlength = 4;
11679 resolve_eid = TRUE;
11680 global_eid = pvalues[3].vvalue;
11681 pvalues[3].voffset = foffset;
11682 pvalues[3].hfname= hf_nds_eid;
11683 foffset = foffset+pvalues[3].vlength;
11684 pvalues[4].vvalue = tvb_get_letohl(tvb, foffset);
11685 pvalues[4].vtype = VTYPE_UINT32;
11686 pvalues[4].vdesc = (char *)match_strval(pvalues[4].vvalue, nds_scope_vals);
11687 if(pvalues[4].vdesc == NULL)
11689 pvalues[4].vdesc = "Unknown Scope Defined";
11691 pvalues[4].vlength = 4;
11692 pvalues[4].hfname = hf_nds_scope;
11693 pvalues[4].voffset = foffset;
11694 foffset = foffset+pvalues[4].vlength;
11695 pvalues[5].vvalue = tvb_get_letohl(tvb, foffset);
11696 pvalues[5].vtype = VTYPE_MULTIVALUE_UINT32;
11697 pvalues[5].vdesc = "Iterator: 0x%08x";
11698 pvalues[5].vlength = 4;
11699 pvalues[5].voffset = foffset;
11700 pvalues[5].hfname= hf_nds_iterator;
11701 pvalues[5].mvtype = MVTYPE_PROCESS_ITERATOR;
11702 foffset = foffset+pvalues[5].vlength;
11705 pvalues[0].vtype = VTYPE_NONE; /* Not Defined */
11709 /* Fill in the INFO column. */
11710 if (check_col(pinfo->cinfo, COL_INFO)) {
11712 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
11713 if (nds_frag != 0xffffffff) {
11714 col_add_fstr(pinfo->cinfo, COL_INFO, "C Continue NDS Fragment %08x", nds_frag);
11717 col_add_fstr(pinfo->cinfo, COL_INFO, "C NDS %s", verb_string);
11719 run_info_str = TRUE;
11722 col_add_fstr(pinfo->cinfo, COL_INFO,
11723 "C Unknown Function %d (0x%02x)",
11728 /* Keep track of the address and connection whence the request
11729 came, and the address and connection to which the request
11730 is being sent, so that we can match up calls with replies.
11731 (We don't include the sequence number, as we may want
11732 to have all packets over the same connection treated
11733 as being part of a single conversation so that we can
11734 let the user select that conversation to be displayed.) */
11736 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
11737 PT_NCP, nw_connection, nw_connection, 0);
11738 if (conversation == NULL) {
11739 /* It's not part of any conversation - create a new one. */
11740 conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
11741 PT_NCP, nw_connection, nw_connection, 0);
11744 if (!pinfo->fd->flags.visited) {
11745 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
11746 request_value->req_frame_num = pinfo->fd->num;
11747 request_value->req_frame_time=pinfo->fd->abs_ts;
11749 /* If this is the first time we're examining the packet,
11750 * check to see if this NCP type uses a "request condition".
11751 * If so, we have to build a proto_tree because request conditions
11752 * use display filters to work, and without a proto_tree,
11753 * display filters can't possibly work. If we already have
11754 * a proto_tree, then wonderful. If we don't, we need to build
11756 if (ncp_rec && !ncp_tree) {
11757 run_req_cond = TRUE;
11759 /* Keep track of the Fragment number in the request for defrag logic */
11760 request_value->nds_frag_num = nds_frag;
11763 /* If we have to handle a request condition, or have to
11764 add to the Info column, we need to construct a protocol
11765 tree. If we already have a proto_tree, then wonderful.
11766 If we don't, we need to build one. */
11767 if ((run_info_str || run_req_cond) && !ncp_tree) {
11770 temp_tree = proto_tree_create_root();
11771 proto_tree_set_visible(temp_tree, FALSE);
11772 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
11773 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
11777 /* If the dissection throws an exception, be sure to free
11778 * the temporary proto_tree that was created. Because of the
11779 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
11780 * block; it has to be in the same scope as the terminating
11781 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
11782 * call CLEANUP_POP and friends, but the value of temp_tree is
11783 * NULL if no cleanup is needed, and non-null if cleanup is needed.
11785 CLEANUP_PUSH(free_proto_tree, temp_tree);
11787 #ifdef FAKE_TREE_IS_VISIBLE
11788 PTREE_DATA(ncp_tree)->visible=1;
11791 request_value = ncp_hash_lookup(conversation, sequence);
11793 case NCP_BROADCAST_SLOT:
11797 case NCP_SERVICE_REQUEST:
11799 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
11800 if (ncp_rec && ncp_rec->request_ptvc)
11802 clear_repeat_vars();
11803 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
11805 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
11806 func, "Function: %d (0x%02X), %s",
11807 func, func, ncp_rec ? ncp_rec->name : "Unknown");
11809 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
11810 subfunc, "SubFunction: %d (0x%02x)",
11813 proto_tree_add_uint(ncp_tree, hf_ncp_fragment_handle, tvb, 8, 4,
11816 if (nds_frag == 0xffffffff) {
11818 proto_tree_add_item(ncp_tree, hf_ncp_fragment_size, tvb, 12, 4, TRUE);
11820 proto_tree_add_item(ncp_tree, hf_ncp_message_size, tvb, 16, 4, TRUE);
11822 nds_prot_flags = tvb_get_letohs(tvb, 22);
11823 prot_flags[0].vvalue = nds_prot_flags;
11824 prot_flags[0].vtype = VTYPE_BITFIELD;
11825 prot_flags[0].vdesc = "NDS Protocol Flags:";
11826 prot_flags[0].vlength = 2;
11827 prot_flags[0].hfname= hf_ncp_nds_flag;
11828 prot_flags[0].voffset = 22;
11829 prot_flags[0].bit1 = "Not Defined";
11830 prot_flags[0].bit1hfname = hf_ndsprot1flag;
11831 prot_flags[0].bit2 = "Not Defined";
11832 prot_flags[0].bit2hfname = hf_ndsprot2flag;
11833 prot_flags[0].bit3 = "Not Defined";
11834 prot_flags[0].bit3hfname = hf_ndsprot3flag;
11835 prot_flags[0].bit4 = "Not Defined";
11836 prot_flags[0].bit4hfname = hf_ndsprot4flag;
11837 prot_flags[0].bit5 = "Not Defined";
11838 prot_flags[0].bit5hfname = hf_ndsprot5flag;
11839 prot_flags[0].bit6 = "Not Defined";
11840 prot_flags[0].bit6hfname = hf_ndsprot6flag;
11841 prot_flags[0].bit7 = "Not Defined";
11842 prot_flags[0].bit7hfname = hf_ndsprot7flag;
11843 prot_flags[0].bit8 = "Not Defined";
11844 prot_flags[0].bit8hfname = hf_ndsprot8flag;
11845 prot_flags[0].bit9 = "Not Defined";
11846 prot_flags[0].bit9hfname = hf_ndsprot9flag;
11847 prot_flags[0].bit10 = "Not Defined";
11848 prot_flags[0].bit10hfname = hf_ndsprot10flag;
11849 prot_flags[0].bit11= "Not Defined";
11850 prot_flags[0].bit11hfname = hf_ndsprot11flag;
11851 prot_flags[0].bit12 = "Not Defined";
11852 prot_flags[0].bit12hfname = hf_ndsprot12flag;
11853 prot_flags[0].bit13 = "Not Defined";
11854 prot_flags[0].bit13hfname = hf_ndsprot13flag;
11855 prot_flags[0].bit14 = "Not Defined";
11856 prot_flags[0].bit14hfname = hf_ndsprot14flag;
11857 prot_flags[0].bit15 = "Include CRC in NDS Header";
11858 prot_flags[0].bit15hfname = hf_ndsprot15flag;
11859 prot_flags[0].bit16 = "Client is a Server";
11860 prot_flags[0].bit16hfname = hf_ndsprot16flag;
11862 process_bitfield(ncp_tree, tvb, &prot_flags[0]);
11864 if (nds_version == 0) {
11865 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 24, 4,
11866 nds_verb, "NDS Verb: %d, (0x%02x), %s",
11867 nds_verb, nds_verb, verb_string);
11870 proto_tree_add_uint_format(ncp_tree, hf_ncp_nds_verb, tvb, 32, 4,
11871 nds_verb, "NDS Verb: %d, (0x%02x), %s",
11872 nds_verb, nds_verb, verb_string);
11874 added_arrow = FALSE;
11875 for (i = 0; i < 9; i++) {
11876 switch (pvalues[i].vtype) {
11878 case VTYPE_NONE: /* no value */
11882 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
11883 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %d",
11888 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
11889 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %d",
11894 proto_tree_add_uint_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
11895 pvalues[i].vlength, pvalues[i].vvalue, pvalues[i].vdesc,
11896 pvalues[i].vvalue);
11900 proto_tree_add_string_format(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
11901 pvalues[i].vlength, pvalues[i].vstring, pvalues[i].vdesc, pvalues[i].vstring);
11902 if (pvalues[i].mvtype == MVTYPE_ATTR_REQUEST) {
11904 * The "vstring" value is set to the input ES type
11905 * for MVTYPE_PROC_ENTRY_SPECIFIERS,
11906 * to add string to columninfo
11908 if (check_col(pinfo->cinfo, COL_INFO)) {
11909 if (!added_arrow) {
11910 col_append_str(pinfo->cinfo, COL_INFO, " -> ");
11911 added_arrow = TRUE;
11913 col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
11918 case VTYPE_BITFIELD:
11919 process_bitfield(ncp_tree, tvb, &pvalues[i]);
11922 case VTYPE_MULTIVALUE_UINT32:
11923 process_multivalues(ncp_tree, tvb, pinfo, &pvalues[i]);
11924 if (pvalues[i].mvtype == MVTYPE_PROC_ENTRY_SPECIFIERS) {
11926 * The "vstring" value is set to the input ES type
11927 * by "process_multivalues()".
11929 g_strlcpy(global_object_name, mv_resolve_name_string, 256);
11931 if (pvalues[i].mvtype == MVTYPE_ATTR_REQUEST || pvalues[i].mvtype == MVTYPE_PROC_ENTRY_SPECIFIERS || pvalues[i].mvtype == MVTYPE_PROCESS_ITERATOR) {
11933 * The "vstring" value is set to the input ES type
11934 * for MVTYPE_PROC_ENTRY_SPECIFIERS,
11935 * and the last string for MVTYPE_ATTR_REQUEST,
11936 * by "process_multivalues()".
11938 if (check_col(pinfo->cinfo, COL_INFO)) {
11939 col_append_str(pinfo->cinfo, COL_INFO, pvalues[i].vstring);
11940 if (pvalues[i].mvtype != MVTYPE_PROCESS_ITERATOR) {
11941 if (!added_arrow) {
11942 col_append_str(pinfo->cinfo, COL_INFO, " -> ");
11943 added_arrow = TRUE;
11945 col_append_str(pinfo->cinfo, COL_INFO, mv_resolve_name_string);
11952 proto_tree_add_bytes(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset,
11953 pvalues[i].vlength, tvb_get_ptr(tvb, pvalues[i].voffset, pvalues[i].vvalue));
11956 case VTYPE_BOOLEAN:
11957 proto_tree_add_item(ncp_tree, pvalues[i].hfname, tvb, pvalues[i].voffset, pvalues[i].vlength, TRUE);
11961 proto_tree_add_uint_format(ncp_tree, hf_nds_p1type, tvb, pvalues[i].voffset,
11962 pvalues[i].vlength, pvalues[i].vtype, "NDS Parameter not defined %u",
11966 /* For NDS requests with just an EID, resolve name from hash table. */
11968 request_eid_value = ncp_eid_hash_lookup(conversation, global_eid);
11970 if (request_eid_value) {
11971 g_strlcpy(global_object_name, request_eid_value->object_name, 256);
11972 if (check_col(pinfo->cinfo, COL_INFO))
11974 col_append_str(pinfo->cinfo, COL_INFO, ", Object Name - ");
11975 col_append_str(pinfo->cinfo, COL_INFO, global_object_name);
11981 request_value->nds_request_verb = nds_verb;
11982 request_value->nds_version = nds_version;
11983 g_strlcpy(request_value->object_name, global_object_name, 256);
11984 request_value->req_nds_flags = global_flags;
11985 request_value->req_nds_prot_flags = nds_prot_flags;
11994 ptvcursor_free(ptvc);
11996 /* Free the temporary proto_tree */
11997 CLEANUP_CALL_AND_POP;
12002 * XXX - this duplicates stuff in "dissect_ncp_request()"; could
12003 * "dissect_ncp_request()" not just call "dissect_ping_req()" if
12004 * the operation is an NCP ping, and "dissect_ping_req()" just dissect
12008 dissect_ping_req(tvbuff_t *tvb, packet_info *pinfo,
12009 guint32 nw_connection, guint8 sequence,
12010 guint16 type, proto_tree *ncp_tree)
12012 guint8 func, subfunc = 0;
12013 ncp_req_hash_value *request_value = NULL;
12014 const ncp_record *ncp_rec = NULL;
12015 conversation_t *conversation;
12016 ptvcursor_t *ptvc = NULL;
12017 proto_tree *temp_tree = NULL;
12018 gint length_remaining = 0;
12020 guint32 ping_version;
12022 char string_buffer[1024];
12024 #ifdef FAKE_TREE_IS_VISIBLE
12026 PTREE_DATA(ncp_tree)->visible=1;
12031 pvalue.vlength = 0;
12032 pvalue.voffset = 0;
12035 string_buffer[0] = '\0';
12036 pvalue.vstring = string_buffer;
12039 func = tvb_get_guint8(tvb, 6);
12040 subfunc = tvb_get_guint8(tvb, 7);
12042 ncp_rec = ncp_record_find(func, subfunc);
12044 /* Fill in the INFO column. */
12045 if (check_col(pinfo->cinfo, COL_INFO))
12050 col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDS");
12051 col_set_str(pinfo->cinfo, COL_INFO, "C Ping for NDS");
12055 if (!pinfo->fd->flags.visited)
12058 /* This is the first time we've looked at this packet.
12059 Keep track of the address and connection whence the request
12060 came, and the address and connection to which the request
12061 is being sent, so that we can match up calls with replies.
12062 (We don't include the sequence number, as we may want
12063 to have all packets over the same connection treated
12064 as being part of a single conversation so that we can
12065 let the user select that conversation to be displayed.) */
12067 conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
12068 PT_NCP, nw_connection, nw_connection, 0);
12070 if (conversation == NULL)
12072 /* It's not part of any conversation - create a new one. */
12073 conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
12074 PT_NCP, nw_connection, nw_connection, 0);
12077 request_value = ncp_hash_insert(conversation, sequence, ncp_rec);
12078 request_value->req_frame_num = pinfo->fd->num;
12079 request_value->req_frame_time=pinfo->fd->abs_ts;
12081 /* If this is the first time we're examining the packet,
12082 * check to see if this NCP type uses a "request condition".
12083 * If so, we have to build a proto_tree because request conditions
12084 * use display filters to work, and without a proto_tree,
12085 * display filters can't possibly work. If we already have
12086 * a proto_tree, then wonderful. If we don't, we need to build
12088 if (ncp_rec && !ncp_tree) {
12091 temp_tree = proto_tree_create_root();
12092 proto_tree_set_visible(temp_tree, FALSE);
12093 ti = proto_tree_add_item(temp_tree, proto_ncp, tvb, 0, -1, FALSE);
12094 ncp_tree = proto_item_add_subtree(ti, ett_ncp);
12099 /* If the dissection throws an exception, be sure to free
12100 * the temporary proto_tree that was created. Because of the
12101 * way the CLEANUP_PUSH macro works, we can't put it in an 'if'
12102 * block; it has to be in the same scope as the terminating
12103 * CLEANUP_POP or CLEANUP_POP_AND_ALLOC. So, we always
12104 * call CLEANUP_POP and friends, but the value of temp_tree is
12105 * NULL if no cleanup is needed, and non-null if cleanup is needed.
12107 CLEANUP_PUSH(free_proto_tree, temp_tree);
12111 case NCP_BROADCAST_SLOT:
12115 case NCP_SERVICE_REQUEST:
12116 proto_tree_add_uint_format(ncp_tree, hf_ncp_func, tvb, 6, 1,
12117 func, "Function: %u (0x%02X), %s",
12118 func, func, ncp_rec ? ncp_rec->name : "Unknown");
12120 proto_tree_add_uint_format(ncp_tree, hf_ncp_subfunc, tvb, 7, 1,
12121 subfunc, "SubFunction: %u (0x%02x)",
12124 length_remaining = tvb_reported_length_remaining(tvb, 8);
12126 if (length_remaining >= 8) {
12127 ping_version = tvb_get_letohl(tvb, 8);
12128 proto_tree_add_uint(ncp_tree, hf_nds_ping_version, tvb, 8,
12130 nds_flags = tvb_get_letohl(tvb, 12);
12131 if (request_value){
12132 request_value->nds_request_verb = 0xf0;
12133 request_value->req_nds_flags = nds_flags;
12135 proto_tree_add_uint_hidden(ncp_tree, hf_ncp_nds_verb, tvb, 0, 0,
12139 pvalue.vvalue = tvb_get_letohs(tvb, 12);
12140 pvalue.vtype = VTYPE_BITFIELD;
12141 pvalue.vstring = "";
12142 pvalue.vdesc = "Ping (low) Request Flags:";
12143 pvalue.vlength = 2;
12144 pvalue.hfname= hf_nds_rflags;
12145 pvalue.voffset = 12;
12146 pvalue.bit1 = "Supported Fields"; /* 0x0001 */
12147 pvalue.bit1hfname = hf_bit1pingflags1;
12148 pvalue.bit2 = "Depth"; /* 0x0002 */
12149 pvalue.bit2hfname = hf_bit2pingflags1;
12150 pvalue.bit3 = "Build Number"; /* 0x0004 */
12151 pvalue.bit3hfname = hf_bit3pingflags1;
12152 pvalue.bit4 = "Flags"; /* 0x0008 */
12153 pvalue.bit4hfname = hf_bit4pingflags1;
12154 pvalue.bit5 = "Verification Flags"; /* 0x0010 */
12155 pvalue.bit5hfname = hf_bit5pingflags1;
12156 pvalue.bit6 = "Letter Version"; /* 0x0020 */
12157 pvalue.bit6hfname = hf_bit6pingflags1;
12158 pvalue.bit7 = "OS Version"; /* 0x0040 */
12159 pvalue.bit7hfname = hf_bit7pingflags1;
12160 pvalue.bit8 = "Not Defined"; /* 0x0080 */
12161 pvalue.bit8hfname = hf_bit8pingflags1;
12162 pvalue.bit9 = "License Flags"; /* 0x0100 */
12163 pvalue.bit9hfname = hf_bit9pingflags1;
12164 pvalue.bit10 = "DS Time"; /* 0x0200 */
12165 pvalue.bit10hfname = hf_bit10pingflags1;
12166 pvalue.bit11 = "Server Time"; /* 0x0400 */
12167 pvalue.bit11hfname = hf_bit11pingflags1;
12168 pvalue.bit12 = "Create Time"; /* 0x0800 */
12169 pvalue.bit12hfname = hf_bit12pingflags1;
12170 pvalue.bit13 = "Not Defined";
12171 pvalue.bit13hfname = hf_bit13pingflags1;
12172 pvalue.bit14 = "Not Defined";
12173 pvalue.bit14hfname = hf_bit14pingflags1;
12174 pvalue.bit15 = "Not Defined";
12175 pvalue.bit15hfname = hf_bit15pingflags1;
12176 pvalue.bit16 = "Not Defined";
12177 pvalue.bit16hfname = hf_bit16pingflags1;
12179 process_bitfield(ncp_tree, tvb, &pvalue);
12181 pvalue.vvalue = tvb_get_letohs(tvb, 14);
12182 pvalue.vtype = VTYPE_BITFIELD;
12183 pvalue.vstring = "";
12184 pvalue.vdesc = "Ping (high) Request Flags:";
12185 pvalue.vlength = 2;
12186 pvalue.hfname= hf_nds_rflags;
12187 pvalue.voffset = 14;
12188 pvalue.bit1 = "Sap Name"; /* 0x0001 */
12189 pvalue.bit1hfname = hf_bit1pingflags2;
12190 pvalue.bit2 = "Tree Name"; /* 0x0002 */
12191 pvalue.bit2hfname = hf_bit2pingflags2;
12192 pvalue.bit3 = "OS Name"; /* 0x0004 */
12193 pvalue.bit3hfname = hf_bit3pingflags2;
12194 pvalue.bit4 = "Hardware Name"; /* 0x0008 */
12195 pvalue.bit4hfname = hf_bit4pingflags2;
12196 pvalue.bit5 = "Vendor Name"; /* 0x0010 */
12197 pvalue.bit5hfname = hf_bit5pingflags2;
12198 pvalue.bit6 = "Not Defined";
12199 pvalue.bit6hfname = hf_bit6pingflags2;
12200 pvalue.bit7 = "Not Defined";
12201 pvalue.bit7hfname = hf_bit7pingflags2;
12202 pvalue.bit8 = "Not Defined";
12203 pvalue.bit8hfname = hf_bit8pingflags2;
12204 pvalue.bit9 = "Not Defined";
12205 pvalue.bit9hfname = hf_bit9pingflags2;
12206 pvalue.bit10 = "Not Defined";
12207 pvalue.bit10hfname = hf_bit10pingflags2;
12208 pvalue.bit11 = "Not Defined";
12209 pvalue.bit11hfname = hf_bit11pingflags2;
12210 pvalue.bit12 = "Not Defined";
12211 pvalue.bit12hfname = hf_bit12pingflags2;
12212 pvalue.bit13 = "Not Defined";
12213 pvalue.bit13hfname = hf_bit13pingflags2;
12214 pvalue.bit14 = "Not Defined";
12215 pvalue.bit14hfname = hf_bit14pingflags2;
12216 pvalue.bit15 = "Not Defined";
12217 pvalue.bit15hfname = hf_bit15pingflags2;
12218 pvalue.bit16 = "Not Defined";
12219 pvalue.bit16hfname = hf_bit16pingflags2;
12221 process_bitfield(ncp_tree, tvb, &pvalue);
12229 ptvc = ptvcursor_new(ncp_tree, tvb, 7);
12230 if (ncp_rec && ncp_rec->request_ptvc) {
12231 clear_repeat_vars();
12232 process_ptvc_record(ptvc, ncp_rec->request_ptvc, NULL, TRUE, ncp_rec);
12234 ptvcursor_free(ptvc);
12236 /* Free the temporary proto_tree */
12237 CLEANUP_CALL_AND_POP;