Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-hclnfsd.c
blob8112f600e7099cef847cc64151ca7e829d5cae37
1 /* packet-hclnfsd.c
2 * Routines for hclnfsd (Hummingbird NFS Daemon) dissection
3 * Copyright 2001, Mike Frisch <frisch@hummingbird.com>
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * Copied from packet-ypserv.c
11 * SPDX-License-Identifier: GPL-2.0-or-later
14 #include "config.h"
17 #include "packet-nfs.h"
20 void proto_register_hclnfsd(void);
21 void proto_reg_handoff_hclnfsd(void);
23 #define HCLNFSD_PROGRAM 0x2f00dbad
25 #define HCLNFSDPROC_NULL 0
26 #define HCLNFSDPROC_SPOOL_INQUIRE 1
27 #define HCLNFSDPROC_SPOOL_FILE 2
28 #define HCLNFSDPROC_AUTHORIZE 3
29 #define HCLNFSDPROC_GRP_NAME_TO_NUMB 4
30 #define HCLNFSDPROC_GRP_TO_NUMBER 5
31 #define HCLNFSDPROC_RETURN_HOST 6
32 #define HCLNFSDPROC_UID_TO_NAME 7
33 #define HCLNFSDPROC_NAME_TO_UID 8
34 #define HCLNFSDPROC_SHARE 20
35 #define HCLNFSDPROC_UNSHARE 21
36 #define HCLNFSDPROC_LOCK 22
37 #define HCLNFSDPROC_REMOVE 23
38 #define HCLNFSDPROC_UNLOCK 24
39 #define HCLNFSDPROC_GET_PRINTERS 30
40 #define HCLNFSDPROC_GET_PRINTQ 31
41 #define HCLNFSDPROC_CANCEL_PRJOB 32
42 #define HCLNFSDPROC_ZAP_LOCKS 105
44 static int proto_hclnfsd;
45 static int hf_hclnfsd_procedure_v1;
46 static int hf_hclnfsd_request_type;
47 static int hf_hclnfsd_device;
48 /* static int hf_hclnfsd_login; */
49 static int hf_hclnfsd_lockname;
50 static int hf_hclnfsd_unknown_data;
51 static int hf_hclnfsd_lockowner;
52 static int hf_hclnfsd_printername;
53 static int hf_hclnfsd_filename;
54 static int hf_hclnfsd_fileext;
55 static int hf_hclnfsd_grpname;
56 static int hf_hclnfsd_hostname;
57 static int hf_hclnfsd_username;
58 static int hf_hclnfsd_queuename;
59 static int hf_hclnfsd_queuecomment;
60 static int hf_hclnfsd_queuestatus;
61 static int hf_hclnfsd_numphysicalprinters;
62 static int hf_hclnfsd_printqueuenumber;
63 static int hf_hclnfsd_printparams;
64 static int hf_hclnfsd_status;
65 static int hf_hclnfsd_sequence;
66 static int hf_hclnfsd_server_ip;
67 static int hf_hclnfsd_host_ip;
68 static int hf_hclnfsd_gid;
69 static int hf_hclnfsd_uid;
70 static int hf_hclnfsd_cookie;
71 static int hf_hclnfsd_mode;
72 static int hf_hclnfsd_access;
73 static int hf_hclnfsd_exclusive;
74 static int hf_hclnfsd_offset;
75 static int hf_hclnfsd_length;
76 static int hf_hclnfsd_jobstatus;
77 static int hf_hclnfsd_timesubmitted;
78 static int hf_hclnfsd_size;
79 static int hf_hclnfsd_copies;
80 static int hf_hclnfsd_auth_ident_obscure;
82 /* Generated from convert_proto_tree_add_text.pl */
83 static int hf_hclnfsd_job_id;
84 static int hf_hclnfsd_print_queues;
85 static int hf_hclnfsd_print_jobs;
86 static int hf_hclnfsd_gids;
87 static int hf_hclnfsd_uids;
88 static int hf_hclnfsd_password;
90 static int ett_hclnfsd;
91 static int ett_hclnfsd_gids;
92 static int ett_hclnfsd_groups;
93 static int ett_hclnfsd_uids;
94 static int ett_hclnfsd_usernames;
95 static int ett_hclnfsd_printqueues;
96 static int ett_hclnfsd_printjob;
97 static int ett_hclnfsd_auth_ident;
99 static int
100 dissect_hclnfsd_gids(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree)
102 uint32_t ngids, ngids_i;
103 proto_tree *gidtree = NULL;
104 proto_item *giditem = NULL;
107 ngids = tvb_get_ntohl(tvb, offset);
108 if (tree)
110 giditem = proto_tree_add_item(tree, hf_hclnfsd_gids, tvb, offset, 4, ENC_BIG_ENDIAN);
111 gidtree = proto_item_add_subtree(giditem, ett_hclnfsd_gids);
113 offset += 4;
115 if (gidtree)
117 for (ngids_i = 0; ngids_i < ngids; ngids_i++)
119 proto_tree_add_item(gidtree, hf_hclnfsd_gid, tvb, offset + (4 * ngids_i), 4, ENC_BIG_ENDIAN);
122 offset += 4 * ngids;
124 return offset;
127 static int
128 dissect_hclnfsd_spool_inquire_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
130 int offset = 0;
131 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_status, offset);
133 offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "spool filehandle", NULL, (rpc_call_info_value*)data);
135 return offset;
139 static int
140 dissect_hclnfsd_spool_file_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
142 int offset = 0;
144 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_printername, offset, NULL);
146 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_filename, offset, NULL);
148 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_fileext, offset);
150 return offset;
154 static const value_string names_request_type[] = {
155 #define HCLNFSD_DISK_REQUEST 4
156 { HCLNFSD_DISK_REQUEST, "DISK" },
157 #define HCLNFSD_PRINT_REQUEST 3
158 { HCLNFSD_PRINT_REQUEST, "PRINTER" },
159 { 0, NULL }
162 static char *
163 hclnfsd_decode_obscure(wmem_allocator_t *pool, const char *ident, int ident_len)
165 char *ident_decoded, *ident_out;
166 int j, x, y;
168 ident_decoded = (char *)wmem_alloc(pool, ident_len);
169 ident_out = ident_decoded;
170 for (x = -1, j = 0; j < ident_len; j++)
172 y = *ident;
173 x ^= *ident;
174 *ident_out = x;
175 x = y;
176 ident++;
177 ident_out++;
179 return ident_decoded;
183 static int
184 dissect_hclnfsd_authorize_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
186 uint32_t request_type;
187 const char *ident = NULL;
188 char *ident_decoded;
189 char *username = NULL;
190 char *password = NULL;
191 int ident_len = 0;
192 int newoffset;
193 proto_item *ident_item = NULL;
194 proto_tree *ident_tree = NULL;
195 int offset = 0;
197 proto_tree_add_item(tree, hf_hclnfsd_server_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
198 offset += 4;
200 request_type = tvb_get_ntohl(tvb, offset);
201 proto_tree_add_uint(tree, hf_hclnfsd_request_type, tvb, offset,
202 4, request_type);
203 offset += 4;
205 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_device, offset,
206 NULL);
208 ident_tree = proto_tree_add_subtree(tree, tvb, offset, -1,
209 ett_hclnfsd_auth_ident, &ident_item, "Authentication Ident");
211 if (ident_tree)
213 newoffset = dissect_rpc_string(tvb, ident_tree,
214 hf_hclnfsd_auth_ident_obscure, offset, &ident);
216 if (ident)
218 ident_len = (int)strlen(ident);
220 proto_item_set_len(ident_item, ident_len);
222 ident_decoded = hclnfsd_decode_obscure(pinfo->pool, ident, ident_len);
224 username = ident_decoded + 2;
225 password = username + strlen(username) + 1;
227 proto_tree_add_string(ident_tree, hf_hclnfsd_username, tvb, offset, ident_len, username);
228 proto_tree_add_string(ident_tree, hf_hclnfsd_password, tvb, offset, ident_len, password);
230 offset = newoffset;
234 return offset;
238 static int
239 dissect_hclnfsd_authorize_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
241 uint32_t status;
242 int offset = 0;
244 status = tvb_get_ntohl(tvb, offset);
245 if (!tree)
246 return offset;
247 offset += 4;
249 if (status != 0)
250 return offset;
252 proto_tree_add_uint(tree, hf_hclnfsd_status, tvb, offset, 4, status);
254 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_uid, offset);
256 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_gid, offset);
258 offset = dissect_hclnfsd_gids(tvb, offset, pinfo, tree);
260 return offset;
263 static int
264 dissect_hclnfsd_grp_name_to_numb_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
266 return dissect_rpc_string(tvb, tree, hf_hclnfsd_grpname, 0, NULL);
269 static int
270 dissect_hclnfsd_grp_name_to_numb_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
272 return dissect_rpc_uint32(tvb, tree, hf_hclnfsd_gid, 0);
276 static int
277 dissect_hclnfsd_grp_to_number_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
279 return dissect_hclnfsd_gids(tvb, 0, pinfo, tree);
283 static int
284 dissect_hclnfsd_grp_to_number_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
286 return dissect_rpc_string(tvb, tree, hf_hclnfsd_grpname, 0, NULL);
290 static int
291 dissect_hclnfsd_return_host_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
293 int offset = 0;
294 proto_tree_add_item(tree, hf_hclnfsd_host_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
295 offset += 4;
297 return offset;
301 static int
302 dissect_hclnfsd_return_host_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
304 return dissect_rpc_string(tvb, tree, hf_hclnfsd_hostname, 0, NULL);
308 static int
309 dissect_hclnfsd_uid_to_name_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
311 uint32_t nuids, nuids_i;
312 proto_tree *uidtree = NULL;
313 proto_item *uiditem = NULL;
314 int offset = 0;
316 nuids = tvb_get_ntohl(tvb, offset);
317 if (tree)
319 uiditem = proto_tree_add_item(tree, hf_hclnfsd_uids, tvb, offset, 4, ENC_BIG_ENDIAN);
321 if (uiditem)
322 uidtree = proto_item_add_subtree(uiditem, ett_hclnfsd_uids);
324 offset += 4;
326 for (nuids_i = 0; nuids_i < nuids; nuids_i++)
327 offset = dissect_rpc_uint32(tvb, uidtree, hf_hclnfsd_uid, offset);
329 return offset;
333 static int
334 dissect_hclnfsd_uid_to_name_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
336 uint32_t nusers, nusers_i;
337 proto_tree *usertree = NULL;
338 proto_item *useritem = NULL;
339 int offset = 0;
341 nusers = tvb_get_ntohl(tvb, offset);
342 if (tree)
344 useritem = proto_tree_add_item(tree, hf_hclnfsd_uids, tvb, offset, 4, ENC_BIG_ENDIAN);
346 if (useritem)
347 usertree = proto_item_add_subtree(useritem, ett_hclnfsd_usernames);
349 offset += 4;
351 if (!usertree)
352 return offset;
354 for (nusers_i = 0; nusers_i < nusers; nusers_i++)
355 offset = dissect_rpc_string(tvb, usertree,
356 hf_hclnfsd_username, offset, NULL);
358 return offset;
362 static int
363 dissect_hclnfsd_name_to_uid_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
365 return dissect_rpc_string(tvb, tree, hf_hclnfsd_username, 0, NULL);
369 static int
370 dissect_hclnfsd_name_to_uid_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
372 return dissect_rpc_uint32(tvb, tree, hf_hclnfsd_uid, 0);
376 static int
377 dissect_hclnfsd_share_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
379 uint32_t request_type;
380 int offset = 0;
382 proto_tree_add_item_ret_uint(tree, hf_hclnfsd_request_type, tvb, offset,
383 4, ENC_BIG_ENDIAN, &request_type);
384 offset += 4;
386 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_cookie, offset);
388 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_lockname, offset, NULL);
390 offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL, (rpc_call_info_value*)data);
392 offset = dissect_rpc_data(tvb, tree, hf_hclnfsd_unknown_data, offset);
394 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_mode, offset);
396 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_access, offset);
398 offset += 4; /* skip last 4 UNUSED bytes */
400 return offset;
404 static int
405 dissect_hclnfsd_share_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
407 uint32_t request_type;
408 int offset = 0;
410 request_type = tvb_get_ntohl(tvb, offset);
411 if (tree)
412 proto_tree_add_uint(tree, hf_hclnfsd_request_type, tvb, offset,
413 4, request_type);
414 offset += 4;
416 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_cookie, offset);
417 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_status, offset);
418 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_sequence, offset);
420 return offset;
424 static int
425 dissect_hclnfsd_unshare_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
427 return dissect_hclnfsd_share_call(tvb, pinfo, tree, data);
431 static int
432 dissect_hclnfsd_unshare_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
434 return dissect_hclnfsd_share_reply(tvb, pinfo, tree, data);
438 static int
439 dissect_hclnfsd_lock_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
441 int offset = 0;
443 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_status, offset);
444 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_cookie, offset);
445 offset += 4; /* skip unused uint */
447 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_exclusive, offset);
449 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_lockname, offset, NULL);
451 offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL, (rpc_call_info_value*)data);
453 offset = dissect_rpc_data(tvb, tree, hf_hclnfsd_lockowner, offset);
455 offset += 4; /* unused, skip */
457 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_offset, offset);
459 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_length, offset);
461 return offset;
465 static int
466 dissect_hclnfsd_lock_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
468 uint32_t request_type;
469 int offset = 0;
471 proto_tree_add_item_ret_uint(tree, hf_hclnfsd_request_type, tvb, offset,
472 4, ENC_BIG_ENDIAN, &request_type);
473 offset += 4;
475 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_cookie, offset);
476 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_status, offset);
478 return offset;
482 static int
483 dissect_hclnfsd_remove_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
485 int offset = 0;
486 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_lockname, offset, NULL);
488 offset += 4; /* skip unused */
490 return offset;
494 static int
495 dissect_hclnfsd_unlock_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
497 int offset = 0;
498 offset += 4; /* skip unused */
500 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_cookie, offset);
502 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_lockname, offset, NULL);
504 offset = dissect_nfs3_fh(tvb, offset, pinfo, tree, "Filehandle", NULL, (rpc_call_info_value*)data);
506 offset = dissect_rpc_data(tvb, tree, hf_hclnfsd_unknown_data, offset);
508 offset += 4; /* skip unused */
510 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_offset, offset);
511 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_length, offset);
513 return offset;
517 static int
518 dissect_hclnfsd_unlock_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
520 return dissect_hclnfsd_lock_reply(tvb, pinfo, tree, data);
524 static int
525 dissect_hclnfsd_get_printers_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
527 unsigned nqueues, nqueues_i;
528 proto_item *queuesitem = NULL;
529 proto_tree *queuestree = NULL;
530 int offset = 0;
532 nqueues = tvb_get_ntohl(tvb, offset);
533 if (tree)
535 queuesitem = proto_tree_add_item(tree, hf_hclnfsd_print_queues, tvb, offset, 4, ENC_BIG_ENDIAN);
536 queuestree = proto_item_add_subtree(queuesitem, ett_hclnfsd_printqueues);
538 offset += 4;
540 if (!queuestree)
541 return offset;
543 for (nqueues_i = 0; nqueues_i < nqueues; nqueues_i++)
545 /* create new item for print queue */
546 offset = dissect_rpc_string(tvb, tree,
547 hf_hclnfsd_queuename, offset, NULL);
549 /* create subtree on new item with print queue comment */
550 offset = dissect_rpc_string(tvb, tree,
551 hf_hclnfsd_queuecomment, offset, NULL);
554 return offset;
558 static int
559 dissect_hclnfsd_get_printq_call(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
561 int offset = 0;
563 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_queuename, offset, NULL);
565 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_username, offset, NULL);
567 return offset;
571 static int
572 dissect_hclnfsd_get_printq_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
574 unsigned datafollows;
575 proto_item *queueitem = NULL;
576 proto_tree *queuetree = NULL;
577 proto_item *jobitem;
578 proto_tree *jobtree;
579 int offset = 0;
581 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_printqueuenumber, offset);
583 offset = dissect_rpc_string(tvb, tree, hf_hclnfsd_queuecomment, offset, NULL);
585 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_queuestatus, offset);
587 offset = dissect_rpc_uint32(tvb, tree, hf_hclnfsd_numphysicalprinters, offset);
589 datafollows = tvb_get_ntohl(tvb, offset);
590 if (tree)
592 queueitem = proto_tree_add_item(tree, hf_hclnfsd_print_jobs, tvb, offset, 4, ENC_BIG_ENDIAN);
593 queuetree = proto_item_add_subtree(queueitem, ett_hclnfsd_printqueues);
595 offset += 4;
597 while (datafollows)
599 jobitem = proto_tree_add_item(queuetree, hf_hclnfsd_job_id, tvb, offset, 4, ENC_BIG_ENDIAN);
600 offset += 4;
602 jobtree = proto_item_add_subtree(jobitem, ett_hclnfsd_printjob);
604 offset = dissect_rpc_string(tvb, jobtree,
605 hf_hclnfsd_username, offset, NULL);
607 offset = dissect_rpc_string(tvb, jobtree,
608 hf_hclnfsd_printparams, offset, NULL);
610 offset = dissect_rpc_uint32(tvb, jobtree, hf_hclnfsd_queuestatus, offset);
612 offset = dissect_rpc_uint32(tvb, jobtree, hf_hclnfsd_jobstatus, offset);
613 offset = dissect_rpc_uint32(tvb, jobtree, hf_hclnfsd_timesubmitted, offset);
614 offset = dissect_rpc_uint32(tvb, jobtree, hf_hclnfsd_size, offset);
615 offset = dissect_rpc_uint32(tvb, jobtree, hf_hclnfsd_copies, offset);
616 offset = dissect_rpc_string(tvb, jobtree, hf_hclnfsd_queuecomment, offset, NULL);
618 datafollows = tvb_get_ntohl(tvb, offset);
619 offset += 4;
622 return offset;
626 /* proc number, "proc name", dissect_request, dissect_reply */
628 static const vsff hclnfsd1_proc[] = {
629 { HCLNFSDPROC_NULL, "NULL",
630 dissect_rpc_void, dissect_rpc_void },
631 { HCLNFSDPROC_SPOOL_INQUIRE, "SPOOL_INQUIRE",
632 dissect_hclnfsd_spool_inquire_call, dissect_rpc_unknown },
633 { HCLNFSDPROC_SPOOL_FILE, "SPOOL_FILE",
634 dissect_hclnfsd_spool_file_call, dissect_rpc_void },
635 { HCLNFSDPROC_AUTHORIZE, "AUTHORIZE",
636 dissect_hclnfsd_authorize_call, dissect_hclnfsd_authorize_reply },
637 { HCLNFSDPROC_GRP_NAME_TO_NUMB, "GRP_NAME_TO_NUMB",
638 dissect_hclnfsd_grp_name_to_numb_call, dissect_hclnfsd_grp_name_to_numb_reply },
639 { HCLNFSDPROC_GRP_TO_NUMBER, "GRP_TO_NUMBER",
640 dissect_hclnfsd_grp_to_number_call, dissect_hclnfsd_grp_to_number_reply },
641 { HCLNFSDPROC_RETURN_HOST, "RETURN_HOST",
642 dissect_hclnfsd_return_host_call, dissect_hclnfsd_return_host_reply },
643 { HCLNFSDPROC_UID_TO_NAME, "UID_TO_NAME",
644 dissect_hclnfsd_uid_to_name_call, dissect_hclnfsd_uid_to_name_reply },
645 { HCLNFSDPROC_NAME_TO_UID, "NAME_TO_UID",
646 dissect_hclnfsd_name_to_uid_call, dissect_hclnfsd_name_to_uid_reply },
647 { HCLNFSDPROC_SHARE, "SHARE",
648 dissect_hclnfsd_share_call, dissect_hclnfsd_share_reply },
649 { HCLNFSDPROC_UNSHARE, "UNSHARE",
650 dissect_hclnfsd_unshare_call, dissect_hclnfsd_unshare_reply },
651 { HCLNFSDPROC_LOCK, "LOCK",
652 dissect_hclnfsd_lock_call, dissect_hclnfsd_lock_reply },
653 { HCLNFSDPROC_REMOVE, "REMOVE",
654 dissect_hclnfsd_remove_call, dissect_rpc_void },
655 { HCLNFSDPROC_UNLOCK, "UNLOCK",
656 dissect_hclnfsd_unlock_call, dissect_hclnfsd_unlock_reply },
657 { HCLNFSDPROC_GET_PRINTERS, "GET_PRINTERS",
658 dissect_rpc_void, dissect_hclnfsd_get_printers_reply },
659 { HCLNFSDPROC_GET_PRINTQ, "GET_PRINTQ",
660 dissect_hclnfsd_get_printq_call, dissect_hclnfsd_get_printq_reply },
661 { HCLNFSDPROC_CANCEL_PRJOB, "CANCEL_PRJOB",
662 dissect_rpc_unknown, dissect_rpc_unknown },
663 { HCLNFSDPROC_ZAP_LOCKS, "ZAP_LOCKS",
664 dissect_rpc_unknown, dissect_rpc_unknown },
665 { 0, NULL, NULL, NULL }
667 static const rpc_prog_vers_info hclnfsd_vers_info[] = {
668 { 1, hclnfsd1_proc, &hf_hclnfsd_procedure_v1 },
670 static const value_string hclnfsd1_proc_vals[] = {
671 { HCLNFSDPROC_NULL, "NULL" },
672 { HCLNFSDPROC_SPOOL_INQUIRE, "SPOOL_INQUIRE" },
673 { HCLNFSDPROC_SPOOL_FILE, "SPOOL_FILE" },
674 { HCLNFSDPROC_AUTHORIZE, "AUTHORIZE" },
675 { HCLNFSDPROC_GRP_NAME_TO_NUMB, "GRP_NAME_TO_NUMB" },
676 { HCLNFSDPROC_GRP_TO_NUMBER, "GRP_TO_NUMBER" },
677 { HCLNFSDPROC_RETURN_HOST, "RETURN_HOST" },
678 { HCLNFSDPROC_UID_TO_NAME, "UID_TO_NAME" },
679 { HCLNFSDPROC_NAME_TO_UID, "NAME_TO_UID" },
680 { HCLNFSDPROC_SHARE, "SHARE" },
681 { HCLNFSDPROC_UNSHARE, "UNSHARE" },
682 { HCLNFSDPROC_LOCK, "LOCK" },
683 { HCLNFSDPROC_REMOVE, "REMOVE" },
684 { HCLNFSDPROC_UNLOCK, "UNLOCK" },
685 { HCLNFSDPROC_GET_PRINTERS, "GET_PRINTERS" },
686 { HCLNFSDPROC_GET_PRINTQ, "GET_PRINTQ" },
687 { HCLNFSDPROC_CANCEL_PRJOB, "CANCEL_PRJOB" },
688 { HCLNFSDPROC_ZAP_LOCKS, "ZAP_LOCKS" },
689 { 0, NULL }
691 /* end of hclnfsd version 1 */
694 void
695 proto_register_hclnfsd(void)
697 static hf_register_info hf[] = {
698 { &hf_hclnfsd_procedure_v1, {
699 "V1 Procedure", "hclnfsd.procedure_v1", FT_UINT32, BASE_DEC,
700 VALS(hclnfsd1_proc_vals), 0, NULL, HFILL }},
701 { &hf_hclnfsd_request_type, {
702 "Request Type", "hclnfsd.request_type", FT_UINT32, BASE_DEC,
703 VALS(names_request_type), 0, NULL, HFILL }},
705 { &hf_hclnfsd_device, {
706 "Device", "hclnfsd.device", FT_STRING, BASE_NONE,
707 NULL, 0, NULL, HFILL }},
709 #if 0
710 { &hf_hclnfsd_login, {
711 "Login Text", "hclnfsd.logintext", FT_STRING, BASE_NONE,
712 NULL, 0, NULL, HFILL }},
713 #endif
715 { &hf_hclnfsd_lockname, {
716 "Lockname", "hclnfsd.lockname", FT_STRING, BASE_NONE,
717 NULL, 0, NULL, HFILL }},
719 { &hf_hclnfsd_unknown_data, {
720 "Unknown", "hclnfsd.unknown_data", FT_BYTES, BASE_NONE,
721 NULL, 0, "Data", HFILL }},
723 { &hf_hclnfsd_lockowner, {
724 "Lockowner", "hclnfsd.lockowner", FT_BYTES, BASE_NONE,
725 NULL, 0, NULL, HFILL }},
727 { &hf_hclnfsd_printername, {
728 "Printer Name", "hclnfsd.printername", FT_STRING, BASE_NONE,
729 NULL, 0, NULL, HFILL }},
731 { &hf_hclnfsd_filename, {
732 "Filename", "hclnfsd.filename", FT_STRING, BASE_NONE,
733 NULL, 0, NULL, HFILL }},
735 { &hf_hclnfsd_fileext, {
736 "File Extension", "hclnfsd.fileext", FT_UINT32, BASE_DEC,
737 NULL, 0, NULL, HFILL }},
739 { &hf_hclnfsd_grpname, {
740 "Group", "hclnfsd.group", FT_STRING, BASE_NONE,
741 NULL, 0, NULL, HFILL }},
743 { &hf_hclnfsd_hostname, {
744 "Hostname", "hclnfsd.hostname", FT_STRING, BASE_NONE,
745 NULL, 0, NULL, HFILL }},
747 { &hf_hclnfsd_username, {
748 "Username", "hclnfsd.username", FT_STRING, BASE_NONE,
749 NULL, 0, NULL, HFILL }},
751 { &hf_hclnfsd_queuename, {
752 "Name", "hclnfsd.printqueuename", FT_STRING, BASE_NONE,
753 NULL, 0, "Print Queue Name", HFILL }},
755 { &hf_hclnfsd_queuecomment, {
756 "Comment", "hclnfsd.printqueuecomment", FT_STRING, BASE_NONE,
757 NULL, 0, "Print Queue Comment", HFILL }},
759 { &hf_hclnfsd_printparams, {
760 "Print Parameters", "hclnfsd.printparameters", FT_STRING, BASE_NONE,
761 NULL, 0, NULL, HFILL }},
763 { &hf_hclnfsd_status, {
764 "Status", "hclnfsd.status", FT_UINT32, BASE_DEC,
765 NULL, 0, NULL, HFILL }},
767 { &hf_hclnfsd_uid, {
768 "UID", "hclnfsd.uid", FT_UINT32, BASE_DEC,
769 NULL, 0, "User ID", HFILL }},
771 { &hf_hclnfsd_sequence, {
772 "Sequence", "hclnfsd.sequence", FT_UINT32, BASE_HEX,
773 NULL, 0, NULL, HFILL }},
775 { &hf_hclnfsd_cookie, {
776 "Cookie", "hclnfsd.cookie", FT_UINT32, BASE_HEX,
777 NULL, 0, NULL, HFILL }},
779 { &hf_hclnfsd_mode, {
780 "Mode", "hclnfsd.mode", FT_UINT32, BASE_DEC,
781 NULL, 0, NULL, HFILL }},
783 { &hf_hclnfsd_access, {
784 "Access", "hclnfsd.access", FT_UINT32, BASE_DEC,
785 NULL, 0, NULL, HFILL }},
787 { &hf_hclnfsd_exclusive, {
788 "Exclusive", "hclnfsd.exclusive", FT_UINT32, BASE_DEC,
789 NULL, 0, NULL, HFILL }},
791 { &hf_hclnfsd_offset, {
792 "Offset", "hclnfsd.offset", FT_UINT32, BASE_DEC,
793 NULL, 0, NULL, HFILL }},
795 { &hf_hclnfsd_length, {
796 "Length", "hclnfsd.length", FT_UINT32, BASE_DEC,
797 NULL, 0, NULL, HFILL }},
799 { &hf_hclnfsd_queuestatus, {
800 "Queue Status", "hclnfsd.queuestatus", FT_UINT32, BASE_DEC,
801 NULL, 0, NULL, HFILL }},
803 { &hf_hclnfsd_printqueuenumber, {
804 "Print Queue Number", "hclnfsd.pqn", FT_UINT32, BASE_DEC,
805 NULL, 0, NULL, HFILL }},
807 { &hf_hclnfsd_numphysicalprinters, {
808 "Number of Physical Printers", "hclnfsd.npp", FT_UINT32, BASE_DEC,
809 NULL, 0, NULL, HFILL }},
811 { &hf_hclnfsd_jobstatus, {
812 "Job Status", "hclnfsd.jobstatus", FT_UINT32, BASE_DEC,
813 NULL, 0, NULL, HFILL }},
815 { &hf_hclnfsd_timesubmitted, {
816 "Time Submitted", "hclnfsd.timesubmitted", FT_UINT32, BASE_DEC,
817 NULL, 0, NULL, HFILL }},
819 { &hf_hclnfsd_size, {
820 "Size", "hclnfsd.size", FT_UINT32, BASE_DEC,
821 NULL, 0, NULL, HFILL }},
823 { &hf_hclnfsd_copies, {
824 "Copies", "hclnfsd.copies", FT_UINT32, BASE_DEC,
825 NULL, 0, NULL, HFILL }},
827 { &hf_hclnfsd_gid, {
828 "GID", "hclnfsd.gid", FT_UINT32, BASE_DEC,
829 NULL, 0, "Group ID", HFILL }},
831 { &hf_hclnfsd_server_ip, {
832 "Server IP", "hclnfsd.server_ip", FT_IPv4, BASE_NONE,
833 NULL, 0, NULL, HFILL }},
835 { &hf_hclnfsd_host_ip, {
836 "Host IP", "hclnfsd.host_ip", FT_IPv4, BASE_NONE,
837 NULL, 0, NULL, HFILL }},
839 { &hf_hclnfsd_auth_ident_obscure, {
840 "Obscure Ident", "hclnfsd.authorize.ident.obscure", FT_STRING,
841 BASE_NONE , NULL, 0, "Authentication Obscure Ident", HFILL }},
843 /* Generated from convert_proto_tree_add_text.pl */
844 { &hf_hclnfsd_gids,
845 { "GIDs", "hclnfsd.gids",
846 FT_UINT32, BASE_DEC, NULL, 0x0,
847 NULL, HFILL }
849 { &hf_hclnfsd_password,
850 { "Password", "hclnfsd.password",
851 FT_STRING, BASE_NONE, NULL, 0x0,
852 NULL, HFILL }
854 { &hf_hclnfsd_uids,
855 { "UIDs", "hclnfsd.uids",
856 FT_UINT32, BASE_DEC, NULL, 0x0,
857 NULL, HFILL }
859 { &hf_hclnfsd_print_queues,
860 { "Print Queues", "hclnfsd.print_queues",
861 FT_UINT32, BASE_DEC, NULL, 0x0,
862 NULL, HFILL }
864 { &hf_hclnfsd_print_jobs,
865 { "Print Jobs", "hclnfsd.print_jobs",
866 FT_UINT32, BASE_DEC, NULL, 0x0,
867 NULL, HFILL }
869 { &hf_hclnfsd_job_id,
870 { "Job ID", "hclnfsd.job_id",
871 FT_UINT32, BASE_DEC, NULL, 0x0,
872 NULL, HFILL }
875 static int *ett[] = {
876 &ett_hclnfsd,
877 &ett_hclnfsd_gids,
878 &ett_hclnfsd_groups,
879 &ett_hclnfsd_uids,
880 &ett_hclnfsd_usernames,
881 &ett_hclnfsd_printqueues,
882 &ett_hclnfsd_printjob,
883 &ett_hclnfsd_auth_ident
886 proto_hclnfsd = proto_register_protocol("Hummingbird NFS Daemon",
887 "HCLNFSD", "hclnfsd");
888 proto_register_field_array(proto_hclnfsd, hf, array_length(hf));
889 proto_register_subtree_array(ett, array_length(ett));
892 void
893 proto_reg_handoff_hclnfsd(void)
895 /* Register the protocol as RPC */
896 rpc_init_prog(proto_hclnfsd, HCLNFSD_PROGRAM, ett_hclnfsd,
897 G_N_ELEMENTS(hclnfsd_vers_info), hclnfsd_vers_info);
901 * Editor modelines - https://www.wireshark.org/tools/modelines.html
903 * Local variables:
904 * c-basic-offset: 8
905 * tab-width: 8
906 * indent-tabs-mode: t
907 * End:
909 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
910 * :indentSize=8:tabSize=8:noTabs=false: