Don't ignore SIGCHLD - doing so means that, on many platforms, we don't
[metze/wireshark/wip.git] / packet-ndps.c
1 /* packet-ndps.c
2  * Routines for NetWare's NDPS
3  * Greg Morris <gmorris@novell.com>
4  * Copyright (c) Novell, Inc. 2002-2003
5  *
6  * $Id: packet-ndps.c,v 1.21 2003/04/21 23:06:38 guy Exp $
7  *
8  * Ethereal - Network traffic analyzer
9  * By Gerald Combs <gerald@ethereal.com>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  */
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <string.h>
32 #include <glib.h>
33 #include <epan/packet.h>
34 #include "prefs.h"
35 #include "packet-ipx.h"
36 #include "packet-tcp.h"
37 #include <epan/conversation.h>
38 #include "packet-ndps.h"
39 #include "reassemble.h"
40
41 #define NDPS_PACKET_INIT_COUNT  200
42
43 /* Tables for reassembly of fragments. */
44 static GHashTable *ndps_fragment_table = NULL;
45 static GHashTable *ndps_reassembled_table = NULL;
46
47 /* desegmentation of ndps */
48 static gboolean ndps_defragment = TRUE;
49 static guint32  frag_number = 0;
50 static guint32  save_frag_length=0;
51 static guint32  save_frag_seq=0;
52 static gboolean ndps_fragmented = FALSE;
53 static gboolean more_fragment = FALSE;
54 static guint32  tid = 1;
55
56 /* Show ID's value */
57 static gboolean ndps_show_oids=FALSE;
58
59 /* Global Attribute for evaluation of Values */
60 static char *global_attribute_name=NULL;
61
62 static void dissect_ndps_request(tvbuff_t*, packet_info*, proto_tree*, guint32, guint32, int);
63
64 static void dissect_ndps_reply(tvbuff_t *, packet_info*, proto_tree*, int);
65
66 static int hf_ndps_segments = -1;
67 static int hf_ndps_segment = -1;
68 static int hf_ndps_segment_overlap = -1;
69 static int hf_ndps_segment_overlap_conflict = -1;
70 static int hf_ndps_segment_multiple_tails = -1;
71 static int hf_ndps_segment_too_long_segment = -1;
72 static int hf_ndps_segment_error = -1;
73
74 static gint ett_ndps_segments = -1;
75 static gint ett_ndps_segment = -1;
76
77 static int proto_ndps = -1;
78 static int hf_ndps_record_mark = -1;
79 static int hf_ndps_length = -1;
80 static int hf_ndps_xid = -1;
81 static int hf_ndps_packet_type = -1;
82 static int hf_ndps_rpc_version = -1;
83 static int hf_ndps_error = -1;
84 static int hf_ndps_items = -1;
85 static int hf_ndps_objects = -1;
86 static int hf_ndps_attributes = -1;
87 static int hf_ndps_sbuffer = -1;
88 static int hf_ndps_rbuffer = -1;
89 static int hf_ndps_user_name = -1;
90 static int hf_ndps_broker_name = -1;
91 static int hf_ndps_pa_name = -1;
92 static int hf_ndps_tree = -1;
93 static int hf_ndps_reqframe = -1;
94 static int hf_ndps_error_val = -1;
95 static int hf_ndps_ext_error = -1;
96 static int hf_ndps_object = -1;
97 static int hf_ndps_cred_type = -1;
98 static int hf_ndps_server_name = -1;
99 static int hf_ndps_connection = -1;
100 static int hf_ndps_auth_null = -1;
101 static int hf_ndps_rpc_accept = -1;
102 static int hf_ndps_rpc_acc_stat = -1;
103 static int hf_ndps_rpc_rej_stat = -1;
104 static int hf_ndps_rpc_acc_results = -1;
105 static int hf_ndps_problem_type = -1;
106 static int hf_security_problem_type = -1;
107 static int hf_service_problem_type = -1;
108 static int hf_access_problem_type = -1;
109 static int hf_printer_problem_type = -1;
110 static int hf_selection_problem_type = -1;
111 static int hf_doc_access_problem_type = -1;
112 static int hf_attribute_problem_type = -1;
113 static int hf_update_problem_type = -1;
114 static int hf_obj_id_type = -1;
115 static int hf_oid_struct_size = -1;
116 static int hf_object_name = -1;
117 static int hf_ndps_document_number = -1;
118 static int hf_ndps_nameorid = -1;
119 static int hf_local_object_name = -1;
120 static int hf_printer_name = -1;
121 static int hf_ndps_qualified_name = -1;
122 static int hf_ndps_item_count = -1;
123 static int hf_ndps_qualifier = -1;
124 static int hf_ndps_lib_error = -1;
125 static int hf_ndps_other_error = -1;
126 static int hf_ndps_other_error_2 = -1;
127 static int hf_ndps_session = -1;
128 static int hf_ndps_abort_flag = -1;
129 static int hf_obj_attribute_type = -1;
130 static int hf_ndps_attribute_value = -1;
131 static int hf_ndps_lower_range = -1;
132 static int hf_ndps_upper_range = -1;
133 static int hf_ndps_n64 = -1;
134 static int hf_ndps_lower_range_n64 = -1;
135 static int hf_ndps_upper_range_n64 = -1;
136 static int hf_ndps_attrib_boolean = -1;
137 static int hf_ndps_realization = -1;
138 static int hf_ndps_xdimension_n64 = -1;
139 static int hf_ndps_ydimension_n64 = -1;
140 static int hf_ndps_dim_value = -1;
141 static int hf_ndps_dim_flag = -1;
142 static int hf_ndps_xydim_value = -1;
143 static int hf_ndps_location_value = -1;
144 static int hf_ndps_xmin_n64 = -1;
145 static int hf_ndps_xmax_n64 = -1;
146 static int hf_ndps_ymin_n64 = -1;
147 static int hf_ndps_ymax_n64 = -1;
148 static int hf_ndps_edge_value = -1;
149 static int hf_ndps_cardinal_or_oid = -1;
150 static int hf_ndps_cardinal_name_or_oid = -1;
151 static int hf_ndps_integer_or_oid = -1;
152 static int hf_ndps_profile_id = -1;
153 static int hf_ndps_persistence = -1;
154 static int hf_ndps_language_id = -1;
155 static int hf_address_type = -1;
156 static int hf_ndps_address = -1;
157 static int hf_ndps_add_bytes = -1;
158 static int hf_ndps_event_type = -1;
159 static int hf_ndps_event_object_identifier = -1;
160 static int hf_ndps_octet_string = -1;
161 static int hf_ndps_scope = -1;
162 static int hf_address_len = -1;
163 static int hf_ndps_net = -1;
164 static int hf_ndps_node = -1;
165 static int hf_ndps_socket = -1;
166 static int hf_ndps_port = -1;
167 static int hf_ndps_ip = -1;
168 static int hf_ndps_server_type = -1;
169 static int hf_ndps_service_type = -1;
170 static int hf_ndps_service_enabled = -1;
171 static int hf_ndps_method_name = -1;
172 static int hf_ndps_method_ver = -1;
173 static int hf_ndps_file_name = -1;
174 static int hf_ndps_admin_submit = -1;
175 static int hf_ndps_oid = -1;
176 static int hf_ndps_object_op = -1;
177 static int hf_answer_time = -1;
178 static int hf_oid_asn1_type = -1;
179 static int hf_ndps_item_ptr = -1;
180 static int hf_ndps_len = -1;
181 static int hf_limit_enc = -1;
182 static int hf_ndps_qualified_name2 = -1;
183 static int hf_ndps_delivery_add_type = -1;
184 static int hf_ndps_criterion_type = -1;
185 static int hf_ndps_ignored_type = -1;
186 static int hf_ndps_resource_type = -1;
187 static int hf_ndps_identifier_type = -1;
188 static int hf_ndps_page_flag = -1;
189 static int hf_ndps_media_type = -1;
190 static int hf_ndps_doc_content = -1;
191 static int hf_ndps_page_size = -1;
192 static int hf_ndps_direction = -1;
193 static int hf_ndps_page_order = -1;
194 static int hf_ndps_medium_size = -1;
195 static int hf_ndps_long_edge_feeds = -1;
196 static int hf_ndps_inc_across_feed = -1;
197 static int hf_ndps_size_inc_in_feed = -1;
198 static int hf_ndps_page_orientation = -1;
199 static int hf_ndps_numbers_up = -1;
200 static int hf_ndps_xdimension = -1;
201 static int hf_ndps_ydimension = -1;
202 static int hf_ndps_state_severity = -1;
203 static int hf_ndps_training = -1;
204 static int hf_ndps_colorant_set = -1;
205 static int hf_ndps_card_enum_time = -1;
206 static int hf_ndps_attrs_arg = -1;
207 static int hf_ndps_context = -1;
208 static int hf_ndps_filter = -1;
209 static int hf_ndps_item_filter = -1;
210 static int hf_ndps_substring_match = -1;
211 static int hf_ndps_time_limit = -1;
212 static int hf_ndps_count_limit = -1;
213 static int hf_ndps_operator = -1;
214 static int hf_ndps_password = -1;
215 static int hf_ndps_retrieve_restrictions = -1;
216 static int hf_bind_security = -1;
217 static int hf_ndps_max_items = -1;
218 static int hf_ndps_status_flags = -1;
219 static int hf_ndps_resource_list_type = -1;
220 static int hf_os_type = -1;
221 static int hf_ndps_printer_type = -1;
222 static int hf_ndps_printer_manuf = -1;
223 static int hf_ndps_inf_file_name = -1;
224 static int hf_ndps_vendor_dir = -1;
225 static int hf_banner_type = -1;
226 static int hf_font_type = -1;
227 static int hf_printer_id = -1;
228 static int hf_ndps_font_name = -1;
229 static int hf_ndps_return_code = -1;
230 static int hf_ndps_banner_name = -1;
231 static int hf_font_type_name = -1;
232 static int hf_font_file_name = -1;
233 static int hf_ndps_prn_file_name = -1;
234 static int hf_ndps_prn_dir_name = -1;
235 static int hf_ndps_def_file_name = -1;
236 static int hf_ndps_win31_items = -1;
237 static int hf_ndps_win95_items = -1;
238 static int hf_ndps_windows_key = -1;
239 static int hf_archive_type = -1;
240 static int hf_archive_file_size = -1;
241 static int hf_ndps_data = -1;
242 static int hf_get_status_flag = -1;
243 static int hf_res_type = -1;
244 static int hf_file_timestamp = -1;
245 static int hf_sub_complete = -1;
246 static int hf_doc_content = -1;
247 static int hf_ndps_doc_name = -1;
248 static int hf_print_arg = -1;
249 static int hf_local_id = -1;
250 static int hf_ndps_included_doc = -1;
251 static int hf_ndps_ref_name = -1;
252 static int hf_interrupt_job_type = -1;
253 static int hf_pause_job_type = -1;
254 static int hf_ndps_force = -1;
255 static int hf_resubmit_op_type = -1;
256 static int hf_shutdown_type = -1;
257 static int hf_ndps_supplier_flag = -1;
258 static int hf_ndps_language_flag = -1;
259 static int hf_ndps_method_flag = -1;
260 static int hf_ndps_delivery_address_flag = -1;
261 static int hf_ndps_list_profiles_type = -1;
262 static int hf_ndps_list_profiles_choice_type = -1;
263 static int hf_ndps_list_profiles_result_type = -1;
264 static int hf_ndps_integer_type_flag = -1;
265 static int hf_ndps_integer_type_value = -1;
266 static int hf_ndps_continuation_option = -1;
267 static int hf_ndps_ds_info_type = -1;
268 static int hf_ndps_guid = -1;
269 static int hf_ndps_list_services_type = -1;
270 static int hf_ndps_item_bytes = -1;
271 static int hf_ndps_certified = -1;
272 static int hf_ndps_attribute_set = -1;
273 static int hf_ndps_data_item_type = -1;
274 static int hf_info_int = -1;
275 static int hf_info_int16 = -1;
276 static int hf_info_int32 = -1;
277 static int hf_info_boolean = -1;
278 static int hf_info_string = -1;
279 static int hf_info_bytes = -1;
280 static int hf_ndps_list_local_servers_type = -1;
281 static int hf_ndps_registry_name = -1;
282 static int hf_ndps_client_server_type = -1;
283 static int hf_ndps_session_type = -1;
284 static int hf_time = -1;
285 static int hf_ndps_supplier_name = -1;
286 static int hf_ndps_message = -1;
287 static int hf_delivery_method_type = -1;
288 static int hf_ndps_get_session_type = -1;
289 static int hf_packet_count = -1;
290 static int hf_last_packet_flag = -1;
291 static int hf_ndps_get_resman_session_type = -1;
292 static int hf_problem_type = -1;
293 static int hf_ndps_values = -1;
294 static int hf_ndps_object_ids_7 = -1;
295 static int hf_ndps_object_ids_8 = -1;
296 static int hf_ndps_object_ids_9 = -1;
297 static int hf_ndps_object_ids_10 = -1;
298 static int hf_ndps_object_ids_11 = -1;
299 static int hf_ndps_object_ids_12 = -1;
300 static int hf_ndps_object_ids_13 = -1;
301 static int hf_ndps_object_ids_14 = -1;
302 static int hf_ndps_object_ids_15 = -1;
303 static int hf_ndps_object_ids_16 = -1;
304 static int hf_ndps_attribute_time = -1;
305 static int hf_print_security = -1;
306 static int hf_notify_time_interval = -1;
307 static int hf_notify_sequence_number = -1;
308 static int hf_notify_lease_exp_time = -1;
309 static int hf_notify_printer_uri = -1;
310 static int hf_level = -1;
311 static int hf_interval = -1;
312
313 static int hf_spx_ndps_program = -1;
314 static int hf_spx_ndps_version = -1;
315 static int hf_spx_ndps_func_print = -1;
316 static int hf_spx_ndps_func_registry = -1;
317 static int hf_spx_ndps_func_notify = -1;
318 static int hf_spx_ndps_func_resman = -1;
319 static int hf_spx_ndps_func_delivery = -1;
320 static int hf_spx_ndps_func_broker = -1;
321
322 static gint ett_ndps = -1;
323 static dissector_handle_t ndps_data_handle;
324
325 /* desegmentation of NDPS over TCP */
326 static gboolean ndps_desegment = TRUE;
327
328 static const value_string true_false[] = {
329     { 0x00000000, "Accept" },
330     { 0x00000001, "Deny" },
331     { 0,          NULL }
332 };
333
334 static const value_string ndps_limit_enc_enum[] = {
335     { 0x00000000, "Time" },
336     { 0x00000001, "Count" },
337     { 0x00000002, "Error" },
338     { 0,          NULL }
339 };
340
341 static const value_string problem_type_enum[] = {
342     { 0x00000000, "Standard" },
343     { 0x00000001, "Extended" },
344     { 0,          NULL }
345 };
346
347 static const value_string accept_stat[] = {
348     { 0x00000000, "Success" },
349     { 0x00000001, "Program Unavailable" },
350     { 0x00000002, "Program Mismatch" },
351     { 0x00000003, "Procedure Unavailable" },
352     { 0x00000004, "Garbage Arguments" },
353     { 0x00000005, "System Error" },
354     { 0,          NULL }
355 };
356
357 static const value_string reject_stat[] = {
358     { 0x00000000, "RPC Mismatch" },
359     { 0x00000001, "Authentication Error" },
360     { 0,          NULL }
361 };
362
363 static const value_string error_type_enum[] = {
364     { 0x00000000, "Security Error" },
365     { 0x00000001, "Service Error" },
366     { 0x00000002, "Access Error" },
367     { 0x00000003, "Printer Error" },
368     { 0x00000004, "Selection Error" },
369     { 0x00000005, "Document Access Error" },
370     { 0x00000006, "Attribute Error" },
371     { 0x00000007, "Update Error" },
372     { 0,          NULL }
373 };
374
375 static const value_string security_problem_enum[] = {
376     { 0x00000000, "Authentication" },
377     { 0x00000001, "Credentials" },
378     { 0x00000002, "Rights" },
379     { 0x00000003, "Invalid PAC" },
380     { 0,          NULL }
381 };
382
383 static const value_string service_problem_enum[] = {
384     { 0x00000000, "Sever Busy" },
385     { 0x00000001, "Server Unavailable" },
386     { 0x00000002, "Complex Operation" },
387     { 0x00000003, "Resource Limit" },
388     { 0x00000004, "Unclassified Server Error" },
389     { 0x00000005, "Too Many Items in List" },
390     { 0x00000006, "Resource not Available" },
391     { 0x00000007, "Cancel Document Support" },
392     { 0x00000008, "Modify Document Support" },
393     { 0x00000009, "Multiple Document Support" },
394     { 0x0000000a, "Parameter Valid Support" },
395     { 0x0000000b, "Invalid Checkpoint" },
396     { 0x0000000c, "Continuation Context" },
397     { 0x0000000d, "Pause Limit Exceeded" },
398     { 0x0000000e, "Unsupported Operation" },
399     { 0x0000000f, "Notify Service Error" },
400     { 0x00000010, "Accounting Service Error" },
401     { 0,          NULL }
402 };
403
404 static const value_string access_problem_enum[] = {
405     { 0x00000000, "Wrong Object Class" },
406     { 0x00000001, "Lack of Access Rights" },
407     { 0x00000002, "Can't Interrupt Job" },
408     { 0x00000003, "Wrong Object State" },
409     { 0x00000004, "Client Not Bound" },
410     { 0x00000005, "Not Available" },
411     { 0x00000006, "Notify Service Not Connected" },
412     { 0x00000007, "PDS Not Connected" },
413     { 0,          NULL }
414 };
415
416 static const value_string printer_problem_enum[] = {
417     { 0x00000000, "Printer Error" },
418     { 0x00000001, "Printer Needs Attention" },
419     { 0x00000002, "Printer Needs Key Operator" },
420     { 0,          NULL }
421 };
422
423 static const value_string selection_problem_enum[] = {
424     { 0x00000000, "Invalid ID" },
425     { 0x00000001, "Unknown ID" },
426     { 0x00000002, "Object Exists" },
427     { 0x00000003, "ID Changed" },
428     { 0,          NULL }
429 };
430
431 static const value_string doc_access_problem_enum[] = {
432     { 0x00000000, "Access Not Available" },
433     { 0x00000001, "Time Expired" },
434     { 0x00000002, "Access Denied" },
435     { 0x00000003, "Unknown Document" },
436     { 0x00000004, "No Documents in Job" },
437     { 0,          NULL }
438 };
439
440 static const value_string attribute_problem_enum[] = {
441     { 0x00000000, "Invalid Syntax" },
442     { 0x00000001, "Undefined Type" },
443     { 0x00000002, "Wrong Matching" },
444     { 0x00000003, "Constraint Violated" },
445     { 0x00000004, "Unsupported Type" },
446     { 0x00000005, "Illegal Modification" },
447     { 0x00000006, "Consists With Other Attribute" },
448     { 0x00000007, "Undefined Attribute Value" },
449     { 0x00000008, "Unsupported Value" },
450     { 0x00000009, "Invalid Noncompulsed Modification" },
451     { 0x0000000a, "Per Job Inadmissible" },
452     { 0x0000000b, "Not Multivalued" },
453     { 0x0000000c, "Mandatory Omitted" },
454     { 0x0000000d, "Illegal For Class" },
455     { 0,          NULL }
456 };
457
458 static const value_string update_problem_enum[] = {
459     { 0x00000000, "No Modifications Allowed" },
460     { 0x00000001, "Insufficient Rights" },
461     { 0x00000002, "Previous Operation Incomplete" },
462     { 0x00000003, "Cancel Not Possible" },
463     { 0,          NULL }
464 };
465
466 static const value_string obj_identification_enum[] = {
467     { 0x00000000, "Printer Contained Object ID" },
468     { 0x00000001, "Document Identifier" },
469     { 0x00000002, "Object Identifier" },
470     { 0x00000003, "Object Name" },
471     { 0x00000004, "Name or Object ID" },
472     { 0x00000005, "Simple Name" },
473     { 0x00000006, "Printer Configuration Object ID" },
474     { 0x00000007, "Qualified Name" },
475     { 0x00000008, "Event Object ID" },
476     { 0,          NULL }
477 };
478
479 static const value_string nameorid_enum[] = {
480     { 0x00000000, "None" },
481     { 0x00000001, "Global" },
482     { 0x00000002, "Local" },
483     { 0,          NULL }
484 };
485
486 static const value_string qualified_name_enum[] = {
487     { 0x00000000, "None" },
488     { 0x00000001, "Simple" },
489     { 0x00000002, "NDS" },
490     { 0,          NULL }
491 };
492
493 static const value_string qualified_name_enum2[] = {
494     { 0x00000000, "NDS" },
495     { 0,          NULL }
496 };
497
498 static const value_string spx_ndps_program_vals[] = {
499     { 0x00060976, "Print Program" },
500     { 0x00060977, "Broker Program" },
501     { 0x00060978, "Registry Program" },
502     { 0x00060979, "Notify Program" },
503     { 0x0006097a, "Resource Manager Program" },
504     { 0x0006097b, "Programmatic Delivery Program" },
505     { 0,          NULL }
506 };
507
508 static const value_string spx_ndps_print_func_vals[] = {
509     { 0x00000000, "None" },
510     { 0x00000001, "Bind PSM" },
511     { 0x00000002, "Bind PA" },
512     { 0x00000003, "Unbind" },
513     { 0x00000004, "Print" },
514     { 0x00000005, "Modify Job" },
515     { 0x00000006, "Cancel Job" },
516     { 0x00000007, "List Object Attributes" },
517     { 0x00000008, "Promote Job" },
518     { 0x00000009, "Interrupt" },
519     { 0x0000000a, "Pause" },
520     { 0x0000000b, "Resume" },
521     { 0x0000000c, "Clean" },
522     { 0x0000000d, "Create" },
523     { 0x0000000e, "Delete" },
524     { 0x0000000f, "Disable PA" },
525     { 0x00000010, "Enable PA" },
526     { 0x00000011, "Resubmit Jobs" },
527     { 0x00000012, "Set" },
528     { 0x00000013, "Shutdown PA" },
529     { 0x00000014, "Startup PA" },
530     { 0x00000015, "Reorder Job" },
531     { 0x00000016, "Pause PA" },
532     { 0x00000017, "Resume PA" },
533     { 0x00000018, "Transfer Data" },
534     { 0x00000019, "Device Control" },
535     { 0x0000001a, "Add Event Profile" },
536     { 0x0000001b, "Remove Event Profile" },
537     { 0x0000001c, "Modify Event Profile" },
538     { 0x0000001d, "List Event Profiles" },
539     { 0x0000001e, "Shutdown PSM" },
540     { 0x0000001f, "Cancel PSM Shutdown" },
541     { 0x00000020, "Set Printer DS Information" },
542     { 0x00000021, "Clean User Jobs" },
543     { 0x00000022, "Map GUID to NDS Name" },
544     { 0x00000023, "Add Event Profile 2" },
545     { 0x00000024, "List Event Profile 2" },
546     { 0,          NULL }
547 };
548
549 static const value_string spx_ndps_notify_func_vals[] = {
550     { 0x00000000, "None" },
551     { 0x00000001, "Notify Bind" },
552     { 0x00000002, "Notify Unbind" },
553     { 0x00000003, "Register Supplier" },
554     { 0x00000004, "Deregister Supplier" },
555     { 0x00000005, "Add Profile" },
556     { 0x00000006, "Remove Profile" },
557     { 0x00000007, "Modify Profile" },
558     { 0x00000008, "List Profiles" },
559     { 0x00000009, "Report Event" },
560     { 0x0000000a, "List Supported Languages" },
561     { 0x0000000b, "Report Notification" },
562     { 0x0000000c, "Add Delivery Method" },
563     { 0x0000000d, "Remove Delivery Method" },
564     { 0x0000000e, "List Delivery Methods" },
565     { 0x0000000f, "Get Delivery Method Information" },
566     { 0x00000010, "Get Notify NDS Object Name" },
567     { 0x00000011, "Get Notify Session Information" },
568     { 0,          NULL }
569 };
570
571 static const value_string spx_ndps_deliver_func_vals[] = {
572     { 0x00000000, "None" },
573     { 0x00000001, "Delivery Bind" },
574     { 0x00000002, "Delivery Unbind" },
575     { 0x00000003, "Delivery Send" },
576     { 0x00000004, "Delivery Send2" },
577     { 0,          NULL }
578 };
579
580 static const value_string spx_ndps_registry_func_vals[] = {
581     { 0x00000000, "None" },
582     { 0x00000001, "Bind" },
583     { 0x00000002, "Unbind" },
584     { 0x00000003, "Register Server" },
585     { 0x00000004, "Deregister Server" },
586     { 0x00000005, "Register Registry" },
587     { 0x00000006, "Deregister Registry" },
588     { 0x00000007, "Registry Update" },
589     { 0x00000008, "List Local Servers" },
590     { 0x00000009, "List Servers" },
591     { 0x0000000a, "List Known Registries" },
592     { 0x0000000b, "Get Registry NDS Object Name" },
593     { 0x0000000c, "Get Registry Session Information" },
594     { 0,          NULL }
595 };
596
597 static const value_string spx_ndps_resman_func_vals[] = {
598     { 0x00000000, "None" },
599     { 0x00000001, "Bind" },
600     { 0x00000002, "Unbind" },
601     { 0x00000003, "Add Resource File" },
602     { 0x00000004, "Delete Resource File" },
603     { 0x00000005, "List Resources" },
604     { 0x00000006, "Get Resource File" },
605     { 0x00000007, "Get Resource File Date" },
606     { 0x00000008, "Get Resource Manager NDS Object Name" },
607     { 0x00000009, "Get Resource Manager Session Information" },
608     { 0x0000000a, "Set Resource Language Context" },
609     { 0,          NULL }
610 };
611
612 static const value_string spx_ndps_broker_func_vals[] = {
613     { 0x00000000, "None" },
614     { 0x00000001, "Bind" },
615     { 0x00000002, "Unbind" },
616     { 0x00000003, "List Services" },
617     { 0x00000004, "Enable Service" },
618     { 0x00000005, "Disable Service" },
619     { 0x00000006, "Down Broker" },
620     { 0x00000007, "Get Broker NDS Object Name" },
621     { 0x00000008, "Get Broker Session Information" },
622     { 0,          NULL }
623 };
624
625 static const value_string ndps_packet_types[] = {
626     { 0x00000000, "Request" },
627     { 0x00000001, "Reply" },
628     { 0,          NULL }
629 };
630
631 static const value_string ndps_realization_enum[] = {
632     { 0x00000000, "Logical" },
633     { 0x00000001, "Physical" },
634     { 0x00000002, "Logical & Physical" },
635     { 0,          NULL }
636 };
637
638 static const value_string ndps_dim_value_enum[] = {
639     { 0x00000000, "Numeric" },
640     { 0x00000001, "Named" },
641     { 0,          NULL }
642 };
643
644 static const value_string ndps_xydim_value_enum[] = {
645     { 0x00000000, "Real" },
646     { 0x00000001, "Named" },
647     { 0x00000002, "Cardinal" },
648     { 0,          NULL }
649 };
650
651 static const value_string ndps_location_value_enum[] = {
652     { 0x00000000, "Numeric" },
653     { 0x00000001, "Named" },
654     { 0,          NULL }
655 };
656
657 static const value_string ndps_edge_value_enum[] = {
658     { 0x00000000, "Bottom" },
659     { 0x00000001, "Right" },
660     { 0x00000002, "Top" },
661     { 0x00000003, "Left" },
662     { 0,          NULL }
663 };
664
665 static const value_string ndps_card_or_oid_enum[] = {
666     { 0x00000000, "Number" },
667     { 0x00000001, "ID" },
668     { 0,          NULL }
669 };
670
671 static const value_string ndps_card_name_or_oid_enum[] = {
672     { 0x00000000, "Number" },
673     { 0x00000001, "ID" },
674     { 0,          NULL }
675 };
676
677 static const value_string ndps_integer_or_oid_enum[] = {
678     { 0x00000000, "ID" },
679     { 0x00000001, "Number" },
680     { 0,          NULL }
681 };
682
683 static const value_string ndps_persistence_enum[] = {
684     { 0x00000000, "Permanent" },
685     { 0x00000001, "Volatile" },
686     { 0,          NULL }
687 };
688
689 static const value_string ndps_address_type_enum[] = {
690     { 0x00000000, "User" },
691     { 0x00000001, "Server" },
692     { 0x00000002, "Volume" },
693     { 0x00000003, "Organization Unit" },
694     { 0x00000004, "Organization" },
695     { 0x00000005, "Group" },
696     { 0x00000006, "Distinguished Name" },
697     { 0x00000007, "User or Container" },
698     { 0x00000008, "Case Exact String" },
699     { 0x00000009, "Case Ignore String" },
700     { 0x0000000a, "Numeric String" },
701     { 0x0000000b, "DOS File Name" },
702     { 0x0000000c, "Phone Number" },
703     { 0x0000000d, "Boolean" },
704     { 0x0000000e, "Integer" },
705     { 0x0000000f, "Network Address" },
706     { 0x00000010, "Choice" },
707     { 0x00000011, "GroupWise User" },
708     { 0,          NULL }
709 };
710
711 static const value_string ndps_address_enum[] = {
712     { 0x00000000, "IPX" },
713     { 0x00000001, "IP" },
714     { 0x00000002, "SDLC" },
715     { 0x00000003, "Token Ring to Ethernet" },
716     { 0x00000004, "OSI" },
717     { 0x00000005, "AppleTalk" },
718     { 0x00000006, "Count" },
719     { 0,          NULL }
720 };
721
722
723 static const value_string ndps_server_type_enum[] = {
724     { 0x00000000, "All" },
725     { 0x00000001, "Public Access Printer Agent" },
726     { 0x00000002, "Notification Server" },
727     { 0x00000003, "Resource Manager" },
728     { 0x00000004, "Network Port Handler" },
729     { 0,          NULL }
730 };
731
732 static const value_string ndps_event_object_enum[] = {
733     { 0x00000000, "Object" },
734     { 0x00000001, "Filter" },
735     { 0x00000002, "Detail" },
736     { 0,          NULL }
737 };
738
739 static const value_string ndps_service_type_enum[] = {
740     { 0x00000000, "SRS" },
741     { 0x00000001, "ENS" },
742     { 0x00000002, "RMS" },
743     { 0,          NULL }
744 };
745
746 static const value_string ndps_delivery_add_enum[] = {
747     { 0x00000000, "MHS Address" },
748     { 0x00000001, "Distinguished Name" },
749     { 0x00000002, "Text" },
750     { 0x00000003, "Octet String" },
751     { 0x00000004, "Distinguished Name String" },
752     { 0x00000005, "RPC Address" },
753     { 0x00000006, "Qualified Name" },
754     { 0,          NULL }
755 };
756
757 static const value_string ndps_resource_enum[] = {
758     { 0x00000000, "Name or ID" },
759     { 0x00000001, "Text" },
760     { 0,          NULL }
761 };
762
763
764 static const value_string ndps_identifier_enum[] = {
765     { 0x00000000, "ID Nominal Number" },
766     { 0x00000001, "ID Alpha-numeric" },
767     { 0x00000002, "ID Tag" },
768     { 0,          NULL }
769 };
770
771 static const value_string ndps_media_enum[] = {
772     { 0x00000000, "Select All Pages" },
773     { 0x00000001, "Selected Pages" },
774     { 0,          NULL }
775 };
776
777 static const value_string ndps_page_size_enum[] = {
778     { 0x00000000, "ID" },
779     { 0x00000001, "Dimensions" },
780     { 0,          NULL }
781 };
782
783 static const value_string ndps_pres_direction_enum[] = {
784     { 0x00000000, "Right to Bottom" },
785     { 0x00000001, "Left to Bottom" },
786     { 0x00000002, "Bidirectional to Bottom" },
787     { 0x00000003, "Right to Top" },
788     { 0x00000004, "Left to Top" },
789     { 0x00000005, "Bidirectional to Top" },
790     { 0x00000006, "Bottom to Right" },
791     { 0x00000007, "Bottom to Left" },
792     { 0x00000008, "Top to Left" },
793     { 0x00000009, "Top to Right" },
794     { 0,          NULL }
795 };
796
797 static const value_string ndps_page_order_enum[] = {
798     { 0x00000000, "Unknown" },
799     { 0x00000001, "First to Last" },
800     { 0x00000002, "Last to First" },
801     { 0,          NULL }
802 };
803
804 static const value_string ndps_medium_size_enum[] = {
805     { 0x00000000, "Discrete" },
806     { 0x00000001, "Continuous" },
807     { 0,          NULL }
808 };
809
810 static const value_string ndps_page_orientation_enum[] = {
811     { 0x00000000, "Unknown" },
812     { 0x00000001, "Face Up" },
813     { 0x00000002, "Face Down" },
814     { 0,          NULL }
815 };
816
817 static const value_string ndps_print_security[] = {
818     { 0x00000001, "Low" },
819     { 0x00000002, "Medium" },
820     { 0x00000003, "High" },
821     { 0,          NULL }
822 };
823
824 static const value_string ndps_numbers_up_enum[] = {
825     { 0x00000000, "Cardinal" },
826     { 0x00000001, "Name or Object ID" },
827     { 0x00000002, "Cardinal Range" },
828     { 0,          NULL }
829 };
830
831
832 static const value_string ndps_state_severity_enum[] = {
833     { 0x00000001, "Other" },
834     { 0x00000002, "Warning" },
835     { 0x00000003, "Critical" },
836     { 0,          NULL }
837 };
838
839
840 static const value_string ndps_training_enum[] = {
841     { 0x00000001, "Other" },
842     { 0x00000002, "Unknown" },
843     { 0x00000003, "Untrained" },
844     { 0x00000004, "Trained" },
845     { 0x00000005, "Field Service" },
846     { 0x00000006, "Management" },
847     { 0,          NULL }
848 };
849
850 static const value_string ndps_colorant_set_enum[] = {
851     { 0x00000000, "Name" },
852     { 0x00000001, "Description" },
853     { 0,          NULL }
854 };
855
856 static const value_string ndps_card_enum_time_enum[] = {
857     { 0x00000000, "Cardinal" },
858     { 0x00000001, "Enumeration" },
859     { 0x00000002, "Time" },
860     { 0,          NULL }
861 };
862
863 static const value_string ndps_attrs_arg_enum[] = {
864     { 0x00000000, "Continuation" },
865     { 0x00000001, "Specification" },
866     { 0,          NULL }
867 };
868
869
870 static const value_string ndps_filter_enum[] = {
871     { 0x00000000, "Item" },
872     { 0x00000001, "And" },
873     { 0x00000002, "Or" },
874     { 0x00000003, "Not" },
875     { 0,          NULL }
876 };
877
878
879 static const value_string ndps_filter_item_enum[] = {
880     { 0x00000000, "Equality" },
881     { 0x00000001, "Substrings" },
882     { 0x00000002, "Greater then or Equal to" },
883     { 0x00000003, "Less then or Equal to" },
884     { 0x00000004, "Present" },
885     { 0x00000005, "Subset of" },
886     { 0x00000006, "Superset of" },
887     { 0x00000007, "Non NULL Set Intersect" },
888     { 0,          NULL }
889 };
890
891 static const value_string ndps_match_criteria_enum[] = {
892     { 0x00000000, "Exact" },
893     { 0x00000001, "Case Insensitive" },
894     { 0x00000002, "Same Letter" },
895     { 0x00000003, "Approximate" },
896     { 0,          NULL }
897 };
898
899 static const value_string ndps_operator_enum[] = {
900     { 0x00000000, "Attributes" },
901     { 0x00000002, "Ordered Jobs" },
902     { 0,          NULL }
903 };
904
905 static const value_string ndps_resource_type_enum[] = {
906     { 0x00000000, "Printer Drivers" },
907     { 0x00000001, "Printer Definitions" },
908     { 0x00000002, "Printer Definitions Short" },
909     { 0x00000003, "Banner Page Files" },
910     { 0x00000004, "Font Types" },
911     { 0x00000005, "Printer Driver Files" },
912     { 0x00000006, "Printer Definition File" },
913     { 0x00000007, "Font Files" },
914     { 0x00000008, "Generic Type" },
915     { 0x00000009, "Generic Files" },
916     { 0x0000000a, "Printer Definition File 2" },
917     { 0x0000000b, "Printer Driver Types 2" },
918     { 0x0000000c, "Printer Driver Files 2" },
919     { 0x0000000d, "Printer Driver Types Archive" },
920     { 0x0000000e, "Languages Available" },
921     { 0,          NULL }
922 };
923
924 static const value_string ndps_os_type_enum[] = {
925     { 0x00000000, "DOS" },
926     { 0x00000001, "Windows 3.1" },
927     { 0x00000002, "Windows 95" },
928     { 0x00000003, "Windows NT" },
929     { 0x00000004, "OS2" },
930     { 0x00000005, "MAC" },
931     { 0x00000006, "UNIX" },
932     { 0x00000007, "Windows NT 4.0" },
933     { 0x00000008, "Windows 2000/XP" },
934     { 0x00000009, "Windows 98" },
935     { 0xffffffff, "None" },
936     { 0,          NULL }
937 };
938
939 static const value_string ndps_banner_type_enum[] = {
940     { 0x00000000, "All" },
941     { 0x00000001, "PCL" },
942     { 0x00000002, "PostScript" },
943     { 0x00000003, "ASCII Text" },
944     { 0,          NULL }
945 };
946
947 static const value_string ndps_font_type_enum[] = {
948     { 0x00000000, "TrueType" },
949     { 0x00000001, "PostScript" },
950     { 0x00000002, "System" },
951     { 0x00000003, "SPD" },
952     { 0x00000004, "True Doc" },
953     { 0,          NULL }
954 };
955
956 static const value_string ndps_archive_enum[] = {
957     { 0x00000000, "ZIP" },
958     { 0x00000001, "JAR" },
959     { 0,          NULL }
960 };
961
962
963 static const value_string ndps_res_type_enum[] = {
964     { 0x00000000, "Printer Driver" },
965     { 0x00000001, "Printer Definition" },
966     { 0x00000002, "Banner Page" },
967     { 0x00000003, "Font" },
968     { 0x00000004, "Generic Resource" },
969     { 0x00000005, "Print Driver Archive" },
970     { 0,          NULL }
971 };
972
973 static const value_string ndps_print_arg_enum[] = {
974     { 0x00000000, "Create Job" },
975     { 0x00000001, "Add Document" },
976     { 0x00000002, "Close Job" },
977     { 0,          NULL }
978 };
979
980 static const value_string ndps_doc_content_enum[] = {
981     { 0x00000000, "Content Included" },
982     { 0x00000001, "Content Referenced" },
983     { 0,          NULL }
984 };
985
986 static const value_string ndps_interrupt_job_enum[] = {
987     { 0x00000000, "Job ID" },
988     { 0x00000001, "Name" },
989     { 0,          NULL }
990 };
991
992 static const value_string ndps_pause_job_enum[] = {
993     { 0x00000000, "Job ID" },
994     { 0x00000001, "Name" },
995     { 0,          NULL }
996 };
997
998 static const value_string ndps_resubmit_op_enum[] = {
999     { 0x00000000, "Copy" },
1000     { 0x00000001, "Move" },
1001     { 0,          NULL }
1002 };
1003
1004 static const value_string ndps_shutdown_enum[] = {
1005     { 0x00000000, "Do Current Jobs" },
1006     { 0x00000001, "Immediate" },
1007     { 0x00000002, "Do Pending Jobs" },
1008     { 0,          NULL }
1009 };
1010
1011 static const value_string ndps_list_profiles_choice_enum[] = {
1012     { 0x00000000, "ID" },
1013     { 0x00000001, "Filter" },
1014     { 0,          NULL }
1015 };
1016
1017 static const value_string ndps_list_profiles_result_enum[] = {
1018     { 0x00000000, "Complete" },
1019     { 0x00000001, "No Event Objects" },
1020     { 0x00000002, "Profile ID's" },
1021     { 0,          NULL }
1022 };
1023
1024 static const value_string ndps_ds_info_enum[] = {
1025     { 0x00000000, "Add" },
1026     { 0x00000001, "Remove" },
1027     { 0x00000002, "Update" },
1028     { 0,          NULL }
1029 };
1030
1031 static const value_string ndps_list_services_enum[] = {
1032     { 0x00000000, "Supported" },
1033     { 0x00000001, "Enabled" },
1034     { 0,          NULL }
1035 };
1036
1037 static const value_string ndps_data_item_enum[] = {
1038     { 0x00000000, "Int8" },
1039     { 0x00000001, "Int16" },
1040     { 0x00000002, "Int32" },
1041     { 0x00000003, "Boolean" },
1042     { 0x00000004, "Character String" },
1043     { 0x00000005, "Byte String" },
1044     { 0,          NULL }
1045 };
1046
1047 static const value_string ndps_list_local_servers_enum[] = {
1048     { 0x00000000, "Specification" },
1049     { 0x00000001, "Continuation" },
1050     { 0,          NULL }
1051 };
1052
1053 static const value_string ndps_delivery_method_enum[] = {
1054     { 0x00000000, "Specification" },
1055     { 0x00000001, "Continuation" },
1056     { 0,          NULL }
1057 };
1058
1059 static const value_string ndps_attribute_enum[] = {
1060     { 0x00000000, "Null" },
1061     { 0x00000001, "Text" },
1062     { 0x00000002, "Descriptive Name" },
1063     { 0x00000003, "Descriptor" },
1064     { 0x00000004, "Message" },
1065     { 0x00000005, "Error Message" },
1066     { 0x00000006, "Simple Name" },
1067     { 0x00000007, "Distinguished Name String" },
1068     { 0x00000008, "Distinguished Name Seq" },
1069     { 0x00000009, "Delta Time" },
1070     { 0x0000000a, "Time" },
1071     { 0x0000000b, "Integer" },
1072     { 0x0000000c, "Integer Seq" },
1073     { 0x0000000d, "Cardinal" },
1074     { 0x0000000e, "Cardinal Seq" },
1075     { 0x0000000f, "Positive Integer" },
1076     { 0x00000010, "Integer Range" },
1077     { 0x00000011, "Cardinal Range" },
1078     { 0x00000012, "Maximum Integer" },
1079     { 0x00000013, "Minimum Integer" },
1080     { 0x00000014, "Integer 64" },
1081     { 0x00000015, "Integer 64 Seq" },
1082     { 0x00000016, "Cardinal 64" },
1083     { 0x00000017, "Cardinal 64 Seq" },
1084     { 0x00000018, "Positive Integer 64" },
1085     { 0x00000019, "Integer 64 Range" },
1086     { 0x0000001a, "Cardinal 64 Range" },
1087     { 0x0000001b, "Maximum Integer 64" },
1088     { 0x0000001c, "Minimum Integer 64" },
1089     { 0x0000001d, "Real" },
1090     { 0x0000001e, "Real Seq" },
1091     { 0x0000001f, "Non-Negative Real" },
1092     { 0x00000020, "Real Range" },
1093     { 0x00000021, "Non-Negative Real Range" },
1094     { 0x00000022, "Boolean" },
1095     { 0x00000023, "Percent" },
1096     { 0x00000024, "Object Identifier" },
1097     { 0x00000025, "Object Identifier Seq" },
1098     { 0x00000026, "Name or OID" },
1099     { 0x00000027, "Name or OID Seq" },
1100     { 0x00000028, "Distinguished Name" },
1101     { 0x00000029, "Relative Distinguished Name Seq" },
1102     { 0x0000002a, "Realization" },
1103     { 0x0000002b, "Medium Dimensions" },
1104     { 0x0000002c, "Dimension" },
1105     { 0x0000002d, "XY Dimensions" },
1106     { 0x0000002e, "Locations" },
1107     { 0x0000002f, "Area" },
1108     { 0x00000030, "Area Seq" },
1109     { 0x00000031, "Edge" },
1110     { 0x00000032, "Font Reference" },
1111     { 0x00000033, "Cardinal or OID" },
1112     { 0x00000034, "OID Cardinal Map" },
1113     { 0x00000035, "Cardinal or Name or OID" },
1114     { 0x00000036, "Positive Integer or OID" },
1115     { 0x00000037, "Event Handling Profile" },
1116     { 0x00000038, "Octet String" },
1117     { 0x00000039, "Priority" },
1118     { 0x0000003a, "Locale" },
1119     { 0x0000003b, "Method Delivery Address" },
1120     { 0x0000003c, "Object Identification" },
1121     { 0x0000003d, "Results Profile" },
1122     { 0x0000003e, "Criteria" },
1123     { 0x0000003f, "Job Password" },
1124     { 0x00000040, "Job Level" },
1125     { 0x00000041, "Job Categories" },
1126     { 0x00000042, "Print Checkpoint" },
1127     { 0x00000043, "Ignored Attribute" },
1128     { 0x00000044, "Resource" },
1129     { 0x00000045, "Medium Substitution" },
1130     { 0x00000046, "Font Substitution" },
1131     { 0x00000047, "Resource Context Seq" },
1132     { 0x00000048, "Sides" },
1133     { 0x00000049, "Page Select Seq" },
1134     { 0x0000004a, "Page Media Select" },
1135     { 0x0000004b, "Document Content" },
1136     { 0x0000004c, "Page Size" },
1137     { 0x0000004d, "Presentation Direction" },
1138     { 0x0000004e, "Page Order" },
1139     { 0x0000004f, "File Reference" },
1140     { 0x00000050, "Medium Source Size" },
1141     { 0x00000051, "Input Tray Medium" },
1142     { 0x00000052, "Output Bins Chars" },
1143     { 0x00000053, "Page ID Type" },
1144     { 0x00000054, "Level Range" },
1145     { 0x00000055, "Category Set" },
1146     { 0x00000056, "Numbers Up Supported" },
1147     { 0x00000057, "Finishing" },
1148     { 0x00000058, "Print Contained Object ID" },
1149     { 0x00000059, "Print Config Object ID" },
1150     { 0x0000005a, "Typed Name" },
1151     { 0x0000005b, "Network Address" },
1152     { 0x0000005c, "XY Dimensions Value" },
1153     { 0x0000005d, "Name or OID Dimensions Map" },
1154     { 0x0000005e, "Printer State Reason" },
1155     { 0x0000005f, "Enumeration" },
1156     { 0x00000060, "Qualified Name" },
1157     { 0x00000061, "Qualified Name Set" },
1158     { 0x00000062, "Colorant Set" },
1159     { 0x00000063, "Resource Printer ID" },
1160     { 0x00000064, "Event Object ID" },
1161     { 0x00000065, "Qualified Name Map" },
1162     { 0x00000066, "File Path" },
1163     { 0x00000067, "Uniform Resource Identifier" },
1164     { 0x00000068, "Cardinal or Enum or Time" },
1165     { 0x00000069, "Print Contained Object ID Set" },
1166     { 0x0000006a, "Octet String Pair" },
1167     { 0x0000006b, "Octet String Integer Pair" },
1168     { 0x0000006c, "Extended Resource Identifier" },
1169     { 0x0000006d, "Event Handling Profile 2" },
1170     { 0,          NULL }
1171 };
1172
1173 static const value_string ndps_error_types[] = {
1174     { 0x00000000, "Ok" },
1175     { 0x00000001, "Error" },
1176     { 0xFFFFFC18, "Broker Out of Memory" },      /* Broker Errors */
1177     { 0xFFFFFC17, "Broker Bad NetWare Version" },
1178     { 0xFFFFFC16, "Broker Wrong Command Line Arguments" },
1179     { 0xFFFFFC15, "Broker Name Not Given" },
1180     { 0xFFFFFC14, "Not Broker Class" },
1181     { 0xFFFFFC13, "Invalid Broker Password" },
1182     { 0xFFFFFC12, "Invalid Broker Name" },
1183     { 0xFFFFFC11, "Broker Failed to Create Thread" },
1184     { 0xFFFFFC10, "Broker Failed to Initialize NUT" },
1185     { 0xFFFFFC0F, "Broker Failed to Get Messages" },
1186     { 0xFFFFFC0E, "Broker Failed to Allocate Resources" },
1187     { 0xFFFFFC0D, "Broker Service Name Must be Fully Distinguished" },
1188     { 0xFFFFFC0C, "Broker Uninitialized Module" },
1189     { 0xFFFFFC0B, "Broker DS Value Size Too Large" },
1190     { 0xFFFFFC0A, "Broker No Attribute Values" },
1191     { 0xFFFFFC09, "Broker Unknown Session" },
1192     { 0xFFFFFC08, "Broker Service Disabled" },
1193     { 0xFFFFFC07, "Broker Unknown Modify Operation" },
1194     { 0xFFFFFC06, "Broker Invalid Arguments" },
1195     { 0xFFFFFC05, "Broker Duplicate Session ID" },
1196     { 0xFFFFFC04, "Broker Unknown Service" },
1197     { 0xFFFFFC03, "Broker Service Already Enabled" },
1198     { 0xFFFFFC02, "Broker Service Already Disabled" },
1199     { 0xFFFFFC01, "Broker Invalid Credential" },
1200     { 0xFFFFFC00, "Broker Unknown Designator" },
1201     { 0xFFFFFBFF, "Broker Failed to Make Change Permanent" },
1202     { 0xFFFFFBFE, "Broker Not Admin Type Session" },
1203     { 0xFFFFFBFD, "Broker Option Not Supported" },
1204     { 0xFFFFFBFC, "Broker No Effective Rights" },
1205     { 0xFFFFFBFB, "Broker Could Not Find File" },
1206     { 0xFFFFFBFA, "Broker Error Reading File" },
1207     { 0xFFFFFBF9, "Broker Not NLM File Format" },
1208     { 0xFFFFFBF8, "Broker Wrong NLM File Version" },
1209     { 0xFFFFFBF7, "Broker Reentrant Initialization Failure" },
1210     { 0xFFFFFBF6, "Broker Already in Progress" },
1211     { 0xFFFFFBF5, "Broker Initialize Failure" },
1212     { 0xFFFFFBF4, "Broker Inconsistent File Format" },
1213     { 0xFFFFFBF3, "Broker Can't Load at Startup" },
1214     { 0xFFFFFBF2, "Broker Autoload Modules Not Loaded" },
1215     { 0xFFFFFBF1, "Broker Unresolved External" },
1216     { 0xFFFFFBF0, "Broker Public Already Defined" },
1217     { 0xFFFFFBEF, "Broker Other Broker Using Object" },
1218     { 0xFFFFFBEE, "Broker Service Failed to Initialize" },
1219     { 0xFFFFFBB4, "Registry Out of Memory" },       /* SRS Errors */
1220     { 0xFFFFFBB3, "Registry Bad NetWare Version" },
1221     { 0xFFFFFBB2, "Registry Failed to Create Context" },
1222     { 0xFFFFFBB1, "Registry Failed Login" },
1223     { 0xFFFFFBB0, "Registry Failed to Create Thread" },
1224     { 0xFFFFFBAF, "Registry Failed to Get Messages" },
1225     { 0xFFFFFBAE, "Registry Service Name Must Be Fully Distinguished" },
1226     { 0xFFFFFBAD, "Registry DS Value Size Too Large" },
1227     { 0xFFFFFBAC, "Registry No Attribute Values" },
1228     { 0xFFFFFBAB, "Registry Unknown Session" },
1229     { 0xFFFFFBAA, "Registry Service Disabled" },
1230     { 0xFFFFFBA9, "Registry Unknown Modify Operation" },
1231     { 0xFFFFFBA8, "Registry Can't Start Advertise" },
1232     { 0xFFFFFBA7, "Registry Duplicate Server Entry" },
1233     { 0xFFFFFBA6, "Registry Can't Bind to Registry" },
1234     { 0xFFFFFBA5, "Registry Can't Create Client" },
1235     { 0xFFFFFBA4, "Registry Invalid Arguments" },
1236     { 0xFFFFFBA3, "Registry Duplicate Session ID" },
1237     { 0xFFFFFBA2, "Registry Unknown Server Entry" },
1238     { 0xFFFFFBA1, "Registry Invalid Credential" },
1239     { 0xFFFFFBA0, "Registry Type Session" },
1240     { 0xFFFFFB9F, "Registry Server Type Session" },
1241     { 0xFFFFFB9E, "Registry Not Server Type Session" },
1242     { 0xFFFFFB9D, "Not Registry Type Session" },
1243     { 0xFFFFFB9C, "Registry Unknown Designator" },
1244     { 0xFFFFFB9B, "Registry Option Not Supported" },
1245     { 0xFFFFFB9A, "Registry Not in List Iteration" },
1246     { 0xFFFFFB99, "Registry Invalid Continuation Handle" },
1247     { 0xFFFFFB50, "Notify Out of Memory" },        /* Notification Service Errors */
1248     { 0xFFFFFB4F, "Notify Bad NetWare Version" },
1249     { 0xFFFFFB4E, "Notify Failed to Create Thread" },
1250     { 0xFFFFFB4D, "Notify Failed to Get Messages" },
1251     { 0xFFFFFB4C, "Notify Failed to Create Context" },
1252     { 0xFFFFFB4B, "Notify Failed Login" },
1253     { 0xFFFFFB4A, "Notify Service Name Must be Fully Distiguished" },
1254     { 0xFFFFFB49, "Notify DS Value Size Too Large" },
1255     { 0xFFFFFB48, "Notify No Attribute Values" },
1256     { 0xFFFFFB47, "Notify Unknown Session" },
1257     { 0xFFFFFB46, "Notify Unknown Notify Profile" },
1258     { 0xFFFFFB45, "Notify Error Reading File" },
1259     { 0xFFFFFB44, "Notify Error Writing File" },
1260     { 0xFFFFFB43, "Wrong Notify Database Version" },
1261     { 0xFFFFFB42, "Corrupted Notify Database" },
1262     { 0xFFFFFB41, "Notify Unknown Event Object ID" },
1263     { 0xFFFFFB40, "Notify Method Already Installed" },
1264     { 0xFFFFFB3F, "Notify Unknown Method" },
1265     { 0xFFFFFB3E, "Notify Service Disabled" },
1266     { 0xFFFFFB3D, "Notify Unknown Modify Operation" },
1267     { 0xFFFFFB3C, "Out of Notify Entries" },
1268     { 0xFFFFFB3B, "Notify Unknown Language ID" },
1269     { 0xFFFFFB3A, "Notify Queue Empty" },
1270     { 0xFFFFFB39, "Notify Can't Load Delivery Method" },
1271     { 0xFFFFFB38, "Notify Invalid Arguments" },
1272     { 0xFFFFFB37, "Notify Duplicate Session ID" },
1273     { 0xFFFFFB36, "Notify Invalid Credentials" },
1274     { 0xFFFFFB35, "Notify Unknown Choice" },
1275     { 0xFFFFFB34, "Notify Unknown Attribute Value" },
1276     { 0xFFFFFB33, "Notify Error Writing Database" },
1277     { 0xFFFFFB32, "Notify Unknown Object ID" },
1278     { 0xFFFFFB31, "Notify Unknown Designator" },
1279     { 0xFFFFFB30, "Notify Failed to Make Change Permanent" },
1280     { 0xFFFFFB2F, "Notify User Interface Not Supported" },
1281     { 0xFFFFFB2E, "Notify Not Supplied Type of Session" },
1282     { 0xFFFFFB2D, "Notify Not Admin Type Session" },
1283     { 0xFFFFFB2C, "Notify No Service Registry Available" },
1284     { 0xFFFFFB2B, "Notify Failed to Register With Any Server" },
1285     { 0xFFFFFB2A, "Notify Empty Event Object Set" },
1286     { 0xFFFFFB29, "Notify Unknown Notify Handle" },
1287     { 0xFFFFFB28, "Notify Option Not Supported" },
1288     { 0xFFFFFB27, "Notify Unknown RPC Session" },
1289     { 0xFFFFFB26, "Notify Initialization Error" },
1290     { 0xFFFFFB25, "Notify No Effective Rights" },
1291     { 0xFFFFFB24, "Notify No Persistent Storage" },
1292     { 0xFFFFFB23, "Notify Bad Method Filename" },
1293     { 0xFFFFFB22, "Notify Unknown Continuation Handle" },
1294     { 0xFFFFFB21, "Notify Invalid Continuation Handle" },
1295     { 0xFFFFFB20, "Notify Could Not Find File" },
1296     { 0xFFFFFB1F, "Notify Error Reading File" },
1297     { 0xFFFFFB1E, "Notify Not NLM File Format" },
1298     { 0xFFFFFB1D, "Notify Wrong NLM File Version" },
1299     { 0xFFFFFB1C, "Notify Reentrant Initialization Failure" },
1300     { 0xFFFFFB1B, "Notify Already in Progress" },
1301     { 0xFFFFFB1A, "Notify Initialization Failure" },
1302     { 0xFFFFFB19, "Notify Inconsistent File Format" },
1303     { 0xFFFFFB18, "Notify Can't Load at Startup" },
1304     { 0xFFFFFB17, "Notify Autoload Modules Not Loaded" },
1305     { 0xFFFFFB16, "Notify Unresolved External" },
1306     { 0xFFFFFB15, "Notify Public Already Defined" },
1307     { 0xFFFFFB14, "Notify Using Unknown Methods" },
1308     { 0xFFFFFB13, "Notify Service Not Fully Enabled" },
1309     { 0xFFFFFB12, "Notify Foreign NDS Tree Name" },
1310     { 0xFFFFFB11, "Notify Delivery Method Rejected Address" },
1311     { 0xFFFFFB10, "Notify Unsupported Delivery Address Type" },
1312     { 0xFFFFFB0F, "Notify User Object No Default Server" },
1313     { 0xFFFFFB0E, "Notify Failed to Send Notification" },
1314     { 0xFFFFFB0D, "Notify Bad Volume in Address" },
1315     { 0xFFFFFB0C, "Notify Broker Has No File Rights" },
1316     { 0xFFFFFB0B, "Notify Maximum Methods Supported" },
1317     { 0xFFFFFB0A, "Notify No Filter Provided" },
1318     { 0xFFFFFB09, "Notify IPX Not Supported By Method" },
1319     { 0xFFFFFB08, "Notify IP Not Supported By Method" },
1320     { 0xFFFFFB07, "Notify Failed to Startup Winsock" },
1321     { 0xFFFFFB06, "Notify No Protocols Available" },
1322     { 0xFFFFFB05, "Notify Failed to Launch RPC Server" },
1323     { 0xFFFFFB04, "Notify Invalid SLP Attribute Format" },
1324     { 0xFFFFFB03, "Notify Invalid SLP URL Format" },
1325     { 0xFFFFFB02, "Notify Unknown Attribute Object ID" },
1326     { 0xFFFFFB01, "Notify Duplicate Session ID" },
1327     { 0xFFFFFB00, "Notify Failed to Authenticate" },
1328     { 0xFFFFFAFF, "Notify Failed to Authenticate Protocol Mismatch" },
1329     { 0xFFFFFAFE, "Notify Failed to Authenticate Internal Error" },
1330     { 0xFFFFFAFD, "Notify Failed to Authenticate Connection Error" },
1331     { 0xFFFFFC7C, "Resource Manager Out of Memory" },  /* ResMan Errors */
1332     { 0xFFFFFC7B, "Resource Manager Bad NetWare Version" },
1333     { 0xFFFFFC7A, "Resource Manager Wrong Command Line Arguments" },
1334     { 0xFFFFFC79, "Resource Manager Broker Name Not Given" },
1335     { 0xFFFFFC78, "Resource Manager Invalid Broker Password" },
1336     { 0xFFFFFC77, "Resource Manager Invalid Broker Name" },
1337     { 0xFFFFFC76, "Resource Manager Failed to Create Thread" },
1338     { 0xFFFFFC75, "Resource Manager Service Name Must be Fully Distinguished" },
1339     { 0xFFFFFC74, "Resource Manager DS Value Size Too Large" },
1340     { 0xFFFFFC73, "Resource Manager No Attribute Values" },
1341     { 0xFFFFFC72, "Resource Manager Unknown Session" },
1342     { 0xFFFFFC71, "Resource Manager Error Reading File" },
1343     { 0xFFFFFC70, "Resource Manager Error Writing File" },
1344     { 0xFFFFFC6F, "Resource Manager Service Disabled" },
1345     { 0xFFFFFC6E, "Resource Manager Unknown Modify Operation" },
1346     { 0xFFFFFC6D, "Resource Manager Duplicate Session ID" },
1347     { 0xFFFFFC6C, "Resource Manager Invalid Credentials" },
1348     { 0xFFFFFC6B, "Resource Manager No Service Registry Available" },
1349     { 0xFFFFFC6A, "Resource Manager Failed to Register With any Server" },
1350     { 0xFFFFFC69, "Resource Manager Failed to Get Messages" },
1351     { 0xFFFFFC68, "Resource Manager Failed to Create Context" },
1352     { 0xFFFFFC67, "Resource Manager Failed to Login" },
1353     { 0xFFFFFC66, "Resource Manager NPD Files Generation Error" },
1354     { 0xFFFFFC65, "Resource Manager INF File Format Error" },
1355     { 0xFFFFFC64, "Resource Manager No Printer Type in INF File" },
1356     { 0xFFFFFC63, "Resource Manager No INF Files Present" },
1357     { 0xFFFFFC62, "Resource Manager File Open Error" },
1358     { 0xFFFFFC61, "Resource Manager Read File Error" },
1359     { 0xFFFFFC60, "Resource Manager Write File Error" },
1360     { 0xFFFFFC5F, "Resource Manager Resource Type Invalid" },
1361     { 0xFFFFFC5E, "Resource Manager No Such Filename" },
1362     { 0xFFFFFC5D, "Resource Manager Banner Type Invalid" },
1363     { 0xFFFFFC5C, "Resource Manager List Type Unknown" },
1364     { 0xFFFFFC5B, "Resource Manager OS Not Supported" },
1365     { 0xFFFFFC5A, "Resource Manager No Banner Files Present" },
1366     { 0xFFFFFC59, "Resource Manager Printer Definition Type Unknown" },
1367     { 0xFFFFFC58, "Resource Manager No Printer Types in List" },
1368     { 0xFFFFFC57, "Resource Manager Option Not Supported" },
1369     { 0xFFFFFC56, "Resource Manager Unicode Convention Error" },
1370     { 0xFFFFFC55, "Resource Manager Invalid Arguments" },
1371     { 0xFFFFFC54, "Resource Manager Initialization Error" },
1372     { 0xFFFFFC53, "Resource Manager No Service Registry Available" },
1373     { 0xFFFFFC52, "Resource Manager Failed to Register to Any Server" },
1374     { 0xFFFFFC51, "Resource Manager Unknown Designator" },
1375     { 0xFFFFFC50, "Resource Manager Not Admin Session" },
1376     { 0xFFFFFC4F, "Resource Manager No Effective Rights" },
1377     { 0xFFFFFC4E, "Resource Manager Bad File Attribute" },
1378     { 0xFFFFFC4D, "Resource Manager Document ID Format Error" },
1379     { 0xFFFFFC4C, "Resource Manager Unknown RPC Session" },
1380     { 0xFFFFFC4B, "Resource Manager Session Being Removed" },
1381     { 0xFFFFFC49, "Resource Manager Font Manager IO Error" },
1382     { 0xFFFFFC48, "Resource Manager Font Manager Reentrancy" },
1383     { 0xFFFFFC47, "Resource Manager Font Manager Sequence Error" },
1384     { 0xFFFFFC46, "Resource Manager Font Manager Corrupt Index File" },
1385     { 0xFFFFFC45, "Resource Manager Font Manager No Such Font" },
1386     { 0xFFFFFC44, "Resource Manager Font Manager Not Initialized" },
1387     { 0xFFFFFC43, "Resource Manager Font Manager System Error" },
1388     { 0xFFFFFC42, "Resource Manager Font Manager Bad Parameter" },
1389     { 0xFFFFFC41, "Resource Manager Font Manager Path Too Long" },
1390     { 0xFFFFFC40, "Resource Manager Font Manager Failure" },
1391     { 0xFFFFFC3F, "Resource Manager Duplicate TIRPC Session" },
1392     { 0xFFFFFC3E, "Resource Manager Connection Lost RMS Data" },
1393     { 0xFFFFFC3D, "Resource Manager Failed to Start Winsock" },
1394     { 0xFFFFFC3C, "Resource Manager No Protocols Available" },
1395     { 0xFFFFFC3B, "Resource Manager Failed to Launch RPC Server" },
1396     { 0xFFFFFC3A, "Resource Manager Invalid SLP Attribute Format" },
1397     { 0xFFFFFC39, "Resource Manager Invalid SLP URL Format" },
1398     { 0xFFFFFC38, "Resource Manager Unresolved External" },
1399     { 0xFFFFFC37, "Resource Manager Failed to Authenticate" },
1400     { 0xFFFFFC36, "Resource Manager Failed to Authenticate Protocol Mismatch" },
1401     { 0xFFFFFC35, "Resource Manager Failed to Authenticate Internal Error" },
1402     { 0xFFFFFC34, "Resource Manager Failed to Authenticate Connection Error" },
1403     { 0xFFFFFC33, "Resource Manager No Rights to Remote Resdir" },
1404     { 0xFFFFFC32, "Resource Manager Can't Initialize NDPS Library" },
1405     { 0xFFFFFC31, "Resource Manager Can't Create Resource Reference" },
1406     { 0xFFFFFC30, "Resource Manager File is Zero Length" },
1407     { 0xFFFFFC2F, "Resource Manager Failed to Write INF in Address" },
1408     { 0xFFFFFCDF, "NDPSM No Memory" },               /* NDPSM Errors */
1409     { 0xFFFFFCDE, "NDPSM Memory Not Found" },
1410     { 0xFFFFFCDD, "NDPSM Job Storage Limit" },
1411     { 0xFFFFFCDC, "NDPSM Job Retention Limit" },
1412     { 0xFFFFFCDB, "NDPSM Unsupported Type" },
1413     { 0xFFFFFCDA, "NDPSM Undefined Type" },
1414     { 0xFFFFFCD9, "NDPSM Unsupported Operation" },
1415     { 0xFFFFFCD8, "NDPSM Error Accessing Database" },
1416     { 0xFFFFFCD7, "NDPSM No PDS" },
1417     { 0xFFFFFCD6, "NDPSM Invalid Class" },
1418     { 0xFFFFFCD5, "NDPSM Bad Parameter" },
1419     { 0xFFFFFCD4, "NDPSM Object Not Found" },
1420     { 0xFFFFFCD3, "NDPSM Attribute Not Found" },
1421     { 0xFFFFFCD2, "NDPSM Value Not Found" },
1422     { 0xFFFFFCD1, "NDPSM Values Not Comparable" },
1423     { 0xFFFFFCD0, "NDPSM Invalid Value Syntax" },
1424     { 0xFFFFFCCF, "NDPSM Job Not Found" },
1425     { 0xFFFFFCCE, "NDPSM Communications Error" },
1426     { 0xFFFFFCCD, "NDPSM Printer Agent Initializing" },
1427     { 0xFFFFFCCC, "NDPSM Printer Agent Going Down" },
1428     { 0xFFFFFCCB, "NDPSM Printer Agent Disabled" },
1429     { 0xFFFFFCCA, "NDPSM Printer Agent Paused" },
1430     { 0xFFFFFCC9, "NDPSM Bad Printer Agent Handle" },
1431     { 0xFFFFFCC8, "NDPSM Object Not Locked" },
1432     { 0xFFFFFCC7, "NDPSM Version Incompatible" },
1433     { 0xFFFFFCC6, "NDPSM PSM Initializing" },
1434     { 0xFFFFFCC5, "NDPSM PSM Going Down" },
1435     { 0xFFFFFCC4, "NDPSM Notification Service Error" },
1436     { 0xFFFFFCC3, "NDPSM Medium Needs Mounted" },
1437     { 0xFFFFFCC2, "NDPSM PDS Not Responding" },
1438     { 0xFFFFFCC1, "NDPSM Session Not Found" },
1439     { 0xFFFFFCC0, "NDPSM RPC Failure" },
1440     { 0xFFFFFCBF, "NDPSM Duplicate Value" },
1441     { 0xFFFFFCBE, "NDPSM PDS Refuses Rename" },
1442     { 0xFFFFFCBD, "NDPSM No Mandatory Attribute" },
1443     { 0xFFFFFCBC, "NDPSM Already Attached" },
1444     { 0xFFFFFCBB, "NDPSM Can't Attach" },
1445     { 0xFFFFFCBA, "NDPSM Too Many NetWare Servers" },
1446     { 0xFFFFFCB9, "NDPSM Can't Create Document File" },
1447     { 0xFFFFFCB8, "NDPSM Can't Delete Document File" },
1448     { 0xFFFFFCB7, "NDPSM Can't Open Document File" },
1449     { 0xFFFFFCB6, "NDPSM Can't Write Document File" },
1450     { 0xFFFFFCB5, "NDPSM Job is Active" },
1451     { 0xFFFFFCB4, "NDPSM No Scheduler" },
1452     { 0xFFFFFCB3, "NDPSM Changing Connection" },
1453     { 0xFFFFFCB2, "NDPSM Could not Create Account Reference" },
1454     { 0xFFFFFCB1, "NDPSM Accounting Service Error" },
1455     { 0xFFFFFCB0, "NDPSM RMS Service Error" },
1456     { 0xFFFFFCAF, "NDPSM Failed Validation" },
1457     { 0xFFFFFCAE, "NDPSM Broker Server Connecting" },
1458     { 0xFFFFFCAD, "NDPSM SRS Service Error" },
1459     { 0xFFFFFD44, "JPM Execute Request Later" },
1460     { 0xFFFFFD43, "JPM Failed to Open Document" },
1461     { 0xFFFFFD42, "JPM Failed to Read Document File" },
1462     { 0xFFFFFD41, "JPM Bad Printer Agent Handle" },
1463     { 0xFFFFFD40, "JPM Bad Job Handle" },
1464     { 0xFFFFFD3F, "JPM Bad Document Handle" },
1465     { 0xFFFFFD3E, "JPM Unsupported Operation" },
1466     { 0xFFFFFD3D, "JPM Request Queue Full" },
1467     { 0xFFFFFD3C, "JPM Printer Agent Not Found" },
1468     { 0xFFFFFD3B, "JPM Invalid Request" },
1469     { 0xFFFFFD3A, "JPM Not Accepting Requests" },
1470     { 0xFFFFFD39, "JPM Printer Agent Already Serviced By PDS" },
1471     { 0xFFFFFD38, "JPM No Job" },
1472     { 0xFFFFFD37, "JPM Job Not Found" },
1473     { 0xFFFFFD36, "JPM Could not Access Database" },
1474     { 0xFFFFFD35, "JPM Bad Object Type" },
1475     { 0xFFFFFD34, "JPM Job Already Closed" },
1476     { 0xFFFFFD33, "JPM Document Already Closed" },
1477     { 0xFFFFFD32, "JPM Print Handler Not Registered" },
1478     { 0xFFFFFD31, "JPM Version Incompatible" },
1479     { 0xFFFFFD30, "JPM Printer Agent Paused" },
1480     { 0xFFFFFD2F, "JPM Printer Agent Shutdown" },
1481     { 0xFFFFFD2E, "JPM No CLIB Context" },
1482     { 0xFFFFFD2D, "JPM Accounting Already Serviced" },
1483     { 0xFFFFFC7B, "Database Can't Create File" },
1484     { 0xFFFFFC7A, "Database Can't Find Data File" },
1485     { 0xFFFFFC79, "Database Can't Open Data File" },
1486     { 0xFFFFFC78, "Database Can't Open Index File" },
1487     { 0xFFFFFC77, "Database Index File Not Open" },
1488     { 0xFFFFFC76, "Database Can't Rename File" },
1489     { 0xFFFFFC75, "Database Can't Read Data File" },
1490     { 0xFFFFFC74, "Database Can't Read Index File" },
1491     { 0xFFFFFC73, "Database Can't Write Data File" },
1492     { 0xFFFFFC72, "Database Can't Write Index File" },
1493     { 0xFFFFFC71, "Database Can't Delete Printer Agent Directory" },
1494     { 0xFFFFFC70, "Database Already Deleted" },
1495     { 0xFFFFFC6F, "Database Object Exists" },
1496     { 0xFFFFFC6E, "Database Descriptor In Use" },
1497     { 0xFFFFFC6D, "Database Descriptor Being Deleted" },
1498     { 0,          NULL }
1499 };
1500
1501 static const value_string ndps_credential_enum[] = {
1502     { 0, "SIMPLE" },
1503     { 1, "CERTIFIED" },
1504     { 2, "NDPS 0" },
1505     { 3, "NDPS 1" },
1506     { 4, "NDPS 2" },
1507     { 0, NULL }
1508 };
1509
1510 static const value_string ndps_object_op_enum[] = {
1511     { 0, "None" },
1512     { 1, "Add" },
1513     { 2, "Delete" },
1514     { 3, "Delete Object" },
1515     { 0, NULL }
1516 };
1517
1518 static const value_string ndps_client_server_enum[] = {
1519     { 0, "Client" },
1520     { 1, "Server" },
1521     { 2, "Client and Server" },
1522     { 0, NULL }
1523 };
1524
1525 static const value_string ndps_session_type_enum[] = {
1526     { 0, "Unknown" },
1527     { 1, "User" },
1528     { 2, "Admin" },
1529     { 3, "Server" },
1530     { 4, "Registry" },
1531     { 0, NULL }
1532 };
1533
1534 static const value_string ndps_get_session_type_enum[] = {
1535     { 0, "Unknown" },
1536     { 1, "User" },
1537     { 2, "Admin" },
1538     { 3, "Supplier" },
1539     { 0, NULL }
1540 };
1541
1542 static const value_string ndps_get_resman_session_type_enum[] = {
1543     { 0, "Unknown" },
1544     { 1, "User" },
1545     { 2, "Admin" },
1546     { 0, NULL }
1547 };
1548
1549 static int
1550 align_4(tvbuff_t *tvb, int aoffset)
1551 {
1552        if(tvb_length_remaining(tvb, aoffset) > 4 )
1553        {
1554                 return (aoffset%4);
1555        }
1556        return 0;
1557 }
1558
1559 static int
1560 ndps_string(tvbuff_t* tvb, int hfinfo, proto_tree *ndps_tree, int offset)
1561 {
1562         int     foffset = offset;
1563         guint32 str_length;
1564         char    buffer[1024];
1565         guint32 i;
1566         guint16 c_char;
1567         guint32 length_remaining = 0;
1568         
1569         str_length = tvb_get_ntohl(tvb, foffset);
1570         foffset += 4;
1571         length_remaining = tvb_length_remaining(tvb, foffset);
1572         if(str_length > (guint)length_remaining || str_length > 1024)
1573         {
1574                 proto_tree_add_string(ndps_tree, hfinfo, tvb, foffset,
1575                     length_remaining + 4, "<String too long to process>");
1576                 foffset += length_remaining;
1577                 return foffset;
1578         }
1579         if(str_length == 0)
1580         {
1581             proto_tree_add_string(ndps_tree, hfinfo, tvb, offset,
1582                 4, "<Not Specified>");
1583             return foffset;
1584         }
1585         for ( i = 0; i < str_length; i++ )
1586         {
1587                 c_char = tvb_get_guint8(tvb, foffset );
1588                 if (c_char<0x20 || c_char>0x7e)
1589                 {
1590                         if (c_char != 0x00)
1591                         { 
1592                                 c_char = 0x2e;
1593                                 buffer[i] = c_char & 0xff;
1594                         }
1595                         else
1596                         {
1597                                 i--;
1598                                 str_length--;
1599                         }
1600                 }
1601                 else
1602                 {
1603                         buffer[i] = c_char & 0xff;
1604                 }
1605                 foffset++;
1606                 length_remaining--;
1607                 
1608                 if(length_remaining==1)
1609                 {
1610                         i++;
1611                         break;
1612                 }        
1613         }
1614         buffer[i] = '\0';
1615         
1616         str_length = tvb_get_ntohl(tvb, offset);
1617         proto_tree_add_string(ndps_tree, hfinfo, tvb, offset+4,
1618                 str_length, buffer);
1619         foffset += align_4(tvb, foffset);
1620         return foffset;
1621 }
1622
1623 static int
1624 objectidentifier(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
1625 {
1626     guint32  length=0;
1627     char        *label=NULL;
1628     guint32     label_value=0;
1629     proto_tree  *atree;
1630     proto_item  *aitem;
1631     gboolean    found=TRUE;
1632  
1633     if (tvb_get_ntohl(tvb, foffset)==0) 
1634     {
1635         return foffset;
1636     }
1637     length = tvb_get_ntohl(tvb, foffset);
1638     foffset += 4;
1639     switch (length)
1640     {
1641     case 9:
1642         label_value = tvb_get_ntohl(tvb, foffset+5);
1643         label = match_strval(label_value, object_ids_7);
1644         if (label==NULL) 
1645         {
1646             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1647             found=FALSE;
1648             break;
1649         }
1650         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_7, tvb, foffset, length, label);
1651         break;
1652     case 10:
1653         label_value = tvb_get_ntohl(tvb, foffset+6);
1654         label = match_strval(label_value, object_ids_8);
1655         if (label==NULL) 
1656         {
1657             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1658             found=FALSE;
1659             break;
1660         }
1661         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_8, tvb, foffset, length, label);
1662         break;
1663     case 11:
1664         label_value = tvb_get_ntohl(tvb, foffset+7);
1665         label = match_strval(label_value, object_ids_9);
1666         if (label==NULL) 
1667         {
1668             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1669             found=FALSE;
1670             break;
1671         }
1672         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_9, tvb, foffset, length, label);
1673         break;
1674     case 12:
1675         label_value = tvb_get_ntohl(tvb, foffset+8);
1676         label = match_strval(label_value, object_ids_10);
1677         if (label==NULL) 
1678         {
1679             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1680             found=FALSE;
1681             break;
1682         }
1683         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_10, tvb, foffset, length, label);
1684         break;
1685     case 13:
1686         label_value = tvb_get_ntohl(tvb, foffset+9);
1687         label = match_strval(label_value, object_ids_11);
1688         if (label==NULL) 
1689         {
1690             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1691             found=FALSE;
1692             break;
1693         }
1694         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_11, tvb, foffset, length, label);
1695         break;
1696     case 14:
1697         label_value = tvb_get_ntohl(tvb, foffset+10);
1698         label = match_strval(label_value, object_ids_12);
1699         if (label==NULL) 
1700         {
1701             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1702             found=FALSE;
1703             break;
1704         }
1705         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_12, tvb, foffset, length, label);
1706         break;
1707     case 15:
1708         label_value = tvb_get_ntohl(tvb, foffset+11);
1709         label = match_strval(label_value, object_ids_13);
1710         if (label==NULL) 
1711         {
1712             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1713             found=FALSE;
1714             break;
1715         }
1716         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_13, tvb, foffset, length, label);
1717         break;
1718     case 16:
1719         label_value = tvb_get_ntohl(tvb, foffset+12);
1720         label = match_strval(label_value, object_ids_14);
1721         if (label==NULL) 
1722         {
1723             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1724             found=FALSE;
1725             break;
1726         }
1727         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_14, tvb, foffset, length, label);
1728         break;
1729     case 17:
1730         label_value = tvb_get_ntohl(tvb, foffset+13);
1731         label = match_strval(label_value, object_ids_15);
1732         if (label==NULL) 
1733         {
1734             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1735             found=FALSE;
1736             break;
1737         }
1738         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_15, tvb, foffset, length, label);
1739         break;
1740     case 18:
1741         label_value = tvb_get_ntohl(tvb, foffset+14);
1742         label = match_strval(label_value, object_ids_16);
1743         if (label==NULL) 
1744         {
1745             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1746             found=FALSE;
1747             break;
1748         }
1749         aitem = proto_tree_add_none_format(ndps_tree, hf_ndps_object_ids_16, tvb, foffset, length, label);
1750         break;
1751     default:
1752         aitem = proto_tree_add_text(ndps_tree, tvb, foffset, length, "Unknown ID");
1753         found=FALSE;
1754         break;
1755     }
1756     if (!found) 
1757     {
1758         label_value = 1;
1759         label = match_strval(label_value, object_ids_7);
1760     }
1761     if (ndps_show_oids)
1762     {
1763         atree = proto_item_add_subtree(aitem, ett_ndps);
1764         proto_tree_add_item(atree, hf_oid_asn1_type, tvb, foffset, 1, FALSE);
1765         foffset += 1;
1766         length = tvb_get_guint8(tvb, foffset);
1767         foffset += 1;
1768         proto_tree_add_item(atree, hf_ndps_oid, tvb, foffset, length, FALSE);
1769         foffset += length;
1770     }
1771     else
1772     {
1773         if (!found) 
1774         {
1775             foffset += length;
1776         }
1777         else
1778         {
1779             foffset += 1;
1780             length = tvb_get_guint8(tvb, foffset);
1781             foffset += 1;
1782             foffset += length;
1783         }
1784     }
1785     global_attribute_name = label;
1786     return foffset+(length%2);
1787 }
1788
1789 static int
1790 name_or_id(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
1791 {
1792
1793     proto_tree_add_item(ndps_tree, hf_ndps_nameorid, tvb, foffset, 4, FALSE);
1794     foffset += 4;
1795     if(tvb_get_ntohl(tvb, foffset-4)==1) /* Global */
1796     {
1797         foffset = objectidentifier(tvb, ndps_tree, foffset);
1798     }
1799     else
1800     {
1801         if(tvb_get_ntohl(tvb, foffset-4)==2) /* Local */
1802         {
1803             foffset = ndps_string(tvb, hf_local_object_name, ndps_tree, foffset);
1804         }
1805     }
1806     return foffset;
1807 }
1808
1809 static int
1810 qualifiedname(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
1811 {
1812     guint32     qualified_name_type=0;
1813
1814     qualified_name_type = tvb_get_ntohl(tvb, foffset);
1815     proto_tree_add_uint(ndps_tree, hf_ndps_qualified_name, tvb, foffset, 4, qualified_name_type);
1816     foffset += 4;
1817     if (qualified_name_type != 0) {
1818         if (qualified_name_type == 1) {
1819             foffset = ndps_string(tvb, hf_printer_name, ndps_tree, foffset);
1820         }
1821         else
1822         {
1823             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
1824             foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
1825         }
1826     }
1827     return foffset;
1828 }
1829
1830 static int
1831 objectidentification(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
1832 {
1833     guint32     object_type=0;
1834     proto_tree  *atree;
1835     proto_item  *aitem;
1836       
1837     object_type = tvb_get_ntohl(tvb, foffset); 
1838     aitem = proto_tree_add_item(ndps_tree, hf_obj_id_type, tvb, foffset, 4, FALSE);
1839     atree = proto_item_add_subtree(aitem, ett_ndps);
1840     foffset += 4;
1841     switch(object_type)
1842     {
1843         case 0:         /* Printer Contained Object ID */
1844             foffset = ndps_string(tvb, hf_printer_name, atree, foffset);
1845             proto_tree_add_item(atree, hf_ndps_object, tvb, foffset, 
1846             4, FALSE);
1847             foffset += 4;
1848             break;
1849         case 1:         /* Document Identifier */
1850             foffset = ndps_string(tvb, hf_printer_name, atree, foffset);
1851             proto_tree_add_item(atree, hf_ndps_document_number, tvb, foffset, 
1852             4, FALSE);
1853             foffset += 4;
1854             break;
1855         case 2:         /* Object Identifier */
1856             foffset = objectidentifier(tvb, atree, foffset);
1857             break;
1858         case 3:         /* Object Name */
1859             foffset = ndps_string(tvb, hf_object_name, atree, foffset);
1860             if (foffset > tvb_length_remaining(tvb, foffset)) {
1861                 return foffset;
1862             }
1863             foffset = name_or_id(tvb, atree, foffset);
1864             break;
1865         case 4:         /* Name or Object ID */
1866             foffset = name_or_id(tvb, atree, foffset);
1867             break;
1868         case 5:         /* Simple Name */
1869             foffset = ndps_string(tvb, hf_object_name, atree, foffset);
1870             break;
1871         case 6:         /* Printer Configuration Object ID */
1872             foffset = ndps_string(tvb, hf_printer_name, atree, foffset);
1873             break;
1874         case 7:         /* Qualified Name */
1875             foffset = qualifiedname(tvb, ndps_tree, foffset);
1876             break;
1877         case 8:         /* Event Object ID */
1878             foffset = ndps_string(tvb, hf_object_name, atree, foffset);
1879             foffset = objectidentifier(tvb, atree, foffset);
1880             proto_tree_add_item(atree, hf_ndps_event_type, tvb, foffset, 
1881             4, FALSE);
1882             foffset += 4;
1883         default:
1884             break;
1885     }
1886     return foffset;
1887 }
1888
1889 static int
1890 print_address(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
1891 {
1892     guint32     address_type=0;
1893     guint32     address=0;
1894     guint32     address_len=0;
1895
1896     address_type = tvb_get_ntohl(tvb, foffset); 
1897     proto_tree_add_uint(ndps_tree, hf_ndps_address, tvb, foffset, 4, address_type);
1898     foffset += 4;
1899     address_len = tvb_get_ntohl(tvb, foffset);
1900     proto_tree_add_item(ndps_tree, hf_address_len, tvb, foffset, 4, FALSE);
1901     foffset += 4;
1902     switch(address_type)
1903     {
1904     case 0x00000000:
1905             proto_tree_add_item(ndps_tree, hf_ndps_net, tvb, foffset, 4, FALSE);
1906             proto_tree_add_item(ndps_tree, hf_ndps_node, tvb, foffset+4, 6, FALSE);
1907             proto_tree_add_item(ndps_tree, hf_ndps_socket, tvb, foffset+10, 2, FALSE);
1908             foffset += address_len;
1909             break;
1910     case 0x00000001:
1911             proto_tree_add_item(ndps_tree, hf_ndps_port, tvb, foffset, 2, FALSE);
1912             address = tvb_get_letohl(tvb, foffset+2);
1913             proto_tree_add_ipv4(ndps_tree, hf_ndps_ip, tvb, foffset+2, 4, address);
1914             foffset += address_len;
1915             break;
1916     default:
1917         foffset += tvb_get_ntohl(tvb, foffset -4);
1918         break;
1919     }
1920     return foffset+(address_len%4);
1921 }
1922
1923 static int
1924 address_item(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
1925 {
1926     guint32     address_type=0;
1927
1928     address_type = tvb_get_ntohl(tvb, foffset); 
1929     proto_tree_add_uint(ndps_tree, hf_address_type, tvb, foffset, 4, address_type);
1930     foffset += 4;
1931     switch(address_type)
1932     {
1933     case 0:
1934     case 1:
1935     case 2:
1936     case 3:
1937     case 4:
1938     case 5:
1939     case 6:
1940     case 7:
1941         foffset = qualifiedname(tvb, ndps_tree, foffset);
1942         break;
1943     case 8:
1944     case 9:
1945     case 10:
1946     case 11:
1947     case 12:
1948         foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
1949         break;
1950     case 13:
1951         proto_tree_add_item(ndps_tree, hf_ndps_attrib_boolean, tvb, foffset, 4, FALSE);
1952         foffset += 4;
1953         break;
1954     case 14:
1955         proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
1956         foffset += 4;
1957         break;
1958     case 15:
1959         foffset = print_address(tvb, ndps_tree, foffset);
1960         break;
1961     case 16:
1962     case 17:
1963     default:
1964         foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
1965         break;
1966     }
1967     return foffset;
1968 }
1969
1970 static int
1971 credentials(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
1972 {
1973     guint32     cred_type=0;
1974     guint32     length=0;
1975     guint32     number_of_items=0;
1976     guint32     i;
1977     proto_tree  *atree;
1978     proto_item  *aitem;
1979
1980     cred_type = tvb_get_ntohl(tvb, foffset);
1981     proto_tree_add_item(ndps_tree, hf_ndps_cred_type, tvb, foffset, 4, FALSE);
1982     foffset += 4;
1983     switch (cred_type)
1984     {
1985     case 0:
1986         foffset = ndps_string(tvb, hf_ndps_user_name, ndps_tree, foffset);
1987         number_of_items=tvb_get_ntohl(tvb, foffset);
1988         foffset += 4;
1989         for (i = 1 ; i <= number_of_items; i++ )
1990         {
1991             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Password %d", i);
1992             atree = proto_item_add_subtree(aitem, ett_ndps);
1993             length = tvb_get_ntohl(tvb, foffset);
1994             foffset += 4;
1995             proto_tree_add_item(atree, hf_ndps_password, tvb, foffset, length, FALSE);
1996             foffset += length;
1997         }
1998         break;
1999     case 1:
2000         length = tvb_get_ntohl(tvb, foffset);
2001         foffset += 4;
2002         proto_tree_add_item(ndps_tree, hf_ndps_certified, tvb, foffset, length, FALSE);
2003         foffset += length;
2004         break;
2005     case 2:
2006         foffset = ndps_string(tvb, hf_ndps_server_name, ndps_tree, foffset);
2007         foffset += 2;
2008         proto_tree_add_item(ndps_tree, hf_ndps_connection, tvb, foffset, 2, FALSE);
2009         foffset += 2;
2010         break;
2011     case 3:
2012         length=tvb_get_ntohl(tvb, foffset);
2013         foffset = ndps_string(tvb, hf_ndps_server_name, ndps_tree, foffset);
2014         if (length == 0) 
2015         {
2016             foffset += 2;
2017         }
2018         if (tvb_get_ntohs(tvb, foffset)==0)  /* NDPS 1.0 */
2019         {
2020             foffset+=2;
2021             if (tvb_get_ntohs(tvb, foffset)==0)  /* NDPS 1.1 */
2022             {
2023                 foffset += 2;
2024             }
2025         }
2026         proto_tree_add_item(ndps_tree, hf_ndps_connection, tvb, foffset, 2, FALSE);
2027         foffset += 2;
2028         foffset = ndps_string(tvb, hf_ndps_user_name, ndps_tree, foffset);
2029         break;
2030     case 4:
2031         foffset = ndps_string(tvb, hf_ndps_server_name, ndps_tree, foffset);
2032         foffset += 2;
2033         proto_tree_add_item(ndps_tree, hf_ndps_connection, tvb, foffset, 2, FALSE);
2034         foffset += 2;
2035         foffset = ndps_string(tvb, hf_ndps_user_name, ndps_tree, foffset);
2036         foffset += 8;   /* Don't know what these 8 bytes signify */
2037         proto_tree_add_item(ndps_tree, hf_ndps_items, tvb, foffset, 4, FALSE);
2038         foffset += 4;
2039         foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
2040         foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
2041         break;
2042     default:
2043         break;
2044     }
2045     return foffset;
2046 }
2047
2048
2049 static int
2050 event_object_set(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
2051 {
2052     guint32     number_of_items=0;
2053     guint32     number_of_items2=0;
2054     guint32     i=0;
2055     guint32     j=0;
2056     proto_tree  *atree;
2057     proto_item  *aitem;
2058     proto_tree  *btree;
2059     proto_item  *bitem;
2060     proto_tree  *ctree;
2061     proto_item  *citem;
2062
2063     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Event");
2064     atree = proto_item_add_subtree(aitem, ett_ndps);
2065     number_of_items = tvb_get_ntohl(tvb, foffset);
2066     foffset += 4;
2067     for (i = 1 ; i <= number_of_items; i++ )
2068     {
2069         bitem = proto_tree_add_item(atree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
2070         btree = proto_item_add_subtree(bitem, ett_ndps);
2071         foffset += 4;
2072         foffset = objectidentifier(tvb, btree, foffset);
2073         foffset += align_4(tvb, foffset);
2074         foffset = objectidentification(tvb, btree, foffset);
2075         foffset += align_4(tvb, foffset);
2076         proto_tree_add_item(btree, hf_ndps_object_op, tvb, foffset, 4, FALSE);
2077         foffset += 4;
2078         proto_tree_add_uint(btree, hf_ndps_event_object_identifier, tvb, foffset, 4, FALSE);
2079         foffset += 4;
2080         if(tvb_get_ntohl(tvb, foffset-4)==1)
2081         {
2082             foffset = objectidentifier(tvb, btree, foffset);
2083             foffset += align_4(tvb, foffset);
2084         }
2085         else
2086         {
2087             if(tvb_get_ntohl(tvb, foffset-4)==2)
2088             {
2089                 number_of_items2 = tvb_get_ntohl(tvb, foffset);
2090                 foffset += 4;
2091                 for (j = 1 ; j <= number_of_items2; j++ )
2092                 {
2093                     citem = proto_tree_add_text(btree, tvb, foffset, 0, "Item %d", j);
2094                     ctree = proto_item_add_subtree(citem, ett_ndps);
2095                     foffset = objectidentifier(tvb, ctree, foffset);
2096                     foffset += align_4(tvb, foffset);
2097                 }
2098             }
2099         }
2100     }
2101     return foffset;
2102 }
2103
2104
2105 static int
2106 cardinal_seq(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
2107 {
2108     guint32     number_of_items=0;
2109     guint32     length=0;
2110     guint32     i=0;
2111     proto_tree  *atree;
2112     proto_item  *aitem;
2113
2114     number_of_items = tvb_get_ntohl(tvb, foffset);
2115     foffset += 4;
2116     for (i = 1 ; i <= number_of_items; i++ )
2117     {
2118         aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Cardinal %d", i);
2119         atree = proto_item_add_subtree(aitem, ett_ndps);
2120         length = tvb_get_ntohl(tvb, foffset);
2121         foffset += 4;
2122         proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
2123         foffset += length;
2124         foffset += (length%2);
2125     }
2126     return foffset;
2127 }
2128
2129
2130 static int
2131 server_entry(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
2132 {
2133     guint32     number_of_items=0;
2134     guint32     i=0;
2135     guint32     data_type=0;
2136     proto_tree  *atree;
2137     proto_item  *aitem;
2138     proto_tree  *btree;
2139     proto_item  *bitem;
2140     proto_tree  *ctree;
2141     proto_item  *citem;
2142
2143     foffset = ndps_string(tvb, hf_ndps_server_name, ndps_tree, foffset);
2144     aitem = proto_tree_add_item(ndps_tree, hf_ndps_server_type, tvb, foffset, 4, FALSE);
2145     atree = proto_item_add_subtree(aitem, ett_ndps);
2146     foffset += 4;
2147     foffset = print_address(tvb, atree, foffset);
2148     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Server Info");
2149     btree = proto_item_add_subtree(bitem, ett_ndps);
2150     number_of_items = tvb_get_ntohl(tvb, foffset); 
2151     foffset += 4;
2152     for (i = 1 ; i <= number_of_items; i++ )
2153     {
2154         citem = proto_tree_add_text(btree, tvb, foffset, 0, "Info %d", i);
2155         ctree = proto_item_add_subtree(citem, ett_ndps);
2156         data_type = tvb_get_ntohl(tvb, foffset);
2157         proto_tree_add_item(ctree, hf_ndps_data_item_type, tvb, foffset, 4, FALSE);
2158         foffset += 4;
2159         switch (data_type) 
2160         {
2161         case 0:   /* Int8 */
2162             proto_tree_add_item(ctree, hf_info_int, tvb, foffset, 1, FALSE);
2163             foffset++;
2164             break;
2165         case 1:   /* Int16 */
2166             proto_tree_add_item(ctree, hf_info_int16, tvb, foffset, 2, FALSE);
2167             foffset += 2;
2168             break;
2169         case 2:   /* Int32 */
2170             proto_tree_add_item(ctree, hf_info_int32, tvb, foffset, 4, FALSE);
2171             foffset += 4;
2172             break;
2173         case 3:   /* Boolean */
2174             proto_tree_add_item(ctree, hf_info_boolean, tvb, foffset, 4, FALSE);
2175             foffset += 4;
2176             break;
2177         case 4:   /* String */
2178         case 5:   /* Bytes */
2179             foffset = ndps_string(tvb, hf_info_string, ctree, foffset);
2180             break;
2181         default:
2182             break;
2183         }
2184     }
2185     return foffset;
2186 }
2187
2188
2189 static int
2190 attribute_value(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
2191 {
2192     guint32     i;
2193     guint32     j;
2194     guint32     number_of_items=0;
2195     guint32     number_of_items2=0;
2196     guint32     attribute_type=0;
2197     guint32     integer_or_oid=0;
2198     guint32     event_object_type=0;
2199     guint32     ignored_type=0;
2200     guint32     resource_type=0;
2201     guint32     identifier_type=0;
2202     guint32     criterion_type=0;
2203     guint32     card_enum_time=0;
2204     guint32     media_type=0;
2205     guint32     doc_content=0;
2206     guint32     page_size=0;
2207     guint32     medium_size=0;
2208     guint32     numbers_up=0;
2209     guint32     colorant_set=0;
2210     guint32     length=0;
2211     char        *label;
2212     guint32     label_value=0;
2213     proto_tree  *atree;
2214     proto_item  *aitem;
2215     proto_tree  *btree;
2216     proto_item  *bitem;
2217
2218     if (global_attribute_name==NULL)
2219     {
2220         label_value = 1;
2221         label = match_strval(label_value, object_ids_7);
2222         global_attribute_name = label;
2223     }
2224     attribute_type = tvb_get_ntohl(tvb, foffset); 
2225     if (ndps_show_oids)
2226     {
2227         proto_tree_add_item(ndps_tree, hf_obj_attribute_type, tvb, foffset, 4, FALSE);
2228     }
2229     foffset += 4;
2230     switch(attribute_type)
2231     {
2232         case 0:         /* Null */
2233             proto_tree_add_item(ndps_tree, hf_ndps_data, tvb, foffset+4, tvb_get_ntohl(tvb, foffset), FALSE);
2234             break;
2235         case 1:         /* Text */
2236         case 2:         /* Descriptive Name */
2237         case 3:         /* Descriptor */
2238         case 6:         /* Simple Name */
2239         case 40:         /* Distinguished Name*/
2240         case 50:         /* Font Reference */
2241         case 58:         /* Locale */
2242         case 102:         /* File Path */
2243         case 103:         /* Uniform Resource Identifier */
2244         case 108:         /* Extended Resource Identifier */
2245             foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
2246             break;
2247         case 4:         /* Message */
2248         case 5:         /* Error Message */
2249         case 38:         /* Name or OID */
2250             foffset = name_or_id(tvb, ndps_tree, foffset);
2251             break;
2252         case 39:         /* Name or OID Seq */
2253             number_of_items = tvb_get_ntohl(tvb, foffset);
2254             foffset += 4;
2255             for (i = 1 ; i <= number_of_items; i++ )
2256             {
2257                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
2258                 atree = proto_item_add_subtree(aitem, ett_ndps);
2259                 foffset = name_or_id(tvb, atree, foffset);
2260             }
2261             break;
2262         case 7:         /* Distinguished Name String*/
2263         case 79:         /* File Reference */
2264             foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
2265             foffset = name_or_id(tvb, ndps_tree, foffset);
2266             break;
2267         case 8:         /* Distinguished Name String Seq */
2268             number_of_items = tvb_get_ntohl(tvb, foffset);
2269             foffset += 4;
2270             for (i = 1 ; i <= number_of_items; i++ )
2271             {
2272                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Name %d", i);
2273                 atree = proto_item_add_subtree(aitem, ett_ndps);
2274                 foffset = ndps_string(tvb, hf_object_name, atree, foffset);
2275                 foffset = name_or_id(tvb, atree, foffset);
2276             }
2277             break;
2278         case 9:          /* Delta Time */
2279         case 10:         /* Time */
2280         case 11:         /* Integer */
2281         case 13:         /* Cardinal */
2282         case 15:         /* Positive Integer */
2283         case 18:         /* Maximum Integer */
2284         case 19:         /* Minimum Integer */
2285         case 35:         /* Percent */
2286         case 57:         /* Job Priority */
2287         case 72:         /* Sides */
2288         case 95:         /* Enumeration */
2289             if (strcmp(global_attribute_name,"(Novell) Attribute PRINTER SECURITY LEVEL")==0)
2290             {
2291                 proto_tree_add_item(ndps_tree, hf_print_security, tvb, foffset, 4, FALSE);
2292                 foffset += 4;
2293             }
2294             else
2295             {
2296                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2297                 foffset += 4;
2298             }
2299             break;
2300         case 12:         /* Integer Seq */
2301         case 14:         /* Cardinal Seq */
2302             length = tvb_get_ntohl(tvb, foffset);
2303             foffset += 4;
2304             proto_tree_add_item(ndps_tree, hf_info_int32, tvb, foffset, length, FALSE);
2305             foffset += length;
2306             break;
2307         case 16:         /* Integer Range */
2308         case 17:         /* Cardinal Range */
2309             proto_tree_add_item(ndps_tree, hf_ndps_lower_range, tvb, foffset, 4, FALSE);
2310             foffset += 4;
2311             proto_tree_add_item(ndps_tree, hf_ndps_upper_range, tvb, foffset, 4, FALSE);
2312             foffset += 4;
2313             break;
2314         case 20:         /* Integer 64 */
2315         case 22:         /* Cardinal 64 */
2316         case 24:         /* Positive Integer 64 */
2317         case 31:         /* Non-Negative Real */
2318         case 29:         /* Real */
2319             proto_tree_add_item(ndps_tree, hf_ndps_n64, tvb, foffset, 8, FALSE);
2320             foffset += 8;
2321             break;
2322         case 21:         /* Integer 64 Seq */
2323         case 23:         /* Cardinal 64 Seq */
2324         case 30:         /* Real Seq */
2325             number_of_items = tvb_get_ntohl(tvb, foffset);
2326             foffset += 4;
2327             for (i = 1 ; i <= number_of_items; i++ )
2328             {
2329                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
2330                 atree = proto_item_add_subtree(aitem, ett_ndps);
2331                 proto_tree_add_item(atree, hf_ndps_n64, tvb, foffset, 8, FALSE);
2332                 foffset += 8;
2333             }
2334             break;
2335         case 25:         /* Integer 64 Range */
2336         case 26:         /* Cardinal 64 Range */
2337         case 32:         /* Real Range */
2338         case 33:         /* Non-Negative Real Range */
2339             proto_tree_add_item(ndps_tree, hf_ndps_lower_range_n64, tvb, foffset, 8, FALSE);
2340             foffset += 8;
2341             proto_tree_add_item(ndps_tree, hf_ndps_upper_range_n64, tvb, foffset, 8, FALSE);
2342             foffset += 8;
2343             break;
2344         case 27:         /* Maximum Integer 64 */
2345             proto_tree_add_item(ndps_tree, hf_ndps_lower_range_n64, tvb, foffset, 8, FALSE);
2346             foffset += 8;
2347             break;
2348         case 28:         /* Minimum Integer 64 */
2349             proto_tree_add_item(ndps_tree, hf_ndps_upper_range_n64, tvb, foffset, 8, FALSE);
2350             foffset += 8;
2351             break;
2352         case 34:         /* Boolean */
2353             proto_tree_add_item(ndps_tree, hf_ndps_attrib_boolean, tvb, foffset, 4, FALSE);
2354             foffset += 4;
2355             break;
2356         case 36:         /* Object Identifier */
2357                 foffset = objectidentifier(tvb, ndps_tree, foffset);
2358             break;
2359         case 37:         /* Object Identifier Seq */
2360             number_of_items = tvb_get_ntohl(tvb, foffset);
2361             foffset += 4;
2362             for (i = 1 ; i <= number_of_items; i++ )
2363             {
2364                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object %d", i);
2365                 atree = proto_item_add_subtree(aitem, ett_ndps);
2366                 foffset = objectidentifier(tvb, atree, foffset);
2367             }
2368             break;
2369         case 41:         /* Relative Distinguished Name Seq */
2370             number_of_items = tvb_get_ntohl(tvb, foffset);
2371             foffset += 4;
2372             for (i = 1 ; i <= number_of_items; i++ )
2373             {
2374                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Name %d", i);
2375                 atree = proto_item_add_subtree(aitem, ett_ndps);
2376                 foffset = ndps_string(tvb, hf_object_name, atree, foffset);
2377             }
2378             break;
2379         case 42:         /* Realization */
2380             proto_tree_add_item(ndps_tree, hf_ndps_realization, tvb, foffset, 4, FALSE);
2381             foffset += 4;
2382             break;
2383         case 43:         /* Medium Dimensions */
2384             proto_tree_add_item(ndps_tree, hf_ndps_xdimension_n64, tvb, foffset, 8, FALSE);
2385             foffset += 8;
2386             proto_tree_add_item(ndps_tree, hf_ndps_ydimension_n64, tvb, foffset, 8, FALSE);
2387             foffset += 8;
2388             break;
2389         case 44:         /* Dimension */
2390             proto_tree_add_item(ndps_tree, hf_ndps_dim_value, tvb, foffset, 8, FALSE);
2391             foffset += 4;
2392             if (tvb_get_ntohl(tvb, foffset-4) == 0) {
2393                 proto_tree_add_item(ndps_tree, hf_ndps_n64, tvb, foffset, 8, FALSE);
2394                 foffset += 8;
2395             }
2396             else
2397             {
2398                 foffset = name_or_id(tvb, ndps_tree, foffset);
2399             }
2400             proto_tree_add_item(ndps_tree, hf_ndps_dim_flag, tvb, foffset, 8, FALSE);
2401             foffset += 4;
2402             proto_tree_add_item(ndps_tree, hf_ndps_n64, tvb, foffset, 8, FALSE);
2403             foffset += 8;
2404             break;
2405         case 45:         /* XY Dimensions */
2406             proto_tree_add_item(ndps_tree, hf_ndps_xydim_value, tvb, foffset, 8, FALSE);
2407             foffset += 4;
2408             if (tvb_get_ntohl(tvb, foffset-4) == 1) {
2409                 foffset = name_or_id(tvb, ndps_tree, foffset);
2410             }
2411             else
2412             {
2413                 proto_tree_add_item(ndps_tree, hf_ndps_xdimension_n64, tvb, foffset, 8, FALSE);
2414                 foffset += 8;
2415                 proto_tree_add_item(ndps_tree, hf_ndps_ydimension_n64, tvb, foffset, 8, FALSE);
2416                 foffset += 8;
2417             }
2418             proto_tree_add_item(ndps_tree, hf_ndps_dim_flag, tvb, foffset, 8, FALSE);
2419             foffset += 4;
2420             proto_tree_add_item(ndps_tree, hf_ndps_n64, tvb, foffset, 8, FALSE);
2421             foffset += 8;
2422             break;
2423         case 46:         /* Locations */
2424             proto_tree_add_item(ndps_tree, hf_ndps_location_value, tvb, foffset, 8, FALSE);
2425             foffset += 4;
2426             if (tvb_get_ntohl(tvb, foffset-4) == 0) {
2427                 number_of_items = tvb_get_ntohl(tvb, foffset);
2428                 foffset += 4;
2429                 for (i = 1 ; i <= number_of_items; i++ )
2430                 {
2431                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Location %d", i);
2432                     atree = proto_item_add_subtree(aitem, ett_ndps);
2433                     proto_tree_add_item(atree, hf_ndps_n64, tvb, foffset, 8, FALSE);
2434                     foffset += 8;
2435                 }
2436             }
2437             else
2438             {
2439                 foffset = name_or_id(tvb, ndps_tree, foffset);
2440             }
2441             proto_tree_add_item(ndps_tree, hf_ndps_dim_flag, tvb, foffset, 8, FALSE);
2442             foffset += 4;
2443             proto_tree_add_item(ndps_tree, hf_ndps_n64, tvb, foffset, 8, FALSE);
2444             foffset += 8;
2445             break;
2446         case 47:         /* Area */
2447             proto_tree_add_item(ndps_tree, hf_ndps_xmin_n64, tvb, foffset, 8, FALSE);
2448             foffset += 8;
2449             proto_tree_add_item(ndps_tree, hf_ndps_xmax_n64, tvb, foffset, 8, FALSE);
2450             foffset += 8;
2451             proto_tree_add_item(ndps_tree, hf_ndps_ymin_n64, tvb, foffset, 8, FALSE);
2452             foffset += 8;
2453             proto_tree_add_item(ndps_tree, hf_ndps_ymax_n64, tvb, foffset, 8, FALSE);
2454             foffset += 8;
2455             break;
2456         case 48:         /* Area Seq */
2457             number_of_items = tvb_get_ntohl(tvb, foffset);
2458             foffset += 4;
2459             for (i = 1 ; i <= number_of_items; i++ )
2460             {
2461                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Area %d", i);
2462                 atree = proto_item_add_subtree(aitem, ett_ndps);
2463                 proto_tree_add_item(atree, hf_ndps_xmin_n64, tvb, foffset, 8, FALSE);
2464                 foffset += 8;
2465                 proto_tree_add_item(atree, hf_ndps_xmax_n64, tvb, foffset, 8, FALSE);
2466                 foffset += 8;
2467                 proto_tree_add_item(atree, hf_ndps_ymin_n64, tvb, foffset, 8, FALSE);
2468                 foffset += 8;
2469                 proto_tree_add_item(atree, hf_ndps_ymax_n64, tvb, foffset, 8, FALSE);
2470                 foffset += 8;
2471             }
2472             break;
2473         case 49:         /* Edge */
2474             proto_tree_add_item(ndps_tree, hf_ndps_edge_value, tvb, foffset, 4, FALSE);
2475             foffset += 4;
2476             break;
2477         case 51:         /* Cardinal or OID */
2478             proto_tree_add_item(ndps_tree, hf_ndps_cardinal_or_oid, tvb, foffset, 4, FALSE);
2479             foffset += 4;
2480             if (tvb_get_ntohl(tvb, foffset-4)==0) {
2481                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2482                 foffset += 4;
2483             }
2484             else
2485             {
2486                 foffset = objectidentifier(tvb, ndps_tree, foffset);
2487             }
2488             break;
2489         case 52:         /* OID Cardinal Map */
2490             foffset = objectidentifier(tvb, ndps_tree, foffset);
2491             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2492             foffset += 4;
2493             break;
2494         case 53:         /* Cardinal or Name or OID */
2495             proto_tree_add_item(ndps_tree, hf_ndps_cardinal_name_or_oid, tvb, foffset, 4, FALSE);
2496             foffset += 4;
2497             if (tvb_get_ntohl(tvb, foffset-4)==0) {
2498                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2499                 foffset += 4;
2500             }
2501             else
2502             {
2503                 foffset = name_or_id(tvb, ndps_tree, foffset);
2504             }
2505             break;
2506         case 54:         /* Positive Integer or OID */
2507             integer_or_oid = tvb_get_ntohl(tvb, foffset);
2508             proto_tree_add_uint(ndps_tree, hf_ndps_integer_or_oid, tvb, foffset, 4, integer_or_oid);
2509             foffset += 4;
2510             if (integer_or_oid==0) {
2511                 foffset = objectidentifier(tvb, ndps_tree, foffset);
2512             }
2513             else
2514             {
2515                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2516                 foffset += 4;
2517             }
2518             break;
2519         case 55:         /* Event Handling Profile */
2520             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
2521             foffset += 4;
2522             proto_tree_add_item(ndps_tree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
2523             foffset += 4;
2524             foffset = qualifiedname(tvb, ndps_tree, foffset);
2525             length = tvb_get_ntohl(tvb, foffset);
2526             foffset += 4;
2527             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
2528             foffset += length;
2529             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
2530             foffset += 4;
2531             foffset = name_or_id(tvb, ndps_tree, foffset);
2532             number_of_items = tvb_get_ntohl(tvb, foffset);
2533             for (i = 1 ; i <= number_of_items; i++ )
2534             {
2535                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Address Item %d", i);
2536                 atree = proto_item_add_subtree(aitem, ett_ndps);
2537                 foffset += address_item(tvb, atree, foffset);
2538             }
2539             number_of_items = tvb_get_ntohl(tvb, foffset);
2540             for (i = 1 ; i <= number_of_items; i++ )
2541             {
2542                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Event %d", i);
2543                 atree = proto_item_add_subtree(aitem, ett_ndps);
2544                 proto_tree_add_item(atree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
2545                 foffset += 4;
2546                 foffset = objectidentifier(tvb, atree, foffset);
2547                 foffset = objectidentification(tvb, atree, foffset);
2548                 proto_tree_add_item(atree, hf_ndps_object_op, tvb, foffset, 4, FALSE);
2549                 foffset += 4;
2550                 
2551                 event_object_type = tvb_get_ntohl(tvb, foffset);
2552                 proto_tree_add_uint(atree, hf_ndps_event_object_identifier, tvb, foffset, 4, event_object_type);
2553                 foffset += 4;
2554                 if(event_object_type==1)
2555                 {
2556                     foffset = objectidentifier(tvb, atree, foffset);
2557                 }
2558                 else
2559                 {
2560                     if(event_object_type==0)
2561                     {
2562                         number_of_items2 = tvb_get_ntohl(tvb, foffset);
2563                         foffset += 4;
2564                         for (j = 1 ; j <= number_of_items2; j++ )
2565                         {
2566                             bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Object %d", i);
2567                             btree = proto_item_add_subtree(bitem, ett_ndps);
2568                             foffset = objectidentifier(tvb, btree, foffset);
2569                         }
2570                     }
2571                 }
2572             }
2573             break;
2574         case 56:         /* Octet String */
2575         case 63:         /* Job Password */
2576         case 66:         /* Print Checkpoint */
2577             foffset = ndps_string(tvb, hf_info_string, ndps_tree, foffset);
2578             break;
2579         case 59:         /* Method Delivery Address */
2580             proto_tree_add_item(ndps_tree, hf_ndps_delivery_add_type, tvb, foffset, 4, FALSE);
2581             event_object_type = tvb_get_ntohl(tvb, foffset);
2582             foffset += 4;
2583             switch(event_object_type)
2584             {
2585                 case 0:     /*MHS ADDR*/
2586                 case 1:     /*DISTINGUISHED_NAME*/
2587                 case 2:     /*TEXT*/
2588                 case 3:     /*OCTET_STRING*/
2589                     foffset = ndps_string(tvb, hf_info_string, ndps_tree, foffset);
2590                     break;
2591                 case 4:     /*DIST_NAME_STRING*/
2592                     foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
2593                     foffset = name_or_id(tvb, ndps_tree, foffset);
2594                     break;
2595                 case 5:     /*RPC_ADDRESS*/
2596                 case 6:     /*QUALIFIED_NAME*/
2597                     foffset = objectidentifier(tvb, ndps_tree, foffset);
2598                     foffset = qualifiedname(tvb, ndps_tree, foffset);
2599                     break;
2600                 default:
2601                     break;
2602             }
2603             break;
2604         case 60:         /* Object Identification */
2605             foffset = objectidentification(tvb, ndps_tree, foffset);
2606             break;
2607         case 61:         /* Results Profile */
2608             foffset = objectidentifier(tvb, ndps_tree, foffset);
2609             foffset = name_or_id(tvb, ndps_tree, foffset);
2610             foffset = address_item(tvb, ndps_tree, foffset);
2611             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2612             foffset += 4;
2613             foffset = name_or_id(tvb, ndps_tree, foffset);
2614             break;
2615         case 62:         /* Criteria */
2616             foffset = objectidentifier(tvb, ndps_tree, foffset);
2617             criterion_type = tvb_get_ntohl(tvb, foffset);
2618             proto_tree_add_uint(ndps_tree, hf_ndps_criterion_type, tvb, foffset, 4, criterion_type);
2619             foffset += 4;
2620             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2621             foffset += 4;
2622             break;
2623         case 64:         /* Job Level */
2624             foffset = objectidentifier(tvb, ndps_tree, foffset);
2625             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2626             foffset += 4;
2627             break;
2628         case 65:         /* Job Categories */
2629             foffset = objectidentifier(tvb, ndps_tree, foffset);
2630             number_of_items = tvb_get_ntohl(tvb, foffset);
2631             foffset += 4;
2632             for (i = 1 ; i <= number_of_items; i++ )
2633             {
2634                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job %d", i);
2635                 atree = proto_item_add_subtree(aitem, ett_ndps);
2636                 length = tvb_get_ntohl(tvb, foffset);
2637                 foffset += 4;
2638                 proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
2639                 foffset += length;
2640                 foffset += (length%2);
2641             }
2642             break;
2643         case 67:         /* Ignored Attribute */
2644             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2645             foffset += 4;
2646             foffset = objectidentifier(tvb, ndps_tree, foffset);
2647             number_of_items = tvb_get_ntohl(tvb, foffset);
2648             foffset += 4;
2649             for (i = 1 ; i <= number_of_items; i++ )
2650             {
2651                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Ignored Attribute %d", i);
2652                 atree = proto_item_add_subtree(aitem, ett_ndps);
2653                 ignored_type = tvb_get_ntohl(tvb, foffset);
2654                 proto_tree_add_uint(atree, hf_ndps_ignored_type, tvb, foffset, 4, ignored_type);
2655                 foffset += 4;
2656                 if (ignored_type == 38)
2657                 {
2658                     foffset = name_or_id(tvb, atree, foffset);
2659                 }
2660                 else
2661                 {
2662                     foffset = objectidentifier(tvb, atree, foffset);
2663                 }
2664             }
2665             break;
2666         case 68:         /* Resource */
2667             resource_type = tvb_get_ntohl(tvb, foffset);
2668             proto_tree_add_uint(ndps_tree, hf_ndps_resource_type, tvb, foffset, 4, resource_type);
2669             foffset += 4;
2670             if (resource_type == 0)
2671             {
2672                 foffset = name_or_id(tvb, ndps_tree, foffset);
2673             }
2674             else
2675             {
2676                 foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
2677             }
2678             break;
2679         case 69:         /* Medium Substitution */
2680             foffset = name_or_id(tvb, ndps_tree, foffset);
2681             foffset = name_or_id(tvb, ndps_tree, foffset);
2682             break;
2683         case 70:         /* Font Substitution */
2684             foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
2685             foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
2686             break;
2687         case 71:         /* Resource Context Seq */
2688             number_of_items = tvb_get_ntohl(tvb, foffset);
2689             foffset += 4;
2690             for (i = 1 ; i <= number_of_items; i++ )
2691             {
2692                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Resource %d", i);
2693                 atree = proto_item_add_subtree(aitem, ett_ndps);
2694                 resource_type = tvb_get_ntohl(tvb, foffset);
2695                 proto_tree_add_uint(atree, hf_ndps_resource_type, tvb, foffset, 4, resource_type);
2696                 foffset += 4;
2697                 if (resource_type == 0)
2698                 {
2699                     foffset = name_or_id(tvb, atree, foffset);
2700                 }
2701                 else
2702                 {
2703                     foffset = ndps_string(tvb, hf_ndps_tree, atree, foffset);
2704                 }
2705             }
2706             break;
2707         case 73:         /* Page Select Seq */
2708             number_of_items = tvb_get_ntohl(tvb, foffset);
2709             foffset += 4;
2710             for (i = 1 ; i <= number_of_items; i++ )
2711             {
2712                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Page Select %d", i);
2713                 atree = proto_item_add_subtree(aitem, ett_ndps);
2714                 proto_tree_add_item(atree, hf_ndps_page_flag, tvb, foffset, 4, FALSE);
2715                 foffset += 4;
2716                 identifier_type = tvb_get_ntohl(tvb, foffset);
2717                 proto_tree_add_uint(atree, hf_ndps_identifier_type, tvb, foffset, 4, identifier_type);
2718                 foffset += 4;
2719                 if (identifier_type == 0)
2720                 {
2721                     proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2722                     foffset += 4;
2723                 }
2724                 if (identifier_type == 1)
2725                 {
2726                     foffset = ndps_string(tvb, hf_ndps_tree, atree, foffset);
2727                 }
2728                 if (identifier_type == 2)
2729                 {
2730                     foffset = name_or_id(tvb, atree, foffset);
2731                 }
2732                 proto_tree_add_item(atree, hf_ndps_page_flag, tvb, foffset, 4, FALSE);
2733                 foffset += 4;
2734                 identifier_type = tvb_get_ntohl(tvb, foffset);
2735                 proto_tree_add_uint(atree, hf_ndps_identifier_type, tvb, foffset, 4, identifier_type);
2736                 foffset += 4;
2737                 if (identifier_type == 0)
2738                 {
2739                     proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2740                     foffset += 4;
2741                 }
2742                 if (identifier_type == 1)
2743                 {
2744                     foffset = ndps_string(tvb, hf_ndps_tree, atree, foffset);
2745                 }
2746                 if (identifier_type == 2)
2747                 {
2748                     foffset = name_or_id(tvb, atree, foffset);
2749                 }
2750             }
2751             break;
2752         case 74:         /* Page Media Select */
2753             media_type = tvb_get_ntohl(tvb, foffset);
2754             proto_tree_add_uint(ndps_tree, hf_ndps_media_type, tvb, foffset, 4, media_type);
2755             foffset += 4;
2756             if (media_type == 0)
2757             {
2758                 foffset = name_or_id(tvb, ndps_tree, foffset);
2759             }
2760             else
2761             {
2762                 foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
2763                 number_of_items = tvb_get_ntohl(tvb, foffset);
2764                 foffset += 4;
2765                 for (i = 1 ; i <= number_of_items; i++ )
2766                 {
2767                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
2768                     atree = proto_item_add_subtree(aitem, ett_ndps);
2769                     proto_tree_add_item(atree, hf_ndps_page_flag, tvb, foffset, 4, FALSE);
2770                     foffset += 4;
2771                     identifier_type = tvb_get_ntohl(tvb, foffset);
2772                     proto_tree_add_uint(atree, hf_ndps_identifier_type, tvb, foffset, 4, identifier_type);
2773                     foffset += 4;
2774                     if (identifier_type == 0)
2775                     {
2776                         proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2777                         foffset += 4;
2778                     }
2779                     if (identifier_type == 1)
2780                     {
2781                         foffset = ndps_string(tvb, hf_ndps_tree, atree, foffset);
2782                     }
2783                     if (identifier_type == 2)
2784                     {
2785                         foffset = name_or_id(tvb, atree, foffset);
2786                     }
2787                 }
2788             }
2789             break;
2790         case 75:         /* Document Content */
2791             doc_content = tvb_get_ntohl(tvb, foffset);
2792             proto_tree_add_uint(ndps_tree, hf_ndps_doc_content, tvb, foffset, 4, doc_content);
2793             foffset += 4;
2794             if (doc_content == 0)
2795             {
2796                 length = tvb_get_ntohl(tvb, foffset);
2797                 foffset += 4;
2798                 proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
2799                 foffset += length;
2800                 foffset += (length%2);
2801             }
2802             else
2803             {
2804                 foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
2805                 foffset = name_or_id(tvb, ndps_tree, foffset);
2806             }
2807             break;
2808         case 76:         /* Page Size */
2809             page_size = tvb_get_ntohl(tvb, foffset);
2810             proto_tree_add_uint(ndps_tree, hf_ndps_page_size, tvb, foffset, 4, page_size);
2811             foffset += 4;
2812             if (page_size == 0)
2813             {
2814                 foffset = objectidentifier(tvb, ndps_tree, foffset);
2815             }
2816             else
2817             {
2818                 proto_tree_add_item(ndps_tree, hf_ndps_xdimension_n64, tvb, foffset, 8, FALSE);
2819                 foffset += 8;
2820                 proto_tree_add_item(ndps_tree, hf_ndps_ydimension_n64, tvb, foffset, 8, FALSE);
2821                 foffset += 8;
2822             }
2823             break;
2824         case 77:         /* Presentation Direction */
2825             proto_tree_add_uint(ndps_tree, hf_ndps_direction, tvb, foffset, 4, FALSE);
2826             foffset += 4;
2827             break;
2828         case 78:         /* Page Order */
2829             proto_tree_add_uint(ndps_tree, hf_ndps_page_order, tvb, foffset, 4, FALSE);
2830             foffset += 4;
2831             break;
2832         case 80:         /* Medium Source Size */
2833             foffset = name_or_id(tvb, ndps_tree, foffset);
2834             medium_size = tvb_get_ntohl(tvb, foffset);
2835             proto_tree_add_uint(ndps_tree, hf_ndps_medium_size, tvb, foffset, 4, medium_size);
2836             foffset += 4;
2837             if (medium_size == 0)
2838             {
2839                 page_size = tvb_get_ntohl(tvb, foffset);
2840                 proto_tree_add_uint(ndps_tree, hf_ndps_page_size, tvb, foffset, 4, page_size);
2841                 foffset += 4;
2842                 if (page_size == 0)
2843                 {
2844                     foffset = objectidentifier(tvb, ndps_tree, foffset);
2845                 }
2846                 else
2847                 {
2848                     proto_tree_add_item(ndps_tree, hf_ndps_xdimension_n64, tvb, foffset, 8, FALSE);
2849                     foffset += 8;
2850                     proto_tree_add_item(ndps_tree, hf_ndps_ydimension_n64, tvb, foffset, 8, FALSE);
2851                     foffset += 8;
2852                 }
2853                 proto_tree_add_item(ndps_tree, hf_ndps_long_edge_feeds, tvb, foffset, 4, FALSE);
2854                 foffset += 4;
2855                 proto_tree_add_item(ndps_tree, hf_ndps_xmin_n64, tvb, foffset, 8, FALSE);
2856                 foffset += 8;
2857                 proto_tree_add_item(ndps_tree, hf_ndps_xmax_n64, tvb, foffset, 8, FALSE);
2858                 foffset += 8;
2859                 proto_tree_add_item(ndps_tree, hf_ndps_ymin_n64, tvb, foffset, 8, FALSE);
2860                 foffset += 8;
2861                 proto_tree_add_item(ndps_tree, hf_ndps_ymax_n64, tvb, foffset, 8, FALSE);
2862                 foffset += 8;
2863             }
2864             else
2865             {
2866                 proto_tree_add_item(ndps_tree, hf_ndps_lower_range_n64, tvb, foffset, 8, FALSE);
2867                 foffset += 8;
2868                 proto_tree_add_item(ndps_tree, hf_ndps_upper_range_n64, tvb, foffset, 8, FALSE);
2869                 foffset += 8;
2870                 proto_tree_add_item(ndps_tree, hf_ndps_inc_across_feed, tvb, foffset, 8, FALSE);
2871                 foffset += 8;
2872                 proto_tree_add_item(ndps_tree, hf_ndps_lower_range_n64, tvb, foffset, 8, FALSE);
2873                 foffset += 8;
2874                 proto_tree_add_item(ndps_tree, hf_ndps_upper_range_n64, tvb, foffset, 8, FALSE);
2875                 foffset += 8;
2876                 proto_tree_add_item(ndps_tree, hf_ndps_size_inc_in_feed, tvb, foffset, 8, FALSE);
2877                 foffset += 8;
2878                 proto_tree_add_item(ndps_tree, hf_ndps_long_edge_feeds, tvb, foffset, 4, FALSE);
2879                 foffset += 4;
2880                 proto_tree_add_item(ndps_tree, hf_ndps_xmin_n64, tvb, foffset, 8, FALSE);
2881                 foffset += 8;
2882                 proto_tree_add_item(ndps_tree, hf_ndps_xmax_n64, tvb, foffset, 8, FALSE);
2883                 foffset += 8;
2884                 proto_tree_add_item(ndps_tree, hf_ndps_ymin_n64, tvb, foffset, 8, FALSE);
2885                 foffset += 8;
2886                 proto_tree_add_item(ndps_tree, hf_ndps_ymax_n64, tvb, foffset, 8, FALSE);
2887                 foffset += 8;
2888             }
2889             break;
2890         case 81:         /* Input Tray Medium */
2891             foffset = name_or_id(tvb, ndps_tree, foffset);
2892             foffset = name_or_id(tvb, ndps_tree, foffset);
2893             break;
2894         case 82:         /* Output Bins Characteristics */
2895             number_of_items = tvb_get_ntohl(tvb, foffset);
2896             foffset += 4;
2897             for (i = 1 ; i <= number_of_items; i++ )
2898             {
2899                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Page Information %d", i);
2900                 atree = proto_item_add_subtree(aitem, ett_ndps);
2901                 proto_tree_add_uint(atree, hf_ndps_page_order, tvb, foffset, 4, FALSE);
2902                 foffset += 4;
2903                 proto_tree_add_uint(atree, hf_ndps_page_orientation, tvb, foffset, 4, FALSE);
2904                 foffset += 4;
2905             }
2906             break;
2907         case 83:         /* Page ID Type */
2908             proto_tree_add_uint(ndps_tree, hf_ndps_identifier_type, tvb, foffset, 4, FALSE);
2909             foffset += 4;
2910             break;
2911         case 84:         /* Level Range */
2912             foffset = objectidentifier(tvb, ndps_tree, foffset);
2913             proto_tree_add_item(ndps_tree, hf_ndps_lower_range, tvb, foffset, 4, FALSE);
2914             foffset += 4;
2915             proto_tree_add_item(ndps_tree, hf_ndps_upper_range, tvb, foffset, 4, FALSE);
2916             foffset += 4;
2917             break;
2918         case 85:         /* Category Set */
2919             foffset = objectidentifier(tvb, ndps_tree, foffset);
2920             number_of_items = tvb_get_ntohl(tvb, foffset);
2921             foffset += 4;
2922             for (i = 1 ; i <= number_of_items; i++ )
2923             {
2924                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Category %d", i);
2925                 atree = proto_item_add_subtree(aitem, ett_ndps);
2926                 length = tvb_get_ntohl(tvb, foffset);
2927                 foffset += 4;
2928                 proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
2929                 foffset += length;
2930                 foffset += (length%2);
2931             }
2932             number_of_items = tvb_get_ntohl(tvb, foffset);
2933             foffset += 4;
2934             for (i = 1 ; i <= number_of_items; i++ )
2935             {
2936                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Value %d", i);
2937                 atree = proto_item_add_subtree(aitem, ett_ndps);
2938                 length = tvb_get_ntohl(tvb, foffset);
2939                 foffset += 4;
2940                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
2941                 foffset += length;
2942                 foffset += (length%2);
2943             }
2944             break;
2945         case 86:         /* Numbers Up Supported */
2946             proto_tree_add_uint(ndps_tree, hf_ndps_numbers_up, tvb, foffset, 4, FALSE);
2947             numbers_up=tvb_get_ntohl(tvb, foffset);
2948             foffset += 4;
2949             switch(numbers_up)
2950             {
2951             case 0:     /*Cardinal*/
2952                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2953                 foffset += 4;
2954                 break;
2955             case 1:     /*Name or OID*/
2956                 foffset = name_or_id(tvb, ndps_tree, foffset);
2957                 break;
2958             case 2:     /*Cardinal Range*/
2959                 proto_tree_add_item(ndps_tree, hf_ndps_lower_range, tvb, foffset, 4, FALSE);
2960                 foffset += 4;
2961                 proto_tree_add_item(ndps_tree, hf_ndps_upper_range, tvb, foffset, 4, FALSE);
2962                 foffset += 4;
2963                 break;
2964             default:
2965                 break;
2966             }
2967             break;
2968         case 87:         /* Finishing */
2969         case 88:         /* Print Contained Object ID */
2970             foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
2971             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
2972             foffset += 4;
2973             break;
2974         case 89:         /* Print Config Object ID */
2975             foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
2976             foffset = qualifiedname(tvb, ndps_tree, foffset);
2977             break;
2978         case 90:         /* Typed Name */
2979             foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
2980             proto_tree_add_item(ndps_tree, hf_level, tvb, foffset, 4, FALSE);
2981             foffset += 4;
2982             proto_tree_add_item(ndps_tree, hf_interval, tvb, foffset, 4, FALSE);
2983             foffset += 4;
2984             break;
2985         case 91:         /* Network Address */
2986             proto_tree_add_item(ndps_tree, hf_ndps_address, tvb, foffset, 4, FALSE);
2987             foffset += 4;
2988             length = tvb_get_ntohl(tvb, foffset);
2989             foffset += 4;
2990             proto_tree_add_item(ndps_tree, hf_ndps_add_bytes, tvb, foffset, 4, FALSE);
2991             foffset += length;
2992             break;
2993         case 92:         /* XY Dimensions Value */
2994             proto_tree_add_item(ndps_tree, hf_ndps_xydim_value, tvb, foffset, 8, FALSE);
2995             foffset += 4;
2996             if (tvb_get_ntohl(tvb, foffset-4) == 1) {
2997                 foffset = name_or_id(tvb, ndps_tree, foffset);
2998             }
2999             else
3000             {
3001                 if (tvb_get_ntohl(tvb, foffset-4) == 0) 
3002                 {
3003                     proto_tree_add_item(ndps_tree, hf_ndps_xdimension_n64, tvb, foffset, 8, FALSE);
3004                     foffset += 8;
3005                     proto_tree_add_item(ndps_tree, hf_ndps_ydimension_n64, tvb, foffset, 8, FALSE);
3006                     foffset += 8;
3007                 }
3008                 else
3009                 {
3010                     proto_tree_add_item(ndps_tree, hf_ndps_xdimension, tvb, foffset, 4, FALSE);
3011                     foffset += 4;
3012                     proto_tree_add_item(ndps_tree, hf_ndps_ydimension, tvb, foffset, 4, FALSE);
3013                     foffset += 4;
3014                 }
3015             }
3016             break;
3017         case 93:         /* Name or OID Dimensions Map */
3018             foffset = name_or_id(tvb, ndps_tree, foffset);
3019             proto_tree_add_item(ndps_tree, hf_ndps_xdimension, tvb, foffset, 4, FALSE);
3020             foffset += 4;
3021             proto_tree_add_item(ndps_tree, hf_ndps_ydimension, tvb, foffset, 4, FALSE);
3022             foffset += 4;
3023             break;
3024         case 94:         /* Printer State Reason */
3025             foffset += 4;
3026             foffset = name_or_id(tvb, ndps_tree, foffset);
3027             proto_tree_add_item(ndps_tree, hf_ndps_state_severity, tvb, foffset, 4, FALSE);
3028             foffset += 4;
3029             proto_tree_add_item(ndps_tree, hf_ndps_training, tvb, foffset, 4, FALSE);
3030             foffset += 4;
3031             foffset = objectidentifier(tvb, ndps_tree, foffset);
3032             foffset += align_4(tvb, foffset);
3033             foffset = objectidentification(tvb, ndps_tree, foffset);
3034             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3035             foffset += 4;
3036             foffset = name_or_id(tvb, ndps_tree, foffset);
3037             break;
3038         case 96:         /* Qualified Name */
3039             foffset = qualifiedname(tvb, ndps_tree, foffset);
3040             break;
3041         case 97:         /* Qualified Name Set */
3042             number_of_items = tvb_get_ntohl(tvb, foffset);
3043             foffset += 4;
3044             for (i = 1 ; i <= number_of_items; i++ )
3045             {
3046                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Name %d", i);
3047                 atree = proto_item_add_subtree(aitem, ett_ndps);
3048                 foffset = qualifiedname(tvb, atree, foffset);
3049             }
3050             break;
3051         case 98:         /* Colorant Set */
3052             colorant_set = tvb_get_ntohl(tvb, foffset);
3053             proto_tree_add_item(ndps_tree, hf_ndps_colorant_set, tvb, foffset, 4, FALSE);
3054             foffset += 4;
3055             if (colorant_set==0)
3056             {
3057                 foffset = name_or_id(tvb, ndps_tree, foffset);
3058             }
3059             else
3060             {
3061
3062                 foffset = objectidentifier(tvb, ndps_tree, foffset);
3063                 number_of_items = tvb_get_ntohl(tvb, foffset);
3064                 foffset += 4;
3065                 for (i = 1 ; i <= number_of_items; i++ )
3066                 {
3067                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Colorant %d", i);
3068                     atree = proto_item_add_subtree(aitem, ett_ndps);
3069                     foffset = name_or_id(tvb, atree, foffset);
3070                 }
3071             }
3072             break;
3073         case 99:         /* Resource Printer ID */
3074             number_of_items = tvb_get_ntohl(tvb, foffset);
3075             foffset += 4;
3076             for (i = 1 ; i <= number_of_items; i++ )
3077             {
3078                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Printer %d", i);
3079                 atree = proto_item_add_subtree(aitem, ett_ndps);
3080                 foffset = ndps_string(tvb, hf_ndps_printer_type, atree, foffset);
3081                 foffset = ndps_string(tvb, hf_ndps_printer_manuf, atree, foffset);
3082                 foffset = ndps_string(tvb, hf_ndps_inf_file_name, atree, foffset);
3083             }
3084             proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
3085             foffset += 4;
3086             break;
3087         case 100:         /* Event Object ID */
3088             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
3089             foffset = objectidentifier(tvb, ndps_tree, foffset);
3090             proto_tree_add_item(ndps_tree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
3091             foffset +=4;
3092             break;
3093         case 101:         /* Qualified Name Map */
3094             foffset = qualifiedname(tvb, ndps_tree, foffset);
3095             foffset = qualifiedname(tvb, ndps_tree, foffset);
3096             break;
3097         case 104:         /* Cardinal or Enum or Time */
3098             card_enum_time = tvb_get_ntohl(tvb, foffset);
3099             proto_tree_add_item(ndps_tree, hf_ndps_card_enum_time, tvb, foffset, 4, FALSE);
3100             foffset += 4;
3101             if (card_enum_time==0)
3102             {
3103                 proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3104                 foffset += 4;
3105             }
3106             else
3107             {
3108                 if (card_enum_time==1)
3109                 {
3110                     proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3111                     foffset += 4;
3112                 }
3113                 else
3114                 {
3115                     proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3116                     foffset += 4;
3117                 }
3118             }
3119             break;
3120         case 105:         /* Print Contained Object ID Set */
3121             number_of_items = tvb_get_ntohl(tvb, foffset);
3122             foffset += 4;
3123             for (i = 1 ; i <= number_of_items; i++ )
3124             {
3125                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object %d", i);
3126                 atree = proto_item_add_subtree(aitem, ett_ndps);
3127                 foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
3128                 proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3129                 foffset += 4;
3130             }
3131             break;
3132         case 106:         /* Octet String Pair */
3133             length = tvb_get_ntohl(tvb, foffset);
3134             foffset += 4;
3135             proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
3136             foffset += length;
3137             foffset += (length%2);
3138             length = tvb_get_ntohl(tvb, foffset);
3139             foffset += 4;
3140             proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
3141             foffset += length;
3142             foffset += (length%2);
3143             break;
3144         case 107:         /* Octet String Integer Pair */
3145             length = tvb_get_ntohl(tvb, foffset);
3146             foffset += 4;
3147             proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
3148             foffset += length;
3149             foffset += (length%2);
3150             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3151             foffset += 4;
3152             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3153             foffset += 4;
3154             break;
3155         case 109:         /* Event Handling Profile 2 */
3156             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3157             foffset += 4;
3158             proto_tree_add_item(ndps_tree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
3159             foffset += 4;
3160             foffset = qualifiedname(tvb, ndps_tree, foffset);
3161             length = tvb_get_ntohl(tvb, foffset);
3162             foffset += 4;
3163             proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
3164             foffset += length;
3165             foffset += (length%2);
3166             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3167             foffset += 4;
3168             foffset = name_or_id(tvb, ndps_tree, foffset);
3169             proto_tree_add_item(ndps_tree, hf_ndps_delivery_add_type, tvb, foffset, 4, FALSE);
3170             event_object_type = tvb_get_ntohl(tvb, foffset);
3171             foffset += 4;
3172             switch(event_object_type)
3173             {
3174                 case 0:     /*MHS ADDR*/
3175                 case 1:     /*DISTINGUISHED_NAME*/
3176                 case 2:     /*TEXT*/
3177                     foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
3178                     break;
3179                 case 3:     /*OCTET_STRING*/
3180                     length = tvb_get_ntohl(tvb, foffset);
3181                     foffset += 4;
3182                     proto_tree_add_item(ndps_tree, hf_ndps_octet_string, tvb, foffset, length, FALSE);
3183                     foffset += length;
3184                     foffset += (length%2);
3185                     break;
3186                 case 4:     /*DIST_NAME_STRING*/
3187                     foffset = ndps_string(tvb, hf_object_name, ndps_tree, foffset);
3188                     foffset = name_or_id(tvb, ndps_tree, foffset);
3189                     break;
3190                 case 5:     /*RPC_ADDRESS*/
3191                 case 6:     /*QUALIFIED_NAME*/
3192                     foffset = objectidentifier(tvb, ndps_tree, foffset);
3193                     foffset = qualifiedname(tvb, ndps_tree, foffset);
3194                     break;
3195                 default:
3196                     break;
3197             }
3198             number_of_items = tvb_get_ntohl(tvb, foffset);
3199             foffset += 4;
3200             for (i = 1 ; i <= number_of_items; i++ )
3201             {
3202                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Event %d", i);
3203                 atree = proto_item_add_subtree(aitem, ett_ndps);
3204                 foffset = ndps_string(tvb, hf_object_name, atree, foffset);
3205                 foffset = objectidentifier(tvb, atree, foffset);
3206                 proto_tree_add_item(atree, hf_ndps_event_type, tvb, foffset, 
3207                 4, FALSE);
3208                 foffset += 4;
3209             }
3210             foffset = objectidentifier(tvb, ndps_tree, foffset);
3211             foffset = qualifiedname(tvb, ndps_tree, foffset);
3212             number_of_items = tvb_get_ntohl(tvb, foffset);
3213             foffset += 4;
3214             for (i = 1 ; i <= number_of_items; i++ )
3215             {
3216                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object %d", i);
3217                 atree = proto_item_add_subtree(aitem, ett_ndps);
3218                 foffset = objectidentifier(tvb, atree, foffset);
3219             }
3220             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3221             foffset += 4;
3222             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3223             foffset += 4;
3224             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
3225             foffset += 4;
3226             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
3227             break;
3228         default:
3229             break;
3230     }
3231     return foffset;
3232 }
3233
3234
3235 static int
3236 commonarguments(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
3237 {
3238     guint32     number_of_items=0;
3239     guint32     i=0;
3240     proto_tree  *atree;
3241     proto_item  *aitem;
3242     proto_tree  *btree;
3243     proto_item  *bitem;
3244
3245     number_of_items = tvb_get_ntohl(tvb, foffset); 
3246     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Common Arguments");
3247     atree = proto_item_add_subtree(aitem, ett_ndps);
3248     foffset += 4;
3249     for (i = 1 ; i <= number_of_items; i++ )
3250     {
3251         bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Argument %d", i);
3252         btree = proto_item_add_subtree(bitem, ett_ndps);
3253         foffset = attribute_value(tvb, atree, foffset);
3254     }
3255     return foffset;
3256 }
3257
3258 static int
3259 res_add_input_data(tvbuff_t* tvb, proto_tree *ndps_tree, int foffset)
3260 {
3261     guint32     resource_type=0;
3262
3263     proto_tree_add_item(ndps_tree, hf_res_type, tvb, foffset, 4, FALSE);
3264     resource_type = tvb_get_ntohl(tvb, foffset);
3265     foffset += 4;
3266     switch (resource_type) 
3267     {
3268     case 0:     /* Print Drivers */
3269         proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
3270         foffset += 4;
3271         foffset = ndps_string(tvb, hf_ndps_prn_dir_name, ndps_tree, foffset);
3272         foffset = ndps_string(tvb, hf_ndps_prn_file_name, ndps_tree, foffset);
3273         break;
3274     case 1:     /* Printer Definitions */
3275         foffset = ndps_string(tvb, hf_ndps_vendor_dir, ndps_tree, foffset);
3276         foffset = ndps_string(tvb, hf_ndps_prn_file_name, ndps_tree, foffset);
3277         break;
3278     case 2:     /* Banner Page Files */
3279         foffset = ndps_string(tvb, hf_ndps_banner_name, ndps_tree, foffset);
3280         break;
3281     case 3:     /* Font Types */
3282         proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
3283         foffset += 4;
3284         proto_tree_add_item(ndps_tree, hf_font_type, tvb, foffset, 4, FALSE);
3285         foffset += 4;
3286         foffset = ndps_string(tvb, hf_ndps_prn_file_name, ndps_tree, foffset);
3287         break;
3288     case 4:     /* Generic Files/ Archive */
3289     case 5:     /* Printer Driver Archive */
3290         proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
3291         foffset += 4;
3292         foffset = ndps_string(tvb, hf_ndps_prn_dir_name, ndps_tree, foffset);
3293         proto_tree_add_item(ndps_tree, hf_archive_type, tvb, foffset, 4, FALSE);
3294         foffset += 4;
3295         break;
3296     default:
3297         break;
3298     }
3299     return foffset;
3300 }
3301
3302
3303 static const fragment_items ndps_frag_items = {
3304         &ett_ndps_segment,
3305         &ett_ndps_segments,
3306         &hf_ndps_segments,
3307         &hf_ndps_segment,
3308         &hf_ndps_segment_overlap,
3309         &hf_ndps_segment_overlap_conflict,
3310         &hf_ndps_segment_multiple_tails,
3311         &hf_ndps_segment_too_long_segment,
3312         &hf_ndps_segment_error,
3313         NULL,
3314         "segments"
3315 };
3316
3317 static dissector_handle_t ndps_data_handle;
3318
3319 /* NDPS packets come in request/reply pairs. The request packets tell the 
3320  * Function and Program numbers. The response, unfortunately, only
3321  * identifies itself via the Exchange ID; you have to know what type of NDPS
3322  * request the request packet contained in order to successfully parse the 
3323  * response. A global method for doing this does not exist in ethereal yet
3324  * (NFS also requires it), so for now the NDPS section will keep its own hash
3325  * table keeping track of NDPS packets.
3326  *
3327  * We construct a conversation specified by the client and server
3328  * addresses and the connection number; the key representing the unique
3329  * NDPS request then is composed of the pointer to the conversation
3330  * structure, cast to a "guint" (which may throw away the upper 32
3331  * bits of the pointer on a P64 platform, but the low-order 32 bits
3332  * are more likely to differ between conversations than the upper 32 bits),
3333  * and the sequence number.
3334  *
3335  * The value stored in the hash table is the ncp_req_hash_value pointer. This
3336  * struct tells us the NDPS Program and Function and gives the NDPS_record pointer.
3337  */
3338 typedef struct {
3339         conversation_t  *conversation;
3340         guint32             ndps_xport;
3341 } ndps_req_hash_key;
3342
3343 typedef struct {
3344         guint32             ndps_prog;
3345         guint32             ndps_func;
3346         guint32             ndps_frame_num;
3347 } ndps_req_hash_value;
3348
3349 static GHashTable *ndps_req_hash = NULL;
3350 static GMemChunk *ndps_req_hash_keys = NULL;
3351 static GMemChunk *ndps_req_hash_values = NULL;
3352
3353 /* Hash Functions */
3354 gint
3355 ndps_equal(gconstpointer v, gconstpointer v2)
3356 {
3357         const ndps_req_hash_key *val1 = (const ndps_req_hash_key*)v;
3358         const ndps_req_hash_key *val2 = (const ndps_req_hash_key*)v2;
3359
3360         if (val1->conversation == val2->conversation &&
3361             val1->ndps_xport  == val2->ndps_xport ) {
3362                 return 1;
3363         }
3364         return 0;
3365 }
3366
3367 guint
3368 ndps_hash(gconstpointer v)
3369 {
3370         const ndps_req_hash_key *ndps_key = (const ndps_req_hash_key*)v;
3371         return GPOINTER_TO_UINT(ndps_key->conversation) + ndps_key->ndps_xport;
3372 }
3373
3374 /* Initializes the hash table and the mem_chunk area each time a new
3375  * file is loaded or re-loaded in ethereal */
3376 static void
3377 ndps_init_protocol(void)
3378 {
3379         /* fragment */
3380         fragment_table_init(&ndps_fragment_table);
3381         reassembled_table_init(&ndps_reassembled_table);
3382
3383         if (ndps_req_hash)
3384                 g_hash_table_destroy(ndps_req_hash);
3385         if (ndps_req_hash_keys)
3386                 g_mem_chunk_destroy(ndps_req_hash_keys);
3387         if (ndps_req_hash_values)
3388                 g_mem_chunk_destroy(ndps_req_hash_values);
3389
3390         ndps_req_hash = g_hash_table_new(ndps_hash, ndps_equal);
3391         ndps_req_hash_keys = g_mem_chunk_new("ndps_req_hash_keys",
3392                         sizeof(ndps_req_hash_key),
3393                         NDPS_PACKET_INIT_COUNT * sizeof(ndps_req_hash_key),
3394                         G_ALLOC_ONLY);
3395         ndps_req_hash_values = g_mem_chunk_new("ndps_req_hash_values",
3396                         sizeof(ndps_req_hash_value),
3397                         NDPS_PACKET_INIT_COUNT * sizeof(ndps_req_hash_value),
3398                         G_ALLOC_ONLY);
3399 }
3400
3401 /* After the sequential run, we don't need the ncp_request hash and keys
3402  * anymore; the lookups have already been done and the vital info
3403  * saved in the reply-packets' private_data in the frame_data struct. */
3404 static void
3405 ndps_postseq_cleanup(void)
3406 {
3407         if (ndps_req_hash) {
3408                 /* Destroy the hash, but don't clean up request_condition data. */
3409                 g_hash_table_destroy(ndps_req_hash);
3410                 ndps_req_hash = NULL;
3411         }
3412         if (ndps_req_hash_keys) {
3413                 g_mem_chunk_destroy(ndps_req_hash_keys);
3414                 ndps_req_hash_keys = NULL;
3415         }
3416         /* Don't free the ncp_req_hash_values, as they're
3417          * needed during random-access processing of the proto_tree.*/
3418 }
3419
3420 ndps_req_hash_value*
3421 ndps_hash_insert(conversation_t *conversation, guint32 ndps_xport)
3422 {
3423         ndps_req_hash_key               *request_key;
3424         ndps_req_hash_value             *request_value;
3425
3426         /* Now remember the request, so we can find it if we later
3427            a reply to it. */
3428         request_key = g_mem_chunk_alloc(ndps_req_hash_keys);
3429         request_key->conversation = conversation;
3430         request_key->ndps_xport = ndps_xport;
3431
3432         request_value = g_mem_chunk_alloc(ndps_req_hash_values);
3433         request_value->ndps_prog = 0;
3434         request_value->ndps_func = 0;
3435         request_value->ndps_frame_num = 0;
3436        
3437         g_hash_table_insert(ndps_req_hash, request_key, request_value);
3438
3439         return request_value;
3440 }
3441
3442 /* Returns the ncp_rec*, or NULL if not found. */
3443 ndps_req_hash_value*
3444 ndps_hash_lookup(conversation_t *conversation, guint32 ndps_xport)
3445 {
3446         ndps_req_hash_key               request_key;
3447
3448         request_key.conversation = conversation;
3449         request_key.ndps_xport = ndps_xport;
3450
3451         return g_hash_table_lookup(ndps_req_hash, &request_key);
3452 }
3453
3454 /* ================================================================= */
3455 /* NDPS                                                               */
3456 /* ================================================================= */
3457
3458 static void
3459 dissect_ndps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree)
3460 {
3461     guint32     ndps_xid;
3462     guint32     ndps_prog;
3463     guint32     ndps_packet_type;
3464     guint32     ndps_rpc_version;
3465     int         foffset;
3466     guint32     ndps_hfname;
3467     guint32     ndps_func;
3468     const char  *ndps_program_string;
3469     const char  *ndps_func_string;
3470
3471
3472     ndps_packet_type = tvb_get_ntohl(tvb, 8);
3473     if (ndps_packet_type != 0 && ndps_packet_type != 1) {     /* Packet Type */
3474         if (check_col(pinfo->cinfo, COL_INFO))
3475             col_set_str(pinfo->cinfo, COL_INFO, "(Continuation Data)");
3476         proto_tree_add_text(ndps_tree, tvb, 0, tvb_length_remaining(tvb, 0), "Data - (%d Bytes)", tvb_length_remaining(tvb, 0));
3477         return;
3478     }
3479     foffset = 0;
3480     proto_tree_add_item(ndps_tree, hf_ndps_record_mark, tvb,
3481                    foffset, 2, FALSE);
3482     foffset += 2;
3483     proto_tree_add_item(ndps_tree, hf_ndps_length, tvb,
3484                    foffset, 2, FALSE);
3485     foffset += 2;
3486
3487     ndps_xid = tvb_get_ntohl(tvb, foffset);
3488     proto_tree_add_uint(ndps_tree, hf_ndps_xid, tvb, foffset, 4, ndps_xid);
3489     foffset += 4;
3490     ndps_packet_type = tvb_get_ntohl(tvb, foffset);
3491     proto_tree_add_uint(ndps_tree, hf_ndps_packet_type, tvb, foffset, 4, ndps_packet_type);
3492     foffset += 4;
3493     if(ndps_packet_type == 0x00000001)          /* Reply packet */
3494     {
3495         if (check_col(pinfo->cinfo, COL_INFO))
3496             col_set_str(pinfo->cinfo, COL_INFO, "R NDPS ");
3497         proto_tree_add_item(ndps_tree, hf_ndps_rpc_accept, tvb, foffset, 4, FALSE);
3498         if (tvb_get_ntohl(tvb, foffset)==0) {
3499             foffset += 4;
3500             proto_tree_add_item(ndps_tree, hf_ndps_auth_null, tvb, foffset, 8, FALSE);
3501             foffset += 8;
3502         }
3503         else
3504         {
3505             foffset += 4;
3506             proto_tree_add_item(ndps_tree, hf_ndps_rpc_rej_stat, tvb, foffset+4, 4, FALSE);
3507             foffset += 4;
3508         }
3509         dissect_ndps_reply(tvb, pinfo, ndps_tree, foffset);
3510     }
3511     else
3512     {
3513         if (check_col(pinfo->cinfo, COL_INFO))
3514             col_set_str(pinfo->cinfo, COL_INFO, "C NDPS ");
3515         ndps_rpc_version = tvb_get_ntohl(tvb, foffset);
3516         proto_tree_add_item(ndps_tree, hf_ndps_rpc_version, tvb, foffset, 4, FALSE);
3517         foffset += 4;
3518         ndps_prog = tvb_get_ntohl(tvb, foffset);
3519         ndps_program_string = match_strval(ndps_prog, spx_ndps_program_vals);
3520         if( ndps_program_string != NULL)
3521         {
3522             proto_tree_add_item(ndps_tree, hf_spx_ndps_program, tvb, foffset, 4, FALSE);
3523             foffset += 4;
3524             if (check_col(pinfo->cinfo, COL_INFO))
3525             {
3526                 col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_program_string);
3527                 col_append_str(pinfo->cinfo, COL_INFO, ", ");
3528             }
3529             proto_tree_add_item(ndps_tree, hf_spx_ndps_version, tvb, foffset, 4, FALSE);
3530             foffset += 4;
3531             ndps_func = tvb_get_ntohl(tvb, foffset);
3532             switch(ndps_prog)
3533             {
3534                 case 0x060976:
3535                     ndps_hfname = hf_spx_ndps_func_print;
3536                     ndps_func_string = match_strval(ndps_func, spx_ndps_print_func_vals);
3537                     break;
3538                 case 0x060977:
3539                     ndps_hfname = hf_spx_ndps_func_broker;
3540                     ndps_func_string = match_strval(ndps_func, spx_ndps_broker_func_vals);
3541                     break;
3542                 case 0x060978:
3543                     ndps_hfname = hf_spx_ndps_func_registry;
3544                     ndps_func_string = match_strval(ndps_func, spx_ndps_registry_func_vals);
3545                     break;
3546                 case 0x060979:
3547                     ndps_hfname = hf_spx_ndps_func_notify;
3548                     ndps_func_string = match_strval(ndps_func, spx_ndps_notify_func_vals);
3549                     break;
3550                 case 0x06097a:
3551                     ndps_hfname = hf_spx_ndps_func_resman;
3552                     ndps_func_string = match_strval(ndps_func, spx_ndps_resman_func_vals);
3553                     break;
3554                 case 0x06097b:
3555                     ndps_hfname = hf_spx_ndps_func_delivery;
3556                     ndps_func_string = match_strval(ndps_func, spx_ndps_deliver_func_vals);
3557                     break;
3558                 default:
3559                     ndps_hfname = 0;
3560                     ndps_func_string = NULL;
3561                     break;
3562             }
3563             if(ndps_hfname != 0)
3564             {
3565                 proto_tree_add_item(ndps_tree, ndps_hfname, tvb, foffset, 4, FALSE);
3566                 if (ndps_func_string != NULL) 
3567                 {
3568                     if (check_col(pinfo->cinfo, COL_INFO))
3569                         col_append_str(pinfo->cinfo, COL_INFO, (const gchar*) ndps_func_string);
3570
3571                     foffset += 4;
3572                     proto_tree_add_item(ndps_tree, hf_ndps_auth_null, tvb, foffset, 16, FALSE);
3573                     foffset+=16;
3574                     dissect_ndps_request(tvb, pinfo, ndps_tree, ndps_prog, ndps_func, foffset);
3575                 }
3576             }
3577         }
3578     }
3579 }
3580
3581 static guint
3582 get_ndps_pdu_len(tvbuff_t *tvb, int offset)
3583 {
3584     guint16 plen;
3585
3586     /*
3587      * Get the length of the NDPS packet.
3588      */
3589     plen = tvb_get_ntohs(tvb, offset + 2);
3590
3591     /*
3592      * That length doesn't include the length of the record mark field
3593      * or the length field itself; add that in.
3594      * (XXX - is the field really a 31-bit length with the uppermost bit
3595      * being a record mark bit?)
3596      */
3597     return plen + 4;
3598 }
3599
3600 static void
3601 dissect_ndps_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3602 {
3603     proto_tree      *ndps_tree = NULL;
3604     proto_item      *ti;
3605
3606     if (check_col(pinfo->cinfo, COL_PROTOCOL))
3607         col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDPS");
3608
3609     if (check_col(pinfo->cinfo, COL_INFO))
3610         col_clear(pinfo->cinfo, COL_INFO);
3611         
3612     if (tree) {
3613         ti = proto_tree_add_item(tree, proto_ndps, tvb, 0, -1, FALSE);
3614         ndps_tree = proto_item_add_subtree(ti, ett_ndps);
3615     }
3616     dissect_ndps(tvb, pinfo, ndps_tree);
3617 }
3618
3619 static void
3620 ndps_defrag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3621 {
3622     guint16         record_mark=0;
3623     guint16         ndps_length=0;
3624     int             len=0;
3625     tvbuff_t        *next_tvb = NULL;
3626     fragment_data   *fd_head;
3627     spx_info        *spx_info;
3628
3629     spx_info = pinfo->private_data;
3630     if (!ndps_defragment) {
3631         dissect_ndps(tvb, pinfo, tree);
3632         return;
3633     }
3634     record_mark = tvb_get_ntohs(tvb, 0);
3635     ndps_length = tvb_get_ntohs(tvb, 2);
3636     if (ndps_length > tvb_length_remaining(tvb, 0) || ndps_fragmented || ndps_length==0) 
3637     {
3638         more_fragment = TRUE;
3639         ndps_fragmented = TRUE;
3640
3641         /*   
3642          * Fragment
3643          */
3644         tid = (pinfo->srcport+pinfo->destport);
3645         len = tvb_reported_length_remaining(tvb, 0);
3646         if ((frag_number + tvb_length_remaining(tvb, 0)-save_frag_length)<=10)
3647         {
3648             more_fragment = FALSE;
3649         }
3650         if (tvb_bytes_exist(tvb, 0, len))
3651         {
3652             fd_head = fragment_add_seq_next(tvb, 0, pinfo, tid, ndps_fragment_table, ndps_reassembled_table, len, more_fragment);
3653             if (fd_head != NULL) 
3654             {
3655                 if (fd_head->next != NULL) 
3656                 {
3657                     next_tvb = tvb_new_real_data(fd_head->data,
3658                         fd_head->len, fd_head->len);
3659                     tvb_set_child_real_data_tvbuff(tvb,
3660                         next_tvb);
3661                     add_new_data_source(pinfo,
3662                         next_tvb,
3663                         "Reassembled NDPS");
3664                     /* Show all fragments. */
3665                     if (tree) 
3666                     {
3667                         show_fragment_seq_tree(fd_head,
3668                             &ndps_frag_items,
3669                             tree, pinfo,
3670                             next_tvb);
3671                         tid++;
3672                     }
3673                     more_fragment = FALSE;
3674                     save_frag_length = 0;
3675                     frag_number=0;
3676                     ndps_fragmented=FALSE;
3677                 } 
3678                 else 
3679                 {
3680                     next_tvb = tvb_new_subset(tvb, 0, -1, -1);
3681                 }
3682             }
3683             else 
3684             {
3685                 if (save_frag_length == 0) 
3686                 {
3687                     save_frag_length = ndps_length;                 /* First Fragment */
3688                     save_frag_seq = tid;
3689                 }
3690                 if ((pinfo->srcport+pinfo->destport) == save_frag_seq) 
3691                 {
3692                     if (!pinfo->fd->flags.visited) 
3693                     {
3694                         frag_number += tvb_length_remaining(tvb, 0);    /* Current offset */
3695                     }
3696                     if (check_col(pinfo->cinfo, COL_INFO))
3697                     {
3698                       if (more_fragment)
3699                       {
3700                         col_append_fstr(pinfo->cinfo, COL_INFO, " [NDPS Fragment]");
3701                       }
3702                     }
3703                 }
3704                 next_tvb = NULL;
3705             }
3706         }
3707         else 
3708         {
3709             /*
3710              * Dissect this
3711              */
3712             next_tvb = tvb_new_subset(tvb, 0, -1, -1);
3713         }
3714         if (next_tvb == NULL)
3715         {
3716             if ((pinfo->srcport+pinfo->destport) == save_frag_seq) 
3717             {
3718                 next_tvb = tvb_new_subset (tvb, 0, -1, -1);
3719                 call_dissector(ndps_data_handle, next_tvb, pinfo, tree);
3720             }
3721             else
3722             {
3723                 if (spx_info->eom) 
3724                 {
3725                     ndps_fragmented=FALSE;
3726                 }
3727                 dissect_ndps(tvb, pinfo, tree);
3728             }
3729         }
3730         else
3731         {
3732             if (spx_info->eom) 
3733             {
3734                 ndps_fragmented=FALSE;
3735             }
3736             dissect_ndps(next_tvb, pinfo, tree);
3737         }
3738     }
3739     else
3740     {
3741         if (spx_info->eom) 
3742         {
3743             ndps_fragmented=FALSE;
3744         }
3745         dissect_ndps(tvb, pinfo, tree);
3746     }
3747 }
3748
3749 static void
3750 dissect_ndps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3751 {
3752     tcp_dissect_pdus(tvb, pinfo, tree, ndps_desegment, 4, get_ndps_pdu_len,
3753         dissect_ndps_pdu);
3754 }
3755
3756
3757 static void
3758 dissect_ndps_ipx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3759 {
3760     proto_tree      *ndps_tree = NULL;
3761     proto_item      *ti;
3762
3763     if (check_col(pinfo->cinfo, COL_PROTOCOL))
3764         col_set_str(pinfo->cinfo, COL_PROTOCOL, "NDPS");
3765
3766     if (check_col(pinfo->cinfo, COL_INFO))
3767         col_clear(pinfo->cinfo, COL_INFO);
3768         
3769     if (tree) {
3770         ti = proto_tree_add_item(tree, proto_ndps, tvb, 0, -1, FALSE);
3771         ndps_tree = proto_item_add_subtree(ti, ett_ndps);
3772     }
3773     ndps_defrag(tvb, pinfo, ndps_tree);
3774 }
3775
3776 static void
3777 dissect_ndps_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, guint32 ndps_prog, guint32 ndps_func, int foffset)
3778 {
3779     ndps_req_hash_value *request_value = NULL;
3780     conversation_t      *conversation;
3781     guint32             i=0;
3782     guint32             j=0;
3783     guint32             field_len=0;
3784     guint32             cred_type=0;
3785     guint32             resource_type=0;
3786     guint32             filter_type=0;
3787     guint32             print_type=0;
3788     guint32             length=0;
3789     guint32             number_of_items=0;
3790     guint32             number_of_items2=0;
3791     proto_tree          *atree;
3792     proto_item          *aitem;
3793     proto_tree          *btree;
3794     proto_item          *bitem;
3795     proto_tree          *ctree;
3796     proto_item          *citem;
3797     proto_tree          *dtree;
3798     proto_item          *ditem;
3799
3800     if (!pinfo->fd->flags.visited) 
3801     {
3802
3803         /* This is the first time we've looked at this packet.
3804         Keep track of the Program and connection whence the request
3805         came, and the address and connection to which the request
3806         is being sent, so that we can match up calls with replies.
3807         (We don't include the sequence number, as we may want
3808         to have all packets over the same connection treated
3809         as being part of a single conversation so that we can
3810         let the user select that conversation to be displayed.) */
3811         
3812         conversation = find_conversation(&pinfo->src, &pinfo->dst,
3813             PT_NCP, (guint32) pinfo->srcport, (guint32) pinfo->srcport, 0);
3814
3815         if (conversation == NULL) 
3816             {
3817             /* It's not part of any conversation - create a new one. */
3818             conversation = conversation_new(&pinfo->src, &pinfo->dst,
3819                 PT_NCP, (guint32) pinfo->srcport, (guint32) pinfo->srcport, 0);
3820         }
3821
3822         request_value = ndps_hash_insert(conversation, (guint32) pinfo->srcport);
3823         request_value->ndps_prog = ndps_prog;
3824         request_value->ndps_func = ndps_func;
3825         request_value->ndps_frame_num = pinfo->fd->num;
3826     }
3827     switch(ndps_prog)
3828     {
3829     case 0x060976:  /* Print */
3830         switch(ndps_func)
3831         {
3832         case 0x00000001:    /* Bind PSM */
3833             foffset = credentials(tvb, ndps_tree, foffset);
3834             break;
3835         case 0x00000002:    /* Bind PA */
3836             foffset = credentials(tvb, ndps_tree, foffset);
3837             proto_tree_add_item(ndps_tree, hf_ndps_retrieve_restrictions, tvb, foffset, 4, FALSE);
3838             foffset += 4;
3839             number_of_items=tvb_get_ntohl(tvb, foffset);
3840             foffset += 4;
3841             for (i = 1 ; i <= number_of_items; i++ )
3842             {
3843                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Security %d", i);
3844                 atree = proto_item_add_subtree(aitem, ett_ndps);
3845                 length = tvb_get_ntohl(tvb, foffset);
3846                 foffset += 4;
3847                 proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
3848             }
3849             foffset = qualifiedname(tvb, ndps_tree, foffset);
3850             break;
3851         case 0x00000003:    /* Unbind */
3852             proto_tree_add_item(ndps_tree, hf_ndps_object, tvb, foffset, 
3853             4, FALSE);
3854             break;
3855         case 0x00000004:    /* Print */
3856             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
3857             foffset += 4;
3858             proto_tree_add_item(ndps_tree, hf_print_arg, tvb, foffset, 4, FALSE);
3859             print_type = tvb_get_ntohl(tvb, foffset);
3860             foffset += 4;
3861             switch (print_type) 
3862             {
3863             case 0:     /* Create Job */
3864                 foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
3865                 proto_tree_add_item(ndps_tree, hf_sub_complete, tvb, foffset, 4, FALSE);
3866                 foffset += 4;
3867                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Transfer Method");
3868                 atree = proto_item_add_subtree(aitem, ett_ndps);
3869                 number_of_items = tvb_get_ntohl(tvb, foffset);
3870                 foffset += 4;
3871                 for (i = 1 ; i <= number_of_items; i++ )
3872                 {
3873                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
3874                     btree = proto_item_add_subtree(bitem, ett_ndps);
3875                     foffset = objectidentifier(tvb, btree, foffset);
3876                     number_of_items2 = tvb_get_ntohl(tvb, foffset);
3877                     foffset += 4;
3878                     for (j = 1 ; j <= number_of_items2; j++ )
3879                     {
3880                         citem = proto_tree_add_text(btree, tvb, foffset, 0, "Value %d", j);
3881                         ctree = proto_item_add_subtree(citem, ett_ndps);
3882                         foffset = attribute_value(tvb, ctree, foffset);
3883                     }
3884                     proto_tree_add_item(btree, hf_ndps_qualifier, tvb, foffset, 4, FALSE);
3885                     foffset += 4;
3886                 }
3887                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Document Content");
3888                 atree = proto_item_add_subtree(aitem, ett_ndps);
3889                 number_of_items = tvb_get_ntohl(tvb, foffset);
3890                 foffset += 4;
3891                 for (i = 1 ; i <= number_of_items; i++ )
3892                 {
3893                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Type %d", i);
3894                     btree = proto_item_add_subtree(bitem, ett_ndps);
3895                     foffset = objectidentifier(tvb, btree, foffset);
3896                 }
3897                 foffset += align_4(tvb, foffset);
3898                 number_of_items = tvb_get_ntohl(tvb, foffset);
3899                 foffset += 4;
3900                 proto_tree_add_item(atree, hf_doc_content, tvb, foffset, 4, FALSE);
3901                 foffset += 4;
3902                 for (i = 1 ; i <= number_of_items; i++ )
3903                 {
3904                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Value %d", i);
3905                     btree = proto_item_add_subtree(bitem, ett_ndps);
3906                     if (tvb_get_ntohl(tvb, foffset-4)==0)
3907                     {
3908                         if (tvb_get_ntohl(tvb, foffset) > tvb_length_remaining(tvb, foffset)) /* Segmented Data */
3909                         {
3910                             proto_tree_add_item(btree, hf_ndps_data, tvb, foffset, tvb_length_remaining(tvb, foffset), FALSE);
3911                             return;
3912                         }
3913                         proto_tree_add_item(btree, hf_ndps_included_doc, tvb, foffset+4, tvb_get_ntohl(tvb, foffset), FALSE);
3914                         foffset += tvb_get_ntohl(tvb, foffset)+4;
3915                         foffset += (length%2);
3916                     }
3917                     else
3918                     {
3919                         foffset = ndps_string(tvb, hf_ndps_ref_name, btree, foffset);
3920                         foffset = name_or_id(tvb, btree, foffset);
3921                     }
3922                 }
3923                 foffset += 4;
3924                 if (align_4(tvb, foffset)>0) {
3925                     foffset += align_4(tvb, foffset);
3926                     foffset += 2;
3927                 }
3928                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Document Type");
3929                 number_of_items = tvb_get_ntohl(tvb, foffset);
3930                 atree = proto_item_add_subtree(aitem, ett_ndps);
3931                 foffset += 4;
3932                 for (i = 1 ; i <= number_of_items; i++ )
3933                 {
3934                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
3935                     btree = proto_item_add_subtree(bitem, ett_ndps);
3936                     foffset = objectidentifier(tvb, btree, foffset);
3937                     number_of_items2 = tvb_get_ntohl(tvb, foffset);
3938                     foffset += 4;
3939                     for (j = 1 ; j <= number_of_items2; j++ )
3940                     {
3941                         citem = proto_tree_add_text(btree, tvb, foffset, 0, "Value %d", j);
3942                         ctree = proto_item_add_subtree(citem, ett_ndps);
3943                         foffset = attribute_value(tvb, ctree, foffset);
3944                     }
3945                     proto_tree_add_item(btree, hf_ndps_qualifier, tvb, foffset, 4, FALSE);
3946                     foffset += 4;
3947                 }
3948                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Document Attributes");
3949                 number_of_items = tvb_get_ntohl(tvb, foffset);
3950                 atree = proto_item_add_subtree(aitem, ett_ndps);
3951                 foffset += 4;
3952                 for (i = 1 ; i <= number_of_items; i++ )
3953                 {
3954                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
3955                     btree = proto_item_add_subtree(bitem, ett_ndps);
3956                     foffset = attribute_value(tvb, btree, foffset);  /* Document Attributes */
3957                 }
3958                 break;
3959             case 1:     /* Add Job */
3960                 foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
3961                 proto_tree_add_item(ndps_tree, hf_local_id, tvb, foffset, 4, FALSE);
3962                 foffset += 4;
3963                 proto_tree_add_item(ndps_tree, hf_sub_complete, tvb, foffset, 4, FALSE);
3964                 foffset += 4;
3965                 number_of_items = tvb_get_ntohl(tvb, foffset);
3966                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Transfer Method");
3967                 atree = proto_item_add_subtree(aitem, ett_ndps);
3968                 foffset += 4;
3969                 for (i = 1 ; i <= number_of_items; i++ )
3970                 {
3971                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Method %d", i);
3972                     btree = proto_item_add_subtree(bitem, ett_ndps);
3973                     foffset = objectidentifier(tvb, btree, foffset); /* Transfer Method */
3974                 }
3975                 proto_tree_add_item(ndps_tree, hf_doc_content, tvb, foffset, 4, FALSE);
3976                 foffset += 4;
3977                 number_of_items = tvb_get_ntohl(tvb, foffset);
3978                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Document Type");
3979                 atree = proto_item_add_subtree(aitem, ett_ndps);
3980                 foffset += 4;
3981                 for (i = 1 ; i <= number_of_items; i++ )
3982                 {
3983                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Type %d", i);
3984                     btree = proto_item_add_subtree(bitem, ett_ndps);
3985                     foffset = objectidentifier(tvb, btree, foffset); /* Document Type */
3986                 }
3987                 foffset += align_4(tvb, foffset);
3988                 number_of_items = tvb_get_ntohl(tvb, foffset);
3989                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Document Attributes");
3990                 atree = proto_item_add_subtree(aitem, ett_ndps);
3991                 foffset += 4;
3992                 for (i = 1 ; i <= number_of_items; i++ )
3993                 {
3994                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
3995                     btree = proto_item_add_subtree(bitem, ett_ndps);
3996                     foffset = attribute_value(tvb, btree, foffset);  /* Document Attributes */
3997                 }
3998                 break;
3999             case 2:     /* Close Job */
4000                 foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
4001                 proto_tree_add_item(ndps_tree, hf_local_id, tvb, foffset, 4, FALSE);
4002                 foffset += 4;
4003                 break;
4004             default:
4005                 break;
4006             }
4007             break;
4008         case 0x00000005:    /* Modify Job */
4009             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4010             foffset += 4;
4011             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
4012             proto_tree_add_item(ndps_tree, hf_local_id, tvb, foffset, 4, FALSE);
4013             foffset += 4;
4014             proto_tree_add_item(ndps_tree, hf_ndps_document_number, tvb, foffset, 4, FALSE);
4015             foffset += 4;
4016             number_of_items = tvb_get_ntohl(tvb, foffset);
4017             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job Modifications");
4018             atree = proto_item_add_subtree(aitem, ett_ndps);
4019             foffset += 4;
4020             for (i = 1 ; i <= number_of_items; i++ )
4021             {
4022                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Modification %d", i);
4023                 btree = proto_item_add_subtree(bitem, ett_ndps);
4024                 foffset = attribute_value(tvb, btree, foffset);  /* Job Modifications */
4025             }
4026             number_of_items = tvb_get_ntohl(tvb, foffset);
4027             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Document Modifications");
4028             atree = proto_item_add_subtree(aitem, ett_ndps);
4029             foffset += 4;
4030             for (i = 1 ; i <= number_of_items; i++ )
4031             {
4032                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Modification %d", i);
4033                 btree = proto_item_add_subtree(bitem, ett_ndps);
4034                 foffset = attribute_value(tvb, btree, foffset);  /* Document Modifications */
4035             }
4036             break;
4037         case 0x00000006:    /* Cancel Job */
4038             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4039             foffset += 4;
4040             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
4041             proto_tree_add_item(ndps_tree, hf_local_id, tvb, foffset, 4, FALSE);
4042             foffset += 4;
4043             proto_tree_add_item(ndps_tree, hf_ndps_document_number, tvb, foffset, 4, FALSE);
4044             foffset += 4;
4045             number_of_items = tvb_get_ntohl(tvb, foffset);
4046             /* Start of nameorid */
4047             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Cancel Message");
4048             atree = proto_item_add_subtree(aitem, ett_ndps);
4049             foffset = name_or_id(tvb, atree, foffset);
4050             /* End of nameorid */
4051             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Retention Period");
4052             atree = proto_item_add_subtree(aitem, ett_ndps);
4053             proto_tree_add_item(atree, hf_ndps_status_flags, tvb, foffset, 4, FALSE);
4054             foffset += 4;
4055             proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, 4, FALSE);
4056             foffset += 4;
4057              
4058             break;
4059         case 0x00000007:    /* List Object Attributes */
4060             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4061             foffset += 4;
4062             proto_tree_add_item(ndps_tree, hf_ndps_attrs_arg, tvb, foffset, 4, FALSE);
4063             foffset += 4;
4064             if (tvb_get_ntohl(tvb, foffset-4)==0) /* Continuation */
4065             {
4066                 length = tvb_get_ntohl(tvb, foffset);
4067                 proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
4068                 foffset += length;
4069                 foffset += (length%2);
4070                 proto_tree_add_item(ndps_tree, hf_ndps_abort_flag, tvb, foffset, 4, FALSE);
4071                 foffset += 4;
4072                 number_of_items = tvb_get_ntohl(tvb, foffset);
4073                 foffset += 4;
4074                 for (i = 1 ; i <= number_of_items; i++ )
4075                 {
4076                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Attribute %d", i);
4077                     atree = proto_item_add_subtree(aitem, ett_ndps);
4078                     foffset = attribute_value(tvb, atree, foffset);
4079                 }
4080             }
4081             else                                  /* Specification */
4082             {
4083                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Class");
4084                 atree = proto_item_add_subtree(aitem, ett_ndps);
4085                 foffset = objectidentifier(tvb, atree, foffset);
4086                 foffset += 4;
4087                 foffset += align_4(tvb, foffset);
4088                 proto_tree_add_item(ndps_tree, hf_ndps_scope, tvb, foffset, 4, FALSE);
4089                 foffset += 4;
4090                 if (tvb_get_ntohl(tvb, foffset-4)!=0)    /* Scope Does not equal 0 */
4091                 {
4092                     number_of_items = tvb_get_ntohl(tvb, foffset); /* Start of NWDPSelector */
4093                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Selector Option");
4094                     atree = proto_item_add_subtree(aitem, ett_ndps);
4095                     foffset += 4;
4096                     for (i = 1 ; i <= number_of_items; i++ )
4097                     {
4098                         bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Option %d", i);
4099                         btree = proto_item_add_subtree(bitem, ett_ndps);
4100                         foffset = objectidentification(tvb, btree, foffset);
4101                     }
4102                     foffset += align_4(tvb, foffset);
4103                     proto_tree_add_item(ndps_tree, hf_ndps_filter, tvb, foffset, 4, FALSE);
4104                     filter_type = tvb_get_ntohl(tvb, foffset);
4105                     foffset += 4;
4106                     /*if (filter_type == 0 || filter_type == 3 ) 
4107                     {
4108                         foffset = filteritem(tvb, ndps_tree, foffset);
4109                     }
4110                     else
4111                     {
4112                         aitem = proto_tree_add_item(ndps_tree, hf_ndps_item_count, tvb, foffset, 4, FALSE);
4113                         atree = proto_item_add_subtree(aitem, ett_ndps);
4114                         number_of_items = tvb_get_ntohl(tvb, foffset);
4115                         foffset += 4;
4116                         for (i = 1 ; i <= number_of_items; i++ )
4117                         {
4118                             foffset = filteritem(tvb, ndps_tree, foffset);
4119                         }
4120                     }*/
4121                     proto_tree_add_item(ndps_tree, hf_ndps_time_limit, tvb, foffset, 4, FALSE);
4122                     foffset += 4;
4123                     proto_tree_add_item(ndps_tree, hf_ndps_count_limit, tvb, foffset, 4, FALSE);
4124                     foffset += 4; /* End of NWDPSelector  */
4125                 }
4126                 foffset += 4;   /* Don't know what this is */
4127                 number_of_items = tvb_get_ntohl(tvb, foffset); /* Start of NWDPObjectIdentifierSet */
4128                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Requested Attributes");
4129                 atree = proto_item_add_subtree(aitem, ett_ndps);
4130                 foffset += 4;
4131                 for (i = 1 ; i <= number_of_items; i++ )
4132                 {
4133                     bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
4134                     btree = proto_item_add_subtree(bitem, ett_ndps);
4135                     foffset = objectidentifier(tvb, btree, foffset);
4136                 } /* End of NWDPObjectIdentifierSet */
4137                 if (number_of_items == 0) 
4138                 {
4139                     break;
4140                 }
4141                 proto_tree_add_item(ndps_tree, hf_ndps_operator, tvb, foffset, 4, FALSE);
4142                 foffset += 4;
4143                 foffset = commonarguments(tvb, ndps_tree, foffset);
4144             }
4145             break;
4146         case 0x00000008:    /* Promote Job */
4147             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4148             foffset += 4;
4149             /* Start of NWDPPrtContainedObjectId */
4150             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job ID");
4151             atree = proto_item_add_subtree(aitem, ett_ndps);
4152             foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
4153             proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
4154             foffset += 4;
4155             /* End of NWDPPrtContainedObjectId */
4156             /* Start of nameorid */
4157             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Message Option");
4158             atree = proto_item_add_subtree(aitem, ett_ndps);
4159             foffset = name_or_id(tvb, atree, foffset);
4160             /* End of nameorid */
4161             foffset = commonarguments(tvb, ndps_tree, foffset);
4162             break;
4163         case 0x00000009:    /* Interrupt */
4164             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4165             foffset += 4;
4166             proto_tree_add_item(ndps_tree, hf_interrupt_job_type, tvb, foffset, 4, FALSE);
4167             foffset += 4;
4168             if (tvb_get_ntohl(tvb, foffset-4)==0)
4169             {
4170                 /* Start of NWDPPrtContainedObjectId */
4171                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job ID");
4172                 atree = proto_item_add_subtree(aitem, ett_ndps);
4173                 foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
4174                 proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
4175                 foffset += 4;
4176                 /* End of NWDPPrtContainedObjectId */
4177             }
4178             else
4179             {
4180                 foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
4181             }
4182             /* Start of nameorid */
4183             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Interrupt Message Option");
4184             atree = proto_item_add_subtree(aitem, ett_ndps);
4185             foffset = name_or_id(tvb, atree, foffset);
4186             /* End of nameorid */
4187             /* Start of NWDPPrtContainedObjectId */
4188             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Interrupting Job");
4189             atree = proto_item_add_subtree(aitem, ett_ndps);
4190             foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
4191             proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
4192             foffset += 4;
4193             /* End of NWDPPrtContainedObjectId */
4194             foffset = commonarguments(tvb, ndps_tree, foffset);
4195             break;
4196         case 0x0000000a:    /* Pause */
4197             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4198             foffset += 4;
4199             proto_tree_add_item(ndps_tree, hf_pause_job_type, tvb, foffset, 4, FALSE);
4200             foffset += 4;
4201             if (tvb_get_ntohl(tvb, foffset-4)==0)
4202             {
4203                 /* Start of NWDPPrtContainedObjectId */
4204                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job ID");
4205                 atree = proto_item_add_subtree(aitem, ett_ndps);
4206                 foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
4207                 proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
4208                 foffset += 4;
4209                 /* End of NWDPPrtContainedObjectId */
4210             }
4211             else
4212             {
4213                 foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
4214             }
4215             /* Start of nameorid */
4216             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Pause Message Option");
4217             atree = proto_item_add_subtree(aitem, ett_ndps);
4218             foffset = name_or_id(tvb, atree, foffset);
4219             /* End of nameorid */
4220             foffset = commonarguments(tvb, ndps_tree, foffset);
4221             break;
4222         case 0x0000000b:    /* Resume */
4223             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4224             foffset += 4;
4225             /* Start of NWDPPrtContainedObjectId */
4226             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job ID");
4227             atree = proto_item_add_subtree(aitem, ett_ndps);
4228             foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
4229             proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
4230             foffset += 4;
4231             /* End of NWDPPrtContainedObjectId */
4232             /* Start of nameorid */
4233             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Resume Message Option");
4234             atree = proto_item_add_subtree(aitem, ett_ndps);
4235             foffset = name_or_id(tvb, atree, foffset);
4236             /* End of nameorid */
4237             foffset = commonarguments(tvb, ndps_tree, foffset);
4238             break;
4239         case 0x0000000c:    /* Clean */
4240             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4241             foffset += 4;
4242             /* Start of nameorid */
4243             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Clean Message Option");
4244             atree = proto_item_add_subtree(aitem, ett_ndps);
4245             foffset = name_or_id(tvb, atree, foffset);
4246             /* End of nameorid */
4247             foffset = commonarguments(tvb, ndps_tree, foffset);
4248             break;
4249         case 0x0000000d:    /* Create */
4250             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4251             foffset += 4;
4252             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Class");
4253             atree = proto_item_add_subtree(aitem, ett_ndps);
4254             foffset = objectidentifier(tvb, atree, foffset);
4255             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object ID");
4256             atree = proto_item_add_subtree(aitem, ett_ndps);
4257             foffset = objectidentification(tvb, atree, foffset);
4258             proto_tree_add_item(ndps_tree, hf_ndps_force, tvb, foffset, 4, FALSE);
4259             foffset += 4;
4260             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Reference Object Option");
4261             atree = proto_item_add_subtree(aitem, ett_ndps);
4262             foffset = objectidentification(tvb, atree, foffset);
4263             /* Start of AttributeSet */
4264             number_of_items = tvb_get_ntohl(tvb, foffset);
4265             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Attribute");
4266             atree = proto_item_add_subtree(aitem, ett_ndps);
4267             foffset += 4;
4268             for (i = 1 ; i <= number_of_items; i++ )
4269             {
4270                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
4271                 btree = proto_item_add_subtree(bitem, ett_ndps);
4272                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
4273             }
4274             /* End of AttributeSet */
4275             foffset = commonarguments(tvb, ndps_tree, foffset);
4276             break;
4277         case 0x0000000e:    /* Delete */
4278             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4279             foffset += 4;
4280             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Class");
4281             atree = proto_item_add_subtree(aitem, ett_ndps);
4282             foffset = objectidentifier(tvb, atree, foffset);
4283             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object ID");
4284             atree = proto_item_add_subtree(aitem, ett_ndps);
4285             foffset = objectidentification(tvb, atree, foffset);
4286             foffset = commonarguments(tvb, ndps_tree, foffset);
4287             break;
4288         case 0x0000000f:    /* Disable PA */
4289             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4290             foffset += 4;
4291             /* Start of NameorID */
4292             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Disable PA Message Option");
4293             atree = proto_item_add_subtree(aitem, ett_ndps);
4294             foffset = name_or_id(tvb, atree, foffset);
4295             /* End of NameorID */
4296             foffset = commonarguments(tvb, ndps_tree, foffset);
4297             break;
4298         case 0x00000010:    /* Enable PA */
4299             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4300             foffset += 4;
4301             /* Start of NameorID */
4302             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Enable PA Message Option");
4303             atree = proto_item_add_subtree(aitem, ett_ndps);
4304             foffset = name_or_id(tvb, atree, foffset);
4305             /* End of NameorID */
4306             foffset = commonarguments(tvb, ndps_tree, foffset);
4307             break;
4308         case 0x00000011:    /* Resubmit Jobs */
4309             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4310             foffset += 4;
4311             foffset = qualifiedname(tvb, ndps_tree, foffset);
4312             foffset = address_item(tvb, ndps_tree, foffset);
4313             proto_tree_add_item(ndps_tree, hf_resubmit_op_type, tvb, foffset, 4, FALSE);
4314             foffset += 4;
4315             number_of_items = tvb_get_ntohl(tvb, foffset); /* Start of ResubmitJob Set */
4316             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Resubmit Job");
4317             atree = proto_item_add_subtree(aitem, ett_ndps);
4318             proto_tree_add_item(atree, hf_ndps_item_count, tvb, foffset, 4, FALSE);
4319             foffset += 4;
4320             for (i = 1 ; i <= number_of_items; i++ )
4321             {
4322                 /* Start of NWDPPrtContainedObjectId */
4323                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Job ID");
4324                 btree = proto_item_add_subtree(bitem, ett_ndps);
4325                 foffset = ndps_string(tvb, hf_ndps_pa_name, btree, foffset);
4326                 proto_tree_add_item(btree, hf_local_id, tvb, foffset, 4, FALSE);
4327                 foffset += 4;
4328                 /* End of NWDPPrtContainedObjectId */
4329                 proto_tree_add_item(atree, hf_ndps_document_number, tvb, foffset, 4, FALSE);
4330                 foffset += 4;
4331                 /* Start of AttributeSet */
4332                 number_of_items = tvb_get_ntohl(tvb, foffset);
4333                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Job Attributes");
4334                 btree = proto_item_add_subtree(bitem, ett_ndps);
4335                 foffset += 4;
4336                 for (j = 1 ; j <= number_of_items; j++ )
4337                 {
4338                     citem = proto_tree_add_text(btree, tvb, foffset, 0, "Attribute %d", j);
4339                     ctree = proto_item_add_subtree(citem, ett_ndps);
4340                     foffset = attribute_value(tvb, ctree, foffset);  /* Object Attribute Set */
4341                 }
4342                 /* End of AttributeSet */
4343                 /* Start of AttributeSet */
4344                 number_of_items = tvb_get_ntohl(tvb, foffset);
4345                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Document Attributes");
4346                 btree = proto_item_add_subtree(bitem, ett_ndps);
4347                 foffset += 4;
4348                 for (j = 1 ; j <= number_of_items; j++ )
4349                 {
4350                     citem = proto_tree_add_text(btree, tvb, foffset, 0, "Attribute %d", j);
4351                     ctree = proto_item_add_subtree(citem, ett_ndps);
4352                     foffset = attribute_value(tvb, ctree, foffset);  /* Object Attribute Set */
4353                 }
4354                 /* End of AttributeSet */
4355             } /* End of ResubmitJob Set */
4356             /* Start of NameorID */
4357             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Resubmit Message Option");
4358             atree = proto_item_add_subtree(aitem, ett_ndps);
4359             foffset = name_or_id(tvb, atree, foffset);
4360             /* End of NameorID */
4361             foffset = commonarguments(tvb, ndps_tree, foffset);
4362             break;
4363         case 0x00000012:    /* Set */
4364             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4365             foffset += 4;
4366             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Class");
4367             atree = proto_item_add_subtree(aitem, ett_ndps);
4368             foffset = objectidentifier(tvb, atree, foffset);
4369             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object ID");
4370             atree = proto_item_add_subtree(aitem, ett_ndps);
4371             foffset = objectidentification(tvb, atree, foffset);
4372             /* Start of AttributeSet */
4373             number_of_items = tvb_get_ntohl(tvb, foffset);
4374             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Attribute Modifications");
4375             atree = proto_item_add_subtree(aitem, ett_ndps);
4376             foffset += 4;
4377             for (i = 1 ; i <= number_of_items; i++ )
4378             {
4379                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Modification %d", i);
4380                 btree = proto_item_add_subtree(bitem, ett_ndps);
4381                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
4382             }
4383             /* End of AttributeSet */
4384             foffset = commonarguments(tvb, ndps_tree, foffset);
4385             break;
4386         case 0x00000013:    /* Shutdown PA */
4387         case 0x0000001e:    /* Shutdown PSM */
4388             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4389             foffset += 4;
4390             proto_tree_add_item(ndps_tree, hf_shutdown_type, tvb, foffset, 4, FALSE);
4391             foffset += 4;
4392             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
4393             /* Start of NameorID */
4394             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Shutdown Message Option");
4395             atree = proto_item_add_subtree(aitem, ett_ndps);
4396             foffset = name_or_id(tvb, atree, foffset);
4397             /* End of NameorID */
4398             foffset = commonarguments(tvb, ndps_tree, foffset);
4399         case 0x00000014:    /* Startup PA */
4400             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4401             foffset += 4;
4402             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
4403             /* Start of NameorID */
4404             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Startup Message Option");
4405             atree = proto_item_add_subtree(aitem, ett_ndps);
4406             foffset = name_or_id(tvb, atree, foffset);
4407             /* End of NameorID */
4408             foffset = commonarguments(tvb, ndps_tree, foffset);
4409             break;
4410         case 0x00000015:    /* Reorder Job */
4411             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4412             foffset += 4;
4413             /* Start of NWDPPrtContainedObjectId */
4414             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job Identification");
4415             atree = proto_item_add_subtree(aitem, ett_ndps);
4416             foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
4417             proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
4418             foffset += 4;
4419             /* End of NWDPPrtContainedObjectId */
4420             /* Start of NWDPPrtContainedObjectId */
4421             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Reference Job ID");
4422             atree = proto_item_add_subtree(aitem, ett_ndps);
4423             foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
4424             proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
4425             foffset += 4;
4426             /* End of NWDPPrtContainedObjectId */
4427             foffset = commonarguments(tvb, ndps_tree, foffset);
4428             break;
4429         case 0x00000016:    /* Pause PA */
4430             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4431             foffset += 4;
4432             /* Start of NameorID */
4433             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Pause Message Option");
4434             atree = proto_item_add_subtree(aitem, ett_ndps);
4435             foffset = name_or_id(tvb, atree, foffset);
4436             /* End of NameorID */
4437             foffset = commonarguments(tvb, ndps_tree, foffset);
4438             break;
4439         case 0x00000017:    /* Resume PA */
4440             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4441             foffset += 4;
4442             /* Start of NameorID */
4443             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Resume Message Option");
4444             atree = proto_item_add_subtree(aitem, ett_ndps);
4445             foffset = name_or_id(tvb, atree, foffset);
4446             /* End of NameorID */
4447             foffset = commonarguments(tvb, ndps_tree, foffset);
4448             break;
4449         case 0x00000018:    /* Transfer Data */
4450             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4451             foffset += 4;
4452             proto_tree_add_item(ndps_tree, hf_get_status_flag, tvb, foffset, 4, FALSE);
4453             foffset += 4;
4454             proto_tree_add_item(ndps_tree, hf_ndps_data, tvb, foffset+4, tvb_get_ntohl(tvb, foffset), FALSE);
4455             break;
4456         case 0x00000019:    /* Device Control */
4457             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4458             foffset += 4;
4459             /* Start of Object Identifier */
4460             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Operation ID");
4461             atree = proto_item_add_subtree(aitem, ett_ndps);
4462             foffset = objectidentifier(tvb, atree, foffset);
4463             /* End of Object Identifier */
4464             foffset = commonarguments(tvb, ndps_tree, foffset);
4465             break;
4466         case 0x0000001a:    /* Add Event Profile */
4467             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4468             foffset += 4;
4469             /* Start of Eventhandling2 */
4470             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
4471             foffset += 4;
4472             proto_tree_add_item(ndps_tree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
4473             foffset += 4;
4474             foffset = qualifiedname(tvb, ndps_tree, foffset);
4475             foffset = ndps_string(tvb, hf_ndps_supplier_name, ndps_tree, foffset);
4476             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
4477             foffset += 4;
4478             /* Start of NameorID */
4479             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
4480             atree = proto_item_add_subtree(aitem, ett_ndps);
4481             foffset = name_or_id(tvb, atree, foffset);
4482             foffset += align_4(tvb, foffset);
4483             /* End of NameorID */
4484             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Delivery Address");
4485             atree = proto_item_add_subtree(aitem, ett_ndps);
4486             number_of_items = tvb_get_ntohl(tvb, foffset);
4487             foffset += 4;
4488             for (i = 1 ; i <= number_of_items; i++ )
4489             {
4490                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Address %d", i);
4491                 btree = proto_item_add_subtree(bitem, ett_ndps);
4492                 foffset = address_item(tvb, btree, foffset);
4493             }
4494             foffset = event_object_set(tvb, ndps_tree, foffset);
4495             foffset = qualifiedname(tvb, ndps_tree, foffset);
4496             break;
4497         case 0x0000001b:    /* Remove Event Profile */
4498             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4499             foffset += 4;
4500             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
4501             foffset += 4;
4502             break;
4503         case 0x0000001c:    /* Modify Event Profile */
4504             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4505             foffset += 4;
4506             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
4507             foffset += 4;
4508             proto_tree_add_item(ndps_tree, hf_ndps_supplier_flag, tvb, foffset, 4, FALSE);
4509             foffset += 4;
4510             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
4511             {
4512                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Supplier ID");
4513                 atree = proto_item_add_subtree(aitem, ett_ndps);
4514                 length = tvb_get_ntohl(tvb, foffset);
4515                 foffset += 4;
4516                 proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
4517                 foffset += length;
4518             }
4519             aitem = proto_tree_add_item(ndps_tree, hf_ndps_language_flag, tvb, foffset, 4, FALSE);
4520             atree = proto_item_add_subtree(aitem, ett_ndps);
4521             foffset += 4;
4522             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
4523             {
4524                 proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
4525                 foffset += 4;
4526             }
4527             aitem = proto_tree_add_item(ndps_tree, hf_ndps_method_flag, tvb, foffset, 4, FALSE);
4528             atree = proto_item_add_subtree(aitem, ett_ndps);
4529             foffset += 4;
4530             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
4531             {
4532                 /* Start of NameorID */
4533                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Method ID");
4534                 btree = proto_item_add_subtree(bitem, ett_ndps);
4535                 foffset = name_or_id(tvb, btree, foffset);
4536                 /* End of NameorID */
4537             }
4538             aitem = proto_tree_add_item(ndps_tree, hf_ndps_delivery_address_flag, tvb, foffset, 4, FALSE);
4539             atree = proto_item_add_subtree(aitem, ett_ndps);
4540             foffset += 4;
4541             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
4542             {
4543                 foffset = print_address(tvb, atree, foffset);
4544             }
4545             foffset = event_object_set(tvb, ndps_tree, foffset);
4546             break;
4547         case 0x0000001d:    /* List Event Profiles */
4548             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4549             foffset += 4;
4550             proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_type, tvb, foffset, 4, FALSE);
4551             foffset += 4;
4552             if (tvb_get_ntohl(tvb, foffset-4)==0)   /* Spec */
4553             {
4554                 foffset = qualifiedname(tvb, ndps_tree, foffset);
4555                 proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_choice_type, tvb, foffset, 4, FALSE);
4556                 foffset += 4;
4557                 if (tvb_get_ntohl(tvb, foffset-4)==0)   /* Choice */
4558                 {
4559                     foffset = cardinal_seq(tvb, ndps_tree, foffset);
4560                 }
4561                 else
4562                 {
4563                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Consumer");
4564                     atree = proto_item_add_subtree(aitem, ett_ndps);
4565                     foffset = qualifiedname(tvb, atree, foffset);
4566                     /* Start of NameorID */
4567                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
4568                     atree = proto_item_add_subtree(aitem, ett_ndps);
4569                     foffset = name_or_id(tvb, atree, foffset);
4570                     /* End of NameorID */
4571                     proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
4572                     foffset += 4;
4573                 }
4574                 proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_result_type, tvb, foffset, 4, FALSE);
4575                 foffset += 4;
4576                 /* Start of integeroption */
4577                 proto_tree_add_item(ndps_tree, hf_ndps_integer_type_flag, tvb, foffset, 4, FALSE);
4578                 foffset += 4;
4579                 if (tvb_get_ntohl(tvb, foffset-4)!=0) 
4580                 {
4581                     proto_tree_add_item(ndps_tree, hf_ndps_integer_type_value, tvb, foffset, 4, FALSE);
4582                     foffset += 4;
4583                 }
4584                 /* End of integeroption */
4585             }
4586             else                                    /* Cont */
4587             {
4588                 length = tvb_get_ntohl(tvb, foffset);
4589                 proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
4590                 foffset += length;
4591                 foffset += (length%2);
4592                 proto_tree_add_item(ndps_tree, hf_ndps_abort_flag, tvb, foffset, 4, FALSE);
4593                 foffset += 4;
4594             }
4595             break;
4596         case 0x0000001f:    /* Cancel PSM Shutdown */
4597             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4598             foffset += 4;
4599             /* Start of NameorID */
4600             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Cancel Shutdown Message Option");
4601             atree = proto_item_add_subtree(aitem, ett_ndps);
4602             foffset = name_or_id(tvb, atree, foffset);
4603             /* End of NameorID */
4604             foffset = commonarguments(tvb, ndps_tree, foffset);
4605             break;
4606         case 0x00000020:    /* Set Printer DS Information */
4607             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4608             foffset += 4;
4609             proto_tree_add_item(ndps_tree, hf_ndps_ds_info_type, tvb, foffset, 4, FALSE);
4610             foffset += 4;
4611             foffset = ndps_string(tvb, hf_printer_name, ndps_tree, foffset);
4612             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "DS Object Name");
4613             atree = proto_item_add_subtree(aitem, ett_ndps);
4614             foffset = qualifiedname(tvb, atree, foffset);
4615             break;
4616         case 0x00000021:    /* Clean User Jobs */
4617             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4618             foffset += 4;
4619             /* Start of NameorID */
4620             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Clean Message Option");
4621             atree = proto_item_add_subtree(aitem, ett_ndps);
4622             foffset = name_or_id(tvb, atree, foffset);
4623             /* End of NameorID */
4624             foffset = commonarguments(tvb, ndps_tree, foffset);
4625             break;
4626         case 0x00000022:    /* Map GUID to NDS Name */
4627             length = tvb_get_ntohl(tvb, foffset);
4628             foffset += 4;
4629             proto_tree_add_item(ndps_tree, hf_ndps_guid, tvb, foffset, length, FALSE);
4630             foffset += length;
4631             break;
4632         case 0x00000023:    /* AddEventProfile2 */
4633             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4634             foffset += 4;
4635             /* Start of Eventhandling2 */
4636             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
4637             foffset += 4;
4638             proto_tree_add_item(ndps_tree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
4639             foffset += 4;
4640             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Consumer Name");
4641             atree = proto_item_add_subtree(aitem, ett_ndps);
4642             foffset = qualifiedname(tvb, atree, foffset);
4643             foffset = ndps_string(tvb, hf_ndps_supplier_name, ndps_tree, foffset);
4644             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
4645             foffset += 4;
4646             /* Start of NameorID */
4647             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
4648             atree = proto_item_add_subtree(aitem, ett_ndps);
4649             foffset = name_or_id(tvb, atree, foffset);
4650             foffset += align_4(tvb, foffset);
4651             /* End of NameorID */
4652             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Delivery Address");
4653             atree = proto_item_add_subtree(aitem, ett_ndps);
4654             number_of_items = tvb_get_ntohl(tvb, foffset);
4655             foffset += 4;
4656             for (i = 1 ; i <= number_of_items; i++ )
4657             {
4658                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Address %d", i);
4659                 btree = proto_item_add_subtree(bitem, ett_ndps);
4660                 foffset = address_item(tvb, btree, foffset);
4661             }
4662             foffset = event_object_set(tvb, ndps_tree, foffset);
4663             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Account");
4664             atree = proto_item_add_subtree(aitem, ett_ndps);
4665             foffset = qualifiedname(tvb, atree, foffset);
4666             /* Start of object identifier set */
4667             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Notify Attributes");
4668             atree = proto_item_add_subtree(aitem, ett_ndps);
4669             number_of_items = tvb_get_ntohl(tvb, foffset);
4670             foffset += 4;
4671             for (i = 1 ; i <= number_of_items; i++ )
4672             {
4673                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
4674                 btree = proto_item_add_subtree(bitem, ett_ndps);
4675                 foffset = objectidentifier(tvb, btree, foffset);
4676             }
4677             /* End of object identifier set */
4678             proto_tree_add_item(ndps_tree, hf_notify_time_interval, tvb, foffset, 4, FALSE);
4679             foffset += 4;
4680             proto_tree_add_item(ndps_tree, hf_notify_sequence_number, tvb, foffset, 4, FALSE);
4681             foffset += 4;
4682             proto_tree_add_item(ndps_tree, hf_notify_lease_exp_time, tvb, foffset, 4, FALSE);
4683             foffset += 4;
4684             foffset = ndps_string(tvb, hf_notify_printer_uri, ndps_tree, foffset);
4685             /* End of Eventhandling2 */
4686             break;
4687         case 0x00000024:    /* ListEventProfiles2 */
4688             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4689             foffset += 4;
4690             proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_type, tvb, foffset, 4, FALSE);
4691             foffset += 4;
4692             if (tvb_get_ntohl(tvb, foffset-4)==0)   /* Spec */
4693             {
4694                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Supplier Alias");
4695                 atree = proto_item_add_subtree(aitem, ett_ndps);
4696                 foffset = qualifiedname(tvb, atree, foffset);
4697                 proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_choice_type, tvb, foffset, 4, FALSE);
4698                 foffset += 4;
4699                 if (tvb_get_ntohl(tvb, foffset-4)==0)   /* Choice */
4700                 {
4701                     foffset = cardinal_seq(tvb, ndps_tree, foffset);
4702                 }
4703                 else
4704                 {
4705                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Consumer");
4706                     atree = proto_item_add_subtree(aitem, ett_ndps);
4707                     foffset = qualifiedname(tvb, atree, foffset);
4708                     /* Start of NameorID */
4709                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
4710                     atree = proto_item_add_subtree(aitem, ett_ndps);
4711                     foffset = name_or_id(tvb, atree, foffset);
4712                     /* End of NameorID */
4713                     proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
4714                     foffset += 4;
4715                 }
4716                 proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_result_type, tvb, foffset, 4, FALSE);
4717                 foffset += 4;
4718                 /* Start of integeroption */
4719                 proto_tree_add_item(ndps_tree, hf_ndps_integer_type_flag, tvb, foffset, 4, FALSE);
4720                 foffset += 4;
4721                 if (tvb_get_ntohl(tvb, foffset-4)!=0) 
4722                 {
4723                     proto_tree_add_item(ndps_tree, hf_ndps_integer_type_value, tvb, foffset, 4, FALSE);
4724                     foffset += 4;
4725                 }
4726                 /* End of integeroption */
4727             }
4728             else                                    /* Cont */
4729             {
4730                 length = tvb_get_ntohl(tvb, foffset);
4731                 proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
4732                 foffset += length;
4733                 foffset += (length%2);
4734                 proto_tree_add_item(ndps_tree, hf_ndps_abort_flag, tvb, foffset, 4, FALSE);
4735                 foffset += 4;
4736             }
4737             break;
4738         default:
4739             break;
4740         }
4741         break;
4742     case 0x060977:  /* Broker */
4743         switch(ndps_func)
4744         {
4745         case 0x00000001:    /* Bind */
4746             foffset = credentials(tvb, ndps_tree, foffset);
4747             proto_tree_add_item(ndps_tree, hf_ndps_retrieve_restrictions, tvb, foffset, 4, FALSE);
4748             foffset += 4;
4749             number_of_items=tvb_get_ntohl(tvb, foffset);
4750             foffset += 4;
4751             for (i = 1 ; i <= number_of_items; i++ )
4752             {
4753                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Security %d", i);
4754                 atree = proto_item_add_subtree(aitem, ett_ndps);
4755                 length = tvb_get_ntohl(tvb, foffset);
4756                 foffset += 4;
4757                 proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
4758             }
4759             break;
4760         case 0x00000002:    /* Unbind */
4761             break;
4762         case 0x00000003:    /* List Services */
4763             proto_tree_add_item(ndps_tree, hf_ndps_list_services_type, tvb, foffset, 4, FALSE);
4764             foffset += 4;
4765             break;
4766         case 0x00000004:    /* Enable Service */
4767             proto_tree_add_item(ndps_tree, hf_ndps_service_type, tvb, foffset, 4, FALSE);
4768             foffset += 4;
4769             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Parameters");
4770             atree = proto_item_add_subtree(aitem, ett_ndps);
4771             proto_tree_add_item(atree, hf_ndps_item_count, tvb, foffset, 4, FALSE);
4772             foffset += 4;
4773             for (i = 1 ; i <= number_of_items; i++ )
4774             {
4775                 length = tvb_get_ntohl(tvb, foffset);
4776                 foffset += 4;
4777                 proto_tree_add_item(ndps_tree, hf_ndps_item_bytes, tvb, foffset, length, FALSE);
4778                 foffset += length;
4779             } 
4780             break;
4781         case 0x00000005:    /* Disable Service */
4782             proto_tree_add_item(ndps_tree, hf_ndps_list_services_type, tvb, foffset, 4, FALSE);
4783             foffset += 4;
4784             break;
4785         case 0x00000006:    /* Down Broker */
4786         case 0x00000007:    /* Get Broker NDS Object Name */
4787         case 0x00000008:    /* Get Broker Session Information */
4788         default:
4789             break;
4790         }
4791         break;
4792     case 0x060978:  /* Registry */
4793         switch(ndps_func)
4794         {
4795         case 0x00000001:    /* Bind */
4796             foffset = credentials(tvb, ndps_tree, foffset);
4797             proto_tree_add_item(ndps_tree, hf_ndps_retrieve_restrictions, tvb, foffset, 4, FALSE);
4798             foffset += 4;
4799             number_of_items=tvb_get_ntohl(tvb, foffset);
4800             foffset += 4;
4801             for (i = 1 ; i <= number_of_items; i++ )
4802             {
4803                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Security %d", i);
4804                 atree = proto_item_add_subtree(aitem, ett_ndps);
4805                 length = tvb_get_ntohl(tvb, foffset);
4806                 foffset += 4;
4807                 proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
4808             }
4809             break;
4810         case 0x00000002:    /* Unbind */
4811             break;
4812         case 0x00000003:    /* Register Server */
4813             foffset = server_entry(tvb, ndps_tree, foffset);
4814             break;
4815         case 0x00000004:    /* Deregister Server */
4816         case 0x00000006:    /* Deregister Registry */
4817         case 0x0000000b:    /* Get Registry NDS Object Name */
4818         case 0x0000000c:    /* Get Registry Session Information */
4819             /* NoOp */
4820             break;
4821         case 0x00000005:    /* Register Registry */
4822             foffset = ndps_string(tvb, hf_ndps_registry_name, ndps_tree, foffset);
4823             foffset = print_address(tvb, ndps_tree, foffset);
4824             break;
4825         case 0x00000007:    /* Registry Update */
4826             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Add");
4827             atree = proto_item_add_subtree(aitem, ett_ndps);
4828             number_of_items = tvb_get_ntohl(tvb, foffset);
4829             foffset += 4;
4830             for (i = 1 ; i <= number_of_items; i++ )
4831             {
4832                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Entry %d", i);
4833                 btree = proto_item_add_subtree(bitem, ett_ndps);
4834                 foffset = server_entry(tvb, btree, foffset);
4835             }
4836             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Remove");
4837             atree = proto_item_add_subtree(aitem, ett_ndps);
4838             number_of_items = tvb_get_ntohl(tvb, foffset);
4839             foffset += 4;
4840             for (i = 1 ; i <= number_of_items; i++ )
4841             {
4842                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Entry %d", i);
4843                 btree = proto_item_add_subtree(bitem, ett_ndps);
4844                 foffset = server_entry(tvb, btree, foffset);
4845             }
4846             break;
4847         case 0x00000008:    /* List Local Servers */
4848         case 0x00000009:    /* List Servers */
4849         case 0x0000000a:    /* List Known Registries */
4850             proto_tree_add_item(ndps_tree, hf_ndps_list_local_servers_type, tvb, foffset, 4, FALSE);
4851             foffset += 4;
4852             if (tvb_get_ntohl(tvb, foffset-4)==0) 
4853             {
4854                 /* Start of integeroption */
4855                 proto_tree_add_item(ndps_tree, hf_ndps_integer_type_flag, tvb, foffset, 4, FALSE);
4856                 foffset += 4;
4857                 if (tvb_get_ntohl(tvb, foffset-4)!=0) 
4858                 {
4859                     proto_tree_add_item(ndps_tree, hf_ndps_integer_type_value, tvb, foffset, 4, FALSE);
4860                     foffset += 4;
4861                 }
4862                 /* End of integeroption */
4863             }
4864             else
4865             {
4866                 length = tvb_get_ntohl(tvb, foffset);
4867                 proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
4868                 foffset += length;
4869                 foffset += (length%2);
4870                 proto_tree_add_item(ndps_tree, hf_ndps_abort_flag, tvb, foffset, 4, FALSE);
4871                 foffset += 4;
4872             }
4873             break;
4874         default:
4875             break;
4876         }
4877         break;
4878     case 0x060979:  /* Notify */
4879         switch(ndps_func)
4880         {
4881         case 0x00000001:    /* Notify Bind */
4882             foffset = credentials(tvb, ndps_tree, foffset);
4883             proto_tree_add_item(ndps_tree, hf_ndps_retrieve_restrictions, tvb, foffset, 4, FALSE);
4884             foffset += 4;
4885             number_of_items=tvb_get_ntohl(tvb, foffset);
4886             foffset += 4;
4887             for (i = 1 ; i <= number_of_items; i++ )
4888             {
4889                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Security %d", i);
4890                 atree = proto_item_add_subtree(aitem, ett_ndps);
4891                 length = tvb_get_ntohl(tvb, foffset);
4892                 foffset += 4;
4893                 proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
4894             }
4895             break;
4896         case 0x00000002:    /* Notify Unbind */
4897         case 0x0000000a:    /* List Supported Languages */
4898         case 0x00000010:    /* Get Notify NDS Object Name */
4899         case 0x00000011:    /* Get Notify Session Information */
4900             /* NoOp */
4901             break;
4902         case 0x00000003:    /* Register Supplier */
4903             foffset = ndps_string(tvb, hf_ndps_supplier_name, ndps_tree, foffset);
4904             /* Start of QualifiedName Set*/
4905             aitem = proto_tree_add_item(ndps_tree, hf_ndps_item_count, tvb, foffset, 4, FALSE);
4906             atree = proto_item_add_subtree(aitem, ett_ndps);
4907             foffset += 4;
4908             for (i = 1 ; i <= number_of_items; i++ )
4909             {
4910                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Supplier Alias");
4911                 btree = proto_item_add_subtree(bitem, ett_ndps);
4912                 foffset = qualifiedname(tvb, btree, foffset);
4913             }
4914             /* End of QualifiedName Set*/
4915             break;
4916         case 0x00000004:    /* Deregister Supplier */
4917             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4918             foffset += 4;
4919             break;
4920         case 0x00000005:    /* Add Profile */
4921             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4922             foffset += 4;
4923             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Supplier Alias");
4924             atree = proto_item_add_subtree(aitem, ett_ndps);
4925             foffset = qualifiedname(tvb, atree, foffset);
4926             /* Start of Eventhandling */
4927             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
4928             foffset += 4;
4929             proto_tree_add_item(ndps_tree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
4930             foffset += 4;
4931             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Consumer Name");
4932             atree = proto_item_add_subtree(aitem, ett_ndps);
4933             foffset = qualifiedname(tvb, atree, foffset);
4934             length = tvb_get_ntohl(tvb, foffset);
4935             foffset += 4;
4936             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
4937             foffset += length;
4938             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
4939             foffset += 4;
4940             /* Start of NameorID */
4941             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
4942             atree = proto_item_add_subtree(aitem, ett_ndps);
4943             foffset = name_or_id(tvb, atree, foffset);
4944             /* End of NameorID */
4945             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Delivery Address");
4946             atree = proto_item_add_subtree(aitem, ett_ndps);
4947             number_of_items = tvb_get_ntohl(tvb, foffset);
4948             for (i = 1 ; i <= number_of_items; i++ )
4949             {
4950                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Address %d", i);
4951                 btree = proto_item_add_subtree(bitem, ett_ndps);
4952                 foffset += address_item(tvb, btree, foffset);
4953             }
4954             foffset = event_object_set(tvb, ndps_tree, foffset);
4955             /* End of Eventhandling */
4956             break;
4957         case 0x00000006:    /* Remove Profile */
4958             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4959             foffset += 4;
4960             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
4961             foffset += 4;
4962             break;
4963         case 0x00000007:    /* Modify Profile */
4964             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
4965             foffset += 4;
4966             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
4967             foffset += 4;
4968             proto_tree_add_item(ndps_tree, hf_ndps_supplier_flag, tvb, foffset, 4, FALSE);
4969             foffset += 4;
4970             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
4971             {
4972                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Supplier ID");
4973                 atree = proto_item_add_subtree(aitem, ett_ndps);
4974                 length = tvb_get_ntohl(tvb, foffset);
4975                 foffset += 4;
4976                 proto_tree_add_item(atree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
4977                 foffset += length;
4978             }
4979             aitem = proto_tree_add_item(ndps_tree, hf_ndps_language_flag, tvb, foffset, 4, FALSE);
4980             atree = proto_item_add_subtree(aitem, ett_ndps);
4981             foffset += 4;
4982             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
4983             {
4984                 proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
4985                 foffset += 4;
4986             }
4987             aitem = proto_tree_add_item(ndps_tree, hf_ndps_method_flag, tvb, foffset, 4, FALSE);
4988             atree = proto_item_add_subtree(aitem, ett_ndps);
4989             foffset += 4;
4990             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
4991             {
4992                 /* Start of NameorID */
4993                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Method ID");
4994                 btree = proto_item_add_subtree(bitem, ett_ndps);
4995                 foffset = name_or_id(tvb, btree, foffset);
4996                 /* End of NameorID */
4997             }
4998             aitem = proto_tree_add_item(ndps_tree, hf_ndps_delivery_address_flag, tvb, foffset, 4, FALSE);
4999             atree = proto_item_add_subtree(aitem, ett_ndps);
5000             foffset += 4;
5001             if (tvb_get_ntohl(tvb, foffset-4)==TRUE) 
5002             {
5003                 foffset = print_address(tvb, atree, foffset);
5004             }
5005             foffset = event_object_set(tvb, ndps_tree, foffset);
5006             break;
5007         case 0x00000008:    /* List Profiles */
5008             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
5009             foffset += 4;
5010             proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_type, tvb, foffset, 4, FALSE);
5011             foffset += 4;
5012             if (tvb_get_ntohl(tvb, foffset-4)==0)   /* Spec */
5013             {
5014                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Supplier Alias");
5015                 atree = proto_item_add_subtree(aitem, ett_ndps);
5016                 foffset = qualifiedname(tvb, atree, foffset);
5017                 proto_tree_add_item(atree, hf_ndps_list_profiles_choice_type, tvb, foffset, 4, FALSE);
5018                 foffset += 4;
5019                 if (tvb_get_ntohl(tvb, foffset-4)==0)   /* Choice */
5020                 {
5021                     foffset = cardinal_seq(tvb, ndps_tree, foffset);
5022                 }
5023                 else
5024                 {
5025                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Consumer");
5026                     atree = proto_item_add_subtree(aitem, ett_ndps);
5027                     foffset = qualifiedname(tvb, atree, foffset);
5028                     /* Start of NameorID */
5029                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
5030                     atree = proto_item_add_subtree(aitem, ett_ndps);
5031                     foffset = name_or_id(tvb, atree, foffset);
5032                     /* End of NameorID */
5033                     proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
5034                     foffset += 4;
5035                 }
5036                 proto_tree_add_item(ndps_tree, hf_ndps_list_profiles_result_type, tvb, foffset, 4, FALSE);
5037                 foffset += 4;
5038                 /* Start of integeroption */
5039                 proto_tree_add_item(ndps_tree, hf_ndps_integer_type_flag, tvb, foffset, 4, FALSE);
5040                 foffset += 4;
5041                 if (tvb_get_ntohl(tvb, foffset-4)!=0) 
5042                 {
5043                     proto_tree_add_item(ndps_tree, hf_ndps_integer_type_value, tvb, foffset, 4, FALSE);
5044                     foffset += 4;
5045                 }
5046                 /* End of integeroption */
5047             }
5048             else                                    /* Cont */
5049             {
5050                 length = tvb_get_ntohl(tvb, foffset);
5051                 proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
5052                 foffset += length;
5053                 foffset += (length%2);
5054                 proto_tree_add_item(ndps_tree, hf_ndps_abort_flag, tvb, foffset, 4, FALSE);
5055                 foffset += 4;
5056             }
5057             break;
5058         case 0x00000009:    /* Report Event */
5059             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
5060             foffset += 4;
5061             /* Start of ReportEventItemSet */
5062             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Event Items");
5063             atree = proto_item_add_subtree(aitem, ett_ndps);
5064             number_of_items = tvb_get_ntohl(tvb, foffset);
5065             for (i = 1 ; i <= number_of_items; i++ )
5066             {
5067                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Item %d", i);
5068                 btree = proto_item_add_subtree(bitem, ett_ndps);
5069                 /* Start of ReportEventItem */
5070                 proto_tree_add_item(btree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
5071                 foffset += 4;
5072                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Containing Class");
5073                 ctree = proto_item_add_subtree(citem, ett_ndps);
5074                 foffset = objectidentifier(tvb, ctree, foffset);
5075                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Containing Object");
5076                 ctree = proto_item_add_subtree(citem, ett_ndps);
5077                 foffset = objectidentification(tvb, ctree, foffset);
5078                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Filter Class");
5079                 ctree = proto_item_add_subtree(citem, ett_ndps);
5080                 foffset = objectidentifier(tvb, ctree, foffset);
5081                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Object Class");
5082                 ctree = proto_item_add_subtree(citem, ett_ndps);
5083                 foffset = objectidentifier(tvb, ctree, foffset);
5084                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Object ID");
5085                 ctree = proto_item_add_subtree(citem, ett_ndps);
5086                 foffset = objectidentification(tvb, ctree, foffset);
5087                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Event Object ID");
5088                 ctree = proto_item_add_subtree(citem, ett_ndps);
5089                 foffset = objectidentifier(tvb, ctree, foffset);
5090                 /* Start of AttributeSet */
5091                 number_of_items = tvb_get_ntohl(tvb, foffset);
5092                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Attribute Modifications");
5093                 ctree = proto_item_add_subtree(citem, ett_ndps);
5094                 foffset += 4;
5095                 for (j = 1 ; j <= number_of_items; j++ )
5096                 {
5097                     ditem = proto_tree_add_text(ctree, tvb, foffset, 0, "Modification %d", j);
5098                     dtree = proto_item_add_subtree(ditem, ett_ndps);
5099                     foffset = attribute_value(tvb, dtree, foffset);  /* Object Attribute Set */
5100                 }
5101                 /* End of AttributeSet */
5102                 foffset = ndps_string(tvb, hf_ndps_message, btree, foffset);
5103                 proto_tree_add_item(btree, hf_time, tvb, foffset, 4, FALSE);
5104                 foffset += 4;
5105                 /* End of ReportEventItem */
5106             }
5107             /* End of ReportEventItemSet */
5108             break;
5109         case 0x0000000b:    /* Report Notification */
5110             /* Start of DestinationSet */
5111             number_of_items = tvb_get_ntohl(tvb, foffset);
5112             foffset += 4;
5113             for (i = 1 ; i <= number_of_items; i++ )
5114             {
5115                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Destination %d", i);
5116                 atree = proto_item_add_subtree(aitem, ett_ndps);
5117                 /* Start of Destination */
5118                 /* Start of NameorID */
5119                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Method ID");
5120                 btree = proto_item_add_subtree(bitem, ett_ndps);
5121                 foffset = name_or_id(tvb, btree, foffset);
5122                 /* End of NameorID */
5123                 /* Start of NotifyDeliveryAddr */
5124                 proto_tree_add_item(atree, hf_address_len, tvb, foffset, 4, FALSE);
5125                 foffset += 4;
5126                 foffset = print_address(tvb, atree, foffset);
5127                 /* End of NotifyDeliveryAddr */
5128                 /* End of Destination */
5129             }
5130             /* End of DestinationSet */
5131             foffset = ndps_string(tvb, hf_ndps_supplier_name, ndps_tree, foffset);
5132             proto_tree_add_item(ndps_tree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
5133             foffset += 4;
5134             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Containing Class");
5135             atree = proto_item_add_subtree(aitem, ett_ndps);
5136             foffset = objectidentifier(tvb, atree, foffset);
5137             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Containing Object");
5138             atree = proto_item_add_subtree(aitem, ett_ndps);
5139             foffset = objectidentification(tvb, atree, foffset);
5140             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Filter Class");
5141             atree = proto_item_add_subtree(aitem, ett_ndps);
5142             foffset = objectidentifier(tvb, atree, foffset);
5143             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Class");
5144             atree = proto_item_add_subtree(aitem, ett_ndps);
5145             foffset = objectidentifier(tvb, atree, foffset);
5146             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object ID");
5147             atree = proto_item_add_subtree(aitem, ett_ndps);
5148             foffset = objectidentification(tvb, atree, foffset);
5149             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Event Object ID");
5150             atree = proto_item_add_subtree(aitem, ett_ndps);
5151             foffset = objectidentifier(tvb, atree, foffset);
5152             /* Start of AttributeSet */
5153             number_of_items = tvb_get_ntohl(tvb, foffset);
5154             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Attributes");
5155             atree = proto_item_add_subtree(aitem, ett_ndps);
5156             foffset += 4;
5157             for (i = 1 ; i <= number_of_items; i++ )
5158             {
5159                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
5160                 btree = proto_item_add_subtree(bitem, ett_ndps);
5161                 foffset = attribute_value(tvb, btree, foffset);  
5162             }
5163             /* End of AttributeSet */
5164             foffset = ndps_string(tvb, hf_ndps_message, ndps_tree, foffset);
5165             proto_tree_add_item(ndps_tree, hf_time, tvb, foffset, 4, FALSE);
5166             foffset += 4;
5167             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Account");
5168             atree = proto_item_add_subtree(aitem, ett_ndps);
5169             foffset = qualifiedname(tvb, atree, foffset);
5170             break;
5171         case 0x0000000c:    /* Add Delivery Method */
5172             foffset = ndps_string(tvb, hf_ndps_file_name, ndps_tree, foffset);
5173             break;
5174         case 0x0000000d:    /* Remove Delivery Method */
5175             /* Start of NameorID */
5176             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
5177             atree = proto_item_add_subtree(aitem, ett_ndps);
5178             foffset = name_or_id(tvb, atree, foffset);
5179             /* End of NameorID */
5180             break;
5181         case 0x0000000e:    /* List Delivery Methods */
5182             cred_type = tvb_get_ntohl(tvb, foffset);
5183             proto_tree_add_item(ndps_tree, hf_delivery_method_type, tvb, foffset, 4, FALSE);
5184             foffset += 4;
5185             switch (cred_type)
5186             {
5187             case 0:        /* Specification */
5188                 /* Start of integeroption */
5189                 proto_tree_add_item(ndps_tree, hf_ndps_integer_type_flag, tvb, foffset, 4, FALSE);
5190                 foffset += 4;
5191                 if (tvb_get_ntohl(tvb, foffset-4)!=0) 
5192                 {
5193                     proto_tree_add_item(ndps_tree, hf_ndps_integer_type_value, tvb, foffset, 4, FALSE);
5194                     foffset += 4;
5195                 }
5196                 /* End of integeroption */
5197                 proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
5198                 foffset += 4;
5199                 break;
5200             case 1:       /* Continuation */
5201                 length = tvb_get_ntohl(tvb, foffset);
5202                 proto_tree_add_item(ndps_tree, hf_ndps_context, tvb, foffset, length, FALSE);
5203                 foffset += length;
5204                 foffset += (length%2);
5205                 proto_tree_add_item(ndps_tree, hf_ndps_abort_flag, tvb, foffset, 4, FALSE);
5206                 foffset += 4;
5207                 break;
5208             default:
5209                 break;
5210             }
5211             break;
5212         case 0x0000000f:    /* Get Delivery Method Information */
5213             /* Start of NameorID */
5214             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
5215             atree = proto_item_add_subtree(aitem, ett_ndps);
5216             foffset = name_or_id(tvb, atree, foffset);
5217             /* End of NameorID */
5218             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
5219             foffset += 4;
5220             break;
5221         default:
5222             break;
5223         }
5224         break;
5225     case 0x06097a:  /* Resman */
5226         switch(ndps_func)
5227         {
5228         case 0x00000001:    /* Bind */
5229             foffset = credentials(tvb, ndps_tree, foffset);
5230             proto_tree_add_item(ndps_tree, hf_ndps_retrieve_restrictions, tvb, foffset, 4, FALSE);
5231             foffset += 4;
5232             number_of_items=tvb_get_ntohl(tvb, foffset);
5233             foffset += 4;
5234             for (i = 1 ; i <= number_of_items; i++ )
5235             {
5236                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Security %d", i);
5237                 atree = proto_item_add_subtree(aitem, ett_ndps);
5238                 length = tvb_get_ntohl(tvb, foffset);
5239                 foffset += 4;
5240                 proto_tree_add_item(atree, hf_bind_security, tvb, foffset, length, FALSE);
5241             }
5242             break;
5243         case 0x00000002:    /* Unbind */
5244         case 0x00000008:    /* Get Resource Manager NDS Object Name */
5245         case 0x00000009:    /* Get Resource Manager Session Information */
5246             /* NoOp */
5247             break;
5248         case 0x00000003:    /* Add Resource File */
5249             proto_tree_add_item(ndps_tree, hf_packet_count, tvb, foffset, 4, FALSE);
5250             foffset += 4;
5251             proto_tree_add_item(ndps_tree, hf_last_packet_flag, tvb, foffset, 4, FALSE);
5252             foffset += 4;
5253             proto_tree_add_item(ndps_tree, hf_file_timestamp, tvb, foffset, 4, FALSE);
5254             foffset += 4;
5255             foffset = res_add_input_data(tvb, ndps_tree, foffset);
5256             number_of_items=tvb_get_ntohl(tvb, foffset);
5257             foffset += 4;
5258             for (i = 1 ; i <= number_of_items; i++ )
5259             {
5260                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
5261                 atree = proto_item_add_subtree(aitem, ett_ndps);
5262                 length=tvb_get_ntohl(tvb, foffset);
5263                 if(tvb_length_remaining(tvb, foffset) < length)
5264                 {
5265                     return;
5266                 }
5267                 proto_tree_add_item(atree, hf_ndps_item_ptr, tvb, foffset, length, FALSE);
5268                 foffset += length;
5269             }
5270             break;
5271         case 0x00000004:    /* Delete Resource File */
5272             foffset = res_add_input_data(tvb, ndps_tree, foffset);
5273             break;
5274         case 0x00000005:    /* List Resources */
5275             proto_tree_add_item(ndps_tree, hf_ndps_max_items, tvb, foffset, 4, FALSE);
5276             foffset += 4;
5277             proto_tree_add_item(ndps_tree, hf_ndps_status_flags, tvb, foffset, 4, FALSE);
5278             foffset += 4;
5279             proto_tree_add_item(ndps_tree, hf_ndps_resource_list_type, tvb, foffset, 4, FALSE);
5280             resource_type = tvb_get_ntohl(tvb, foffset);
5281             foffset += 4;
5282             switch (resource_type) 
5283             {
5284             case 0:     /* Print Drivers */
5285                 proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
5286                 foffset += 4;
5287                 break;
5288             case 1:     /* Printer Definitions */
5289             case 2:     /* Printer Definitions Short */
5290                 foffset = ndps_string(tvb, hf_ndps_vendor_dir, ndps_tree, foffset);
5291                 break;
5292             case 3:     /* Banner Page Files */
5293                 proto_tree_add_item(ndps_tree, hf_banner_type, tvb, foffset, 4, FALSE);
5294                 foffset += 4;
5295                 break;
5296             case 4:     /* Font Types */
5297                 proto_tree_add_item(ndps_tree, hf_font_type, tvb, foffset, 4, FALSE);
5298                 foffset += 4;
5299                 proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
5300                 foffset += 4;
5301                 break;
5302             case 5:     /* Printer Driver Files */
5303             case 12:    /* Printer Driver Files 2 */
5304             case 9:     /* Generic Files */
5305                 proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
5306                 foffset += 4;
5307                 foffset = ndps_string(tvb, hf_ndps_printer_type, ndps_tree, foffset);
5308                 foffset = ndps_string(tvb, hf_ndps_printer_manuf, ndps_tree, foffset);
5309                 foffset = ndps_string(tvb, hf_ndps_inf_file_name, ndps_tree, foffset);
5310                 field_len = tvb_get_ntohl(tvb, foffset);
5311                 foffset += 4;
5312                 proto_tree_add_item(ndps_tree, hf_printer_id, tvb, foffset, field_len, FALSE);
5313                 break;
5314             case 6:     /* Printer Definition File */
5315             case 10:    /* Printer Definition File 2 */
5316                 foffset = ndps_string(tvb, hf_ndps_vendor_dir, ndps_tree, foffset);
5317                 foffset += 4;
5318                 foffset = ndps_string(tvb, hf_ndps_printer_type, ndps_tree, foffset);
5319                 foffset = ndps_string(tvb, hf_ndps_printer_manuf, ndps_tree, foffset);
5320                 foffset = ndps_string(tvb, hf_ndps_inf_file_name, ndps_tree, foffset);
5321                 field_len = tvb_get_ntohl(tvb, foffset);
5322                 foffset += 4;
5323                 proto_tree_add_item(ndps_tree, hf_printer_id, tvb, foffset, field_len, FALSE);
5324                 break;
5325             case 7:     /* Font Files */
5326                 proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
5327                 foffset += 4;
5328                 proto_tree_add_item(ndps_tree, hf_font_type, tvb, foffset, 4, FALSE);
5329                 foffset += 4;
5330                 foffset = ndps_string(tvb, hf_ndps_font_name, ndps_tree, foffset);
5331                 break;
5332             case 8:     /* Generic Type */
5333             case 11:    /* Printer Driver Types 2 */
5334             case 13:    /* Printer Driver Types Archive */
5335                 foffset = ndps_string(tvb, hf_ndps_printer_manuf, ndps_tree, foffset);
5336                 foffset = ndps_string(tvb, hf_ndps_printer_type, ndps_tree, foffset);
5337                 foffset = ndps_string(tvb, hf_ndps_inf_file_name, ndps_tree, foffset);
5338                 break;
5339             case 14:    /* Languages Available */
5340                 break;
5341             default:
5342                 break;
5343             }
5344             break;
5345         case 0x00000006:    /* Get Resource File */
5346             proto_tree_add_item(ndps_tree, hf_get_status_flag, tvb, foffset, 4, FALSE);
5347             foffset += 4;
5348             proto_tree_add_item(ndps_tree, hf_res_type, tvb, foffset, 4, FALSE);
5349             resource_type = tvb_get_ntohl(tvb, foffset);
5350             foffset += 4;
5351             switch (resource_type) 
5352             {
5353             case 0:     /* Print Drivers */
5354                 proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
5355                 foffset += 4;
5356                 foffset = ndps_string(tvb, hf_ndps_prn_dir_name, ndps_tree, foffset);
5357                 foffset = ndps_string(tvb, hf_ndps_prn_file_name, ndps_tree, foffset);
5358                 break;
5359             case 1:     /* Printer Definitions */
5360                 foffset = ndps_string(tvb, hf_ndps_vendor_dir, ndps_tree, foffset);
5361                 foffset = ndps_string(tvb, hf_ndps_prn_file_name, ndps_tree, foffset);
5362                 break;
5363             case 2:     /* Banner Page Files */
5364                 foffset = ndps_string(tvb, hf_ndps_banner_name, ndps_tree, foffset);
5365                 break;
5366             case 3:     /* Font Types */
5367                 proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
5368                 foffset += 4;
5369                 proto_tree_add_item(ndps_tree, hf_font_type, tvb, foffset, 4, FALSE);
5370                 foffset += 4;
5371                 foffset = ndps_string(tvb, hf_ndps_prn_file_name, ndps_tree, foffset);
5372                 break;
5373             case 4:     /* Generic Files/ Archive */
5374             case 5:     /* Printer Driver Archive */
5375                 proto_tree_add_item(ndps_tree, hf_os_type, tvb, foffset, 4, FALSE);
5376                 foffset += 4;
5377                 foffset = ndps_string(tvb, hf_ndps_prn_dir_name, ndps_tree, foffset);
5378                 proto_tree_add_item(ndps_tree, hf_archive_type, tvb, foffset, 4, FALSE);
5379                 foffset += 4;
5380                 break;
5381             default:
5382                 break;
5383             }
5384             break;
5385         case 0x00000007:    /* Get Resource File Date */
5386             proto_tree_add_item(ndps_tree, hf_ndps_status_flags, tvb, foffset, 4, FALSE);
5387             foffset += 4;
5388             foffset = res_add_input_data(tvb, ndps_tree, foffset);
5389             break;
5390         case 0x0000000a:    /* Set Resource Language Context */
5391             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
5392             foffset += 4;
5393             break;
5394         default:
5395             break;
5396         }
5397         break;
5398     case 0x06097b:  /* Delivery */
5399         switch(ndps_func)
5400         {
5401         case 0x00000001:    /* Delivery Bind */
5402             foffset = credentials(tvb, ndps_tree, foffset);
5403             break;
5404         case 0x00000002:    /* Delivery Unbind */
5405             /* NoOp */
5406             break;
5407         case 0x00000003:    /* Delivery Send */
5408             number_of_items = tvb_get_ntohl(tvb, foffset);
5409             foffset += 4;
5410             for (i = 1 ; i <= number_of_items; i++ )
5411             {
5412                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
5413                 atree = proto_item_add_subtree(aitem, ett_ndps);
5414                 proto_tree_add_item(atree, hf_ndps_session, tvb, foffset, 4, FALSE);
5415                 foffset += 4;
5416                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Supplier ID");
5417                 btree = proto_item_add_subtree(bitem, ett_ndps);
5418                 length = tvb_get_ntohl(tvb, foffset);
5419                 foffset += 4;
5420                 proto_tree_add_item(btree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
5421                 foffset += length;
5422                 proto_tree_add_item(btree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
5423                 foffset += 4;
5424                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Containing Class");
5425                 btree = proto_item_add_subtree(bitem, ett_ndps);
5426                 foffset = objectidentifier(tvb, btree, foffset);
5427                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Containing Object");
5428                 btree = proto_item_add_subtree(bitem, ett_ndps);
5429                 foffset = objectidentification(tvb, btree, foffset);
5430                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Filter Class");
5431                 btree = proto_item_add_subtree(bitem, ett_ndps);
5432                 foffset = objectidentifier(tvb, btree, foffset);
5433                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Object Class");
5434                 btree = proto_item_add_subtree(bitem, ett_ndps);
5435                 foffset = objectidentifier(tvb, btree, foffset);
5436                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Object ID");
5437                 btree = proto_item_add_subtree(bitem, ett_ndps);
5438                 foffset = objectidentification(tvb, btree, foffset);
5439                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Event Object ID");
5440                 btree = proto_item_add_subtree(bitem, ett_ndps);
5441                 foffset = objectidentifier(tvb, btree, foffset);
5442                 foffset = attribute_value(tvb, atree, foffset);
5443                 foffset = ndps_string(tvb, hf_ndps_message, atree, foffset);
5444                 proto_tree_add_item(atree, hf_time, tvb, foffset, 4, FALSE);
5445                 foffset += 4;
5446                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Account");
5447                 btree = proto_item_add_subtree(bitem, ett_ndps);
5448                 foffset = qualifiedname(tvb, btree, foffset);
5449             }
5450             break;
5451         case 0x00000004:    /* Delivery Send2 */
5452             number_of_items = tvb_get_ntohl(tvb, foffset);
5453             foffset += 4;
5454             for (i = 1 ; i <= number_of_items; i++ )
5455             {
5456                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object %d", i);
5457                 atree = proto_item_add_subtree(aitem, ett_ndps);
5458                 proto_tree_add_item(atree, hf_ndps_session, tvb, foffset, 4, FALSE);
5459                 foffset += 4;
5460                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Supplier ID");
5461                 btree = proto_item_add_subtree(bitem, ett_ndps);
5462                 length = tvb_get_ntohl(tvb, foffset);
5463                 foffset += 4;
5464                 proto_tree_add_item(btree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
5465                 foffset += length;
5466                 proto_tree_add_item(atree, hf_ndps_event_type, tvb, foffset, 4, FALSE);
5467                 foffset += 4;
5468                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Containing Class");
5469                 btree = proto_item_add_subtree(bitem, ett_ndps);
5470                 foffset = objectidentifier(tvb, btree, foffset);
5471                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Containing Object");
5472                 btree = proto_item_add_subtree(bitem, ett_ndps);
5473                 foffset = objectidentification(tvb, btree, foffset);
5474                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Filter Class");
5475                 btree = proto_item_add_subtree(bitem, ett_ndps);
5476                 foffset = objectidentifier(tvb, btree, foffset);
5477                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Object Class");
5478                 btree = proto_item_add_subtree(bitem, ett_ndps);
5479                 foffset = objectidentifier(tvb, btree, foffset);
5480                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Object ID");
5481                 btree = proto_item_add_subtree(bitem, ett_ndps);
5482                 foffset = objectidentification(tvb, btree, foffset);
5483                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Event Object ID");
5484                 btree = proto_item_add_subtree(bitem, ett_ndps);
5485                 foffset = objectidentifier(tvb, btree, foffset);
5486                 /* Start of AttributeSet */
5487                 number_of_items = tvb_get_ntohl(tvb, foffset);
5488                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute");
5489                 btree = proto_item_add_subtree(bitem, ett_ndps);
5490                 proto_tree_add_item(btree, hf_ndps_attributes, tvb, foffset, 4, FALSE);
5491                 foffset += 4;
5492                 for (i = 1 ; i <= number_of_items; i++ )
5493                 {
5494                     foffset = attribute_value(tvb, btree, foffset);  
5495                 }
5496                 /* End of AttributeSet */
5497                 foffset = ndps_string(tvb, hf_ndps_message, atree, foffset);
5498                 proto_tree_add_item(atree, hf_time, tvb, foffset, 4, FALSE);
5499                 foffset += 4;
5500                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Account");
5501                 btree = proto_item_add_subtree(bitem, ett_ndps);
5502                 foffset = qualifiedname(tvb, btree, foffset);
5503             }
5504             break;
5505         default:
5506             break;
5507         }
5508         break;
5509     default:
5510         break;
5511     }
5512     return;
5513 }
5514
5515 static int
5516 ndps_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int foffset)
5517 {
5518     guint32     number_of_items=0;
5519     guint32     problem_type=0;
5520     guint32     i;
5521     proto_tree  *atree;
5522     proto_item  *aitem;
5523     proto_tree  *btree;
5524     proto_item  *bitem;
5525
5526     problem_type = tvb_get_ntohl(tvb, foffset);
5527     if (check_col(pinfo->cinfo, COL_INFO))
5528         col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
5529     proto_tree_add_item(ndps_tree, hf_ndps_problem_type, tvb, foffset, 4, FALSE);
5530     foffset += 4;
5531     switch(problem_type)
5532     {
5533     case 0:                 /* Security Error */
5534         proto_tree_add_item(ndps_tree, hf_problem_type, tvb, foffset, 4, FALSE);
5535         foffset += 4;
5536         if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5537         {
5538             proto_tree_add_item(ndps_tree, hf_security_problem_type, tvb, foffset, 4, FALSE);
5539             foffset += 4;
5540         }
5541         else                /* Extended Error */
5542         {
5543             /* Start of objectidentifier */
5544             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Extended Error");
5545             atree = proto_item_add_subtree(aitem, ett_ndps);
5546             foffset = objectidentifier(tvb, atree, foffset);
5547             /* End of objectidentifier */
5548         }
5549         /* Start of NameorID */
5550         aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Message");
5551         atree = proto_item_add_subtree(aitem, ett_ndps);
5552         foffset = name_or_id(tvb, atree, foffset);
5553         /* End of NameorID */
5554         break;
5555     case 1:                 /* Service Error */
5556         proto_tree_add_item(ndps_tree, hf_problem_type, tvb, foffset, 4, FALSE);
5557         foffset += 4;
5558         if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5559         {
5560             proto_tree_add_item(ndps_tree, hf_service_problem_type, tvb, foffset, 4, FALSE);
5561             foffset += 4;
5562         }
5563         else                /* Extended Error */
5564         {
5565             /* Start of objectidentifier */
5566             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Extended Error");
5567             atree = proto_item_add_subtree(aitem, ett_ndps);
5568             foffset = objectidentifier(tvb, atree, foffset);
5569             /* End of objectidentifier */
5570         }
5571         foffset = objectidentification(tvb, ndps_tree, foffset);
5572         foffset = attribute_value(tvb, ndps_tree, foffset);  /* Object Attribute Set */
5573         proto_tree_add_item(ndps_tree, hf_ndps_lib_error, tvb, foffset, 4, FALSE);
5574         foffset += 4;
5575         proto_tree_add_item(ndps_tree, hf_ndps_other_error, tvb, foffset, 4, FALSE);
5576         foffset += 4;
5577         proto_tree_add_item(ndps_tree, hf_ndps_other_error_2, tvb, foffset, 4, FALSE);
5578         foffset += 4;
5579         break;
5580     case 2:                 /* Access Error */
5581         proto_tree_add_item(ndps_tree, hf_problem_type, tvb, foffset, 4, FALSE);
5582         foffset += 4;
5583         if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5584         {
5585             proto_tree_add_item(ndps_tree, hf_access_problem_type, tvb, foffset, 4, FALSE);
5586             foffset += 4;
5587         }
5588         else                /* Extended Error */
5589         {
5590             /* Start of objectidentifier */
5591             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Extended Error");
5592             atree = proto_item_add_subtree(aitem, ett_ndps);
5593             foffset = objectidentifier(tvb, atree, foffset);
5594             /* End of objectidentifier */
5595         }
5596         foffset = objectidentification(tvb, ndps_tree, foffset);
5597         break;
5598     case 3:                 /* Printer Error */
5599         proto_tree_add_item(ndps_tree, hf_problem_type, tvb, foffset, 4, FALSE);
5600         foffset += 4;
5601         if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5602         {
5603             proto_tree_add_item(ndps_tree, hf_printer_problem_type, tvb, foffset, 4, FALSE);
5604             foffset += 4;
5605         }
5606         else                /* Extended Error */
5607         {
5608             /* Start of objectidentifier */
5609             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Extended Error");
5610             atree = proto_item_add_subtree(aitem, ett_ndps);
5611             foffset = objectidentifier(tvb, atree, foffset);
5612             /* End of objectidentifier */
5613         }
5614         foffset = objectidentification(tvb, ndps_tree, foffset);
5615         break;
5616     case 4:                 /* Selection Error */
5617         proto_tree_add_item(ndps_tree, hf_problem_type, tvb, foffset, 4, FALSE);
5618         foffset += 4;
5619         if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5620         {
5621             proto_tree_add_item(ndps_tree, hf_selection_problem_type, tvb, foffset, 4, FALSE);
5622             foffset += 4;
5623         }
5624         else                /* Extended Error */
5625         {
5626             /* Start of objectidentifier */
5627             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Extended Error");
5628             atree = proto_item_add_subtree(aitem, ett_ndps);
5629             foffset = objectidentifier(tvb, atree, foffset);
5630             /* End of objectidentifier */
5631         }
5632         foffset = objectidentification(tvb, ndps_tree, foffset);
5633         foffset = attribute_value(tvb, ndps_tree, foffset);  /* Object Attribute Set */
5634         break;
5635     case 5:                 /* Document Access Error */
5636         proto_tree_add_item(ndps_tree, hf_problem_type, tvb, foffset, 4, FALSE);
5637         foffset += 4;
5638         if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5639         {
5640             proto_tree_add_item(ndps_tree, hf_doc_access_problem_type, tvb, foffset, 4, FALSE);
5641             foffset = objectidentifier(tvb, ndps_tree, foffset);
5642         }
5643         else                /* Extended Error */
5644         {
5645             /* Start of objectidentifier */
5646             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Extended Error");
5647             atree = proto_item_add_subtree(aitem, ett_ndps);
5648             foffset = objectidentifier(tvb, atree, foffset);
5649             /* End of objectidentifier */
5650         }
5651         foffset = objectidentification(tvb, ndps_tree, foffset);
5652         break;
5653     case 6:                 /* Attribute Error */
5654         number_of_items = tvb_get_ntohl(tvb, foffset); 
5655         foffset += 4;
5656         for (i = 1 ; i <= number_of_items; i++ )
5657         {
5658             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
5659             atree = proto_item_add_subtree(aitem, ett_ndps);
5660             proto_tree_add_item(atree, hf_problem_type, tvb, foffset, 4, FALSE);
5661             foffset += 4;
5662             if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5663             {
5664                 proto_tree_add_item(atree, hf_attribute_problem_type, tvb, foffset, 4, FALSE);
5665                 foffset += 4;
5666             }
5667             else                /* Extended Error */
5668             {
5669                 /* Start of objectidentifier */
5670                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Extended Error");
5671                 btree = proto_item_add_subtree(bitem, ett_ndps);
5672                 foffset = objectidentifier(tvb, btree, foffset);
5673                 /* End of objectidentifier */
5674             }
5675             foffset = attribute_value(tvb, atree, foffset);  /* Object Attribute Set */
5676         }
5677         break;
5678     case 7:                 /* Update Error */
5679         proto_tree_add_item(ndps_tree, hf_problem_type, tvb, foffset, 4, FALSE);
5680         foffset += 4;
5681         if (tvb_get_ntohl(tvb, foffset-4)==0) /* Standard Error */
5682         {
5683             proto_tree_add_item(ndps_tree, hf_update_problem_type, tvb, foffset, 4, FALSE);
5684             foffset += 4;
5685         }
5686         else                /* Extended Error */
5687         {
5688             /* Start of objectidentifier */
5689             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Extended Error");
5690             atree = proto_item_add_subtree(aitem, ett_ndps);
5691             foffset = objectidentifier(tvb, atree, foffset);
5692             /* End of objectidentifier */
5693         }
5694         foffset = objectidentification(tvb, ndps_tree, foffset);
5695         break;
5696     default:
5697         break;
5698     }
5699     return foffset;
5700 }
5701
5702 static int
5703 return_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int foffset)
5704 {
5705     proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
5706     foffset += 4;
5707     if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
5708         col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
5709     if (tvb_get_ntohl(tvb, foffset-4) == 0) 
5710     {
5711         return foffset;
5712     }
5713     proto_tree_add_item(ndps_tree, hf_ndps_ext_error, tvb, foffset, 4, FALSE);
5714     foffset += 4;
5715     return foffset;
5716 }
5717
5718 static void
5719 dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int foffset)
5720 {
5721     conversation_t          *conversation = NULL;
5722     ndps_req_hash_value     *request_value = NULL;
5723     proto_tree              *atree;
5724     proto_item              *aitem;
5725     proto_tree              *btree;
5726     proto_item              *bitem;
5727     proto_tree              *ctree;
5728     proto_item              *citem;
5729     proto_tree              *dtree;
5730     proto_item              *ditem;
5731     guint32                 i;
5732     guint32                 j;
5733     guint32                 k;
5734     guint32                 number_of_items=0;
5735     guint32                 number_of_items2=0;
5736     guint32                 number_of_items3=0;
5737     guint32                 length=0;
5738     guint32                 ndps_func=0;
5739     guint32                 ndps_prog=0;
5740     guint32                 error_val=0;
5741     guint32                 resource_type=0;
5742     
5743     if (!pinfo->fd->flags.visited) {
5744         /* Find the conversation whence the request would have come. */
5745         conversation = find_conversation(&pinfo->src, &pinfo->dst,
5746             PT_NCP, (guint32) pinfo->destport, (guint32) pinfo->destport, 0);
5747         if (conversation != NULL) {
5748             /* find the record telling us the request made that caused
5749             this reply */
5750             request_value = ndps_hash_lookup(conversation, (guint32) pinfo->destport);
5751             p_add_proto_data(pinfo->fd, proto_ndps, (void*) request_value);
5752         }
5753         /* else... we haven't seen an NDPS Request for that conversation. */
5754     }
5755     else {
5756         request_value = p_get_proto_data(pinfo->fd, proto_ndps);
5757     }
5758     if (request_value) {
5759         ndps_prog = request_value->ndps_prog;
5760         ndps_func = request_value->ndps_func;
5761         proto_tree_add_uint_format(ndps_tree, hf_ndps_reqframe, tvb, 0, 
5762            0, request_value->ndps_frame_num,
5763            "Response to Request in Frame Number: %u",
5764            request_value->ndps_frame_num);
5765     }
5766
5767     if (tvb_length_remaining(tvb, foffset) < 12 && tvb_get_ntohl(tvb, foffset) == 0) /* No error and no return data */
5768     {
5769         proto_tree_add_uint(ndps_tree, hf_ndps_error_val, tvb, foffset, 4, error_val);
5770         if (check_col(pinfo->cinfo, COL_INFO))
5771                 col_append_str(pinfo->cinfo, COL_INFO, "- Ok");
5772         return;
5773     }
5774     if(ndps_func == 1 || ndps_func == 2)
5775     {
5776         proto_tree_add_item(ndps_tree, hf_ndps_rpc_acc_stat, tvb, foffset, 4, FALSE);
5777         foffset += 4;
5778         if (tvb_length_remaining(tvb,foffset) < 4 ) {
5779             if (check_col(pinfo->cinfo, COL_INFO))
5780                 col_append_str(pinfo->cinfo, COL_INFO, "- Error");
5781             return;
5782         }
5783         proto_tree_add_item(ndps_tree, hf_ndps_rpc_acc_results, tvb, foffset, 4, FALSE);
5784         foffset += 4;
5785         if (tvb_length_remaining(tvb,foffset) < 4) {
5786             if (check_col(pinfo->cinfo, COL_INFO))
5787                 col_append_str(pinfo->cinfo, COL_INFO, "- Error");
5788             return;
5789         }
5790     }
5791     error_val = tvb_get_ntohl(tvb, foffset);
5792     proto_tree_add_uint(ndps_tree, hf_ndps_error_val, tvb, foffset, 4, error_val);
5793     foffset += 4;
5794     /* Some functions return an error with no data, 0 is ok */
5795     if (match_strval(tvb_get_ntohl(tvb, foffset), ndps_error_types) && tvb_length_remaining(tvb,foffset) < 8 && (tvb_get_ntohl(tvb, foffset)!=0))  
5796     {
5797         proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
5798         if (check_col(pinfo->cinfo, COL_INFO))
5799             col_append_str(pinfo->cinfo, COL_INFO, "- Error");
5800         return;
5801     }
5802     if (check_col(pinfo->cinfo, COL_INFO))
5803         col_append_str(pinfo->cinfo, COL_INFO, "- Ok");
5804     switch(ndps_prog)
5805     {
5806     case 0x060976:  /* Print */
5807         switch(ndps_func)
5808         {
5809         case 0x00000001:    /* Bind PSM */
5810             proto_tree_add_item(ndps_tree, hf_ndps_oid, tvb, foffset, 4, FALSE);
5811             foffset += 4;
5812             if(error_val != 0)
5813             {
5814                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
5815                 if(tvb_length_remaining(tvb, foffset) < 4)
5816                 {
5817                     break;
5818                 }
5819                 proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
5820                 foffset += 4;
5821             }
5822             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "PSM Name");
5823             atree = proto_item_add_subtree(aitem, ett_ndps);
5824             foffset = qualifiedname(tvb, atree, foffset);
5825             break;
5826         case 0x00000002:    /* Bind PA */
5827             proto_tree_add_item(ndps_tree, hf_ndps_oid, tvb, foffset, 4, FALSE);
5828             foffset += 4;
5829             if(error_val != 0)
5830             {
5831                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
5832                 if(tvb_length_remaining(tvb, foffset) < 4)
5833                 {
5834                     break;
5835                 }
5836                 proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
5837                 foffset += 4;
5838             }
5839                 foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
5840             break;
5841         case 0x00000003:    /* Unbind */
5842             break;
5843         case 0x00000004:    /* Print */
5844             foffset = ndps_string(tvb, hf_ndps_pa_name, ndps_tree, foffset);
5845             proto_tree_add_item(ndps_tree, hf_local_id, tvb, foffset, 4, FALSE);
5846             foffset += 4;
5847             if(error_val != 0)
5848             {
5849                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
5850             }
5851             break;
5852         case 0x00000005:    /* Modify Job */
5853         case 0x00000006:    /* Cancel Job */
5854         case 0x00000008:    /* Promote Job */
5855         case 0x0000000b:    /* Resume */
5856         case 0x0000000d:    /* Create */
5857             /* Start of AttributeSet */
5858             number_of_items = tvb_get_ntohl(tvb, foffset);
5859             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Attribute Set");
5860             atree = proto_item_add_subtree(aitem, ett_ndps);
5861             foffset += 4;
5862             for (i = 1 ; i <= number_of_items; i++ )
5863             {
5864                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
5865                 btree = proto_item_add_subtree(bitem, ett_ndps);
5866                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
5867             }
5868             /* End of AttributeSet */
5869             if(error_val != 0)
5870             {
5871                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
5872             }
5873             break;
5874         case 0x00000007:    /* List Object Attributes */
5875             proto_tree_add_item(ndps_tree, hf_answer_time, tvb, foffset, 4, FALSE);
5876             foffset += 4;
5877             /* Continuation Option */
5878             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Continuation Option");
5879             atree = proto_item_add_subtree(aitem, ett_ndps);
5880             number_of_items=tvb_get_ntohl(tvb, foffset);
5881             foffset += 4;
5882             for (i = 1 ; i <= number_of_items; i++ )
5883             {
5884                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Option %d", i);
5885                 btree = proto_item_add_subtree(bitem, ett_ndps);
5886                 length=tvb_get_ntohl(tvb, foffset);
5887                 if(tvb_length_remaining(tvb, foffset) < length)
5888                 {
5889                     return;
5890                 }
5891                 proto_tree_add_item(btree, hf_ndps_item_ptr, tvb, foffset, length, FALSE);
5892                 foffset += length;
5893             }
5894             /* Limit Encountered Option */
5895             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Limit Encountered Option");
5896             atree = proto_item_add_subtree(aitem, ett_ndps);
5897             proto_tree_add_item(atree, hf_ndps_len, tvb, foffset, 4, FALSE);
5898             foffset += 4;
5899             proto_tree_add_item(atree, hf_limit_enc, tvb, foffset, 4, FALSE);
5900             foffset += 4;
5901             /* Object Results Set */
5902             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Results Set");
5903             atree = proto_item_add_subtree(aitem, ett_ndps);
5904             number_of_items=tvb_get_ntohl(tvb, foffset);
5905             foffset += 4;
5906             for (i = 1 ; i <= number_of_items; i++ )
5907             {
5908                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Result %d", i);
5909                 btree = proto_item_add_subtree(bitem, ett_ndps);
5910                 foffset = objectidentification(tvb, btree, foffset);
5911                 number_of_items2 = tvb_get_ntohl(tvb, foffset);
5912                 foffset += 4;
5913                 for (j = 1 ; j <= number_of_items2; j++ )
5914                 {
5915                     citem = proto_tree_add_text(btree, tvb, foffset, 0, "Attribute %d", j);
5916                     ctree = proto_item_add_subtree(citem, ett_ndps);
5917                     foffset = objectidentifier(tvb, ctree, foffset);
5918                     foffset += align_4(tvb, foffset);
5919                     number_of_items3 = tvb_get_ntohl(tvb, foffset);
5920                     foffset += 4;
5921                     for (k = 1 ; k <= number_of_items3; k++ )
5922                     {
5923                         ditem = proto_tree_add_text(ctree, tvb, foffset, 0, "Value %d", k);
5924                         dtree = proto_item_add_subtree(ditem, ett_ndps);
5925                         foffset = attribute_value(tvb, dtree, foffset);
5926                         foffset += align_4(tvb, foffset);
5927                     }
5928                     proto_tree_add_item(ctree, hf_ndps_qualifier, tvb, foffset, 4, FALSE);
5929                     foffset += 4;
5930                 }
5931                 foffset = objectidentifier(tvb, btree, foffset);
5932                 foffset += 2;
5933             }
5934             if(error_val != 0)
5935             {
5936                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
5937             }
5938             break;
5939         case 0x00000009:    /* Interrupt */
5940         case 0x0000000a:    /* Pause */
5941             /* Start of NWDPPrtContainedObjectId */
5942             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job ID");
5943             atree = proto_item_add_subtree(aitem, ett_ndps);
5944             foffset = ndps_string(tvb, hf_ndps_pa_name, atree, foffset);
5945             proto_tree_add_item(atree, hf_local_id, tvb, foffset, 4, FALSE);
5946             foffset += 4;
5947             /* End of NWDPPrtContainedObjectId */
5948             /* Start of AttributeSet */
5949             number_of_items = tvb_get_ntohl(tvb, foffset);
5950             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Object Attribute Set");
5951             atree = proto_item_add_subtree(aitem, ett_ndps);
5952             foffset += 4;
5953             for (i = 1 ; i <= number_of_items; i++ )
5954             {
5955                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Attribute %d", i);
5956                 btree = proto_item_add_subtree(bitem, ett_ndps);
5957                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
5958             }
5959             /* End of AttributeSet */
5960             if(error_val != 0)
5961             {
5962                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
5963             }
5964             break;
5965         case 0x0000000c:    /* Clean */
5966         case 0x0000000e:    /* Delete */
5967         case 0x0000000f:    /* Disable PA */
5968         case 0x00000010:    /* Enable PA */
5969         case 0x00000012:    /* Set */
5970         case 0x00000013:    /* Shutdown PA */
5971         case 0x00000014:    /* Startup PA */
5972         case 0x00000018:    /* Transfer Data */
5973         case 0x00000019:    /* Device Control */
5974         case 0x0000001b:    /* Remove Event Profile */
5975         case 0x0000001c:    /* Modify Event Profile */
5976         case 0x0000001e:    /* Shutdown PSM */
5977         case 0x0000001f:    /* Cancel PSM Shutdown */
5978         case 0x00000020:    /* Set Printer DS Information */
5979         case 0x00000021:    /* Clean User Jobs */
5980             if(error_val != 0)
5981             {
5982                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
5983             }
5984             break;
5985         case 0x00000011:    /* Resubmit Jobs */
5986             number_of_items = tvb_get_ntohl(tvb, foffset); /* Start of ResubmitJob Set */
5987             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Resubmit Job");
5988             atree = proto_item_add_subtree(aitem, ett_ndps);
5989             foffset += 4;
5990             for (i = 1 ; i <= number_of_items; i++ )
5991             {
5992                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Job %d", i);
5993                 btree = proto_item_add_subtree(bitem, ett_ndps);
5994                 /* Start of NWDPPrtContainedObjectId */
5995                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Old Job");
5996                 ctree = proto_item_add_subtree(citem, ett_ndps);
5997                 foffset = ndps_string(tvb, hf_ndps_pa_name, ctree, foffset);
5998                 proto_tree_add_item(ctree, hf_local_id, tvb, foffset, 4, FALSE);
5999                 foffset += 4;
6000                 /* End of NWDPPrtContainedObjectId */
6001                 /* Start of NWDPPrtContainedObjectId */
6002                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "New Job");
6003                 ctree = proto_item_add_subtree(citem, ett_ndps);
6004                 foffset = ndps_string(tvb, hf_ndps_pa_name, ctree, foffset);
6005                 proto_tree_add_item(ctree, hf_local_id, tvb, foffset, 4, FALSE);
6006                 foffset += 4;
6007                 /* End of NWDPPrtContainedObjectId */
6008                 /* Start of AttributeSet */
6009                 number_of_items2 = tvb_get_ntohl(tvb, foffset);
6010                 citem = proto_tree_add_text(btree, tvb, foffset, 0, "Job Status");
6011                 ctree = proto_item_add_subtree(citem, ett_ndps);
6012                 foffset += 4;
6013                 for (j = 1 ; j <= number_of_items2; j++ )
6014                 {
6015                     ditem = proto_tree_add_text(ctree, tvb, foffset, 0, "Object %d", j);
6016                     dtree = proto_item_add_subtree(ditem, ett_ndps);
6017                     foffset = attribute_value(tvb, dtree, foffset);  /* Object Attribute Set */
6018                 }
6019                 /* End of AttributeSet */
6020             } /* End of ResubmitJob Set */
6021             if(error_val != 0)
6022             {
6023                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6024             }
6025             break;
6026         case 0x00000015:    /* Reorder Job */
6027             /* Start of AttributeSet */
6028             number_of_items = tvb_get_ntohl(tvb, foffset);
6029             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Job Status");
6030             atree = proto_item_add_subtree(aitem, ett_ndps);
6031             foffset += 4;
6032             for (i = 1 ; i <= number_of_items; i++ )
6033             {
6034                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Object %d", i);
6035                 btree = proto_item_add_subtree(bitem, ett_ndps);
6036                 foffset = attribute_value(tvb, btree, foffset);  /* Object Attribute Set */
6037             }
6038             /* End of AttributeSet */
6039             if(error_val != 0)
6040             {
6041                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6042             }
6043             break;
6044         case 0x00000016:    /* Pause PA */
6045         case 0x00000017:    /* Resume PA */
6046             /* Start of AttributeSet */
6047             number_of_items = tvb_get_ntohl(tvb, foffset);
6048             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Printer Status");
6049             atree = proto_item_add_subtree(aitem, ett_ndps);
6050             foffset += 4;
6051             for (i = 1 ; i <= number_of_items; i++ )
6052             {
6053                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Object %d", i);
6054                 btree = proto_item_add_subtree(bitem, ett_ndps);
6055                 foffset = attribute_value(tvb, atree, foffset);  /* Object Attribute Set */
6056             }
6057             /* End of AttributeSet */
6058             if(error_val != 0)
6059             {
6060                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6061             }
6062             break;
6063         case 0x0000001a:    /* Add Event Profile */
6064             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
6065             foffset += 4;
6066             if(error_val != 0)
6067             {
6068                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6069             }
6070             break;
6071         case 0x0000001d:    /* List Event Profiles */
6072             length = tvb_get_ntohl(tvb, foffset);
6073             foffset += 4;
6074             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
6075             foffset += length;
6076             /* Start of Eventhandling */
6077             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
6078             foffset += 4;
6079             proto_tree_add_item(ndps_tree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
6080             foffset += 4;
6081             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Consumer Name");
6082             atree = proto_item_add_subtree(aitem, ett_ndps);
6083             foffset = qualifiedname(tvb, atree, foffset);
6084             length = tvb_get_ntohl(tvb, foffset);
6085             foffset += 4;
6086             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
6087             foffset += length;
6088             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
6089             foffset += 4;
6090             /* Start of NameorID */
6091             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
6092             atree = proto_item_add_subtree(aitem, ett_ndps);
6093             foffset = name_or_id(tvb, atree, foffset);
6094             /* End of NameorID */
6095             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Delivery Address");
6096             atree = proto_item_add_subtree(aitem, ett_ndps);
6097             number_of_items = tvb_get_ntohl(tvb, foffset);
6098             for (i = 1 ; i <= number_of_items; i++ )
6099             {
6100                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Address %d", i);
6101                 btree = proto_item_add_subtree(bitem, ett_ndps);
6102                 foffset += address_item(tvb, btree, foffset);
6103             }
6104             foffset = event_object_set(tvb, ndps_tree, foffset);
6105             /* End of Eventhandling */
6106             length = tvb_get_ntohl(tvb, foffset);
6107             foffset += 4;
6108             proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
6109             foffset += length;
6110             if(error_val != 0)
6111             {
6112                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6113             }
6114             break;
6115         case 0x00000022:    /* Map GUID to NDS Name */
6116             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "NDS Printer Name");
6117             atree = proto_item_add_subtree(aitem, ett_ndps);
6118             foffset = qualifiedname(tvb, atree, foffset);
6119             if(error_val != 0)
6120             {
6121                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6122             }
6123             break;
6124         case 0x00000023:    /* AddEventProfile2 */
6125             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
6126             foffset += 4;
6127             proto_tree_add_item(ndps_tree, hf_notify_lease_exp_time, tvb, foffset, 4, FALSE);
6128             foffset += 4;
6129             if(error_val != 0)
6130             {
6131                 foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6132             }
6133             break;
6134         case 0x00000024:    /* ListEventProfiles2 */
6135             number_of_items = tvb_get_ntohl(tvb, foffset);
6136             foffset += 4;
6137             for (i = 1 ; i <= number_of_items; i++ )
6138             {
6139                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Event %d", i);
6140                 atree = proto_item_add_subtree(aitem, ett_ndps);
6141                 /* Start of Eventhandling2 */
6142                 proto_tree_add_item(atree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
6143                 foffset += 4;
6144                 proto_tree_add_item(atree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
6145                 foffset += 4;
6146                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Consumer Name");
6147                 btree = proto_item_add_subtree(bitem, ett_ndps);
6148                 foffset = qualifiedname(tvb, btree, foffset);
6149                 foffset = ndps_string(tvb, hf_ndps_supplier_name, atree, foffset);
6150                 proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
6151                 foffset += 4;
6152                 /* Start of NameorID */
6153                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Method ID");
6154                 btree = proto_item_add_subtree(bitem, ett_ndps);
6155                 foffset = name_or_id(tvb, btree, foffset);
6156                 foffset += align_4(tvb, foffset);
6157                 /* End of NameorID */
6158                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Delivery Address");
6159                 btree = proto_item_add_subtree(bitem, ett_ndps);
6160                 number_of_items = tvb_get_ntohl(tvb, foffset);
6161                 foffset += 4;
6162                 for (i = 1 ; i <= number_of_items; i++ )
6163                 {
6164                     citem = proto_tree_add_text(btree, tvb, foffset, 0, "Address %d", i);
6165                     ctree = proto_item_add_subtree(citem, ett_ndps);
6166                     foffset = address_item(tvb, ctree, foffset);
6167                 }
6168                 foffset = event_object_set(tvb, ndps_tree, foffset);
6169                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Account");
6170                 btree = proto_item_add_subtree(bitem, ett_ndps);
6171                 foffset = qualifiedname(tvb, btree, foffset);
6172                 /* Start of object identifier set */
6173                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Notify Attributes");
6174                 btree = proto_item_add_subtree(bitem, ett_ndps);
6175                 number_of_items = tvb_get_ntohl(tvb, foffset);
6176                 foffset += 4;
6177                 for (i = 1 ; i <= number_of_items; i++ )
6178                 {
6179                     citem = proto_tree_add_text(btree, tvb, foffset, 0, "Attribute %d", i);
6180                     ctree = proto_item_add_subtree(citem, ett_ndps);
6181                     foffset = objectidentifier(tvb, ctree, foffset);
6182                 }
6183                 /* End of object identifier set */
6184                 proto_tree_add_item(atree, hf_notify_time_interval, tvb, foffset, 4, FALSE);
6185                 foffset += 4;
6186                 proto_tree_add_item(atree, hf_notify_sequence_number, tvb, foffset, 4, FALSE);
6187                 foffset += 4;
6188                 proto_tree_add_item(atree, hf_notify_lease_exp_time, tvb, foffset, 4, FALSE);
6189                 foffset += 4;
6190                 foffset = ndps_string(tvb, hf_notify_printer_uri, atree, foffset);
6191                 /* End of Eventhandling2 */
6192                 proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
6193                 foffset += length;
6194                 if(error_val != 0)
6195                 {
6196                     foffset = ndps_error(tvb, pinfo, ndps_tree, foffset);
6197                 }
6198             }
6199             break;
6200         default:
6201             break;
6202         }
6203         break;
6204     case 0x060977:  /* Broker */
6205         switch(ndps_func)
6206         {
6207         case 0x00000001:    /* Bind */
6208         case 0x00000002:    /* Unbind */
6209         case 0x00000004:    /* Enable Service */
6210         case 0x00000005:    /* Disable Service */
6211         case 0x00000006:    /* Down Broker */
6212             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6213             break;
6214         case 0x00000003:    /* List Services */
6215             number_of_items = tvb_get_ntohl(tvb, foffset); 
6216             foffset += 4;
6217             for (i = 1 ; i <= number_of_items; i++ )
6218             {
6219                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Service %d", i);
6220                 atree = proto_item_add_subtree(aitem, ett_ndps);
6221                 bitem = proto_tree_add_item(atree, hf_ndps_service_type, tvb, foffset, 4, FALSE);
6222                 btree = proto_item_add_subtree(bitem, ett_ndps);
6223                 foffset += 4;
6224                 proto_tree_add_item(btree, hf_ndps_service_enabled, tvb, foffset, 4, FALSE);
6225                 foffset += 4;
6226             }
6227             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6228             break;
6229         case 0x00000007:    /* Get Broker NDS Object Name */
6230             proto_tree_add_item(ndps_tree, hf_ndps_items, tvb, foffset,
6231             4, FALSE);
6232             foffset += 4;
6233             foffset = ndps_string(tvb, hf_ndps_broker_name, ndps_tree, foffset);
6234             foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
6235             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6236             break;
6237         case 0x00000008:    /* Get Broker Session Information */
6238         default:
6239             break;
6240         }
6241         break;
6242     case 0x060978:  /* Registry */
6243         switch(ndps_func)
6244         {
6245         case 0x00000001:    /* Bind */
6246             number_of_items = tvb_get_ntohl(tvb, foffset);
6247             foffset += 4;
6248             for (i = 1 ; i <= number_of_items; i++ )
6249             {
6250                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Attribute %d", i);
6251                 atree = proto_item_add_subtree(aitem, ett_ndps);
6252                 length = tvb_get_ntohl(tvb, foffset);
6253                 foffset += 4;
6254                 proto_tree_add_item(atree, hf_ndps_attribute_set, tvb, foffset, length, FALSE);
6255             }
6256             break;
6257         case 0x00000002:    /* Unbind */
6258             /* NoOp */
6259             break;
6260         case 0x00000003:    /* Register Server */
6261         case 0x00000004:    /* Deregister Server */
6262         case 0x00000005:    /* Register Registry */
6263         case 0x00000006:    /* Deregister Registry */
6264         case 0x00000007:    /* Registry Update */
6265             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6266             break;
6267         case 0x00000008:    /* List Local Servers */
6268         case 0x00000009:    /* List Servers */
6269             number_of_items = tvb_get_ntohl(tvb, foffset); 
6270             foffset += 4;
6271             for (i = 1 ; i <= number_of_items; i++ )
6272             {
6273                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
6274                 atree = proto_item_add_subtree(aitem, ett_ndps);
6275                 foffset = server_entry(tvb, atree, foffset);
6276             }
6277             length = tvb_get_ntohl(tvb, foffset);
6278             foffset += 4;
6279             proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
6280             foffset += length;
6281             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6282             break;
6283         case 0x0000000a:    /* List Known Registries */
6284             number_of_items = tvb_get_ntohl(tvb, foffset); 
6285             proto_tree_add_item(ndps_tree, hf_ndps_item_count, tvb, foffset, 4, FALSE);
6286             foffset += 4;
6287             for (i = 1 ; i <= number_of_items; i++ )
6288             {
6289                 aitem = proto_tree_add_item(ndps_tree, hf_ndps_client_server_type, tvb, foffset, 4, FALSE);
6290                 atree = proto_item_add_subtree(aitem, ett_ndps);
6291                 foffset += 4;
6292                 foffset = ndps_string(tvb, hf_ndps_registry_name, atree, foffset);
6293                 foffset = print_address(tvb, atree, foffset);
6294             }
6295             length = tvb_get_ntohl(tvb, foffset);
6296             foffset += 4;
6297             proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
6298             foffset += length;
6299             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6300             break;
6301         case 0x0000000b:    /* Get Registry NDS Object Name */
6302             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "NDS Printer Name");
6303             atree = proto_item_add_subtree(aitem, ett_ndps);
6304             foffset = qualifiedname(tvb, atree, foffset);
6305             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6306             break;
6307         case 0x0000000c:    /* Get Registry Session Information */
6308             proto_tree_add_item(ndps_tree, hf_ndps_session_type, tvb, foffset, 4, FALSE);
6309             foffset += 4;
6310             proto_tree_add_item(ndps_tree, hf_time, tvb, foffset, 4, FALSE);
6311             foffset += 4;
6312             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6313             break;
6314         default:
6315             break;
6316         }
6317         break;
6318     case 0x060979:  /* Notify */
6319         switch(ndps_func)
6320         {
6321         case 0x00000001:    /* Notify Bind */
6322             number_of_items = tvb_get_ntohl(tvb, foffset);
6323             foffset += 4;
6324             for (i = 1 ; i <= number_of_items; i++ )
6325             {
6326                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Attribute %d", i);
6327                 atree = proto_item_add_subtree(aitem, ett_ndps);
6328                 length = tvb_get_ntohl(tvb, foffset);
6329                 foffset += 4;
6330                 proto_tree_add_item(atree, hf_ndps_attribute_set, tvb, foffset, length, FALSE);
6331             }
6332             break;
6333         case 0x00000002:    /* Notify Unbind */
6334             /* NoOp */
6335             break;
6336         case 0x00000003:    /* Register Supplier */
6337             proto_tree_add_item(ndps_tree, hf_ndps_session, tvb, foffset, 4, FALSE);
6338             foffset += 4;
6339             foffset = event_object_set(tvb, ndps_tree, foffset);
6340             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6341             break;
6342         case 0x00000004:    /* Deregister Supplier */
6343         case 0x0000000b:    /* Report Notification */
6344         case 0x0000000d:    /* Remove Delivery Method */
6345             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6346             break;
6347         case 0x00000005:    /* Add Profile */
6348             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
6349             foffset += 4;
6350             foffset = event_object_set(tvb, ndps_tree, foffset);
6351             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6352             break;
6353         case 0x00000006:    /* Remove Profile */
6354         case 0x00000007:    /* Modify Profile */
6355         case 0x00000009:    /* Report Event */
6356             foffset = event_object_set(tvb, ndps_tree, foffset);
6357             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6358             break;
6359         case 0x00000008:    /* List Profiles */
6360             /* Start of ProfileResultSet */
6361             proto_tree_add_item(ndps_tree, hf_ndps_len, tvb, foffset, 4, FALSE);
6362             foffset += 4;
6363             /* Start of Eventhandling */
6364             proto_tree_add_item(ndps_tree, hf_ndps_profile_id, tvb, foffset, 4, FALSE);
6365             foffset += 4;
6366             proto_tree_add_item(ndps_tree, hf_ndps_persistence, tvb, foffset, 4, FALSE);
6367             foffset += 4;
6368             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Consumer Name");
6369             atree = proto_item_add_subtree(aitem, ett_ndps);
6370             foffset = qualifiedname(tvb, atree, foffset);
6371             length = tvb_get_ntohl(tvb, foffset);
6372             foffset += 4;
6373             proto_tree_add_item(ndps_tree, hf_ndps_attribute_value, tvb, foffset, length, FALSE);
6374             foffset += length;
6375             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
6376             foffset += 4;
6377             /* Start of NameorID */
6378             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
6379             atree = proto_item_add_subtree(aitem, ett_ndps);
6380             foffset = name_or_id(tvb, atree, foffset);
6381             /* End of NameorID */
6382             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Delivery Address");
6383             atree = proto_item_add_subtree(aitem, ett_ndps);
6384             number_of_items = tvb_get_ntohl(tvb, foffset);
6385             for (i = 1 ; i <= number_of_items; i++ )
6386             {
6387                 foffset += address_item(tvb, atree, foffset);
6388             }
6389             foffset = event_object_set(tvb, ndps_tree, foffset);
6390             /* End of Eventhandling */
6391             /* End of ProfileResultSet */
6392             length = tvb_get_ntohl(tvb, foffset);
6393             foffset += 4;
6394             proto_tree_add_item(ndps_tree, hf_ndps_continuation_option, tvb, foffset, length, FALSE);
6395             foffset += length;
6396             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6397             break;
6398         case 0x0000000a:    /* List Supported Languages */
6399             /* Start of IntegerSeq */
6400             length = tvb_get_ntohl(tvb, foffset);
6401             foffset += 4;
6402             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, length, FALSE);
6403             foffset += length;
6404             /* End of IntegerSeq */
6405             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6406             break;
6407         case 0x0000000c:    /* Add Delivery Method */
6408             /* Start of NameorID */
6409             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
6410             atree = proto_item_add_subtree(aitem, ett_ndps);
6411             foffset = name_or_id(tvb, atree, foffset);
6412             /* End of NameorID */
6413             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6414             break;
6415         case 0x0000000e:    /* List Delivery Methods */
6416             /* Start of DeliveryMethodSet */
6417             number_of_items = tvb_get_ntohl(tvb, foffset); 
6418             foffset += 4;
6419             for (i = 1 ; i <= number_of_items; i++ )
6420             {
6421                 aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method %d", i);
6422                 atree = proto_item_add_subtree(aitem, ett_ndps);
6423                 /* Start of DeliveryMethod */
6424                 /* Start of NameorID */
6425                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Method ID");
6426                 btree = proto_item_add_subtree(bitem, ett_ndps);
6427                 foffset = name_or_id(tvb, btree, foffset);
6428                 foffset += align_4(tvb, foffset);
6429                 /* End of NameorID */
6430                 foffset = ndps_string(tvb, hf_ndps_method_name, btree, foffset);
6431                 foffset = ndps_string(tvb, hf_ndps_method_ver, btree, foffset);
6432                 foffset = ndps_string(tvb, hf_ndps_file_name, btree, foffset);
6433                 proto_tree_add_item(btree, hf_ndps_admin_submit, tvb, foffset, 4, FALSE);
6434                 foffset += 4;
6435                 /* End of DeliveryMethod */
6436             }
6437             /* End of DeliveryMethodSet */
6438             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6439             break;
6440         case 0x0000000f:    /* Get Delivery Method Information */
6441             /* Start of DeliveryMethod */
6442             /* Start of NameorID */
6443             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Method ID");
6444             atree = proto_item_add_subtree(aitem, ett_ndps);
6445             foffset = name_or_id(tvb, atree, foffset);
6446             /* End of NameorID */
6447             foffset = ndps_string(tvb, hf_ndps_method_name, atree, foffset);
6448             foffset = ndps_string(tvb, hf_ndps_method_ver, atree, foffset);
6449             foffset = ndps_string(tvb, hf_ndps_file_name, atree, foffset);
6450             proto_tree_add_item(atree, hf_ndps_admin_submit, tvb, foffset, 4, FALSE);
6451             foffset += 4;
6452             /* End of DeliveryMethod */
6453             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Delivery Address");
6454             atree = proto_item_add_subtree(aitem, ett_ndps);
6455             number_of_items = tvb_get_ntohl(tvb, foffset);
6456             for (i = 1 ; i <= number_of_items; i++ )
6457             {
6458                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Address %d", i);
6459                 btree = proto_item_add_subtree(bitem, ett_ndps);
6460                 foffset += address_item(tvb, btree, foffset);
6461             }
6462             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6463             break;
6464         case 0x00000010:    /* Get Notify NDS Object Name */
6465             proto_tree_add_item(ndps_tree, hf_ndps_items, tvb, foffset,
6466             4, FALSE);
6467             foffset += 4;
6468             foffset = ndps_string(tvb, hf_ndps_broker_name, ndps_tree, foffset);
6469             foffset = ndps_string(tvb, hf_ndps_tree, ndps_tree, foffset);
6470             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6471             break;
6472         case 0x00000011:    /* Get Notify Session Information */
6473             proto_tree_add_item(ndps_tree, hf_ndps_get_session_type, tvb, foffset, 4, FALSE);
6474             foffset += 4;
6475             proto_tree_add_item(ndps_tree, hf_time, tvb, foffset, 4, FALSE);
6476             foffset += 4;
6477             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6478             break;
6479         default:
6480             break;
6481         }
6482         break;
6483     case 0x06097a:  /* Resman */
6484         switch(ndps_func)
6485         {
6486         case 0x00000001:    /* Bind */
6487             length = tvb_get_ntohl(tvb, foffset);
6488             foffset += 4;
6489             proto_tree_add_item(ndps_tree, hf_ndps_attribute_set, tvb, foffset, length, FALSE);
6490             break;
6491         case 0x00000002:    /* Unbind */
6492             /* NoOp */
6493             break;
6494         case 0x00000003:    /* Add Resource File */
6495         case 0x00000004:    /* Delete Resource File */
6496             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6497             break;
6498         case 0x00000005:    /* List Resources */
6499             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
6500             foffset += 4;
6501             if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
6502                 col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
6503             if (tvb_get_ntohl(tvb, foffset-4) != 0) 
6504             {
6505                 break;
6506             }
6507             proto_tree_add_item(ndps_tree, hf_ndps_status_flags, tvb, foffset, 4, FALSE);
6508             foffset += 4;
6509             proto_tree_add_item(ndps_tree, hf_ndps_resource_list_type, tvb, foffset, 4, FALSE);
6510             resource_type = tvb_get_ntohl(tvb, foffset);
6511             foffset += 4;
6512             switch (resource_type) 
6513             {
6514             case 0:     /* Print Drivers */
6515             case 1:     /* Printer Definitions */
6516             case 2:     /* Printer Definitions Short */
6517                 number_of_items = tvb_get_ntohl(tvb, foffset);
6518                 foffset += 4;
6519                 for (i = 1 ; i <= number_of_items; i++ )
6520                 {
6521                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Definition %d", i);
6522                     atree = proto_item_add_subtree(aitem, ett_ndps);
6523                     if (tvb_get_ntohl(tvb, foffset)==0) {  /* Offset for old type support */
6524                         foffset += 2;
6525                     }
6526                     foffset += 4; /* Item always == 1 */
6527                     foffset = ndps_string(tvb, hf_ndps_printer_manuf, atree, foffset);
6528                     if (tvb_get_ntohl(tvb, foffset)==0) {
6529                         foffset += 2;
6530                     }
6531                     foffset += 4;
6532                     foffset = ndps_string(tvb, hf_ndps_printer_type, atree, foffset);
6533                     if (tvb_get_ntohl(tvb, foffset)==0) {
6534                         foffset += 2;
6535                     }
6536                     foffset += 4;
6537                     foffset = ndps_string(tvb, hf_ndps_inf_file_name, atree, foffset);
6538                 }
6539                 break;
6540             case 3:     /* Banner Page Files */
6541                 number_of_items = tvb_get_ntohl(tvb, foffset);
6542                 foffset += 4;
6543                 for (i = 1 ; i <= number_of_items; i++ )
6544                 {
6545                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Banner %d", i);
6546                     atree = proto_item_add_subtree(aitem, ett_ndps);
6547                     foffset = ndps_string(tvb, hf_ndps_banner_name, atree, foffset);
6548                 }
6549                 break;
6550             case 4:     /* Font Types */
6551                 number_of_items = tvb_get_ntohl(tvb, foffset);
6552                 foffset += 4;
6553                 for (i = 1 ; i <= number_of_items; i++ )
6554                 {
6555                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Font %d", i);
6556                     atree = proto_item_add_subtree(aitem, ett_ndps);
6557                     foffset = ndps_string(tvb, hf_font_type_name, atree, foffset);
6558                 }
6559                 break;
6560             case 7:     /* Font Files */
6561                 number_of_items = tvb_get_ntohl(tvb, foffset);
6562                 foffset += 4;
6563                 for (i = 1 ; i <= number_of_items; i++ )
6564                 {
6565                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Font File %d", i);
6566                     atree = proto_item_add_subtree(aitem, ett_ndps);
6567                     foffset = ndps_string(tvb, hf_font_file_name, atree, foffset);
6568                 }
6569                 break;
6570             case 5:     /* Printer Driver Files */
6571             case 12:    /* Printer Driver Files 2 */
6572             case 9:     /* Generic Files */
6573                 number_of_items = tvb_get_ntohl(tvb, foffset);
6574                 foffset += 4;
6575                 for (i = 1 ; i <= number_of_items; i++ )
6576                 {
6577                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "File %d", i);
6578                     atree = proto_item_add_subtree(aitem, ett_ndps);
6579                     foffset = ndps_string(tvb, hf_ndps_prn_file_name, atree, foffset);
6580                     foffset = ndps_string(tvb, hf_ndps_prn_dir_name, atree, foffset);
6581                     foffset = ndps_string(tvb, hf_ndps_inf_file_name, atree, foffset);
6582                 }
6583                 break;
6584             case 6:     /* Printer Definition File */
6585                 number_of_items = tvb_get_ntohl(tvb, foffset);
6586                 foffset += 4;
6587                 for (i = 1 ; i <= number_of_items; i++ )
6588                 {
6589                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Definition %d", i);
6590                     atree = proto_item_add_subtree(aitem, ett_ndps);
6591                     foffset = ndps_string(tvb, hf_ndps_prn_file_name, atree, foffset);
6592                     foffset = ndps_string(tvb, hf_ndps_prn_dir_name, atree, foffset);
6593                     foffset = ndps_string(tvb, hf_ndps_inf_file_name, atree, foffset);
6594                 }
6595                 number_of_items = tvb_get_ntohl(tvb, foffset);
6596                 foffset += 4;
6597                 for (i = 1 ; i <= number_of_items; i++ )
6598                 {
6599                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Item %d", i);
6600                     atree = proto_item_add_subtree(aitem, ett_ndps);
6601                     foffset = ndps_string(tvb, hf_ndps_def_file_name, atree, foffset);
6602                     number_of_items2 = tvb_get_ntohl(tvb, foffset);
6603                     bitem = proto_tree_add_item(atree, hf_ndps_win31_items, tvb, foffset, 4, FALSE);
6604                     btree = proto_item_add_subtree(bitem, ett_ndps);
6605                     foffset += 4;
6606                     for (i = 1 ; i <= number_of_items2; i++ )
6607                     {
6608                         foffset = ndps_string(tvb, hf_ndps_windows_key, btree, foffset);
6609                     }
6610                     number_of_items2 = tvb_get_ntohl(tvb, foffset);
6611                     bitem = proto_tree_add_item(atree, hf_ndps_win95_items, tvb, foffset, 4, FALSE);
6612                     btree = proto_item_add_subtree(bitem, ett_ndps);
6613                     foffset += 4;
6614                     for (i = 1 ; i <= number_of_items2; i++ )
6615                     {
6616                         foffset = ndps_string(tvb, hf_ndps_windows_key, btree, foffset);
6617                     }
6618                 }
6619                 break;
6620             case 10:    /* Printer Definition File 2 */
6621                 foffset = ndps_string(tvb, hf_ndps_def_file_name, ndps_tree, foffset);
6622                 number_of_items = tvb_get_ntohl(tvb, foffset);
6623                 foffset += 4;
6624                 for (i = 1 ; i <= number_of_items; i++ )
6625                 {
6626                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "OS %d", i);
6627                     atree = proto_item_add_subtree(aitem, ett_ndps);
6628                     proto_tree_add_item(atree, hf_os_type, tvb, foffset, 4, FALSE);
6629                     foffset += 4;
6630                     number_of_items2 = tvb_get_ntohl(tvb, foffset);
6631                     foffset += 4;
6632                     for (i = 1 ; i <= number_of_items2; i++ )
6633                     {
6634                         bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Key %d", i);
6635                         btree = proto_item_add_subtree(bitem, ett_ndps);
6636                         foffset = ndps_string(tvb, hf_ndps_windows_key, btree, foffset);
6637                     }
6638                 }
6639                 break;
6640             case 8:     /* Generic Type */
6641             case 11:    /* Printer Driver Types 2 */
6642             case 13:    /* Printer Driver Types Archive */
6643                 number_of_items = tvb_get_ntohl(tvb, foffset);
6644                 foffset += 4;
6645                 for (i = 1 ; i <= number_of_items; i++ )
6646                 {
6647                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Type %d", i);
6648                     atree = proto_item_add_subtree(aitem, ett_ndps);
6649                     foffset = ndps_string(tvb, hf_ndps_printer_manuf, atree, foffset);
6650                     foffset = ndps_string(tvb, hf_ndps_printer_type, atree, foffset);
6651                     foffset = ndps_string(tvb, hf_ndps_prn_file_name, atree, foffset);
6652                     foffset = ndps_string(tvb, hf_ndps_prn_dir_name, atree, foffset);
6653                     proto_tree_add_item(atree, hf_archive_type, tvb, foffset, 4, FALSE);
6654                     foffset += 4;
6655                     proto_tree_add_item(atree, hf_archive_file_size, tvb, foffset, 4, FALSE);
6656                     foffset += 4;
6657                 }
6658                 break;
6659             case 14:    /* Languages Available */
6660                 number_of_items = tvb_get_ntohl(tvb, foffset);
6661                 foffset += 4;
6662                 for (i = 1 ; i <= number_of_items; i++ )
6663                 {
6664                     aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Language %d", i);
6665                     atree = proto_item_add_subtree(aitem, ett_ndps);
6666                     proto_tree_add_item(atree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
6667                     foffset += 4;
6668                 }
6669                 break;
6670             default:
6671                 break;
6672             }
6673             break;
6674         case 0x00000006:    /* Get Resource File */
6675             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
6676             foffset += 4;
6677             if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
6678                 col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
6679             if (tvb_get_ntohl(tvb, foffset-4) != 0) 
6680             {
6681                 break;
6682             }
6683             proto_tree_add_item(ndps_tree, hf_get_status_flag, tvb, foffset, 4, FALSE);
6684             foffset += 4;
6685             proto_tree_add_item(ndps_tree, hf_file_timestamp, tvb, foffset, 4, FALSE);
6686             foffset += 4;
6687             proto_tree_add_item(ndps_tree, hf_ndps_data, tvb, foffset, -1, FALSE);
6688             break;
6689         case 0x00000007:    /* Get Resource File Date */
6690             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
6691             foffset += 4;
6692             if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
6693                 col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
6694             if (tvb_get_ntohl(tvb, foffset-4) != 0) 
6695             {
6696                 break;
6697             }
6698             proto_tree_add_item(ndps_tree, hf_file_timestamp, tvb, foffset, 4, FALSE);
6699             foffset += 4;
6700             break;
6701         case 0x00000008:    /* Get Resource Manager NDS Object Name */
6702             foffset = qualifiedname(tvb, ndps_tree, foffset);
6703             proto_tree_add_uint(ndps_tree, hf_ndps_error_val, tvb, foffset, 4, error_val);
6704             foffset += 4;
6705             break;
6706         case 0x00000009:    /* Get Resource Manager Session Information */
6707             proto_tree_add_item(ndps_tree, hf_ndps_get_resman_session_type, tvb, foffset, 4, FALSE);
6708             foffset += 4;
6709             proto_tree_add_item(ndps_tree, hf_time, tvb, foffset, 4, FALSE);
6710             foffset += 4;
6711             foffset = return_code(tvb, pinfo, ndps_tree, foffset);
6712             break;
6713         case 0x0000000a:    /* Set Resource Language Context */
6714             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
6715             foffset += 4;
6716             if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
6717                 col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
6718             if (tvb_get_ntohl(tvb, foffset-4) != 0) 
6719             {
6720                 break;
6721             }
6722             proto_tree_add_item(ndps_tree, hf_ndps_language_id, tvb, foffset, 4, FALSE);
6723             foffset += 4;
6724             break;
6725         default:
6726             break;
6727         }
6728         break;
6729     case 0x06097b:  /* Delivery */
6730         switch(ndps_func)
6731         {
6732         case 0x00000001:    /* Delivery Bind */
6733             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
6734             foffset += 4;
6735             if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
6736                 col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
6737             break;
6738         case 0x00000002:    /* Delivery Unbind */
6739             /* NoOp */
6740             break;
6741         case 0x00000003:    /* Delivery Send */
6742         case 0x00000004:    /* Delivery Send2 */
6743             proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, FALSE);
6744             foffset += 4;
6745             if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0)
6746                 col_add_fstr(pinfo->cinfo, COL_INFO, "R NDPS - Error");
6747             if (tvb_get_ntohl(tvb, foffset-4) != 0) 
6748             {
6749                 break;
6750             }
6751             aitem = proto_tree_add_text(ndps_tree, tvb, foffset, 0, "Failed Items");
6752             atree = proto_item_add_subtree(aitem, ett_ndps);
6753             number_of_items=tvb_get_ntohl(tvb, foffset);
6754             foffset += 4;
6755             for (i = 1 ; i <= number_of_items; i++ )
6756             {
6757                 bitem = proto_tree_add_text(atree, tvb, foffset, 0, "Item %d", i);
6758                 btree = proto_item_add_subtree(bitem, ett_ndps);
6759                 length=tvb_get_ntohl(tvb, foffset);
6760                 if(tvb_length_remaining(tvb, foffset) < length)
6761                 {
6762                     return;
6763                 }
6764                 proto_tree_add_item(btree, hf_ndps_item_ptr, tvb, foffset, length, FALSE);
6765                 foffset += length;
6766             }
6767             break;
6768         default:
6769             break;
6770         }
6771         break;
6772     default:
6773         break;
6774     }
6775     return;
6776 }
6777
6778 void
6779 proto_register_ndps(void)
6780 {
6781         static hf_register_info hf_ndps[] = {
6782                 { &hf_ndps_record_mark,
6783                 { "Record Mark",                "ndps.record_mark", FT_UINT16, BASE_HEX, NULL, 0x0,
6784                         "Record Mark", HFILL }},
6785
6786         { &hf_ndps_packet_type,
6787         { "Packet Type",    "ndps.packet_type",
6788           FT_UINT32,    BASE_HEX,   VALS(ndps_packet_types),   0x0,
6789           "Packet Type", HFILL }},
6790
6791         { &hf_ndps_length,
6792         { "Record Length",    "ndps.record_length",
6793            FT_UINT16,    BASE_DEC,   NULL,   0x0,
6794            "Record Length", HFILL }},
6795         
6796         { &hf_ndps_xid,
6797         { "Exchange ID",    "ndps.xid",
6798            FT_UINT32,    BASE_HEX,   NULL,   0x0,
6799            "Exchange ID", HFILL }},
6800
6801         { &hf_ndps_rpc_version,
6802         { "RPC Version",    "ndps.rpc_version",
6803            FT_UINT32,    BASE_HEX,   NULL,   0x0,
6804            "RPC Version", HFILL }},
6805
6806         { &hf_spx_ndps_program,
6807         { "NDPS Program Number",    "spx.ndps_program",
6808           FT_UINT32,    BASE_HEX,   VALS(spx_ndps_program_vals),   0x0,
6809           "NDPS Program Number", HFILL }},
6810         
6811         { &hf_spx_ndps_version,
6812         { "Program Version",    "spx.ndps_version",
6813           FT_UINT32,    BASE_DEC,   NULL,   0x0,
6814           "Program Version", HFILL }}, 
6815     
6816         { &hf_ndps_error,
6817         { "NDPS Error",    "spx.ndps_error",
6818           FT_UINT32,    BASE_HEX,   NULL,   0x0,
6819           "NDPS Error", HFILL }}, 
6820         
6821         { &hf_spx_ndps_func_print,
6822         { "Print Program",    "spx.ndps_func_print",
6823           FT_UINT32,    BASE_HEX,   VALS(spx_ndps_print_func_vals),   0x0,
6824           "Print Program", HFILL }},
6825         
6826         { &hf_spx_ndps_func_notify,
6827         { "Notify Program",    "spx.ndps_func_notify",
6828           FT_UINT32,    BASE_HEX,   VALS(spx_ndps_notify_func_vals),   0x0,
6829           "Notify Program", HFILL }},
6830         
6831         { &hf_spx_ndps_func_delivery,
6832         { "Delivery Program",    "spx.ndps_func_delivery",
6833           FT_UINT32,    BASE_HEX,   VALS(spx_ndps_deliver_func_vals),   0x0,
6834           "Delivery Program", HFILL }},
6835         
6836         { &hf_spx_ndps_func_registry,
6837         { "Registry Program",    "spx.ndps_func_registry",
6838           FT_UINT32,    BASE_HEX,   VALS(spx_ndps_registry_func_vals),   0x0,
6839           "Registry Program", HFILL }},
6840         
6841         { &hf_spx_ndps_func_resman,
6842         { "ResMan Program",    "spx.ndps_func_resman",
6843           FT_UINT32,    BASE_HEX,   VALS(spx_ndps_resman_func_vals),   0x0,
6844           "ResMan Program", HFILL }},
6845         
6846         { &hf_spx_ndps_func_broker,
6847         { "Broker Program",    "spx.ndps_func_broker",
6848           FT_UINT32,    BASE_HEX,   VALS(spx_ndps_broker_func_vals),   0x0,
6849           "Broker Program", HFILL }},
6850         
6851         { &hf_ndps_items,
6852         { "Number of Items",    "ndps.items",
6853           FT_UINT32,    BASE_DEC,   NULL,   0x0,
6854           "Number of Items", HFILL }},
6855
6856         { &hf_ndps_objects,
6857         { "Number of Objects",    "ndps.objects",
6858           FT_UINT32,    BASE_DEC,   NULL,   0x0,
6859           "Number of Objects", HFILL }},
6860
6861         { &hf_ndps_attributes,
6862         { "Number of Attributes",    "ndps.attributes",
6863           FT_UINT32,    BASE_DEC,   NULL,   0x0,
6864           "Number of Attributes", HFILL }},
6865
6866         { &hf_ndps_sbuffer,
6867         { "Server",    "ndps.sbuffer",
6868           FT_UINT32,    BASE_DEC,   NULL,   0x0,
6869           "Server", HFILL }},
6870         
6871         { &hf_ndps_rbuffer,
6872         { "Connection",    "ndps.rbuffer",
6873           FT_UINT32,    BASE_DEC,   NULL,   0x0,
6874           "Connection", HFILL }},
6875
6876         { &hf_ndps_user_name,
6877         { "Trustee Name",    "ndps.user_name",
6878           FT_STRING,    BASE_NONE,   NULL,   0x0,
6879           "Trustee Name", HFILL }},
6880         
6881         { &hf_ndps_broker_name,
6882         { "Broker Name",    "ndps.broker_name",
6883           FT_STRING,    BASE_NONE,   NULL,   0x0,
6884           "Broker Name", HFILL }},
6885
6886         { &hf_ndps_pa_name,
6887         { "Printer Name",    "ndps.pa_name",
6888           FT_STRING,    BASE_NONE,   NULL,   0x0,
6889           "Printer Name", HFILL }},
6890         
6891         { &hf_ndps_tree,
6892         { "Tree",    "ndps.tree",
6893           FT_STRING,    BASE_NONE,   NULL,   0x0,
6894           "Tree", HFILL }},
6895
6896         { &hf_ndps_reqframe,
6897         { "Request Frame",    "ndps.reqframe",
6898           FT_FRAMENUM,  BASE_NONE,   NULL,   0x0,
6899           "Request Frame", HFILL }},
6900
6901         { &hf_ndps_error_val,
6902         { "Return Status",    "ndps.error_val",
6903           FT_UINT32,    BASE_HEX,   VALS(ndps_error_types),   0x0,
6904           "Return Status", HFILL }},
6905
6906         { &hf_ndps_object,
6907         { "Object ID",    "ndps.object",
6908           FT_UINT32,    BASE_HEX,   NULL,   0x0,
6909           "Object ID", HFILL }},
6910
6911         { &hf_ndps_cred_type,
6912         { "Credential Type",    "ndps.cred_type",
6913           FT_UINT32,    BASE_HEX,   VALS(ndps_credential_enum),   0x0,
6914           "Credential Type", HFILL }},
6915
6916         { &hf_ndps_server_name,
6917         { "Server Name",    "ndps.server_name",
6918           FT_STRING,    BASE_DEC,   NULL,   0x0,
6919           "Server Name", HFILL }},
6920
6921         { &hf_ndps_connection,
6922         { "Connection",    "ndps.connection",
6923           FT_UINT16,    BASE_DEC,   NULL,   0x0,
6924           "Connection", HFILL }},
6925
6926         { &hf_ndps_ext_error,
6927         { "Extended Error Code",    "ndps.ext_error",
6928           FT_UINT32,    BASE_HEX,   NULL,   0x0,
6929           "Extended Error Code", HFILL }},
6930
6931         { &hf_ndps_auth_null,
6932         { "Auth Null",    "ndps.auth_null",
6933           FT_BYTES,    BASE_NONE,   NULL,   0x0,
6934           "Auth Null", HFILL }},
6935
6936         { &hf_ndps_rpc_accept,
6937         { "RPC Accept or Deny",    "ndps.rpc_acc",
6938           FT_UINT32,    BASE_HEX,   VALS(true_false),   0x0,
6939           "RPC Accept or Deny", HFILL }},
6940
6941         { &hf_ndps_rpc_acc_stat,
6942         { "RPC Accept Status",    "ndps.rpc_acc_stat",
6943           FT_UINT32,    BASE_HEX,   VALS(accept_stat),   0x0,
6944           "RPC Accept Status", HFILL }},
6945         
6946         { &hf_ndps_rpc_rej_stat,
6947         { "RPC Reject Status",    "ndps.rpc_rej_stat",
6948           FT_UINT32,    BASE_HEX,   VALS(reject_stat),   0x0,
6949           "RPC Reject Status", HFILL }},
6950         
6951         { &hf_ndps_rpc_acc_results,
6952         { "RPC Accept Results",    "ndps.rpc_acc_res",
6953           FT_UINT32,    BASE_HEX,   NULL,   0x0,
6954           "RPC Accept Results", HFILL }},
6955
6956         { &hf_ndps_problem_type,
6957         { "Problem Type",    "ndps.rpc_prob_type",
6958           FT_UINT32,    BASE_HEX,   VALS(error_type_enum),   0x0,
6959           "Problem Type", HFILL }},
6960     
6961         { &hf_security_problem_type,
6962         { "Security Problem",    "ndps.rpc_sec_prob",
6963           FT_UINT32,    BASE_HEX,   VALS(security_problem_enum),   0x0,
6964           "Security Problem", HFILL }},
6965
6966         { &hf_service_problem_type,
6967         { "Service Problem",    "ndps.rpc_serv_prob",
6968           FT_UINT32,    BASE_HEX,   VALS(service_problem_enum),   0x0,
6969           "Service Problem", HFILL }},
6970         
6971         { &hf_access_problem_type,
6972         { "Access Problem",    "ndps.rpc_acc_prob",
6973           FT_UINT32,    BASE_HEX,   VALS(access_problem_enum),   0x0,
6974           "Access Problem", HFILL }},
6975         
6976         { &hf_printer_problem_type,
6977         { "Printer Problem",    "ndps.rpc_print_prob",
6978           FT_UINT32,    BASE_HEX,   VALS(printer_problem_enum),   0x0,
6979           "Printer Problem", HFILL }},
6980         
6981         { &hf_selection_problem_type,
6982         { "Selection Problem",    "ndps.rpc_sel_prob",
6983           FT_UINT32,    BASE_HEX,   VALS(selection_problem_enum),   0x0,
6984           "Selection Problem", HFILL }},
6985         
6986         { &hf_doc_access_problem_type,
6987         { "Document Access Problem",    "ndps.rpc_doc_acc_prob",
6988           FT_UINT32,    BASE_HEX,   VALS(doc_access_problem_enum),   0x0,
6989           "Document Access Problem", HFILL }},
6990         
6991         { &hf_attribute_problem_type,
6992         { "Attribute Problem",    "ndps.rpc_attr_prob",
6993           FT_UINT32,    BASE_HEX,   VALS(attribute_problem_enum),   0x0,
6994           "Attribute Problem", HFILL }},
6995
6996         { &hf_update_problem_type,
6997         { "Update Problem",    "ndps.rpc_update_prob",
6998           FT_UINT32,    BASE_HEX,   VALS(update_problem_enum),   0x0,
6999           "Update Problem", HFILL }},
7000         
7001         { &hf_obj_id_type,
7002         { "Object ID Type",    "ndps.rpc_obj_id_type",
7003           FT_UINT32,    BASE_HEX,   VALS(obj_identification_enum),   0x0,
7004           "Object ID Type", HFILL }},
7005
7006         { &hf_oid_struct_size,
7007         { "OID Struct Size",    "ndps.rpc_oid_struct_size",
7008           FT_UINT16,    BASE_HEX,   NULL,   0x0,
7009           "OID Struct Size", HFILL }},
7010         
7011         { &hf_object_name,
7012         { "Object Name",    "ndps.ndps_object_name",
7013           FT_STRING,    BASE_NONE,   NULL,   0x0,
7014           "Object Name", HFILL }},
7015
7016         { &hf_ndps_document_number,
7017         { "Document Number",    "ndps.ndps_doc_num",
7018           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7019           "Document Number", HFILL }},
7020
7021         { &hf_ndps_nameorid,
7022         { "Name or ID Type",    "ndps.ndps_nameorid",
7023           FT_UINT32,    BASE_HEX,   VALS(nameorid_enum),   0x0,
7024           "Name or ID Type", HFILL }},
7025
7026         { &hf_local_object_name,
7027         { "Local Object Name",    "ndps.ndps_loc_object_name",
7028           FT_STRING,    BASE_NONE,   NULL,   0x0,
7029           "Local Object Name", HFILL }},
7030
7031         { &hf_printer_name,
7032         { "Printer Name",    "ndps.ndps_printer_name",
7033           FT_STRING,    BASE_NONE,   NULL,   0x0,
7034           "Printer Name", HFILL }},
7035
7036         { &hf_ndps_qualified_name,
7037         { "Qualified Name Type",    "ndps.ndps_qual_name_type",
7038           FT_UINT32,    BASE_HEX,   VALS(qualified_name_enum),   0x0,
7039           "Qualified Name Type", HFILL }},
7040
7041         { &hf_ndps_qualified_name2,
7042         { "Qualified Name Type",    "ndps.ndps_qual_name_type2",
7043           FT_UINT32,    BASE_HEX,   VALS(qualified_name_enum2),   0x0,
7044           "Qualified Name Type", HFILL }},
7045         
7046
7047         { &hf_ndps_item_count,
7048         { "Number of Items",    "ndps.ndps_item_count",
7049           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7050           "Number of Items", HFILL }},
7051
7052         { &hf_ndps_qualifier,
7053         { "Qualifier",    "ndps.ndps_qual",
7054           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7055           "Qualifier", HFILL }},
7056
7057         { &hf_ndps_lib_error,
7058         { "Lib Error",    "ndps.ndps_lib_error",
7059           FT_UINT32,    BASE_HEX,   VALS(ndps_error_types),   0x0,
7060           "Lib Error", HFILL }},
7061
7062         { &hf_ndps_other_error,
7063         { "Other Error",    "ndps.ndps_other_error",
7064           FT_UINT32,    BASE_HEX,   VALS(ndps_error_types),   0x0,
7065           "Other Error", HFILL }},
7066
7067         { &hf_ndps_other_error_2,
7068         { "Other Error 2",    "ndps.ndps_other_error_2",
7069           FT_UINT32,    BASE_HEX,   VALS(ndps_error_types),   0x0,
7070           "Other Error 2", HFILL }},
7071
7072         { &hf_ndps_session,
7073         { "Session Handle",    "ndps.ndps_session",
7074           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7075           "Session Handle", HFILL }},
7076
7077         { &hf_ndps_abort_flag,
7078         { "Abort?",    "ndps.ndps_abort",
7079           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7080           "Abort?", HFILL }},
7081
7082         { &hf_obj_attribute_type,
7083         { "Value Syntax",    "ndps.ndps_attrib_type",
7084           FT_UINT32,    BASE_HEX,   VALS(ndps_attribute_enum),   0x0,
7085           "Value Syntax", HFILL }},
7086
7087         { &hf_ndps_attribute_value,
7088         { "Value",    "ndps.attribue_value",
7089           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7090           "Value", HFILL }},
7091
7092         { &hf_ndps_lower_range,
7093         { "Lower Range",    "ndps.lower_range",
7094           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7095           "Lower Range", HFILL }},
7096
7097         { &hf_ndps_upper_range,
7098         { "Upper Range",    "ndps.upper_range",
7099           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7100           "Upper Range", HFILL }},
7101
7102         { &hf_ndps_n64,
7103         { "Value",    "ndps.n64",
7104           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7105           "Value", HFILL }},
7106
7107         { &hf_ndps_lower_range_n64,
7108         { "Lower Range",    "ndps.lower_range_n64",
7109           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7110           "Lower Range", HFILL }},
7111
7112         { &hf_ndps_upper_range_n64,
7113         { "Upper Range",    "ndps.upper_range_n64",
7114           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7115           "Upper Range", HFILL }},
7116
7117         { &hf_ndps_attrib_boolean,
7118         { "Value?",    "ndps.ndps_attrib_boolean",
7119           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7120           "Value?", HFILL }},
7121
7122         { &hf_ndps_realization,
7123         { "Realization Type",    "ndps.ndps_realization",
7124           FT_UINT32,    BASE_HEX,   VALS(ndps_realization_enum),   0x0,
7125           "Realization Type", HFILL }},
7126
7127         { &hf_ndps_xdimension_n64,
7128         { "X Dimension",    "ndps.xdimension_n64",
7129           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7130           "X Dimension", HFILL }},
7131
7132         { &hf_ndps_ydimension_n64,
7133         { "Y Dimension",    "ndps.xdimension_n64",
7134           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7135           "Y Dimension", HFILL }},
7136
7137         { &hf_ndps_dim_value,
7138         { "Dimension Value Type",    "ndps.ndps_dim_value",
7139           FT_UINT32,    BASE_HEX,   VALS(ndps_dim_value_enum),   0x0,
7140           "Dimension Value Type", HFILL }},
7141
7142         { &hf_ndps_dim_flag,
7143         { "Dimension Flag",    "ndps.ndps_dim_falg",
7144           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7145           "Dimension Flag", HFILL }},
7146
7147         { &hf_ndps_xydim_value,
7148         { "XY Dimension Value Type",    "ndps.ndps_xydim_value",
7149           FT_UINT32,    BASE_HEX,   VALS(ndps_xydim_value_enum),   0x0,
7150           "XY Dimension Value Type", HFILL }},
7151
7152         { &hf_ndps_location_value,
7153         { "Location Value Type",    "ndps.ndps_location_value",
7154           FT_UINT32,    BASE_HEX,   VALS(ndps_location_value_enum),   0x0,
7155           "Location Value Type", HFILL }},
7156
7157         { &hf_ndps_xmin_n64,
7158         { "Minimum X Dimension",    "ndps.xmin_n64",
7159           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7160           "Minimum X Dimension", HFILL }},
7161
7162         { &hf_ndps_xmax_n64,
7163         { "Maximum X Dimension",    "ndps.xmax_n64",
7164           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7165           "Maximum X Dimension", HFILL }},
7166
7167         { &hf_ndps_ymin_n64,
7168         { "Minimum Y Dimension",    "ndps.ymin_n64",
7169           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7170           "Minimum Y Dimension", HFILL }},
7171
7172         { &hf_ndps_ymax_n64,
7173         { "Maximum Y Dimension",    "ndps.ymax_n64",
7174           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7175           "Maximum Y Dimension", HFILL }},
7176
7177         { &hf_ndps_edge_value,
7178         { "Edge Value",    "ndps.ndps_edge_value",
7179           FT_UINT32,    BASE_HEX,   VALS(ndps_edge_value_enum),   0x0,
7180           "Edge Value", HFILL }},
7181
7182         { &hf_ndps_cardinal_or_oid,
7183         { "Cardinal or OID",    "ndps.ndps_car_or_oid",
7184           FT_UINT32,    BASE_HEX,   VALS(ndps_card_or_oid_enum),   0x0,
7185           "Cardinal or OID", HFILL }},
7186
7187         { &hf_ndps_cardinal_name_or_oid,
7188         { "Cardinal Name or OID",    "ndps.ndps_car_name_or_oid",
7189           FT_UINT32,    BASE_HEX,   VALS(ndps_card_name_or_oid_enum),   0x0,
7190           "Cardinal Name or OID", HFILL }},
7191
7192         { &hf_ndps_integer_or_oid,
7193         { "Integer or OID",    "ndps.ndps_integer_or_oid",
7194           FT_UINT32,    BASE_HEX,   VALS(ndps_integer_or_oid_enum),   0x0,
7195           "Integer or OID", HFILL }},
7196
7197         { &hf_ndps_profile_id,
7198         { "Profile ID",    "ndps.ndps_profile_id",
7199           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7200           "Profile ID", HFILL }},
7201
7202         { &hf_ndps_persistence,
7203         { "Persistence",    "ndps.ndps_persistence",
7204           FT_UINT32,    BASE_HEX,   VALS(ndps_persistence_enum),   0x0,
7205           "Persistence", HFILL }},
7206
7207         { &hf_ndps_language_id,
7208         { "Language ID",    "ndps.ndps_lang_id",
7209           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7210           "Language ID", HFILL }},
7211
7212         { &hf_address_type,
7213         { "Address Type",    "ndps.ndps_address_type",
7214           FT_UINT32,    BASE_HEX,   VALS(ndps_address_type_enum),   0x0,
7215           "Address Type", HFILL }},
7216
7217         { &hf_ndps_address,
7218         { "Address",    "ndps.ndps_address",
7219           FT_UINT32,    BASE_HEX,   VALS(ndps_address_enum),   0x0,
7220           "Address", HFILL }},
7221
7222         { &hf_ndps_add_bytes,
7223         { "Address Bytes",    "ndps.add_bytes",
7224           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7225           "Address Bytes", HFILL }},
7226
7227         { &hf_ndps_event_type,
7228         { "Event Type",    "ndps.ndps_event_type",
7229           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7230           "Event Type", HFILL }},
7231
7232         { &hf_ndps_event_object_identifier,
7233         { "Event Object Type",    "ndps.ndps_event_object_identifier",
7234           FT_UINT32,    BASE_HEX,   VALS(ndps_event_object_enum),   0x0,
7235           "Event Object Type", HFILL }},
7236
7237         { &hf_ndps_octet_string,
7238         { "Octet String",    "ndps.octet_string",
7239           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7240           "Octet String", HFILL }},
7241
7242         { &hf_ndps_scope,
7243         { "Scope",    "ndps.scope",
7244           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7245           "Scope", HFILL }},
7246
7247         { &hf_address_len,
7248         { "Address Length",    "ndps.addr_len",
7249           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7250           "Address Length", HFILL }},
7251
7252         { &hf_ndps_net,
7253         { "IPX Network",    "ndps.net",
7254           FT_IPXNET,    BASE_NONE,   NULL,   0x0,
7255           "Scope", HFILL }},
7256
7257         { &hf_ndps_node,
7258         { "Node",    "ndps.node",
7259           FT_ETHER,    BASE_NONE,   NULL,   0x0,
7260           "Node", HFILL }},
7261
7262         { &hf_ndps_socket,
7263         { "IPX Socket",    "ndps.socket",
7264           FT_UINT16,    BASE_HEX,   NULL,   0x0,
7265           "IPX Socket", HFILL }},
7266
7267         { &hf_ndps_port,
7268         { "IP Port",    "ndps.port",
7269           FT_UINT16,    BASE_DEC,   NULL,   0x0,
7270           "IP Port", HFILL }},
7271
7272         { &hf_ndps_ip,
7273         { "IP Address",    "ndps.ip",
7274           FT_IPv4,    BASE_DEC,   NULL,   0x0,
7275           "IP Address", HFILL }},
7276         
7277         { &hf_ndps_server_type,
7278         { "NDPS Server Type",    "ndps.ndps_server_type",
7279           FT_UINT32,    BASE_HEX,   VALS(ndps_server_type_enum),   0x0,
7280           "NDPS Server Type", HFILL }},
7281
7282         { &hf_ndps_service_type,
7283         { "NDPS Service Type",    "ndps.ndps_service_type",
7284           FT_UINT32,    BASE_HEX,   VALS(ndps_service_type_enum),   0x0,
7285           "NDPS Service Type", HFILL }},
7286     
7287         { &hf_ndps_service_enabled,
7288         { "Service Enabled?",    "ndps.ndps_service_enabled",
7289           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7290           "Service Enabled?", HFILL }},
7291
7292         { &hf_ndps_method_name,
7293         { "Method Name",    "ndps.method_name",
7294           FT_STRING,    BASE_NONE,   NULL,   0x0,
7295           "Method Name", HFILL }},
7296
7297         { &hf_ndps_method_ver,
7298         { "Method Version",    "ndps.method_ver",
7299           FT_STRING,    BASE_NONE,   NULL,   0x0,
7300           "Method Version", HFILL }},
7301
7302         { &hf_ndps_file_name,
7303         { "File Name",    "ndps.file_name",
7304           FT_STRING,    BASE_NONE,   NULL,   0x0,
7305           "File Name", HFILL }},
7306         
7307         { &hf_ndps_admin_submit,
7308         { "Admin Submit Flag?",    "ndps.admin_submit_flag",
7309           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7310           "Admin Submit Flag?", HFILL }},
7311
7312         { &hf_ndps_oid,
7313         { "Object ID",    "ndps.oid",
7314           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7315           "Object ID", HFILL }},
7316
7317         { &hf_ndps_object_op,
7318         { "Operation",    "ndps.ndps_object_op",
7319           FT_UINT32,    BASE_HEX,   VALS(ndps_object_op_enum),   0x0,
7320           "Operation", HFILL }},
7321
7322         { &hf_answer_time,
7323         { "Answer Time",    "ndps.answer_time",
7324           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7325           "Answer Time", HFILL }},
7326         
7327         { &hf_oid_asn1_type,
7328         { "ASN.1 Type",    "ndps.asn1_type",
7329           FT_UINT16,    BASE_DEC,   NULL,   0x0,
7330           "ASN.1 Type", HFILL }},
7331
7332         { &hf_ndps_item_ptr,
7333         { "Item Pointer",    "ndps.item_ptr",
7334           FT_BYTES,    BASE_DEC,   NULL,   0x0,
7335           "Item Pointer", HFILL }},
7336
7337         { &hf_ndps_len,
7338         { "Length",    "ndps.ndps_len",
7339           FT_UINT16,    BASE_DEC,   NULL,   0x0,
7340           "Length", HFILL }},
7341      
7342         { &hf_limit_enc,
7343         { "Limit Encountered",    "ndps.ndps_limit_enc",
7344           FT_UINT32,    BASE_HEX,   VALS(ndps_limit_enc_enum),   0x0,
7345           "Limit Encountered", HFILL }},
7346         
7347         { &hf_ndps_delivery_add_type,
7348         { "Delivery Address Type",    "ndps.ndps_delivery_add_type",
7349           FT_UINT32,    BASE_HEX,   VALS(ndps_delivery_add_enum),   0x0,
7350           "Delivery Address Type", HFILL }},
7351
7352         { &hf_ndps_criterion_type,
7353         { "Criterion Type",    "ndps.ndps_criterion_type",
7354           FT_UINT32,    BASE_HEX,   VALS(ndps_attribute_enum),   0x0,
7355           "Criterion Type", HFILL }},
7356
7357         { &hf_ndps_ignored_type,
7358         { "Ignored Type",    "ndps.ndps_ignored_type",
7359           FT_UINT32,    BASE_HEX,   VALS(ndps_attribute_enum),   0x0,
7360           "Ignored Type", HFILL }},
7361
7362         { &hf_ndps_resource_type,
7363         { "Resource Type",    "ndps.ndps_resource_type",
7364           FT_UINT32,    BASE_HEX,   VALS(ndps_resource_enum),   0x0,
7365           "Resource Type", HFILL }},
7366       
7367         { &hf_ndps_identifier_type,
7368         { "Identifier Type",    "ndps.ndps_identifier_type",
7369           FT_UINT32,    BASE_HEX,   VALS(ndps_identifier_enum),   0x0,
7370           "Identifier Type", HFILL }},
7371
7372         { &hf_ndps_page_flag,
7373         { "Page Flag",    "ndps.ndps_page_flag",
7374           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7375           "Page Flag", HFILL }},
7376         
7377         { &hf_ndps_media_type,
7378         { "Media Type",    "ndps.ndps_media_type",
7379           FT_UINT32,    BASE_HEX,   VALS(ndps_media_enum),   0x0,
7380           "Media Type", HFILL }},
7381
7382         { &hf_ndps_page_size,
7383         { "Page Size",    "ndps.ndps_page_size",
7384           FT_UINT32,    BASE_HEX,   VALS(ndps_page_size_enum),   0x0,
7385           "Page Size", HFILL }},
7386      
7387         { &hf_ndps_direction,
7388         { "Direction",    "ndps.ndps_direction",
7389           FT_UINT32,    BASE_HEX,   VALS(ndps_pres_direction_enum),   0x0,
7390           "Direction", HFILL }},
7391        
7392         { &hf_ndps_page_order,
7393         { "Page Order",    "ndps.ndps_page_order",
7394           FT_UINT32,    BASE_HEX,   VALS(ndps_page_order_enum),   0x0,
7395           "Page Order", HFILL }},
7396
7397         { &hf_ndps_medium_size,
7398         { "Medium Size",    "ndps.ndps_medium_size",
7399           FT_UINT32,    BASE_HEX,   VALS(ndps_medium_size_enum),   0x0,
7400           "Medium Size", HFILL }},
7401
7402         { &hf_ndps_long_edge_feeds,
7403         { "Long Edge Feeds?",    "ndps.ndps_long_edge_feeds",
7404           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7405           "Long Edge Feeds?", HFILL }},
7406
7407         { &hf_ndps_inc_across_feed,
7408         { "Increment Across Feed",    "ndps.inc_across_feed",
7409           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7410           "Increment Across Feed", HFILL }},
7411
7412         { &hf_ndps_size_inc_in_feed,
7413         { "Size Increment in Feed",    "ndps.size_inc_in_feed",
7414           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7415           "Size Increment in Feed", HFILL }},
7416
7417         { &hf_ndps_page_orientation,
7418         { "Page Orientation",    "ndps.ndps_page_orientation",
7419           FT_UINT32,    BASE_HEX,   VALS(ndps_page_orientation_enum),   0x0,
7420           "Page Orientation", HFILL }},
7421
7422         { &hf_ndps_numbers_up,
7423         { "Numbers Up",    "ndps.ndps_numbers_up",
7424           FT_UINT32,    BASE_HEX,   VALS(ndps_numbers_up_enum),   0x0,
7425           "Numbers Up", HFILL }},
7426
7427         { &hf_ndps_xdimension,
7428         { "X Dimension",    "ndps.ndps_xdimension",
7429           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7430           "X Dimension", HFILL }},
7431         
7432         { &hf_ndps_ydimension,
7433         { "Y Dimension",    "ndps.ndps_ydimension",
7434           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7435           "Y Dimension", HFILL }},
7436         
7437         { &hf_ndps_state_severity,
7438         { "State Severity",    "ndps.ndps_state_severity",
7439           FT_UINT32,    BASE_HEX,   VALS(ndps_state_severity_enum),   0x0,
7440           "State Severity", HFILL }},
7441
7442         { &hf_ndps_training,
7443         { "Training",    "ndps.ndps_training",
7444           FT_UINT32,    BASE_HEX,   VALS(ndps_training_enum),   0x0,
7445           "Training", HFILL }},
7446
7447         { &hf_ndps_colorant_set,
7448         { "Colorant Set",    "ndps.ndps_colorant_set",
7449           FT_UINT32,    BASE_HEX,   VALS(ndps_colorant_set_enum),   0x0,
7450           "Colorant Set", HFILL }},
7451
7452         { &hf_ndps_card_enum_time,
7453         { "Cardinal, Enum, or Time",    "ndps.ndps_card_enum_time",
7454           FT_UINT32,    BASE_HEX,   VALS(ndps_card_enum_time_enum),   0x0,
7455           "Cardinal, Enum, or Time", HFILL }},
7456
7457         { &hf_ndps_attrs_arg,
7458         { "List Attribute Operation",    "ndps.ndps_attrs_arg",
7459           FT_UINT32,    BASE_HEX,   VALS(ndps_attrs_arg_enum),   0x0,
7460           "List Attribute Operation", HFILL }},
7461         
7462         { &hf_ndps_context,
7463         { "Context",    "ndps.context",
7464           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7465           "Context", HFILL }},
7466
7467         { &hf_ndps_filter,
7468         { "Filter Type",    "ndps.ndps_filter",
7469           FT_UINT32,    BASE_HEX,   VALS(ndps_filter_enum),   0x0,
7470           "Filter Type", HFILL }},
7471
7472         { &hf_ndps_item_filter,
7473         { "Filter Item Operation",    "ndps.ndps_filter_item",
7474           FT_UINT32,    BASE_HEX,   VALS(ndps_filter_item_enum),   0x0,
7475           "Filter Item Operation", HFILL }},
7476         
7477         { &hf_ndps_substring_match,
7478         { "Substring Match",    "ndps.ndps_substring_match",
7479           FT_UINT32,    BASE_HEX,   VALS(ndps_match_criteria_enum),   0x0,
7480           "Substring Match", HFILL }},
7481
7482         { &hf_ndps_time_limit,
7483         { "Time Limit",    "ndps.ndps_time_limit",
7484           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7485           "Time Limit", HFILL }},
7486
7487         { &hf_ndps_count_limit,
7488         { "Count Limit",    "ndps.ndps_count_limit",
7489           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7490           "Count Limit", HFILL }},
7491
7492         { &hf_ndps_operator,
7493         { "Operator Type",    "ndps.ndps_operator",
7494           FT_UINT32,    BASE_DEC,   VALS(ndps_operator_enum),   0x0,
7495           "Operator Type", HFILL }},
7496
7497         { &hf_ndps_password,
7498         { "Password",    "ndps.password",
7499           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7500           "Password", HFILL }},
7501         
7502         { &hf_ndps_retrieve_restrictions,
7503         { "Retrieve Restrictions",    "ndps.ndps_ret_restrict",
7504           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7505           "Retrieve Restrictions", HFILL }},
7506     
7507         { &hf_bind_security,
7508         { "Bind Security Options",    "ndps.ndps_bind_security",
7509           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7510           "Bind Security Options", HFILL }},
7511         
7512         { &hf_ndps_max_items,
7513         { "Maximum Items in List",    "ndps.ndps_max_items",
7514           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7515           "Maximum Items in List", HFILL }},
7516
7517         { &hf_ndps_status_flags,
7518         { "Status Flag",    "ndps.ndps_status_flags",
7519           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7520           "Status Flag", HFILL }},
7521
7522         { &hf_ndps_resource_list_type,
7523         { "Resource Type",    "ndps.ndps_resource_type",
7524           FT_UINT32,    BASE_DEC,   VALS(ndps_resource_type_enum),   0x0,
7525           "Resource Type", HFILL }},
7526
7527         { &hf_os_type,
7528         { "OS Type",    "ndps.os_type",
7529           FT_UINT32,    BASE_DEC,   VALS(ndps_os_type_enum),   0x0,
7530           "OS Type", HFILL }},
7531
7532         { &hf_ndps_printer_type,
7533         { "Printer Type",    "ndps.prn_type",
7534           FT_STRING,    BASE_NONE,   NULL,   0x0,
7535           "Printer Type", HFILL }},
7536
7537         { &hf_ndps_printer_manuf,
7538         { "Printer Manufacturer",    "ndps.prn_manuf",
7539           FT_STRING,    BASE_NONE,   NULL,   0x0,
7540           "Printer Manufacturer", HFILL }},
7541
7542         { &hf_ndps_inf_file_name,
7543         { "INF File Name",    "ndps.inf_file_name",
7544           FT_STRING,    BASE_NONE,   NULL,   0x0,
7545           "INF File Name", HFILL }},
7546
7547         { &hf_ndps_vendor_dir,
7548         { "Vendor Directory",    "ndps.vendor_dir",
7549           FT_STRING,    BASE_NONE,   NULL,   0x0,
7550           "Vendor Directory", HFILL }},
7551
7552         { &hf_banner_type,
7553         { "Banner Type",    "ndps.banner_type",
7554           FT_UINT32,    BASE_DEC,   VALS(ndps_banner_type_enum),   0x0,
7555           "Banner Type", HFILL }},
7556
7557         { &hf_font_type,
7558         { "Font Type",    "ndps.font_type",
7559           FT_UINT32,    BASE_DEC,   VALS(ndps_font_type_enum),   0x0,
7560           "Font Type", HFILL }},
7561
7562         { &hf_printer_id,
7563         { "Printer ID",    "ndps.printer_id",
7564           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7565           "Printer ID", HFILL }},
7566
7567         { &hf_ndps_font_name,
7568         { "Font Name",    "ndps.font_name",
7569           FT_STRING,    BASE_NONE,   NULL,   0x0,
7570           "Font Name", HFILL }},
7571
7572         { &hf_ndps_return_code,
7573         { "Return Code",    "ndps.ret_code",
7574           FT_UINT32,    BASE_HEX,   VALS(ndps_error_types),   0x0,
7575           "Return Code", HFILL }},
7576
7577         { &hf_ndps_banner_name,
7578         { "Banner Name",    "ndps.banner_name",
7579           FT_STRING,    BASE_NONE,   NULL,   0x0,
7580           "Banner Name", HFILL }},
7581
7582         { &hf_font_type_name,
7583         { "Font Type Name",    "ndps.font_type_name",
7584           FT_STRING,    BASE_NONE,   NULL,   0x0,
7585           "Font Type Name", HFILL }},
7586
7587         { &hf_font_file_name,
7588         { "Font File Name",    "ndps.font_file_name",
7589           FT_STRING,    BASE_NONE,   NULL,   0x0,
7590           "Font File Name", HFILL }},
7591
7592         { &hf_ndps_prn_file_name,
7593         { "Printer File Name",    "ndps.print_file_name",
7594           FT_STRING,    BASE_NONE,   NULL,   0x0,
7595           "Printer File Name", HFILL }},
7596
7597         { &hf_ndps_prn_dir_name,
7598         { "Printer Directory Name",    "ndps.print_dir_name",
7599           FT_STRING,    BASE_NONE,   NULL,   0x0,
7600           "Printer Directory Name", HFILL }},
7601
7602         { &hf_ndps_def_file_name,
7603         { "Printer Definition Name",    "ndps.print_def_name",
7604           FT_STRING,    BASE_NONE,   NULL,   0x0,
7605           "Printer Definition Name", HFILL }},
7606
7607         { &hf_ndps_win31_items,
7608         { "Windows 31 Keys",    "ndps.win31_keys",
7609           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7610           "Windows 31 Keys", HFILL }},
7611
7612         { &hf_ndps_win95_items,
7613         { "Windows 95 Keys",    "ndps.win95_keys",
7614           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7615           "Windows 95 Keys", HFILL }},
7616
7617         { &hf_ndps_windows_key,
7618         { "Windows Key",    "ndps.windows_key",
7619           FT_STRING,    BASE_NONE,   NULL,   0x0,
7620           "Windows Key", HFILL }},
7621
7622         { &hf_archive_type,
7623         { "Archive Type",    "ndps.archive_type",
7624           FT_UINT32,    BASE_DEC,   VALS(ndps_archive_enum),   0x0,
7625           "Archive Type", HFILL }},
7626
7627         { &hf_archive_file_size,
7628         { "Archive File Size",    "ndps.archive_size",
7629           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7630           "Archive File Size", HFILL }},
7631
7632         { &hf_ndps_segment_overlap,
7633           { "Segment overlap",  "ndps.segment.overlap", FT_BOOLEAN, BASE_NONE,
7634                 NULL, 0x0, "Segment overlaps with other segments", HFILL }},
7635     
7636         { &hf_ndps_segment_overlap_conflict,
7637           { "Conflicting data in segment overlap", "ndps.segment.overlap.conflict",
7638         FT_BOOLEAN, BASE_NONE,
7639                 NULL, 0x0, "Overlapping segments contained conflicting data", HFILL }},
7640     
7641         { &hf_ndps_segment_multiple_tails,
7642           { "Multiple tail segments found", "ndps.segment.multipletails",
7643         FT_BOOLEAN, BASE_NONE,
7644                 NULL, 0x0, "Several tails were found when desegmenting the packet", HFILL }},
7645     
7646         { &hf_ndps_segment_too_long_segment,
7647           { "Segment too long", "ndps.segment.toolongsegment", FT_BOOLEAN, BASE_NONE,
7648                 NULL, 0x0, "Segment contained data past end of packet", HFILL }},
7649     
7650         { &hf_ndps_segment_error,
7651           {"Desegmentation error",      "ndps.segment.error", FT_FRAMENUM, BASE_NONE,
7652                 NULL, 0x0, "Desegmentation error due to illegal segments", HFILL }},
7653     
7654         { &hf_ndps_segment,
7655           { "NDPS Fragment",            "ndps.fragment", FT_FRAMENUM, BASE_NONE,
7656                 NULL, 0x0, "NDPS Fragment", HFILL }},
7657     
7658         { &hf_ndps_segments,
7659           { "NDPS Fragments",   "ndps.fragments", FT_NONE, BASE_NONE,
7660                 NULL, 0x0, "NDPS Fragments", HFILL }},
7661
7662         { &hf_ndps_data,
7663           { "[Data]",   "ndps.data", FT_NONE, BASE_NONE,
7664                 NULL, 0x0, "[Data]", HFILL }},
7665
7666         { &hf_get_status_flag,
7667         { "Get Status Flag",    "ndps.get_status_flags",
7668           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7669           "Get Status Flag", HFILL }},
7670         
7671         { &hf_res_type,
7672         { "Resource Type",    "ndps.res_type",
7673           FT_UINT32,    BASE_DEC,   VALS(ndps_res_type_enum),   0x0,
7674           "Resource Type", HFILL }},
7675               
7676         { &hf_file_timestamp,
7677         { "File Time Stamp",    "ndps.file_time_stamp",
7678           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7679           "File Time Stamp", HFILL }},
7680
7681         { &hf_print_arg,
7682         { "Print Type",    "ndps.print_arg",
7683           FT_UINT32,    BASE_DEC,   VALS(ndps_print_arg_enum),   0x0,
7684           "Print Type", HFILL }},
7685
7686         { &hf_sub_complete,
7687           { "Submission Complete?",     "ndps.sub_complete", FT_BOOLEAN, BASE_NONE,
7688                 NULL, 0x0, "Submission Complete?", HFILL }},
7689
7690         { &hf_doc_content,
7691         { "Document Content",    "ndps.doc_content",
7692           FT_UINT32,    BASE_DEC,   VALS(ndps_doc_content_enum),   0x0,
7693           "Document Content", HFILL }},
7694
7695         { &hf_ndps_doc_name,
7696         { "Document Name",    "ndps.doc_name",
7697           FT_STRING,    BASE_NONE,   NULL,   0x0,
7698           "Document Name", HFILL }},
7699
7700         { &hf_local_id,
7701         { "Local ID",    "ndps.local_id",
7702           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7703           "Local ID", HFILL }},
7704
7705         { &hf_ndps_included_doc,
7706         { "Included Document",    "ndps.included_doc",
7707           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7708           "Included Document", HFILL }},
7709
7710         { &hf_ndps_ref_name,
7711         { "Referenced Document Name",    "ndps.ref_doc_name",
7712           FT_STRING,    BASE_NONE,   NULL,   0x0,
7713           "Referenced Document Name", HFILL }},
7714
7715         { &hf_interrupt_job_type,
7716         { "Interrupt Job Identifier",    "ndps.interrupt_job_type",
7717           FT_UINT32,    BASE_DEC,   VALS(ndps_interrupt_job_enum),   0x0,
7718           "Interrupt Job Identifier", HFILL }},
7719
7720         { &hf_pause_job_type,
7721         { "Pause Job Identifier",    "ndps.pause_job_type",
7722           FT_UINT32,    BASE_DEC,   VALS(ndps_pause_job_enum),   0x0,
7723           "Pause Job Identifier", HFILL }},
7724
7725         { &hf_ndps_force,
7726         { "Force?",    "ndps.ndps_force",
7727           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7728           "Force?", HFILL }},
7729
7730         { &hf_resubmit_op_type,
7731         { "Resubmit Operation Type",    "ndps.resubmit_op_type",
7732           FT_UINT32,    BASE_DEC,   VALS(ndps_resubmit_op_enum),   0x0,
7733           "Resubmit Operation Type", HFILL }},
7734
7735         { &hf_shutdown_type,
7736         { "Shutdown Type",    "ndps.shutdown_type",
7737           FT_UINT32,    BASE_DEC,   VALS(ndps_shutdown_enum),   0x0,
7738           "Shutdown Type", HFILL }},
7739
7740         { &hf_ndps_supplier_flag,
7741         { "Supplier Data?",    "ndps.supplier_flag",
7742           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7743           "Supplier Data?", HFILL }},
7744
7745         { &hf_ndps_language_flag,
7746         { "Language Data?",    "ndps.language_flag",
7747           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7748           "Language Data?", HFILL }},
7749
7750         { &hf_ndps_method_flag,
7751         { "Method Data?",    "ndps.method_flag",
7752           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7753           "Method Data?", HFILL }},
7754         
7755         { &hf_ndps_delivery_address_flag,
7756         { "Delivery Address Data?",    "ndps.delivery_flag",
7757           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7758           "Delivery Address Data?", HFILL }},
7759        
7760         { &hf_ndps_list_profiles_type,
7761         { "List Profiles Type",    "ndps.ndps_list_profiles_type",
7762           FT_UINT32,    BASE_HEX,   VALS(ndps_attrs_arg_enum),   0x0,
7763           "List Profiles Type", HFILL }},
7764     
7765         { &hf_ndps_list_profiles_choice_type,
7766         { "List Profiles Choice Type",    "ndps.ndps_list_profiles_choice_type",
7767           FT_UINT32,    BASE_HEX,   VALS(ndps_list_profiles_choice_enum),   0x0,
7768           "List Profiles Choice Type", HFILL }},
7769         
7770         { &hf_ndps_list_profiles_result_type,
7771         { "List Profiles Result Type",    "ndps.ndps_list_profiles_result_type",
7772           FT_UINT32,    BASE_HEX,   VALS(ndps_list_profiles_result_enum),   0x0,
7773           "List Profiles Result Type", HFILL }},
7774         
7775         { &hf_ndps_integer_type_flag,
7776         { "Integer Type Flag",    "ndps.ndps_integer_type_flag",
7777           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7778           "Integer Type Flag", HFILL }},
7779         
7780         { &hf_ndps_integer_type_value,
7781         { "Integer Type Value",    "ndps.ndps_integer_type_value",
7782           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7783           "Integer Type Value", HFILL }},
7784         
7785         { &hf_ndps_continuation_option,
7786         { "Continuation Option",    "ndps.ndps_continuation_option",
7787           FT_BYTES,    BASE_HEX,   NULL,   0x0,
7788           "Continuation Option", HFILL }},
7789
7790         { &hf_ndps_ds_info_type,
7791         { "DS Info Type",    "ndps.ndps_ds_info_type",
7792           FT_UINT32,    BASE_HEX,   VALS(ndps_ds_info_enum),   0x0,
7793           "DS Info Type", HFILL }},
7794
7795         { &hf_ndps_guid,
7796         { "GUID",    "ndps.guid",
7797           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7798           "GUID", HFILL }},
7799
7800         { &hf_ndps_list_services_type,
7801         { "Services Type",    "ndps.ndps_list_services_type",
7802           FT_UINT32,    BASE_HEX,   VALS(ndps_list_services_enum),   0x0,
7803           "Services Type", HFILL }},
7804
7805         { &hf_ndps_item_bytes,
7806         { "Item Ptr",    "ndps.item_bytes",
7807           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7808           "Item Ptr", HFILL }},
7809
7810         { &hf_ndps_certified,
7811         { "Certified",    "ndps.certified",
7812           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7813           "Certified", HFILL }},
7814
7815         { &hf_ndps_attribute_set,
7816         { "Attribute Set",    "ndps.attribute_set",
7817           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7818           "Attribute Set", HFILL }},
7819
7820         { &hf_ndps_data_item_type,
7821         { "Item Type",    "ndps.ndps_data_item_type",
7822           FT_UINT32,    BASE_HEX,   VALS(ndps_data_item_enum),   0x0,
7823           "Item Type", HFILL }},
7824
7825         { &hf_info_int,
7826         { "Integer Value",    "ndps.info_int",
7827           FT_UINT8,    BASE_HEX,   NULL,   0x0,
7828           "Integer Value", HFILL }},
7829
7830         { &hf_info_int16,
7831         { "16 Bit Integer Value",    "ndps.info_int16",
7832           FT_UINT16,    BASE_HEX,   NULL,   0x0,
7833           "16 Bit Integer Value", HFILL }},
7834
7835         { &hf_info_int32,
7836         { "32 Bit Integer Value",    "ndps.info_int32",
7837           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7838           "32 Bit Integer Value", HFILL }},
7839
7840         { &hf_info_boolean,
7841         { "Boolean Value",    "ndps.info_boolean",
7842           FT_BOOLEAN,    BASE_NONE,   NULL,   0x0,
7843           "Boolean Value", HFILL }},
7844
7845         { &hf_info_string,
7846         { "String Value",    "ndps.info_string",
7847           FT_STRING,    BASE_NONE,   NULL,   0x0,
7848           "String Value", HFILL }},
7849
7850         { &hf_info_bytes,
7851         { "Byte Value",    "ndps.info_bytes",
7852           FT_BYTES,    BASE_NONE,   NULL,   0x0,
7853           "Byte Value", HFILL }},
7854        
7855         { &hf_ndps_list_local_servers_type,
7856         { "Server Type",    "ndps.ndps_list_local_server_type",
7857           FT_UINT32,    BASE_HEX,   VALS(ndps_list_local_servers_enum),   0x0,
7858           "Server Type", HFILL }},
7859
7860         { &hf_ndps_registry_name,
7861         { "Registry Name",    "ndps.registry_name",
7862           FT_STRING,    BASE_NONE,   NULL,   0x0,
7863           "Registry Name", HFILL }},
7864
7865         { &hf_ndps_client_server_type,
7866         { "Client/Server Type",    "ndps.ndps_client_server_type",
7867           FT_UINT32,    BASE_HEX,   VALS(ndps_client_server_enum),   0x0,
7868           "Client/Server Type", HFILL }},
7869
7870         { &hf_ndps_session_type,
7871         { "Session Type",    "ndps.ndps_session_type",
7872           FT_UINT32,    BASE_HEX,   VALS(ndps_session_type_enum),   0x0,
7873           "Session Type", HFILL }},
7874
7875         { &hf_time,
7876         { "Time",    "ndps.time",
7877           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7878           "Time", HFILL }},
7879
7880         { &hf_ndps_supplier_name,
7881         { "Supplier Name",    "ndps.supplier_name",
7882           FT_STRING,    BASE_NONE,   NULL,   0x0,
7883           "Supplier Name", HFILL }},
7884
7885         { &hf_ndps_message,
7886         { "Message",    "ndps.message",
7887           FT_STRING,    BASE_NONE,   NULL,   0x0,
7888           "Message", HFILL }},
7889
7890         { &hf_delivery_method_type,
7891         { "Delivery Method Type",    "ndps.delivery_method_type",
7892           FT_UINT32,    BASE_HEX,   VALS(ndps_delivery_method_enum),   0x0,
7893           "Delivery Method Type", HFILL }},
7894
7895         { &hf_ndps_get_session_type,
7896         { "Session Type",    "ndps.ndps_get_session_type",
7897           FT_UINT32,    BASE_HEX,   VALS(ndps_get_session_type_enum),   0x0,
7898           "Session Type", HFILL }},
7899
7900         { &hf_packet_count,
7901         { "Packet Count",    "ndps.packet_count",
7902           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7903           "Packet Count", HFILL }},
7904
7905         { &hf_last_packet_flag,
7906         { "Last Packet Flag",    "ndps.last_packet_flag",
7907           FT_UINT32,    BASE_DEC,   NULL,   0x0,
7908           "Last Packet Flag", HFILL }},
7909
7910         { &hf_ndps_get_resman_session_type,
7911         { "Session Type",    "ndps.ndps_get_resman_session_type",
7912           FT_UINT32,    BASE_HEX,   VALS(ndps_get_resman_session_type_enum),   0x0,
7913           "Session Type", HFILL }},
7914
7915         { &hf_problem_type,
7916         { "Problem Type",    "ndps.ndps_get_resman_session_type",
7917           FT_UINT32,    BASE_HEX,   VALS(problem_type_enum),   0x0,
7918           "Problem Type", HFILL }},
7919
7920         { &hf_ndps_values,
7921         { "Number of Values",    "ndps.values",
7922           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7923           "Number of Values", HFILL }},
7924         
7925         { &hf_ndps_object_ids_7,
7926         { "Object ID Definition",    "ndps.objectid_def7",
7927           FT_NONE,    BASE_HEX,   NULL,
7928           0x0, "Object ID Definition", HFILL }},
7929         
7930         { &hf_ndps_object_ids_8,
7931         { "Object ID Definition",    "ndps.objectid_def8",
7932           FT_NONE,    BASE_HEX,   NULL,
7933           0x0, "Object ID Definition", HFILL }},
7934
7935         { &hf_ndps_object_ids_9,
7936         { "Object ID Definition",    "ndps.objectid_def9",
7937           FT_NONE,    BASE_HEX,   NULL,
7938           0x0, "Object ID Definition", HFILL }},
7939
7940         { &hf_ndps_object_ids_10,
7941         { "Object ID Definition",    "ndps.objectid_def10",
7942           FT_NONE,    BASE_HEX,   NULL,
7943           0x0, "Object ID Definition", HFILL }},
7944
7945         { &hf_ndps_object_ids_11,
7946         { "Object ID Definition",    "ndps.objectid_def11",
7947           FT_NONE,    BASE_HEX,   NULL,
7948           0x0, "Object ID Definition", HFILL }},
7949
7950         { &hf_ndps_object_ids_12,
7951         { "Object ID Definition",    "ndps.objectid_def12",
7952           FT_NONE,    BASE_HEX,   NULL,
7953           0x0, "Object ID Definition", HFILL }},
7954
7955         { &hf_ndps_object_ids_13,
7956         { "Object ID Definition",    "ndps.objectid_def13",
7957           FT_NONE,    BASE_HEX,   NULL,
7958           0x0, "Object ID Definition", HFILL }},
7959
7960         { &hf_ndps_object_ids_14,
7961         { "Object ID Definition",    "ndps.objectid_def14",
7962           FT_NONE,    BASE_HEX,   NULL,
7963           0x0, "Object ID Definition", HFILL }},
7964
7965         { &hf_ndps_object_ids_15,
7966         { "Object ID Definition",    "ndps.objectid_def15",
7967           FT_NONE,    BASE_HEX,   NULL,
7968           0x0, "Object ID Definition", HFILL }},
7969
7970         { &hf_ndps_object_ids_16,
7971         { "Object ID Definition",    "ndps.objectid_def16",
7972           FT_NONE,    BASE_HEX,   NULL,
7973           0x0, "Object ID Definition", HFILL }},
7974
7975         { &hf_ndps_attribute_time,
7976         { "Time",    "ndps.attribute_time",
7977           FT_ABSOLUTE_TIME,    BASE_DEC,   NULL,   0x0,
7978           "Time", HFILL }},
7979
7980         { &hf_print_security,
7981         { "Printer Security",    "ndps.print_security",
7982           FT_UINT32,    BASE_HEX,   VALS(ndps_print_security),   0x0,
7983           "Printer Security", HFILL }},
7984         
7985         { &hf_notify_time_interval,
7986         { "Notify Time Interval",    "ndps.notify_time_interval",
7987           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7988           "Notify Time Interval", HFILL }},
7989
7990         { &hf_notify_sequence_number,
7991         { "Notify Sequence Number",    "ndps.notify_seq_number",
7992           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7993           "Notify Sequence Number", HFILL }},
7994
7995         { &hf_notify_lease_exp_time,
7996         { "Notify Lease Expiration Time",    "ndps.notify_lease_exp_time",
7997           FT_UINT32,    BASE_HEX,   NULL,   0x0,
7998           "Notify Lease Expiration Time", HFILL }},
7999
8000         { &hf_notify_printer_uri,
8001         { "Notify Printer URI",    "ndps.notify_printer_uri",
8002           FT_STRING,    BASE_NONE,   NULL,   0x0,
8003           "Notify Printer URI", HFILL }},
8004
8005         { &hf_level,
8006         { "Level",    "ndps.level",
8007           FT_UINT32,    BASE_HEX,   NULL,   0x0,
8008           "Level", HFILL }},
8009
8010         { &hf_interval,
8011         { "Interval",    "ndps.interval",
8012           FT_UINT32,    BASE_HEX,   NULL,   0x0,
8013           "Interval", HFILL }},
8014     };
8015
8016         static gint *ett[] = {
8017                 &ett_ndps,
8018                 &ett_ndps_segments,
8019                 &ett_ndps_segment,
8020         };
8021         module_t *ndps_module;
8022         
8023         proto_ndps = proto_register_protocol("Novell Distributed Print System", "NDPS", "ndps");
8024         proto_register_field_array(proto_ndps, hf_ndps, array_length(hf_ndps));
8025         proto_register_subtree_array(ett, array_length(ett));
8026
8027         ndps_module = prefs_register_protocol(proto_ndps, NULL);
8028         prefs_register_bool_preference(ndps_module, "desegment_tcp",
8029             "Desegment all NDPS messages spanning multiple TCP segments",
8030             "Whether the NDPS dissector should desegment all messages spanning multiple TCP segments",
8031             &ndps_desegment);
8032         prefs_register_bool_preference(ndps_module, "desegment_spx",
8033             "Desegment all NDPS messages spanning multiple SPX packets",
8034             "Whether the NDPS dissector should desegment all messages spanning multiple SPX packets",
8035             &ndps_defragment);
8036         prefs_register_bool_preference(ndps_module, "show_oid",
8037             "Display NDPS Details?",
8038             "Whether or not the NDPS dissector should show object id's and other details",
8039             &ndps_show_oids);
8040
8041         register_init_routine(&ndps_init_protocol);
8042         register_postseq_cleanup_routine(&ndps_postseq_cleanup);
8043 }
8044
8045 void
8046 proto_reg_handoff_ndps(void)
8047 {
8048         dissector_handle_t ndps_handle, ndps_tcp_handle;
8049
8050         ndps_handle = create_dissector_handle(dissect_ndps_ipx, proto_ndps);
8051         ndps_tcp_handle = create_dissector_handle(dissect_ndps_tcp, proto_ndps);
8052         
8053         dissector_add("spx.socket", SPX_SOCKET_PA, ndps_handle);
8054         dissector_add("spx.socket", SPX_SOCKET_BROKER, ndps_handle);
8055         dissector_add("spx.socket", SPX_SOCKET_SRS, ndps_handle);
8056         dissector_add("spx.socket", SPX_SOCKET_ENS, ndps_handle);
8057         dissector_add("spx.socket", SPX_SOCKET_RMS, ndps_handle);
8058         dissector_add("spx.socket", SPX_SOCKET_NOTIFY_LISTENER, ndps_handle);
8059         dissector_add("tcp.port", TCP_PORT_PA, ndps_tcp_handle);
8060         dissector_add("tcp.port", TCP_PORT_BROKER, ndps_tcp_handle);
8061         dissector_add("tcp.port", TCP_PORT_SRS, ndps_tcp_handle);
8062         dissector_add("tcp.port", TCP_PORT_ENS, ndps_tcp_handle);
8063         dissector_add("tcp.port", TCP_PORT_RMS, ndps_tcp_handle);
8064         dissector_add("tcp.port", TCP_PORT_NOTIFY_LISTENER, ndps_tcp_handle);
8065         ndps_data_handle = find_dissector("data");
8066 }