Don't attempt to modify the data pointed to by the result of
[obnox/wireshark/wip.git] / packet-hclnfsd.c
1 /* packet-hclnfsd.c
2  * Routines for hclnfsd (Hummingbird NFS Daemon) dissection
3  * Copyright 2001, Mike Frisch <frisch@hummingbird.com>
4  *
5  * $Id: packet-hclnfsd.c,v 1.3 2001/02/06 18:43:24 guy Exp $
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@zing.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * Copied from packet-ypserv.c
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software
25  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
26  */
27
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31
32
33 #ifdef HAVE_SYS_TYPES_H
34 #include <sys/types.h>
35 #endif
36
37
38 #include "packet-rpc.h"
39 #include "packet-hclnfsd.h"
40
41 static int proto_hclnfsd = -1;
42
43 static int hf_hclnfsd_request_type = -1;
44 static int hf_hclnfsd_device = -1;
45 static int hf_hclnfsd_login = -1;
46 static int hf_hclnfsd_lockname = -1;
47 static int hf_hclnfsd_unknown_data = -1;
48 static int hf_hclnfsd_lockowner = -1;
49 static int hf_hclnfsd_printername = -1;
50 static int hf_hclnfsd_filename = -1;
51 static int hf_hclnfsd_grpname = -1;
52 static int hf_hclnfsd_hostname = -1;
53 static int hf_hclnfsd_username = -1;
54 static int hf_hclnfsd_queuename = -1;
55 static int hf_hclnfsd_queuecomment = -1;
56 static int hf_hclnfsd_printparams = -1;
57 static int hf_hclnfsd_status = -1;
58
59 static gint ett_hclnfsd = -1;
60 static gint ett_hclnfsd_gids = -1;
61 static gint ett_hclnfsd_groups = -1;
62 static gint ett_hclnfsd_uids = -1;
63 static gint ett_hclnfsd_usernames = -1;
64 static gint ett_hclnfsd_printqueues = -1;
65 static gint ett_hclnfsd_printjob = -1;
66
67
68 /* defined in 'packet-nfs.c' */
69 extern int
70 dissect_nfs_fh3(const u_char *, int, frame_data *, proto_tree *, char *);
71
72
73 int
74 dissect_hclnfsd_gids(const u_char *pd, int offset, frame_data *fd, 
75         proto_tree *tree)
76 {
77         guint ngids, ngids_i, gid;
78         proto_tree *gidtree = NULL;
79         proto_item *giditem = NULL;
80
81         if (!tree) return offset;
82
83         ngids = EXTRACT_UINT(pd, offset);
84         if (tree)
85         {
86                 giditem = proto_tree_add_text(tree, NullTVB, offset, 4, "GIDs: %d", 
87                         ngids);
88                 if (giditem)
89                         gidtree = proto_item_add_subtree(giditem, ett_hclnfsd_gids);
90         }
91         offset += 4;
92
93         if (gidtree)
94         {
95                 for (ngids_i = 0; ngids_i < ngids; ngids_i++)
96                 {
97                         gid = EXTRACT_UINT(pd, offset + (4 * ngids_i));
98                         proto_tree_add_text(gidtree, NullTVB, offset + (4 * ngids_i), 4, 
99                                 "GID: %d", gid);
100                 }
101         }
102         offset += 4 * ngids;
103
104         return offset;
105 }
106         
107 int
108 dissect_hclnfsd_spool_inquire_call(const u_char *pd, int offset, 
109         frame_data *fd, proto_tree *tree)
110 {
111         offset = dissect_rpc_uint32(pd, offset, fd, tree, "status");
112
113         offset = dissect_nfs_fh3(pd, offset, fd, tree, "spool filehandle");
114
115         return offset;
116 }
117
118
119 int
120 dissect_hclnfsd_spool_file_call(const u_char *pd, int offset,
121         frame_data *fd, proto_tree *tree)
122 {
123         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_printername,
124                 NULL);
125
126         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_filename,
127                 NULL);
128
129         offset = dissect_rpc_uint32(pd, offset, fd, tree, "File Extension");
130
131         return offset;
132 }
133
134
135 static const value_string names_request_type[] = {
136 #define HCLNFSD_DISK_REQUEST 4
137         { HCLNFSD_DISK_REQUEST, "DISK" },
138 #define HCLNFSD_PRINT_REQUEST 3
139         { HCLNFSD_PRINT_REQUEST, "PRINTER" },
140         { 0, NULL }
141 };
142
143
144 int
145 dissect_hclnfsd_authorize_call(const u_char *pd, int offset,
146         frame_data *fd, proto_tree *tree)
147 {
148         guint request_type;
149
150         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Server IP");
151
152         request_type = EXTRACT_UINT(pd, offset);
153         if (tree)
154                 proto_tree_add_uint(tree, hf_hclnfsd_request_type, NullTVB, offset,
155                         4, request_type);
156         offset += 4;
157
158         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_device, NULL);
159
160         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_login, NULL);
161
162         return offset;
163 }
164
165
166 int
167 dissect_hclnfsd_authorize_reply(const u_char *pd, int offset,
168         frame_data *fd, proto_tree *tree)
169 {
170         guint status;
171
172         status = EXTRACT_UINT(pd, offset);
173         if (!tree) return offset;
174         offset += 4;
175
176         if (status != 0)
177                 return offset;
178
179         proto_tree_add_uint(tree, hf_hclnfsd_status, NullTVB, offset, 4, status);
180
181         offset = dissect_rpc_uint32(pd, offset, fd, tree, "UID");
182
183         offset = dissect_rpc_uint32(pd, offset, fd, tree, "GID");
184
185         offset = dissect_hclnfsd_gids(pd, offset, fd, tree);
186
187         return offset;
188 }
189
190 int
191 dissect_hclnfsd_grp_name_to_numb_call(const u_char *pd, int offset,
192         frame_data *fd, proto_tree *tree)
193 {
194         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_grpname,
195                 NULL);
196
197         return offset;
198 }
199
200
201 int
202 dissect_hclnfsd_grp_name_to_numb_reply(const u_char *pd, int offset,
203         frame_data *fd, proto_tree *tree)
204 {
205         offset = dissect_rpc_uint32(pd, offset, fd, tree, "GID");
206         
207         return offset;
208 }
209
210
211 int
212 dissect_hclnfsd_grp_to_number_call(const u_char *pd, int offset,
213         frame_data *fd, proto_tree *tree)
214 {
215
216         offset = dissect_hclnfsd_gids(pd, offset, fd, tree);
217
218         return offset;
219 }
220
221
222 int
223 dissect_hclnfsd_grp_to_number_reply(const u_char *pd, int offset,
224         frame_data *fd, proto_tree *tree)
225 {
226         guint ngrpnames, ngrpnames_i;
227         proto_tree *grptree = NULL;
228         proto_item *grpitem = NULL;
229
230         ngrpnames = EXTRACT_UINT(pd, offset);
231         if (tree)
232         {
233                 grpitem = proto_tree_add_text(tree, NullTVB, offset, 4, "Groups: %d",
234                         ngrpnames);
235
236                 if (grpitem)
237                         grptree = proto_item_add_subtree(grpitem, ett_hclnfsd_groups);
238         }
239         offset += 4;
240
241         if (!grptree)
242                 return offset;
243
244         for (ngrpnames_i = 0; ngrpnames_i < ngrpnames ; ngrpnames_i++)
245                 offset = dissect_rpc_string(pd, offset, fd, grptree, 
246                         hf_hclnfsd_grpname, NULL);
247         
248         return offset;
249 }
250
251
252 int
253 dissect_hclnfsd_return_host_call(const u_char *pd, int offset,
254         frame_data *fd, proto_tree *tree)
255 {
256         offset = dissect_rpc_uint32(pd, offset, fd, tree, "IP");
257
258         return offset;
259 }
260
261
262 int
263 dissect_hclnfsd_return_host_reply(const u_char *pd, int offset,
264         frame_data *fd, proto_tree *tree)
265 {
266         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_hostname, NULL);
267
268         return offset;
269 }
270
271
272 int
273 dissect_hclnfsd_uid_to_name_call(const u_char *pd, int offset,
274         frame_data *fd, proto_tree *tree)
275 {
276         guint nuids, nuids_i;
277         proto_tree *uidtree = NULL;
278         proto_item *uiditem = NULL;
279
280         nuids = EXTRACT_UINT(pd, offset);
281         if (tree)
282         {
283                 uiditem = proto_tree_add_text(tree, NullTVB, offset, 4, "UIDs: %d",
284                         nuids);
285
286                 if (uiditem)
287                         uidtree = proto_item_add_subtree(uiditem, ett_hclnfsd_uids);
288         }
289         offset += 4;
290
291         if (!uidtree)
292                 return offset;
293
294         for (nuids_i = 0; nuids_i < nuids; nuids_i++)
295                 offset = dissect_rpc_uint32(pd, offset, fd, uidtree, "UID");
296
297         return offset;
298 }
299
300
301 int
302 dissect_hclnfsd_uid_to_name_reply(const u_char *pd, int offset,
303         frame_data *fd, proto_tree *tree)
304 {
305         guint nusers, nusers_i;
306         proto_tree *usertree = NULL;
307         proto_item *useritem = NULL;
308
309         nusers = EXTRACT_UINT(pd, offset);
310         if (tree)
311         {
312                 useritem = proto_tree_add_text(tree, NullTVB, offset, 4, "UIDs: %d",
313                         nusers);
314
315                 if (useritem)
316                         usertree = proto_item_add_subtree(useritem, ett_hclnfsd_usernames);
317         }
318         offset += 4;
319
320         if (!usertree)
321                 return offset;
322
323         for (nusers_i = 0; nusers_i < nusers; nusers_i++)
324                 offset = dissect_rpc_string(pd, offset, fd, usertree, 
325                         hf_hclnfsd_username, NULL);
326
327         return offset;
328 }
329
330
331 int
332 dissect_hclnfsd_name_to_uid_call(const u_char *pd, int offset,
333         frame_data *fd, proto_tree *tree)
334 {
335         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_username, NULL);
336
337         return offset;
338 }
339
340
341 int
342 dissect_hclnfsd_name_to_uid_reply(const u_char *pd, int offset,
343         frame_data *fd, proto_tree *tree)
344 {
345         offset = dissect_rpc_uint32(pd, offset, fd, tree, "UID");
346
347         return offset;
348 }
349
350
351 int
352 dissect_hclnfsd_share_call(const u_char *pd, int offset,
353         frame_data *fd, proto_tree *tree)
354 {
355         guint request_type;
356
357         request_type = EXTRACT_UINT(pd, offset);
358         if (tree)
359                 proto_tree_add_uint(tree, hf_hclnfsd_request_type, NullTVB, offset,
360                         4, request_type);
361         offset += 4;
362
363         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Cookie");
364
365         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_lockname, NULL);
366
367         offset = dissect_nfs_fh3(pd, offset, fd, tree, "Filehandle");
368
369         offset = dissect_rpc_data(pd, offset, fd, tree, hf_hclnfsd_unknown_data);
370
371         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Mode");
372
373         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Access");
374
375         offset = dissect_rpc_uint32(pd, offset, fd, tree, "unused");
376
377         return offset;
378 }
379
380
381 int
382 dissect_hclnfsd_share_reply(const u_char *pd, int offset,
383         frame_data *fd, proto_tree *tree)
384 {
385         guint request_type;
386
387         request_type = EXTRACT_UINT(pd, offset);
388         if (tree)
389                 proto_tree_add_uint(tree, hf_hclnfsd_request_type, NullTVB, offset,
390                         4, request_type);
391         offset += 4;
392
393         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Cookie");
394
395         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Stat");
396
397         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Sequence");
398
399         return offset;
400 }
401
402
403 int
404 dissect_hclnfsd_unshare_call(const u_char *pd, int offset,
405         frame_data *fd, proto_tree *tree)
406 {
407         return dissect_hclnfsd_share_call(pd, offset, fd, tree);
408 }
409
410
411 int
412 dissect_hclnfsd_unshare_reply(const u_char *pd, int offset,
413         frame_data *fd, proto_tree *tree)
414 {
415         return dissect_hclnfsd_share_reply(pd, offset, fd, tree);
416 }
417
418
419 int
420 dissect_hclnfsd_lock_call(const u_char *pd, int offset,
421         frame_data *fd, proto_tree *tree)
422 {
423         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Status");
424
425         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Cookie");
426
427         offset = dissect_rpc_uint32(pd, offset, fd, tree, "unused");
428
429         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Exclusive");
430
431         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_lockname, NULL);
432
433         offset = dissect_nfs_fh3(pd, offset, fd, tree, "Filehandle");
434
435         offset = dissect_rpc_data(pd, offset, fd, tree, hf_hclnfsd_lockowner);
436
437         offset = dissect_rpc_uint32(pd, offset, fd, tree, "unused");
438
439         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Offset");
440
441         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Length");
442
443         return offset;
444 }
445
446
447 int
448 dissect_hclnfsd_lock_reply(const u_char *pd, int offset,
449         frame_data *fd, proto_tree *tree)
450 {
451         guint request_type;
452
453         request_type = EXTRACT_UINT(pd, offset);
454         if (tree)
455                 proto_tree_add_uint(tree, hf_hclnfsd_request_type, NullTVB, offset,
456                         4, request_type);
457         offset += 4;
458
459         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Cookie");
460
461         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Stat");
462
463         return offset;
464 }
465
466
467 int
468 dissect_hclnfsd_remove_call(const u_char *pd, int offset,
469         frame_data *fd, proto_tree *tree)
470 {
471         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_lockname, NULL);
472
473         offset = dissect_rpc_uint32(pd, offset, fd, tree, "unused");
474
475         return offset;
476 }
477
478
479 int
480 dissect_hclnfsd_unlock_call(const u_char *pd, int offset,
481         frame_data *fd, proto_tree *tree)
482 {
483         offset = dissect_rpc_uint32(pd, offset, fd, tree, "unused");
484
485         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Cookie");
486
487         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_lockname, NULL);
488
489         offset = dissect_nfs_fh3(pd, offset, fd, tree, "Filehandle");
490
491         offset = dissect_rpc_data(pd, offset, fd, tree, hf_hclnfsd_unknown_data);
492
493         offset = dissect_rpc_uint32(pd, offset, fd, tree, "unused");
494
495         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Offset");
496
497         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Length");
498         
499         return offset;
500 }
501
502
503 int
504 dissect_hclnfsd_unlock_reply(const u_char *pd, int offset,
505         frame_data *fd, proto_tree *tree)
506 {
507         return dissect_hclnfsd_lock_reply(pd, offset, fd, tree);
508 }
509
510
511 int
512 dissect_hclnfsd_get_printers_reply(const u_char *pd, int offset,
513         frame_data *fd, proto_tree *tree)
514 {
515         guint nqueues, nqueues_i;
516         proto_item *queuesitem = NULL;
517         proto_tree *queuestree = NULL;
518
519         nqueues = EXTRACT_UINT(pd, offset);
520         if (tree)
521         {
522                 queuesitem = proto_tree_add_text(tree, NullTVB, offset, 4,
523                         "Print Queues: %d", nqueues);
524
525                 if (queuesitem)
526                         queuestree = proto_item_add_subtree(queuesitem, 
527                                 ett_hclnfsd_printqueues);
528         }
529         offset += 4;
530
531         if (!queuestree)
532                 return offset;
533
534         for (nqueues_i = 0; nqueues_i < nqueues; nqueues_i++)
535         {
536                 /* create new item for print queue */
537                 offset = dissect_rpc_string(pd, offset, fd, queuestree,
538                         hf_hclnfsd_queuename, NULL);
539
540                 /* create subtree on new item with print queue comment */
541
542                 offset = dissect_rpc_string(pd, offset, fd, queuestree, 
543                         hf_hclnfsd_queuecomment, NULL);
544         }
545
546         return offset;
547 }
548
549
550 int
551 dissect_hclnfsd_get_printq_call(const u_char *pd, int offset,
552         frame_data *fd, proto_tree *tree)
553 {
554         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_queuename, 
555                 NULL);
556
557         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_username, NULL);
558
559         return offset;
560 }
561
562
563 int
564 dissect_hclnfsd_get_printq_reply(const u_char *pd, int offset,
565         frame_data *fd, proto_tree *tree)
566 {
567         guint datafollows, jobid;
568         proto_item *queueitem = NULL;
569         proto_tree *queuetree = NULL;
570         proto_item *jobitem;
571         proto_tree *jobtree;
572
573         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Print Queue Number");
574
575         offset = dissect_rpc_string(pd, offset, fd, tree, hf_hclnfsd_queuecomment,
576                 NULL);
577
578         offset = dissect_rpc_uint32(pd, offset, fd, tree, "Queue Status");
579
580         offset = dissect_rpc_uint32(pd, offset, fd, tree, 
581                 "Number of Physical Printers");
582
583         datafollows = EXTRACT_UINT(pd, offset);
584         if (tree)
585         {
586                 queueitem = proto_tree_add_text(tree, NullTVB, offset, 4, 
587                         "Print Jobs: %d", datafollows);
588                 if (queueitem)
589                         queuetree = proto_item_add_subtree(queueitem, ett_hclnfsd_printqueues);
590         }
591         offset += 4;
592
593         if (!queuetree)
594                 return offset;
595         
596         while (datafollows)
597         {
598                 jobid = EXTRACT_UINT(pd, offset);
599                 jobitem = proto_tree_add_text(queuetree, NullTVB, offset, 4, "Job ID: %d",
600                         jobid);
601                 offset += 4;
602
603                 jobtree = proto_item_add_subtree(jobitem, ett_hclnfsd_printjob);
604                         
605                 offset = dissect_rpc_string(pd, offset, fd, jobtree, 
606                         hf_hclnfsd_username, NULL);
607                 offset = dissect_rpc_string(pd, offset, fd, jobtree,
608                         hf_hclnfsd_printparams, NULL);
609                 offset = dissect_rpc_uint32(pd, offset, fd, jobtree, "Queue Position");
610                 offset = dissect_rpc_uint32(pd, offset, fd, jobtree, "Job Status");
611                 offset = dissect_rpc_uint32(pd, offset, fd, jobtree, "Time Submitted");
612                 offset = dissect_rpc_uint32(pd, offset, fd, jobtree, "Size");
613                 offset = dissect_rpc_uint32(pd, offset, fd, jobtree, "Copies");
614                 offset = dissect_rpc_string(pd, offset, fd, jobtree, 
615                         hf_hclnfsd_queuecomment, NULL);
616                 datafollows = EXTRACT_UINT(pd, offset);
617                 offset += 4;
618         }
619
620         return offset;
621 }
622
623
624 /* proc number, "proc name", dissect_request, dissect_reply */
625 /* NULL as function pointer means: take the generic one. */
626
627 static const old_vsff hclnfsd1_proc[] = {
628     { HCLNFSDPROC_NULL, "NULL", 
629                 NULL, NULL },
630     { HCLNFSDPROC_SPOOL_INQUIRE, "SPOOL_INQUIRE",
631                 dissect_hclnfsd_spool_inquire_call, NULL }, 
632     { HCLNFSDPROC_SPOOL_FILE, "SPOOL_FILE",
633                 dissect_hclnfsd_spool_file_call, NULL }, 
634     { HCLNFSDPROC_AUTHORIZE, "AUTHORIZE",
635                 dissect_hclnfsd_authorize_call, dissect_hclnfsd_authorize_reply }, 
636     { HCLNFSDPROC_GRP_NAME_TO_NUMB, "GRP_NAME_TO_NUMB",
637                 dissect_hclnfsd_grp_name_to_numb_call, dissect_hclnfsd_grp_name_to_numb_reply }, 
638     { HCLNFSDPROC_GRP_TO_NUMBER, "GRP_TO_NUMBER",
639                 dissect_hclnfsd_grp_to_number_call, dissect_hclnfsd_grp_to_number_reply },
640     { HCLNFSDPROC_RETURN_HOST, "RETURN_HOST",
641                 dissect_hclnfsd_return_host_call, dissect_hclnfsd_return_host_reply }, 
642     { HCLNFSDPROC_UID_TO_NAME, "UID_TO_NAME",
643                 dissect_hclnfsd_uid_to_name_call, dissect_hclnfsd_uid_to_name_reply }, 
644     { HCLNFSDPROC_NAME_TO_UID, "NAME_TO_UID",
645                 dissect_hclnfsd_name_to_uid_call, dissect_hclnfsd_name_to_uid_reply }, 
646     { HCLNFSDPROC_SHARE, "SHARE",
647                 dissect_hclnfsd_share_call, dissect_hclnfsd_share_reply }, 
648     { HCLNFSDPROC_UNSHARE, "UNSHARE",
649                 dissect_hclnfsd_unshare_call, dissect_hclnfsd_unshare_reply }, 
650     { HCLNFSDPROC_LOCK, "LOCK",
651                 dissect_hclnfsd_lock_call, dissect_hclnfsd_lock_reply }, 
652     { HCLNFSDPROC_REMOVE, "REMOVE",
653                 dissect_hclnfsd_remove_call, NULL }, 
654     { HCLNFSDPROC_UNLOCK, "UNLOCK",
655                 dissect_hclnfsd_unlock_call, dissect_hclnfsd_unlock_reply }, 
656     { HCLNFSDPROC_GET_PRINTERS, "GET_PRINTERS",
657                 NULL, dissect_hclnfsd_get_printers_reply }, 
658     { HCLNFSDPROC_GET_PRINTQ, "GET_PRINTQ",
659                 dissect_hclnfsd_get_printq_call, dissect_hclnfsd_get_printq_reply }, 
660     { HCLNFSDPROC_CANCEL_PRJOB, "CANCEL_PRJOB",
661                 NULL, NULL }, 
662     { HCLNFSDPROC_ZAP_LOCKS, "ZAP_LOCKS",
663                 NULL, NULL }, 
664     { 0, NULL, NULL, NULL }
665 };
666 /* end of hclnfsd version 1 */
667
668
669 void
670 proto_register_hclnfsd(void)
671 {
672 #if 0
673         static struct true_false_string okfailed = { "Ok", "Failed" };
674         static struct true_false_string yesno = { "Yes", "No" };
675 #endif
676                 
677         static hf_register_info hf[] = {
678                 { &hf_hclnfsd_request_type, {
679                         "Request Type", "hclnfsd.request_type", FT_UINT32, BASE_DEC,
680                         VALS(names_request_type), 0, "Request Type" }},
681
682                 { &hf_hclnfsd_device, {
683                         "Device", "hclnfsd.device", FT_STRING, BASE_DEC,
684                         NULL, 0, "Device" }},
685
686                 { &hf_hclnfsd_login, {
687                         "Login Text", "hclnfsd.logintext", FT_STRING, BASE_DEC,
688                         NULL, 0, "Login Text" }},
689
690                 { &hf_hclnfsd_lockname, {
691                         "Lockname", "hclnfsd.lockname", FT_STRING, BASE_DEC,
692                         NULL, 0, "Lockname" }},
693
694                 { &hf_hclnfsd_unknown_data, {
695                         "Unknown", "hclnfsd.unknown_data", FT_STRING, BASE_DEC,
696                         NULL, 0, "Data" }},
697
698                 { &hf_hclnfsd_lockowner, {
699                         "Lockowner", "hclnfsd.lockowner", FT_STRING, BASE_DEC,
700                         NULL, 0, "Lockowner" }},
701
702                 { &hf_hclnfsd_printername, {
703                         "Printer Name", "hclnfsd.printername", FT_STRING, BASE_DEC,
704                         NULL, 0, "Printer name" }},
705
706                 { &hf_hclnfsd_filename, {
707                         "Filename", "hclnfsd.filename", FT_STRING, BASE_DEC,
708                         NULL, 0, "Filename" }},
709
710                 { &hf_hclnfsd_grpname, {
711                         "Group", "hclnfsd.group", FT_STRING, BASE_DEC,
712                         NULL, 0, "Group" }},
713
714                 { &hf_hclnfsd_hostname, {
715                         "Hostname", "hclnfsd.hostname", FT_STRING, BASE_DEC,
716                         NULL, 0, "Hostname" }},
717
718                 { &hf_hclnfsd_username, {
719                         "Username", "hclnfsd.username", FT_STRING, BASE_DEC,
720                         NULL, 0, "Username" }},
721
722                 { &hf_hclnfsd_queuename, {
723                         "Name", "hclnfsd.printqueuename", FT_STRING, BASE_DEC,
724                         NULL, 0, "Print Queue Name" }},
725
726                 { &hf_hclnfsd_queuecomment, {
727                         "Comment", "hclnfsd.printqueuecomment", FT_STRING, BASE_DEC,
728                         NULL, 0, "Print Queue Comment" }},
729
730                 { &hf_hclnfsd_printparams, {
731                         "Print Parameters", "hclnfsd.printparameters", FT_STRING, BASE_DEC,
732                         NULL, 0, "Print Parameters" }},
733
734                 { &hf_hclnfsd_status, {
735                         "Status", "hclnfsd.status", FT_UINT32, BASE_DEC,
736                         NULL, 0, "Status" }}
737         };
738         static gint *ett[] = {
739                 &ett_hclnfsd,
740                 &ett_hclnfsd_gids,
741                 &ett_hclnfsd_groups,
742                 &ett_hclnfsd_uids,
743                 &ett_hclnfsd_usernames,
744                 &ett_hclnfsd_printqueues,
745                 &ett_hclnfsd_printjob,
746         };
747
748         proto_hclnfsd = proto_register_protocol("Hummingbird NFS Daemon", 
749                 "HCLNFSD", "hclnfsd");
750         proto_register_field_array(proto_hclnfsd, hf, array_length(hf));
751         proto_register_subtree_array(ett, array_length(ett));
752 }
753
754 void
755 proto_reg_handoff_hclnfsd(void)
756 {
757         /* Register the protocol as RPC */
758         rpc_init_prog(proto_hclnfsd, HCLNFSD_PROGRAM, ett_hclnfsd);
759
760         /* Register the procedure tables */
761         old_rpc_init_proc_table(HCLNFSD_PROGRAM, 1, hclnfsd1_proc);
762 }