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