MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-nisplus.c
bloba02e6d8dbe84d91b534031805bb8e60c5be44b9a
1 /* packet-nisplus.c
2 * 2001 Ronnie Sahlberg <See AUTHORS for email>
4 * $Id$
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 #include "config.h"
27 #include <time.h>
29 #include "packet-rpc.h"
30 #include "packet-nisplus.h"
32 static int proto_nisplus = -1;
33 static int hf_nisplus_procedure_v3 = -1;
34 static int hf_nisplus_object = -1;
35 static int hf_nisplus_oid = -1;
36 static int hf_nisplus_object_ctime = -1;
37 static int hf_nisplus_object_mtime = -1;
38 static int hf_nisplus_object_name = -1;
39 static int hf_nisplus_object_owner = -1;
40 static int hf_nisplus_object_group = -1;
41 static int hf_nisplus_object_domain = -1;
42 static int hf_nisplus_object_ttl = -1;
43 static int hf_nisplus_object_type = -1;
44 static int hf_nisplus_object_private = -1;
45 static int hf_nisplus_directory = -1;
46 static int hf_nisplus_directory_name = -1;
47 static int hf_nisplus_directory_type = -1;
48 static int hf_nisplus_directory_ttl = -1;
49 static int hf_nisplus_directory_mask = -1;
50 static int hf_nisplus_directory_mask_list = -1;
51 static int hf_nisplus_access_mask = -1;
52 static int hf_nisplus_mask_world_read = -1;
53 static int hf_nisplus_mask_world_modify = -1;
54 static int hf_nisplus_mask_world_create = -1;
55 static int hf_nisplus_mask_world_destroy = -1;
56 static int hf_nisplus_mask_group_read = -1;
57 static int hf_nisplus_mask_group_modify = -1;
58 static int hf_nisplus_mask_group_create = -1;
59 static int hf_nisplus_mask_group_destroy = -1;
60 static int hf_nisplus_mask_owner_read = -1;
61 static int hf_nisplus_mask_owner_modify = -1;
62 static int hf_nisplus_mask_owner_create = -1;
63 static int hf_nisplus_mask_owner_destroy = -1;
64 static int hf_nisplus_mask_nobody_read = -1;
65 static int hf_nisplus_mask_nobody_modify = -1;
66 static int hf_nisplus_mask_nobody_create = -1;
67 static int hf_nisplus_mask_nobody_destroy = -1;
68 static int hf_nisplus_server_name = -1;
69 static int hf_nisplus_key_type = -1;
70 static int hf_nisplus_key_data = -1;
71 static int hf_nisplus_servers = -1;
72 static int hf_nisplus_cbservers = -1;
73 static int hf_nisplus_server = -1;
74 static int hf_nisplus_endpoints = -1;
75 static int hf_nisplus_endpoint = -1;
76 static int hf_nisplus_endpoint_uaddr = -1;
77 static int hf_nisplus_endpoint_family = -1;
78 static int hf_nisplus_endpoint_proto = -1;
79 static int hf_nisplus_link = -1;
80 static int hf_nisplus_attrs_array = -1;
81 static int hf_nisplus_attr = -1;
82 static int hf_nisplus_attr_name = -1;
83 static int hf_nisplus_attr_val = -1;
84 static int hf_nisplus_entry = -1;
85 static int hf_nisplus_entry_type = -1;
86 static int hf_nisplus_entry_cols = -1;
87 static int hf_nisplus_entry_col = -1;
88 /* static int hf_nisplus_entry_flags = -1; */
89 static int hf_nisplus_entry_val = -1;
90 static int hf_nisplus_entry_mask = -1;
91 static int hf_nisplus_entry_mask_binary = -1;
92 static int hf_nisplus_entry_mask_crypt = -1;
93 static int hf_nisplus_entry_mask_xdr = -1;
94 static int hf_nisplus_entry_mask_modified = -1;
95 static int hf_nisplus_entry_mask_asn = -1;
96 static int hf_nisplus_table = -1;
97 static int hf_nisplus_table_type = -1;
98 static int hf_nisplus_table_maxcol = -1;
99 static int hf_nisplus_table_sep = -1;
100 static int hf_nisplus_table_cols = -1;
101 static int hf_nisplus_table_col = -1;
102 static int hf_nisplus_table_path = -1;
103 static int hf_nisplus_table_col_name = -1;
104 static int hf_nisplus_table_col_mask = -1;
105 static int hf_nisplus_table_col_mask_binary = -1;
106 static int hf_nisplus_table_col_mask_encrypted = -1;
107 static int hf_nisplus_table_col_mask_xdr = -1;
108 static int hf_nisplus_table_col_mask_searchable = -1;
109 static int hf_nisplus_table_col_mask_casesensitive = -1;
110 static int hf_nisplus_table_col_mask_modified = -1;
111 static int hf_nisplus_table_col_mask_asn = -1;
112 static int hf_nisplus_group = -1;
113 static int hf_nisplus_group_flags = -1;
114 static int hf_nisplus_grps = -1;
115 static int hf_nisplus_group_name = -1;
116 static int hf_nisplus_ib_flags = -1;
117 static int hf_nisplus_ib_bufsize = -1;
118 static int hf_nisplus_cookie = -1;
119 static int hf_nisplus_fd_dirname = -1;
120 static int hf_nisplus_fd_requester = -1;
121 static int hf_nisplus_taglist = -1;
122 static int hf_nisplus_tag = -1;
123 static int hf_nisplus_tag_type = -1;
124 static int hf_nisplus_tag_val = -1;
125 static int hf_nisplus_dump_dir = -1;
126 static int hf_nisplus_dump_time = -1;
127 static int hf_nisplus_dummy = -1;
128 static int hf_nisplus_ping_dir = -1;
129 static int hf_nisplus_ping_time = -1;
130 static int hf_nisplus_error = -1;
131 static int hf_nisplus_dir_data = -1;
132 static int hf_nisplus_signature = -1;
133 static int hf_nisplus_log_entries = -1;
134 static int hf_nisplus_log_entry = -1;
135 static int hf_nisplus_log_type = -1;
136 static int hf_nisplus_log_time = -1;
137 static int hf_nisplus_log_principal = -1;
138 static int hf_nisplus_callback_status = -1;
139 static int hf_nisplus_cp_status = -1;
140 static int hf_nisplus_cp_zticks = -1;
141 static int hf_nisplus_cp_dticks = -1;
142 static int hf_nisplus_zticks = -1;
143 static int hf_nisplus_dticks = -1;
144 static int hf_nisplus_aticks = -1;
145 static int hf_nisplus_cticks = -1;
147 static gint ett_nisplus = -1;
148 static gint ett_nisplus_object = -1;
149 static gint ett_nisplus_oid = -1;
150 static gint ett_nisplus_directory = -1;
151 static gint ett_nisplus_directory_mask = -1;
152 static gint ett_nisplus_access_mask = -1;
153 static gint ett_nisplus_server = -1;
154 static gint ett_nisplus_endpoint = -1;
155 static gint ett_nisplus_link = -1;
156 static gint ett_nisplus_attr = -1;
157 static gint ett_nisplus_entry = -1;
158 static gint ett_nisplus_entry_col = -1;
159 static gint ett_nisplus_entry_mask = -1;
160 static gint ett_nisplus_table = -1;
161 static gint ett_nisplus_table_col = -1;
162 static gint ett_nisplus_table_col_mask = -1;
163 static gint ett_nisplus_group = -1;
164 static gint ett_nisplus_grps = -1;
165 static gint ett_nisplus_tag = -1;
166 static gint ett_nisplus_log_entry = -1;
169 #define NIS_MASK_TABLE_BINARY 0x0001
170 #define NIS_MASK_TABLE_CRYPT 0x0002
171 #define NIS_MASK_TABLE_XDR 0x0004
172 #define NIS_MASK_TABLE_SRCH 0x0008
173 #define NIS_MASK_TABLE_CASE 0x0010
174 #define NIS_MASK_TABLE_MODIFIED 0x0020
175 #define NIS_MASK_TABLE_ASN 0x0040
178 #define NIS_MASK_ENTRY_BINARY 0x0001
179 #define NIS_MASK_ENTRY_CRYPT 0x0002
180 #define NIS_MASK_ENTRY_XDR 0x0004
181 #define NIS_MASK_ENTRY_MODIFIED 0x0008
182 #define NIS_MASK_ENTRY_ASN 0x0040
185 #define NIS_MASK_WORLD_READ 0x0001
186 #define NIS_MASK_WORLD_MODIFY 0x0002
187 #define NIS_MASK_WORLD_CREATE 0x0004
188 #define NIS_MASK_WORLD_DESTROY 0x0008
189 #define NIS_MASK_GROUP_READ 0x0010
190 #define NIS_MASK_GROUP_MODIFY 0x0020
191 #define NIS_MASK_GROUP_CREATE 0x0040
192 #define NIS_MASK_GROUP_DESTROY 0x0080
193 #define NIS_MASK_OWNER_READ 0x0100
194 #define NIS_MASK_OWNER_MODIFY 0x0200
195 #define NIS_MASK_OWNER_CREATE 0x0400
196 #define NIS_MASK_OWNER_DESTROY 0x0800
197 #define NIS_MASK_NOBODY_READ 0x1000
198 #define NIS_MASK_NOBODY_MODIFY 0x2000
199 #define NIS_MASK_NOBODY_CREATE 0x4000
200 #define NIS_MASK_NOBODY_DESTROY 0x8000
203 static const value_string key_type[] = {
204 #define NIS_KEY_NONE 0
205 { NIS_KEY_NONE, "No Public Key (unix/sys auth)" },
206 #define NIS_KEY_DH 1
207 { NIS_KEY_DH, "Diffie-Hellman" },
208 #define NIS_KEY_RSA 2
209 { NIS_KEY_RSA, "RSA" },
210 #define NIS_KEY_KERB 3
211 { NIS_KEY_KERB, "Kerberos" },
212 #define NIS_KEY_DHEXT 4
213 { NIS_KEY_DHEXT, "Extended Diffie-Hellman for RPC-GSS" },
214 { 0, NULL },
217 static const value_string obj_type[] = {
218 #define NIS_BOGUS_OBJ 0
219 { NIS_BOGUS_OBJ, "Bogus Object" },
220 #define NIS_NO_OBJ 1
221 { NIS_NO_OBJ, "NULL Object" },
222 #define NIS_DIRECTORY_OBJ 2
223 { NIS_DIRECTORY_OBJ, "Directory Object" },
224 #define NIS_GROUP_OBJ 3
225 { NIS_GROUP_OBJ, "Group Object" },
226 #define NIS_TABLE_OBJ 4
227 { NIS_TABLE_OBJ, "Table Object" },
228 #define NIS_ENTRY_OBJ 5
229 { NIS_ENTRY_OBJ, "Entry Object" },
230 #define NIS_LINK_OBJ 6
231 { NIS_LINK_OBJ, "Link Object" },
232 #define NIS_PRIVATE_OBJ 7
233 { NIS_PRIVATE_OBJ, "Private Object" },
234 { 0, NULL },
237 static const value_string ns_type[] = {
238 #define NIS_TYPE_UNKNOWN 0
239 { NIS_TYPE_UNKNOWN, "UNKNOWN" },
240 #define NIS_TYPE_NIS 1
241 { NIS_TYPE_NIS, "NIS Plus Service" },
242 #define NIS_TYPE_SUNYP 2
243 { NIS_TYPE_SUNYP, "Old NIS Service (YP)" },
244 #define NIS_TYPE_IVY 3
245 { NIS_TYPE_IVY, "NIS Plus Plus Service" },
246 #define NIS_TYPE_DNS 4
247 { NIS_TYPE_DNS, "Domain Name Service (DNS)" },
248 #define NIS_TYPE_X500 5
249 { NIS_TYPE_X500, "ISO/CCITT X.500 Service" },
250 #define NIS_TYPE_DNANS 6
251 { NIS_TYPE_DNANS, "Digital DECNet Name Service" },
252 #define NIS_TYPE_XCHS 7
253 { NIS_TYPE_XCHS, "Xerox ClearingHouse Service" },
254 #define NIS_TYPE_CDS 8
255 { NIS_TYPE_CDS, "CDS" },
256 { 0, NULL },
262 static int
263 dissect_nisplus_time(tvbuff_t *tvb, int offset, proto_tree *tree, int hfindex)
265 nstime_t ts;
267 ts.nsecs = 0;
268 ts.secs = tvb_get_ntohl(tvb, offset);
269 offset += 4;
271 proto_tree_add_time(tree, hfindex, tvb, offset, 4, &ts);
273 return offset;
276 static int
277 dissect_group(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
279 offset = dissect_rpc_string(tvb, tree,
280 hf_nisplus_group_name, offset, NULL);
282 return offset;
286 static int
287 dissect_group_obj(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
289 proto_item* lock_item = NULL;
290 proto_tree* lock_tree = NULL;
291 int old_offset = offset;
293 lock_item = proto_tree_add_item(tree, hf_nisplus_group,
294 tvb, offset, -1, ENC_NA);
296 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_group);
298 offset = dissect_rpc_uint32(tvb, lock_tree,
299 hf_nisplus_group_flags, offset);
301 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
302 dissect_group, hf_nisplus_grps);
304 proto_item_set_len(lock_item, offset-old_offset);
305 return offset;
309 static int
310 dissect_access_rights(tvbuff_t *tvb, int offset, proto_tree *tree)
312 proto_item* mask_item = NULL;
313 proto_tree* mask_tree = NULL;
314 guint32 mask;
316 mask_item = proto_tree_add_item(tree, hf_nisplus_access_mask,
317 tvb, offset, 4, ENC_NA);
319 mask_tree = proto_item_add_subtree(mask_item, ett_nisplus_access_mask);
320 mask = tvb_get_ntohl(tvb, offset);
321 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_world_read, tvb, offset, 4, mask);
322 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_world_modify, tvb, offset, 4, mask);
323 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_world_create, tvb, offset, 4, mask);
324 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_world_destroy, tvb, offset, 4, mask);
325 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_group_read, tvb, offset, 4, mask);
326 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_group_modify, tvb, offset, 4, mask);
327 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_group_create, tvb, offset, 4, mask);
328 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_group_destroy, tvb, offset, 4, mask);
329 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_owner_read, tvb, offset, 4, mask);
330 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_owner_modify, tvb, offset, 4, mask);
331 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_owner_create, tvb, offset, 4, mask);
332 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_owner_destroy, tvb, offset, 4, mask);
333 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_nobody_read, tvb, offset, 4, mask);
334 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_nobody_modify, tvb, offset, 4, mask);
335 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_nobody_create, tvb, offset, 4, mask);
336 proto_tree_add_boolean(mask_tree, hf_nisplus_mask_nobody_destroy, tvb, offset, 4, mask);
337 offset += 4;
339 return offset;
342 static int
343 dissect_table(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
345 proto_item* lock_item = NULL;
346 proto_tree* lock_tree = NULL;
347 proto_item* mask_item = NULL;
348 proto_tree* mask_tree = NULL;
349 guint32 mask;
350 int old_offset = offset;
352 lock_item = proto_tree_add_item(tree, hf_nisplus_table_col,
353 tvb, offset, -1, ENC_NA);
355 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_table_col);
357 offset = dissect_rpc_string(tvb, lock_tree,
358 hf_nisplus_table_col_name, offset, NULL);
361 mask_item = proto_tree_add_item(lock_tree, hf_nisplus_table_col_mask,
362 tvb, offset, 4,
363 ENC_NA);
364 mask_tree = proto_item_add_subtree(mask_item, ett_nisplus_table_col_mask);
365 mask = tvb_get_ntohl(tvb, offset);
366 proto_tree_add_boolean(mask_tree, hf_nisplus_table_col_mask_binary,
367 tvb, offset, 4, mask);
368 proto_tree_add_boolean(mask_tree, hf_nisplus_table_col_mask_encrypted,
369 tvb, offset, 4, mask);
370 proto_tree_add_boolean(mask_tree, hf_nisplus_table_col_mask_xdr,
371 tvb, offset, 4, mask);
372 proto_tree_add_boolean(mask_tree, hf_nisplus_table_col_mask_searchable,
373 tvb, offset, 4, mask);
374 proto_tree_add_boolean(mask_tree, hf_nisplus_table_col_mask_casesensitive,
375 tvb, offset, 4, mask);
376 proto_tree_add_boolean(mask_tree, hf_nisplus_table_col_mask_modified,
377 tvb, offset, 4, mask);
378 proto_tree_add_boolean(mask_tree, hf_nisplus_table_col_mask_asn,
379 tvb, offset, 4, mask);
380 offset += 4;
382 offset = dissect_access_rights(tvb, offset, lock_tree);
384 proto_item_set_len(lock_item, offset-old_offset);
385 return offset;
388 static int
389 dissect_table_obj(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
391 proto_item* lock_item = NULL;
392 proto_tree* lock_tree = NULL;
393 int old_offset = offset;
395 lock_item = proto_tree_add_item(tree, hf_nisplus_table,
396 tvb, offset, -1, ENC_NA);
398 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_table);
400 offset = dissect_rpc_string(tvb, lock_tree,
401 hf_nisplus_table_type, offset, NULL);
403 offset = dissect_rpc_uint32(tvb, lock_tree,
404 hf_nisplus_table_maxcol, offset);
406 offset = dissect_rpc_uint32(tvb, lock_tree,
407 hf_nisplus_table_sep, offset);
409 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
410 dissect_table, hf_nisplus_table_cols);
412 offset = dissect_rpc_string(tvb, lock_tree,
413 hf_nisplus_table_path, offset, NULL);
415 proto_item_set_len(lock_item, offset-old_offset);
416 return offset;
419 static int
420 dissect_entry(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
422 proto_item* lock_item = NULL;
423 proto_tree* lock_tree = NULL;
424 proto_item* mask_item = NULL;
425 proto_tree* mask_tree = NULL;
426 guint32 mask;
427 int old_offset = offset;
429 lock_item = proto_tree_add_item(tree, hf_nisplus_entry_col,
430 tvb, offset, -1, ENC_NA);
432 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_entry_col);
434 mask_item = proto_tree_add_item(lock_tree, hf_nisplus_entry_mask,
435 tvb, offset, 4,
436 ENC_NA);
438 mask_tree = proto_item_add_subtree(mask_item, ett_nisplus_entry_mask);
439 mask = tvb_get_ntohl(tvb, offset);
440 proto_tree_add_boolean(mask_tree, hf_nisplus_entry_mask_binary, tvb, offset, 4, mask);
441 proto_tree_add_boolean(mask_tree, hf_nisplus_entry_mask_crypt, tvb, offset, 4, mask);
442 proto_tree_add_boolean(mask_tree, hf_nisplus_entry_mask_xdr, tvb, offset, 4, mask);
443 proto_tree_add_boolean(mask_tree, hf_nisplus_entry_mask_modified, tvb, offset, 4, mask);
444 proto_tree_add_boolean(mask_tree, hf_nisplus_entry_mask_asn, tvb, offset, 4, mask);
445 offset += 4;
447 offset = dissect_rpc_string(tvb, lock_tree,
448 hf_nisplus_entry_val, offset, NULL);
450 proto_item_set_len(lock_item, offset-old_offset);
451 return offset;
454 static int
455 dissect_entry_obj(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
457 proto_item* lock_item = NULL;
458 proto_tree* lock_tree = NULL;
459 int old_offset = offset;
461 lock_item = proto_tree_add_item(tree, hf_nisplus_entry,
462 tvb, offset, -1, ENC_NA);
464 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_entry);
466 offset = dissect_rpc_string(tvb, lock_tree,
467 hf_nisplus_entry_type, offset, NULL);
469 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
470 dissect_entry, hf_nisplus_entry_cols);
472 proto_item_set_len(lock_item, offset-old_offset);
473 return offset;
476 static int
477 dissect_attr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
479 proto_item* lock_item = NULL;
480 proto_tree* lock_tree = NULL;
481 int old_offset = offset;
483 lock_item = proto_tree_add_item(tree, hf_nisplus_attr,
484 tvb, offset, -1, ENC_NA);
486 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_attr);
488 offset = dissect_rpc_string(tvb, lock_tree,
489 hf_nisplus_attr_name, offset, NULL);
491 offset = dissect_rpc_data(tvb, lock_tree,
492 hf_nisplus_attr_val, offset);
494 proto_item_set_len(lock_item, offset-old_offset);
495 return offset;
498 static int
499 dissect_link_obj(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
501 proto_item* lock_item = NULL;
502 proto_tree* lock_tree = NULL;
503 int old_offset = offset;
505 lock_item = proto_tree_add_item(tree, hf_nisplus_link,
506 tvb, offset, -1, ENC_NA);
508 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_link);
510 offset = dissect_rpc_uint32(tvb, lock_tree,
511 hf_nisplus_object_type, offset);
513 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
514 dissect_attr, hf_nisplus_attrs_array);
516 offset = dissect_rpc_string(tvb, lock_tree,
517 hf_nisplus_object_name, offset, NULL);
519 proto_item_set_len(lock_item, offset-old_offset);
520 return offset;
524 static int
525 dissect_endpoint(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
527 proto_item* lock_item = NULL;
528 proto_tree* lock_tree = NULL;
529 int old_offset = offset;
531 lock_item = proto_tree_add_item(tree, hf_nisplus_endpoint,
532 tvb, offset, -1, ENC_NA);
534 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_endpoint);
536 offset = dissect_rpc_string(tvb, lock_tree,
537 hf_nisplus_endpoint_uaddr, offset, NULL);
539 offset = dissect_rpc_string(tvb, lock_tree,
540 hf_nisplus_endpoint_family, offset, NULL);
542 offset = dissect_rpc_string(tvb, lock_tree,
543 hf_nisplus_endpoint_proto, offset, NULL);
545 proto_item_set_len(lock_item, offset-old_offset);
546 return offset;
550 static int
551 dissect_directory_server(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
553 proto_item* lock_item = NULL;
554 proto_tree* lock_tree = NULL;
555 int old_offset = offset;
557 lock_item = proto_tree_add_item(tree, hf_nisplus_server,
558 tvb, offset, -1, ENC_NA);
560 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_server);
562 offset = dissect_rpc_string(tvb, lock_tree,
563 hf_nisplus_server_name, offset, NULL);
565 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
566 dissect_endpoint, hf_nisplus_endpoints);
568 offset = dissect_rpc_uint32(tvb, lock_tree,
569 hf_nisplus_key_type, offset);
571 offset = dissect_rpc_data(tvb, lock_tree,
572 hf_nisplus_key_data, offset);
574 proto_item_set_len(lock_item, offset-old_offset);
575 return offset;
579 static int
580 dissect_directory_mask(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
582 proto_item* lock_item = NULL;
583 proto_tree* lock_tree = NULL;
584 int old_offset = offset;
586 lock_item = proto_tree_add_item(tree, hf_nisplus_directory_mask,
587 tvb, offset, -1, ENC_NA);
589 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_directory_mask);
591 offset = dissect_access_rights(tvb, offset, lock_tree);
593 offset = dissect_rpc_uint32(tvb, lock_tree,
594 hf_nisplus_object_type, offset);
596 proto_item_set_len(lock_item, offset-old_offset);
597 return offset;
600 static int
601 dissect_directory_obj(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree)
603 proto_item* lock_item = NULL;
604 proto_tree* lock_tree = NULL;
605 int old_offset = offset;
607 lock_item = proto_tree_add_item(tree, hf_nisplus_directory,
608 tvb, offset, -1, ENC_NA);
610 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_directory);
612 offset = dissect_rpc_string(tvb, lock_tree,
613 hf_nisplus_directory_name, offset, NULL);
615 offset = dissect_rpc_uint32(tvb, lock_tree,
616 hf_nisplus_directory_type, offset);
618 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
619 dissect_directory_server, hf_nisplus_servers);
621 offset = dissect_rpc_uint32(tvb, lock_tree,
622 hf_nisplus_directory_ttl, offset);
624 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
625 dissect_directory_mask, hf_nisplus_directory_mask_list);
627 proto_item_set_len(lock_item, offset-old_offset);
628 return offset;
631 static int
632 dissect_nisplus_oid(tvbuff_t *tvb, int offset, proto_tree *tree)
634 proto_item* lock_item = NULL;
635 proto_tree* lock_tree = NULL;
636 int old_offset = offset;
638 lock_item = proto_tree_add_item(tree, hf_nisplus_oid, tvb,
639 offset, -1, ENC_NA);
641 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_oid);
643 offset = dissect_nisplus_time(tvb, offset, lock_tree,
644 hf_nisplus_object_ctime);
646 offset = dissect_nisplus_time(tvb, offset, lock_tree,
647 hf_nisplus_object_mtime);
649 proto_item_set_len(lock_item, offset-old_offset);
650 return offset;
653 static int
654 dissect_nisplus_object(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
656 proto_item* lock_item = NULL;
657 proto_tree* lock_tree = NULL;
658 gint32 type;
659 int old_offset = offset;
661 lock_item = proto_tree_add_item(tree, hf_nisplus_object, tvb,
662 offset, -1, ENC_NA);
664 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_object);
666 offset = dissect_nisplus_oid(tvb, offset, lock_tree);
668 offset = dissect_rpc_string(tvb, lock_tree,
669 hf_nisplus_object_name, offset, NULL);
671 offset = dissect_rpc_string(tvb, lock_tree,
672 hf_nisplus_object_owner, offset, NULL);
674 offset = dissect_rpc_string(tvb, lock_tree,
675 hf_nisplus_object_group, offset, NULL);
677 offset = dissect_rpc_string(tvb, lock_tree,
678 hf_nisplus_object_domain, offset, NULL);
680 offset = dissect_access_rights(tvb, offset, lock_tree);
682 offset = dissect_rpc_uint32(tvb, lock_tree,
683 hf_nisplus_object_ttl, offset);
685 type = tvb_get_ntohl(tvb, offset);
686 offset = dissect_rpc_uint32(tvb, lock_tree,
687 hf_nisplus_object_type, offset);
688 switch (type) {
689 case NIS_DIRECTORY_OBJ:
690 offset = dissect_directory_obj(tvb, offset, pinfo, lock_tree);
691 break;
692 case NIS_GROUP_OBJ:
693 offset = dissect_group_obj(tvb, offset, pinfo, lock_tree);
694 break;
695 case NIS_TABLE_OBJ:
696 offset = dissect_table_obj(tvb, offset, pinfo, lock_tree);
697 break;
698 case NIS_ENTRY_OBJ:
699 offset = dissect_entry_obj(tvb, offset, pinfo, lock_tree);
700 break;
701 case NIS_LINK_OBJ:
702 offset = dissect_link_obj(tvb, offset, pinfo, lock_tree);
703 break;
704 case NIS_PRIVATE_OBJ:
705 offset = dissect_rpc_data(tvb, lock_tree,
706 hf_nisplus_object_private, offset);
707 break;
708 case NIS_NO_OBJ:
709 break;
710 case NIS_BOGUS_OBJ:
711 break;
712 default:
713 break;
716 proto_item_set_len(lock_item, offset-old_offset);
717 return offset;
719 /* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
720 end of nis object, thats right, all this was the definition of
721 ONE SINGLE struct.
726 static int
727 dissect_ns_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
729 offset = dissect_rpc_string(tvb, tree,
730 hf_nisplus_object_name, offset, NULL);
732 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
733 dissect_nisplus_object, hf_nisplus_object);
735 return offset;
738 static int
739 dissect_ib_request(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
741 offset = dissect_rpc_string(tvb, tree,
742 hf_nisplus_object_name, offset, NULL);
744 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
745 dissect_attr, hf_nisplus_attrs_array);
747 offset = dissect_rpc_uint32(tvb, tree,
748 hf_nisplus_ib_flags, offset);
750 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
751 dissect_nisplus_object, hf_nisplus_object);
753 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
754 dissect_directory_server, hf_nisplus_cbservers);
756 offset = dissect_rpc_uint32(tvb, tree,
757 hf_nisplus_ib_bufsize, offset);
759 offset = dissect_rpc_data(tvb, tree,
760 hf_nisplus_cookie, offset);
762 return offset;
765 static int
766 dissect_fd_args(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
768 offset = dissect_rpc_string(tvb, tree,
769 hf_nisplus_fd_dirname, offset, NULL);
771 offset = dissect_rpc_string(tvb, tree,
772 hf_nisplus_fd_requester, offset, NULL);
774 return offset;
777 static int
778 dissect_nisplus_tag(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
780 proto_item* lock_item = NULL;
781 proto_tree* lock_tree = NULL;
782 int old_offset = offset;
784 lock_item = proto_tree_add_item(tree, hf_nisplus_tag, tvb,
785 offset, -1, ENC_NA);
787 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_tag);
789 offset = dissect_rpc_uint32(tvb, lock_tree,
790 hf_nisplus_tag_type, offset);
792 offset = dissect_rpc_string(tvb, lock_tree,
793 hf_nisplus_tag_val, offset, NULL);
795 proto_item_set_len(lock_item, offset-old_offset);
796 return offset;
799 static int
800 dissect_nisplus_taglist(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
802 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
803 dissect_nisplus_tag, hf_nisplus_taglist);
805 return offset;
808 static int
809 dissect_dump_args(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
811 offset = dissect_rpc_string(tvb, tree,
812 hf_nisplus_dump_dir, offset, NULL);
814 offset = dissect_nisplus_time(tvb, offset, tree,
815 hf_nisplus_dump_time);
817 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
818 dissect_directory_server, hf_nisplus_cbservers);
820 return offset;
823 static int
824 dissect_netobj(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
826 offset = dissect_rpc_data(tvb, tree,
827 hf_nisplus_dummy, offset);
829 return offset;
832 static int
833 dissect_nisname(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
835 offset = dissect_rpc_string(tvb, tree,
836 hf_nisplus_object_name, offset, NULL);
838 return offset;
841 static int
842 dissect_ping_args(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
844 offset = dissect_rpc_string(tvb, tree,
845 hf_nisplus_ping_dir, offset, NULL);
847 offset = dissect_nisplus_time(tvb, offset, tree,
848 hf_nisplus_ping_time);
850 return offset;
854 static const value_string nis_error[] = {
855 #define NIS_SUCCESS 0
856 { NIS_SUCCESS, "A-ok, let's rock n roll" },
857 #define NIS_S_SUCCESS 1
858 { NIS_S_SUCCESS, "Name found (maybe)" },
859 #define NIS_NOTFOUND 2
860 { NIS_NOTFOUND, "Name definitely not found" },
861 #define NIS_S_NOTFOUND 3
862 { NIS_S_NOTFOUND, "Name maybe not found" },
863 #define NIS_CACHEEXPIRED 4
864 { NIS_CACHEEXPIRED, "Name exists but cache out of date" },
865 #define NIS_NAMEUNREACHABLE 5
866 { NIS_NAMEUNREACHABLE, "Can't get there from here" },
867 #define NIS_UNKNOWNOBJ 6
868 { NIS_UNKNOWNOBJ, "Object type is bogus" },
869 #define NIS_TRYAGAIN 7
870 { NIS_TRYAGAIN, "I'm busy, call back" },
871 #define NIS_SYSTEMERROR 8
872 { NIS_SYSTEMERROR, "Generic system error" },
873 #define NIS_CHAINBROKEN 9
874 { NIS_CHAINBROKEN, "First/Next warning" },
875 #define NIS_PERMISSION 10
876 { NIS_PERMISSION, "Not enough permission to access" },
877 #define NIS_NOTOWNER 11
878 { NIS_NOTOWNER, "You don't own it, sorry" },
879 #define NIS_NOT_ME 12
880 { NIS_NOT_ME, "I don't serve this name" },
881 #define NIS_NOMEMORY 13
882 { NIS_NOMEMORY, "Outta VM! Help!" },
883 #define NIS_NAMEEXISTS 14
884 { NIS_NAMEEXISTS, "Can't create over another name" },
885 #define NIS_NOTMASTER 15
886 { NIS_NOTMASTER, "I'm just a secondary, don't ask me" },
887 #define NIS_INVALIDOBJ 16
888 { NIS_INVALIDOBJ, "Object is broken somehow" },
889 #define NIS_BADNAME 17
890 { NIS_BADNAME, "Unparsable name" },
891 #define NIS_NOCALLBACK 18
892 { NIS_NOCALLBACK, "Couldn't talk to call back proc" },
893 #define NIS_CBRESULTS 19
894 { NIS_CBRESULTS, "Results being called back to you" },
895 #define NIS_NOSUCHNAME 20
896 { NIS_NOSUCHNAME, "Name unknown" },
897 #define NIS_NOTUNIQUE 21
898 { NIS_NOTUNIQUE, "Value is not uniques (entry)" },
899 #define NIS_IBMODERROR 22
900 { NIS_IBMODERROR, "Inf. Base. Modify error." },
901 #define NIS_NOSUCHTABLE 23
902 { NIS_NOSUCHTABLE, "Name for table was wrong" },
903 #define NIS_TYPEMISMATCH 24
904 { NIS_TYPEMISMATCH, "Entry and table type mismatch" },
905 #define NIS_LINKNAMEERROR 25
906 { NIS_LINKNAMEERROR, "Link points to bogus name" },
907 #define NIS_PARTIAL 26
908 { NIS_PARTIAL, "Partial success, found table" },
909 #define NIS_TOOMANYATTRS 27
910 { NIS_TOOMANYATTRS, "Too many attributes" },
911 #define NIS_RPCERROR 28
912 { NIS_RPCERROR, "RPC error encountered" },
913 #define NIS_BADATTRIBUTE 29
914 { NIS_BADATTRIBUTE, "Bad or invalid attribute" },
915 #define NIS_NOTSEARCHABLE 30
916 { NIS_NOTSEARCHABLE, "Non-searchable object searched" },
917 #define NIS_CBERROR 31
918 { NIS_CBERROR, "Error during callback (svc crash)" },
919 #define NIS_FOREIGNNS 32
920 { NIS_FOREIGNNS, "Foreign Namespace" },
921 #define NIS_BADOBJECT 33
922 { NIS_BADOBJECT, "Malformed object structure" },
923 #define NIS_NOTSAMEOBJ 34
924 { NIS_NOTSAMEOBJ, "Object swapped during deletion" },
925 #define NIS_MODFAIL 35
926 { NIS_MODFAIL, "Failure during a Modify." },
927 #define NIS_BADREQUEST 36
928 { NIS_BADREQUEST, "Illegal query for table" },
929 #define NIS_NOTEMPTY 37
930 { NIS_NOTEMPTY, "Attempt to remove a non-empty tbl" },
931 #define NIS_COLDSTART_ERR 38
932 { NIS_COLDSTART_ERR, "Error accessing the cold start file" },
933 #define NIS_RESYNC 39
934 { NIS_RESYNC, "Transaction log too far out of date" },
935 #define NIS_FAIL 40
936 { NIS_FAIL, "NIS operation failed." },
937 #define NIS_UNAVAIL 41
938 { NIS_UNAVAIL, "NIS+ service is unavailable (client)" },
939 #define NIS_RES2BIG 42
940 { NIS_RES2BIG, "NIS+ result too big for datagram" },
941 #define NIS_SRVAUTH 43
942 { NIS_SRVAUTH, "NIS+ server wasn't authenticated." },
943 #define NIS_CLNTAUTH 44
944 { NIS_CLNTAUTH, "NIS+ Client wasn't authenticated." },
945 #define NIS_NOFILESPACE 45
946 { NIS_NOFILESPACE, "NIS+ server ran out of disk space" },
947 #define NIS_NOPROC 46
948 { NIS_NOPROC, "NIS+ server couldn't create new proc" },
949 #define NIS_DUMPLATER 47
950 { NIS_DUMPLATER, "NIS+ server already has dump child" },
951 { 0, NULL },
954 static int
955 dissect_nisplus_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
957 offset = dissect_rpc_uint32(tvb, tree,
958 hf_nisplus_error, offset);
960 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
961 dissect_nisplus_object, hf_nisplus_object);
963 offset = dissect_rpc_data(tvb, tree,
964 hf_nisplus_cookie, offset);
966 offset = dissect_rpc_uint32(tvb, tree,
967 hf_nisplus_zticks, offset);
969 offset = dissect_rpc_uint32(tvb, tree,
970 hf_nisplus_dticks, offset);
972 offset = dissect_rpc_uint32(tvb, tree,
973 hf_nisplus_aticks, offset);
975 offset = dissect_rpc_uint32(tvb, tree,
976 hf_nisplus_cticks, offset);
978 return offset;
981 static int
982 dissect_fd_result(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
984 offset = dissect_rpc_uint32(tvb, tree,
985 hf_nisplus_error, offset);
987 offset = dissect_rpc_string(tvb, tree,
988 hf_nisplus_fd_dirname, offset, NULL);
990 offset = dissect_rpc_data(tvb, tree,
991 hf_nisplus_dir_data, offset);
993 offset = dissect_rpc_data(tvb, tree,
994 hf_nisplus_signature, offset);
996 return offset;
999 static const value_string entry_type[] = {
1000 #define LOG_NOP 0
1001 { LOG_NOP, "NOP" },
1002 #define LOG_ADD_NAME 1
1003 { LOG_ADD_NAME, "Name Was Added" },
1004 #define LOG_REM_NAME 2
1005 { LOG_REM_NAME, "Name Was Removed" },
1006 #define LOG_MOD_NAME_OLD 3
1007 { LOG_MOD_NAME_OLD, "Name Was Modified" },
1008 #define LOG_MOD_NAME_NEW 4
1009 { LOG_MOD_NAME_NEW, "Name Was Modified" },
1010 #define LOG_ADD_IBASE 5
1011 { LOG_ADD_IBASE, "Entry Added To Information Base" },
1012 #define LOG_REM_IBASE 6
1013 { LOG_REM_IBASE, "Entry Removed From Information Base" },
1014 #define LOG_MOD_IBASE 7
1015 { LOG_MOD_IBASE, "Entry Modified In Information Base" },
1016 #define LOG_UPD_STAMP 8
1017 { LOG_UPD_STAMP, "Update Timestamp" },
1018 { 0, NULL },
1020 static int
1021 dissect_log_entry(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
1023 proto_item* lock_item = NULL;
1024 proto_tree* lock_tree = NULL;
1025 int old_offset = offset;
1027 lock_item = proto_tree_add_item(tree, hf_nisplus_log_entry,
1028 tvb, offset, -1, ENC_NA);
1030 lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_log_entry);
1032 offset = dissect_nisplus_time(tvb, offset, lock_tree,
1033 hf_nisplus_log_time);
1035 offset = dissect_rpc_uint32(tvb, lock_tree,
1036 hf_nisplus_log_type, offset);
1038 offset = dissect_rpc_string(tvb, lock_tree,
1039 hf_nisplus_log_principal, offset, NULL);
1041 offset = dissect_rpc_string(tvb, lock_tree,
1042 hf_nisplus_directory_name, offset, NULL);
1044 offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
1045 dissect_attr, hf_nisplus_attrs_array);
1047 offset = dissect_nisplus_object(tvb, offset, pinfo, lock_tree, data);
1049 proto_item_set_len(lock_item, offset-old_offset);
1050 return offset;
1053 static int
1054 dissect_log_result(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
1056 offset = dissect_rpc_uint32(tvb, tree,
1057 hf_nisplus_error, offset);
1059 offset = dissect_rpc_data(tvb, tree,
1060 hf_nisplus_cookie, offset);
1062 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
1063 dissect_log_entry, hf_nisplus_log_entries);
1065 return offset;
1068 static int
1069 dissect_callback_result(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1071 offset = dissect_rpc_bool(tvb, tree, hf_nisplus_callback_status,
1072 offset);
1074 return offset;
1077 static int
1078 dissect_change_time(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1080 offset = dissect_nisplus_time(tvb, offset, tree,
1081 hf_nisplus_log_time);
1083 return offset;
1086 static int
1087 dissect_cp_result(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1089 offset = dissect_rpc_uint32(tvb, tree,
1090 hf_nisplus_cp_status, offset);
1092 offset = dissect_rpc_uint32(tvb, tree,
1093 hf_nisplus_cp_zticks, offset);
1095 offset = dissect_rpc_uint32(tvb, tree,
1096 hf_nisplus_cp_dticks, offset);
1098 return offset;
1101 static int
1102 dissect_nisplus_error(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1104 offset = dissect_rpc_uint32(tvb, tree,
1105 hf_nisplus_error, offset);
1107 return offset;
1110 /* proc number, "proc name", dissect_request, dissect_reply */
1111 /* NULL as function pointer means: type of arguments is "void". */
1112 static const vsff nisplus3_proc[] = {
1113 { NISPROC_NULL, "NULL",
1114 NULL, NULL },
1115 { NISPROC_LOOKUP, "LOOKUP",
1116 dissect_ns_request, dissect_nisplus_result },
1117 { NISPROC_ADD, "ADD",
1118 dissect_ns_request, dissect_nisplus_result },
1119 { NISPROC_MODIFY, "MODIFY",
1120 dissect_ns_request, dissect_nisplus_result },
1121 { NISPROC_REMOVE, "REMOVE",
1122 dissect_ns_request, dissect_nisplus_result },
1123 { NISPROC_IBLIST, "IBLIST",
1124 dissect_ib_request, dissect_nisplus_result },
1125 { NISPROC_IBADD, "IBADD",
1126 dissect_ib_request, dissect_nisplus_result },
1127 { NISPROC_IBMODIFY, "IBMODIFY",
1128 dissect_ib_request, dissect_nisplus_result },
1129 { NISPROC_IBREMOVE, "IBREMOVE",
1130 dissect_ib_request, dissect_nisplus_result },
1131 { NISPROC_IBFIRST, "IBFIRST",
1132 dissect_ib_request, dissect_nisplus_result },
1133 { NISPROC_IBNEXT, "IBNEXT",
1134 dissect_ib_request, dissect_nisplus_result },
1135 { NISPROC_FINDDIRECTORY, "FINDDIRECTORY",
1136 dissect_fd_args, dissect_fd_result },
1137 { NISPROC_STATUS, "STATUS",
1138 dissect_nisplus_taglist, dissect_nisplus_taglist },
1139 { NISPROC_DUMPLOG, "DUMPLOG",
1140 dissect_dump_args, dissect_log_result },
1141 { NISPROC_DUMP, "DUMP",
1142 dissect_dump_args, dissect_log_result },
1143 { NISPROC_CALLBACK, "CALLBACK",
1144 dissect_netobj, dissect_callback_result },
1145 { NISPROC_CPTIME, "CPTIME",
1146 dissect_nisname, dissect_change_time },
1147 { NISPROC_CHECKPOINT, "CHECKPOINT",
1148 dissect_nisname, dissect_cp_result },
1149 { NISPROC_PING, "PING",
1150 dissect_ping_args, NULL },
1151 { NISPROC_SERVSTATE, "SERVSTATE",
1152 dissect_nisplus_taglist, dissect_nisplus_taglist },
1153 { NISPROC_MKDIR, "MKDIR",
1154 dissect_nisname, dissect_nisplus_error },
1155 { NISPROC_RMDIR, "RMDIR",
1156 dissect_nisname, dissect_nisplus_error },
1157 { NISPROC_UPDKEYS, "UPDKEYS",
1158 dissect_nisname, dissect_nisplus_error },
1159 { 0, NULL, NULL, NULL }
1161 static const value_string nisplus3_proc_vals[] = {
1162 { NISPROC_NULL, "NULL" },
1163 { NISPROC_LOOKUP, "LOOKUP" },
1164 { NISPROC_ADD, "ADD" },
1165 { NISPROC_MODIFY, "MODIFY" },
1166 { NISPROC_REMOVE, "REMOVE" },
1167 { NISPROC_IBLIST, "IBLIST" },
1168 { NISPROC_IBADD, "IBADD" },
1169 { NISPROC_IBMODIFY, "IBMODIFY" },
1170 { NISPROC_IBREMOVE, "IBREMOVE" },
1171 { NISPROC_IBFIRST, "IBFIRST" },
1172 { NISPROC_IBNEXT, "IBNEXT" },
1173 { NISPROC_FINDDIRECTORY, "FINDDIRECTORY" },
1174 { NISPROC_STATUS, "STATUS" },
1175 { NISPROC_DUMPLOG, "DUMPLOG" },
1176 { NISPROC_DUMP, "DUMP" },
1177 { NISPROC_CALLBACK, "CALLBACK" },
1178 { NISPROC_CPTIME, "CPTIME" },
1179 { NISPROC_CHECKPOINT, "CHECKPOINT" },
1180 { NISPROC_PING, "PING" },
1181 { NISPROC_SERVSTATE, "SERVSTATE" },
1182 { NISPROC_MKDIR, "MKDIR" },
1183 { NISPROC_RMDIR, "RMDIR" },
1184 { NISPROC_UPDKEYS, "UPDKEYS" },
1185 { 0, NULL }
1190 void
1191 proto_register_nis(void)
1193 static const true_false_string tfs_col_binary = {
1194 "column is binary",
1195 "column is NOT binary"
1197 static const true_false_string tfs_col_encrypted = {
1198 "column is encrypted",
1199 "column is NOT encrypted"
1201 static const true_false_string tfs_col_xdr = {
1202 "column is xdr encoded",
1203 "column is NOT xdr encoded"
1205 static const true_false_string tfs_col_searchable = {
1206 "column is searchable",
1207 "column is NOT searchable"
1209 static const true_false_string tfs_col_casesensitive = {
1210 "column is case sensitive",
1211 "column is NOT case sensitive"
1213 static const true_false_string tfs_col_modified = {
1214 "column is modified",
1215 "column is NOT modified"
1217 static const true_false_string tfs_col_asn = {
1218 "column is asn.1 encoded",
1219 "column is NOT asn.1 encoded"
1222 static const true_false_string tfs_entry_binary = {
1223 "entry is binary",
1224 "entry is NOT binary"
1227 static const true_false_string tfs_entry_crypt = {
1228 "entry is encrypted",
1229 "entry is NOT encrypted"
1232 static const true_false_string tfs_entry_xdr = {
1233 "entry is xdr encoded",
1234 "entry is NOT xdr encoded"
1237 static const true_false_string tfs_entry_modified = {
1238 "entry is modified",
1239 "entry is NOT modified"
1242 static const true_false_string tfs_entry_asn = {
1243 "entry is asn.1 encoded",
1244 "entry is NOT asn.1 encoded"
1247 static const true_false_string tfs_world_read = {
1248 "world can read",
1249 "world can NOT read"
1252 static const true_false_string tfs_world_modify = {
1253 "world can modify",
1254 "world can NOT modify"
1257 static const true_false_string tfs_world_create = {
1258 "world can create",
1259 "world can NOT create"
1262 static const true_false_string tfs_world_destroy = {
1263 "world can destroy",
1264 "world can NOT destroy"
1267 static const true_false_string tfs_group_read = {
1268 "group can read",
1269 "group can NOT read"
1272 static const true_false_string tfs_group_modify = {
1273 "group can modify",
1274 "group can NOT modify"
1277 static const true_false_string tfs_group_create = {
1278 "group can create",
1279 "group can NOT create"
1282 static const true_false_string tfs_group_destroy = {
1283 "group can destroy",
1284 "group can NOT destroy"
1287 static const true_false_string tfs_owner_read = {
1288 "owner can read",
1289 "owner can NOT read"
1292 static const true_false_string tfs_owner_modify = {
1293 "owner can modify",
1294 "owner can NOT modify"
1297 static const true_false_string tfs_owner_create = {
1298 "owner can create",
1299 "owner can NOT create"
1302 static const true_false_string tfs_owner_destroy = {
1303 "owner can destroy",
1304 "owner can NOT destroy"
1307 static const true_false_string tfs_nobody_read = {
1308 "nobody can read",
1309 "nobody can NOT read"
1312 static const true_false_string tfs_nobody_modify = {
1313 "nobody can modify",
1314 "nobody can NOT modify"
1317 static const true_false_string tfs_nobody_create = {
1318 "nobody can create",
1319 "nobody can NOT create"
1322 static const true_false_string tfs_nobody_destroy = {
1323 "nobody can destroy",
1324 "nobody can NOT destroy"
1327 static const true_false_string tfs_callback_status = {
1328 "unknown",
1329 "unknown"
1335 static hf_register_info hf[] = {
1336 { &hf_nisplus_procedure_v3, {
1337 "V3 Procedure", "nisplus.procedure_v3", FT_UINT32, BASE_DEC,
1338 VALS(nisplus3_proc_vals), 0, NULL, HFILL }},
1339 { &hf_nisplus_object, {
1340 "NIS Object", "nisplus.object", FT_NONE, BASE_NONE,
1341 NULL, 0, NULL, HFILL }},
1343 { &hf_nisplus_oid, {
1344 "Object Identity Verifier", "nisplus.object.oid", FT_NONE, BASE_NONE,
1345 NULL, 0, "NIS Object Identity Verifier", HFILL }},
1347 { &hf_nisplus_object_name, {
1348 "name", "nisplus.object.name", FT_STRING, BASE_NONE,
1349 NULL, 0, "NIS Name For This Object", HFILL }},
1351 { &hf_nisplus_object_owner, {
1352 "owner", "nisplus.object.owner", FT_STRING, BASE_NONE,
1353 NULL, 0, "NIS Name Of Object Owner", HFILL }},
1355 { &hf_nisplus_object_group, {
1356 "group", "nisplus.object.group", FT_STRING, BASE_NONE,
1357 NULL, 0, "NIS Name Of Access Group", HFILL }},
1359 { &hf_nisplus_object_domain, {
1360 "domain", "nisplus.object.domain", FT_STRING, BASE_NONE,
1361 NULL, 0, "NIS Administrator For This Object", HFILL }},
1363 { &hf_nisplus_object_ttl, {
1364 "ttl", "nisplus.object.ttl", FT_UINT32, BASE_DEC,
1365 NULL, 0, "NIS Time To Live For This Object", HFILL }},
1367 { &hf_nisplus_object_private, {
1368 "private", "nisplus.object.private", FT_BYTES, BASE_NONE,
1369 NULL, 0, "NIS Private Object", HFILL }},
1371 { &hf_nisplus_directory, {
1372 "directory", "nisplus.directory", FT_NONE, BASE_NONE,
1373 NULL, 0, "NIS Directory Object", HFILL }},
1375 { &hf_nisplus_directory_name, {
1376 "directory name", "nisplus.directory.name", FT_STRING, BASE_NONE,
1377 NULL, 0, "Name Of Directory Being Served", HFILL }},
1379 { &hf_nisplus_directory_type, {
1380 "type", "nisplus.directory.type", FT_UINT32, BASE_DEC,
1381 VALS(ns_type), 0, "NIS Type Of Name Service", HFILL }},
1383 { &hf_nisplus_directory_ttl, {
1384 "ttl", "nisplus.directory.ttl", FT_UINT32, BASE_DEC,
1385 NULL, 0, "Time To Live", HFILL }},
1387 { &hf_nisplus_directory_mask, {
1388 "mask", "nisplus.directory.mask", FT_NONE, BASE_NONE,
1389 NULL, 0, "NIS Directory Create/Destroy Rights", HFILL }},
1391 { &hf_nisplus_directory_mask_list, {
1392 "mask list", "nisplus.directory.mask_list", FT_NONE, BASE_NONE,
1393 NULL, 0, "List Of Directory Create/Destroy Rights", HFILL }},
1395 { &hf_nisplus_mask_world_read, {
1396 "WORLD READ", "nisplus.directory.mask.world_read",
1397 FT_BOOLEAN, 32, TFS(&tfs_world_read),
1398 NIS_MASK_WORLD_READ, "World Read Flag", HFILL }},
1400 { &hf_nisplus_mask_world_modify, {
1401 "WORLD MODIFY", "nisplus.directory.mask.world_modify",
1402 FT_BOOLEAN, 32, TFS(&tfs_world_modify),
1403 NIS_MASK_WORLD_MODIFY, "World Modify Flag", HFILL }},
1405 { &hf_nisplus_mask_world_create, {
1406 "WORLD CREATE", "nisplus.directory.mask.world_create",
1407 FT_BOOLEAN, 32, TFS(&tfs_world_create),
1408 NIS_MASK_WORLD_CREATE, "World Create Flag", HFILL }},
1410 { &hf_nisplus_mask_world_destroy, {
1411 "WORLD DESTROY", "nisplus.directory.mask.world_destroy",
1412 FT_BOOLEAN, 32, TFS(&tfs_world_destroy),
1413 NIS_MASK_WORLD_DESTROY, "World Destroy Flag", HFILL }},
1415 { &hf_nisplus_mask_group_read, {
1416 "GROUP READ", "nisplus.directory.mask.group_read",
1417 FT_BOOLEAN, 32, TFS(&tfs_group_read),
1418 NIS_MASK_GROUP_READ, "Group Read Flag", HFILL }},
1420 { &hf_nisplus_mask_group_modify, {
1421 "GROUP MODIFY", "nisplus.directory.mask.group_modify",
1422 FT_BOOLEAN, 32, TFS(&tfs_group_modify),
1423 NIS_MASK_GROUP_MODIFY, "Group Modify Flag", HFILL }},
1425 { &hf_nisplus_mask_group_create, {
1426 "GROUP CREATE", "nisplus.directory.mask.group_create",
1427 FT_BOOLEAN, 32, TFS(&tfs_group_create),
1428 NIS_MASK_GROUP_CREATE, "Group Create Flag", HFILL }},
1430 { &hf_nisplus_mask_group_destroy, {
1431 "GROUP DESTROY", "nisplus.directory.mask.group_destroy",
1432 FT_BOOLEAN, 32, TFS(&tfs_group_destroy),
1433 NIS_MASK_GROUP_DESTROY, "Group Destroy Flag", HFILL }},
1435 { &hf_nisplus_mask_owner_read, {
1436 "OWNER READ", "nisplus.directory.mask.owner_read",
1437 FT_BOOLEAN, 32, TFS(&tfs_owner_read),
1438 NIS_MASK_OWNER_READ, "Owner Read Flag", HFILL }},
1440 { &hf_nisplus_mask_owner_modify, {
1441 "OWNER MODIFY", "nisplus.directory.mask.owner_modify",
1442 FT_BOOLEAN, 32, TFS(&tfs_owner_modify),
1443 NIS_MASK_OWNER_MODIFY, "Owner Modify Flag", HFILL }},
1445 { &hf_nisplus_mask_owner_create, {
1446 "OWNER CREATE", "nisplus.directory.mask.owner_create",
1447 FT_BOOLEAN, 32, TFS(&tfs_owner_create),
1448 NIS_MASK_OWNER_CREATE, "Owner Create Flag", HFILL }},
1450 { &hf_nisplus_mask_owner_destroy, {
1451 "OWNER DESTROY", "nisplus.directory.mask.owner_destroy",
1452 FT_BOOLEAN, 32, TFS(&tfs_owner_destroy),
1453 NIS_MASK_OWNER_DESTROY, "Owner Destroy Flag", HFILL }},
1455 { &hf_nisplus_mask_nobody_read, {
1456 "NOBODY READ", "nisplus.directory.mask.nobody_read",
1457 FT_BOOLEAN, 32, TFS(&tfs_nobody_read),
1458 NIS_MASK_NOBODY_READ, "Nobody Read Flag", HFILL }},
1460 { &hf_nisplus_mask_nobody_modify, {
1461 "NOBODY MODIFY", "nisplus.directory.mask.nobody_modify",
1462 FT_BOOLEAN, 32, TFS(&tfs_nobody_modify),
1463 NIS_MASK_NOBODY_MODIFY, "Nobody Modify Flag", HFILL }},
1465 { &hf_nisplus_mask_nobody_create, {
1466 "NOBODY CREATE", "nisplus.directory.mask.nobody_create",
1467 FT_BOOLEAN, 32, TFS(&tfs_nobody_create),
1468 NIS_MASK_NOBODY_CREATE, "Nobody Create Flag", HFILL }},
1470 { &hf_nisplus_mask_nobody_destroy, {
1471 "NOBODY DESTROY", "nisplus.directory.mask.nobody_destroy",
1472 FT_BOOLEAN, 32, TFS(&tfs_nobody_destroy),
1473 NIS_MASK_NOBODY_DESTROY, "Nobody Destroy Flag", HFILL }},
1475 { &hf_nisplus_access_mask, {
1476 "access mask", "nisplus.access.mask", FT_NONE, BASE_NONE,
1477 NULL, 0, "NIS Access Mask", HFILL }},
1479 { &hf_nisplus_object_type, {
1480 "type", "nisplus.object.type", FT_UINT32, BASE_DEC,
1481 VALS(obj_type), 0, "NIS Type Of Object", HFILL }},
1483 { &hf_nisplus_servers, {
1484 "nis servers", "nisplus.servers", FT_NONE, BASE_NONE,
1485 NULL, 0, "NIS Servers For This Directory", HFILL }},
1487 { &hf_nisplus_cbservers, {
1488 "nis servers", "nisplus.servers", FT_NONE, BASE_NONE,
1489 NULL, 0, "Optional Callback Server", HFILL }},
1491 { &hf_nisplus_server, {
1492 "server", "nisplus.server", FT_NONE, BASE_NONE,
1493 NULL, 0, "NIS Server For This Directory", HFILL }},
1495 { &hf_nisplus_server_name, {
1496 "name", "nisplus.server.name", FT_STRING, BASE_NONE,
1497 NULL, 0, "Name Of NIS Server", HFILL }},
1499 { &hf_nisplus_key_type, {
1500 "type", "nisplus.key.type", FT_UINT32, BASE_DEC,
1501 VALS(key_type), 0, "Type Of Key", HFILL }},
1503 { &hf_nisplus_key_data, {
1504 "key data", "nisplus.key.data", FT_BYTES, BASE_NONE,
1505 NULL, 0, "Encryption Key", HFILL }},
1507 { &hf_nisplus_endpoints, {
1508 "nis endpoints", "nisplus.endpoints", FT_NONE, BASE_NONE,
1509 NULL, 0, "Endpoints For This NIS Server", HFILL }},
1511 { &hf_nisplus_endpoint, {
1512 "endpoint", "nisplus.endpoint", FT_NONE, BASE_NONE,
1513 NULL, 0, "Endpoint For This NIS Server", HFILL }},
1515 { &hf_nisplus_endpoint_uaddr, {
1516 "addr", "nisplus.endpoint.uaddr", FT_STRING, BASE_NONE,
1517 NULL, 0, "Address", HFILL }},
1519 { &hf_nisplus_endpoint_family, {
1520 "family", "nisplus.endpoint.family", FT_STRING, BASE_NONE,
1521 NULL, 0, "Transport Family", HFILL }},
1523 { &hf_nisplus_endpoint_proto, {
1524 "proto", "nisplus.endpoint.proto", FT_STRING, BASE_NONE,
1525 NULL, 0, "Protocol", HFILL }},
1527 { &hf_nisplus_link, {
1528 "link", "nisplus.link", FT_NONE, BASE_NONE,
1529 NULL, 0, "NIS Link Object", HFILL }},
1531 { &hf_nisplus_attrs_array, {
1532 "Attributes", "nisplus.attributes", FT_NONE, BASE_NONE,
1533 NULL, 0, "List Of Attributes", HFILL }},
1535 { &hf_nisplus_attr, {
1536 "Attribute", "nisplus.attr", FT_NONE, BASE_NONE,
1537 NULL, 0, NULL, HFILL }},
1539 { &hf_nisplus_attr_name, {
1540 "name", "nisplus.attr.name", FT_STRING, BASE_NONE,
1541 NULL, 0, "Attribute Name", HFILL }},
1543 { &hf_nisplus_attr_val, {
1544 "val", "nisplus.attr.val", FT_BYTES, BASE_NONE,
1545 NULL, 0, "Attribute Value", HFILL }},
1547 { &hf_nisplus_entry, {
1548 "entry", "nisplus.entry", FT_NONE, BASE_NONE,
1549 NULL, 0, "Entry Object", HFILL }},
1551 { &hf_nisplus_entry_type, {
1552 "type", "nisplus.entry.type", FT_STRING, BASE_NONE,
1553 NULL, 0, "Entry Type", HFILL }},
1555 { &hf_nisplus_entry_cols, {
1556 "columns", "nisplus.entry.cols", FT_NONE, BASE_NONE,
1557 NULL, 0, "Entry Columns", HFILL }},
1559 { &hf_nisplus_entry_col, {
1560 "column", "nisplus.entry.col", FT_NONE, BASE_NONE,
1561 NULL, 0, "Entry Column", HFILL }},
1563 #if 0
1564 { &hf_nisplus_entry_flags, {
1565 "flags", "nisplus.entry.flags", FT_UINT32, BASE_HEX,
1566 NULL, 0, "Entry Col Flags", HFILL }},
1567 #endif
1569 { &hf_nisplus_entry_val, {
1570 "val", "nisplus.entry.val", FT_STRING, BASE_NONE,
1571 NULL, 0, "Entry Value", HFILL }},
1573 { &hf_nisplus_entry_mask, {
1574 "mask", "nisplus.entry.mask", FT_NONE, BASE_NONE,
1575 NULL, 0, "Entry Col Mask", HFILL }},
1577 { &hf_nisplus_entry_mask_binary, {
1578 "BINARY", "nisplus.entry.mask.binary",
1579 FT_BOOLEAN, 32, TFS(&tfs_entry_binary),
1580 NIS_MASK_ENTRY_BINARY, "Is This Entry BINARY Flag", HFILL }},
1582 { &hf_nisplus_entry_mask_crypt, {
1583 "ENCRYPTED", "nisplus.entry.mask.encrypted",
1584 FT_BOOLEAN, 32, TFS(&tfs_entry_crypt),
1585 NIS_MASK_ENTRY_CRYPT, "Is This Entry ENCRYPTED Flag", HFILL }},
1587 { &hf_nisplus_entry_mask_xdr, {
1588 "XDR", "nisplus.entry.mask.xdr",
1589 FT_BOOLEAN, 32, TFS(&tfs_entry_xdr),
1590 NIS_MASK_ENTRY_XDR, "Is This Entry XDR Encoded Flag", HFILL }},
1592 { &hf_nisplus_entry_mask_modified, {
1593 "MODIFIED", "nisplus.entry.mask.modified",
1594 FT_BOOLEAN, 32, TFS(&tfs_entry_modified),
1595 NIS_MASK_ENTRY_MODIFIED, "Is This Entry MODIFIED Flag", HFILL }},
1597 { &hf_nisplus_entry_mask_asn, {
1598 "ASN.1", "nisplus.entry.mask.asn",
1599 FT_BOOLEAN, 32, TFS(&tfs_entry_asn),
1600 NIS_MASK_ENTRY_ASN, "Is This Entry ASN.1 Encoded Flag", HFILL }},
1602 { &hf_nisplus_table, {
1603 "table", "nisplus.table", FT_NONE, BASE_NONE,
1604 NULL, 0, "Table Object", HFILL }},
1606 { &hf_nisplus_table_type, {
1607 "type", "nisplus.table.type", FT_STRING, BASE_NONE,
1608 NULL, 0, "Table Type", HFILL }},
1610 { &hf_nisplus_table_maxcol, {
1611 "max columns", "nisplus.table.maxcol", FT_UINT16, BASE_DEC,
1612 NULL, 0, "Maximum Number Of Columns For Table", HFILL }},
1614 { &hf_nisplus_table_sep, {
1615 "separator", "nisplus.table.separator", FT_UINT8, BASE_HEX,
1616 NULL, 0, "Separator Character", HFILL }},
1618 { &hf_nisplus_table_cols, {
1619 "columns", "nisplus.table.cols", FT_NONE, BASE_NONE,
1620 NULL, 0, "Table Columns", HFILL }},
1622 { &hf_nisplus_table_col, {
1623 "column", "nisplus.table.col", FT_NONE, BASE_NONE,
1624 NULL, 0, "Table Column", HFILL }},
1626 { &hf_nisplus_table_path, {
1627 "path", "nisplus.table.path", FT_STRING, BASE_NONE,
1628 NULL, 0, "Table Path", HFILL }},
1630 { &hf_nisplus_table_col_name, {
1631 "column name", "nisplus.table.col.name", FT_STRING, BASE_NONE,
1632 NULL, 0, NULL, HFILL }},
1634 { &hf_nisplus_table_col_mask, {
1635 "flags", "nisplus.table.col.flags", FT_NONE, BASE_NONE,
1636 NULL, 0, "Flags For This Column", HFILL }},
1638 { &hf_nisplus_table_col_mask_binary, {
1639 "binary", "nisplus.table.flags.binary",
1640 FT_BOOLEAN, 32, TFS(&tfs_col_binary),
1641 NIS_MASK_TABLE_BINARY, "Is This Column BINARY", HFILL }},
1643 { &hf_nisplus_table_col_mask_encrypted, {
1644 "encrypted", "nisplus.table.flags.encrypted",
1645 FT_BOOLEAN, 32, TFS(&tfs_col_encrypted),
1646 NIS_MASK_TABLE_CRYPT, "Is This Column ENCRYPTED", HFILL }},
1648 { &hf_nisplus_table_col_mask_xdr, {
1649 "xdr", "nisplus.table.flags.xdr",
1650 FT_BOOLEAN, 32, TFS(&tfs_col_xdr),
1651 NIS_MASK_TABLE_XDR, "Is This Column XDR Encoded", HFILL }},
1653 { &hf_nisplus_table_col_mask_searchable, {
1654 "searchable", "nisplus.table.flags.searchable",
1655 FT_BOOLEAN, 32, TFS(&tfs_col_searchable),
1656 NIS_MASK_TABLE_SRCH, "Is This Column SEARCHABLE", HFILL }},
1658 { &hf_nisplus_table_col_mask_casesensitive, {
1659 "casesensitive", "nisplus.table.flags.casesensitive",
1660 FT_BOOLEAN, 32, TFS(&tfs_col_casesensitive),
1661 NIS_MASK_TABLE_CASE, "Is This Column CASESENSITIVE", HFILL }},
1663 { &hf_nisplus_table_col_mask_modified, {
1664 "modified", "nisplus.table.flags.modified",
1665 FT_BOOLEAN, 32, TFS(&tfs_col_modified),
1666 NIS_MASK_TABLE_MODIFIED, "Is This Column MODIFIED", HFILL }},
1668 { &hf_nisplus_table_col_mask_asn, {
1669 "asn", "nisplus.table.flags.asn",
1670 FT_BOOLEAN, 32, TFS(&tfs_col_asn),
1671 NIS_MASK_TABLE_ASN, "Is This Column ASN.1 Encoded", HFILL }},
1673 { &hf_nisplus_group, {
1674 "Group", "nisplus.group", FT_NONE, BASE_NONE,
1675 NULL, 0, "Group Object", HFILL }},
1677 { &hf_nisplus_grps, {
1678 "Groups", "nisplus.grps", FT_NONE, BASE_NONE,
1679 NULL, 0, "List Of Groups", HFILL }},
1681 { &hf_nisplus_group_flags, {
1682 "flags", "nisplus.group.flags", FT_UINT32, BASE_HEX,
1683 NULL, 0, "Group Object Flags", HFILL }},
1685 { &hf_nisplus_group_name, {
1686 "group name", "nisplus.group.name", FT_STRING, BASE_NONE,
1687 NULL, 0, "Name Of Group Member", HFILL }},
1689 { &hf_nisplus_object_ctime, {
1690 "ctime", "nisplus.ctime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1691 NULL, 0, "Time Of Creation", HFILL }},
1693 { &hf_nisplus_object_mtime, {
1694 "mtime", "nisplus.mtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1695 NULL, 0, "Time Last Modified", HFILL }},
1697 { &hf_nisplus_ib_flags, {
1698 "flags", "nisplus.ib.flags", FT_UINT32, BASE_HEX,
1699 NULL, 0, "Information Base Flags", HFILL }},
1701 { &hf_nisplus_ib_bufsize, {
1702 "bufsize", "nisplus.ib.bufsize", FT_UINT32, BASE_HEX,
1703 NULL, 0, "Optional First/NextBufSize", HFILL }},
1705 { &hf_nisplus_cookie, {
1706 "cookie", "nisplus.cookie", FT_BYTES, BASE_NONE,
1707 NULL, 0, NULL, HFILL }},
1709 { &hf_nisplus_fd_dirname, {
1710 "dirname", "nisplus.fd.dirname", FT_STRING, BASE_NONE,
1711 NULL, 0, "Directory Name", HFILL }},
1713 { &hf_nisplus_fd_requester, {
1714 "requester", "nisplus.fd.requester", FT_STRING, BASE_NONE,
1715 NULL, 0, "Host Principal Name For Signature", HFILL }},
1717 { &hf_nisplus_taglist, {
1718 "taglist", "nisplus.taglist", FT_NONE, BASE_NONE,
1719 NULL, 0, "List Of Tags", HFILL }},
1721 { &hf_nisplus_tag, {
1722 "tag", "nisplus.tag", FT_NONE, BASE_NONE,
1723 NULL, 0, NULL, HFILL }},
1725 { &hf_nisplus_tag_type, {
1726 "type", "nisplus.tag.type", FT_UINT32, BASE_DEC,
1727 NULL, 0, "Type Of Statistics Tag", HFILL }},
1729 { &hf_nisplus_tag_val, {
1730 "value", "nisplus.tag.value", FT_STRING, BASE_NONE,
1731 NULL, 0, "Value Of Statistics Tag", HFILL }},
1733 { &hf_nisplus_dump_dir, {
1734 "directory", "nisplus.dump.dir", FT_STRING, BASE_NONE,
1735 NULL, 0, "Directory To Dump", HFILL }},
1737 { &hf_nisplus_dump_time, {
1738 "time", "nisplus.dump.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1739 NULL, 0, "From This Timestamp", HFILL }},
1741 { &hf_nisplus_dummy, {
1742 "dummy", "nisplus.dummy", FT_BYTES, BASE_NONE,
1743 NULL, 0, NULL, HFILL }},
1745 { &hf_nisplus_ping_time, {
1746 "time", "nisplus.ping.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1747 NULL, 0, "Timestamp Of The Transaction", HFILL }},
1749 { &hf_nisplus_ping_dir, {
1750 "directory", "nisplus.ping.dir", FT_STRING, BASE_NONE,
1751 NULL, 0, "Directory That Had The Change", HFILL }},
1753 { &hf_nisplus_error, {
1754 "status", "nisplus.status", FT_UINT32, BASE_DEC,
1755 VALS(nis_error), 0, "NIS Status Code", HFILL }},
1757 { &hf_nisplus_dir_data, {
1758 "data", "nisplus.fd.dir.data", FT_BYTES, BASE_NONE,
1759 NULL, 0, "Directory Data In XDR Format", HFILL }},
1761 { &hf_nisplus_signature, {
1762 "signature", "nisplus.fd.sig", FT_BYTES, BASE_NONE,
1763 NULL, 0, "Signature Of The Source", HFILL }},
1765 { &hf_nisplus_log_entries, {
1766 "log entries", "nisplus.log.entries", FT_NONE, BASE_NONE,
1767 NULL, 0, NULL, HFILL }},
1769 { &hf_nisplus_log_entry, {
1770 "log entry", "nisplus.log.entry", FT_NONE, BASE_NONE,
1771 NULL, 0, NULL, HFILL }},
1773 { &hf_nisplus_log_time, {
1774 "time", "nisplus.log.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1775 NULL, 0, "Time Of Log Entry", HFILL }},
1777 { &hf_nisplus_log_type, {
1778 "type", "nisplus.log.entry.type", FT_UINT32, BASE_DEC,
1779 VALS(entry_type), 0, "Type Of Entry In Transaction Log", HFILL }},
1781 { &hf_nisplus_log_principal, {
1782 "principal", "nisplus.log.principal", FT_STRING, BASE_NONE,
1783 NULL, 0, "Principal Making The Change", HFILL }},
1785 { &hf_nisplus_callback_status, {
1786 "status", "nisplus.callback.status",
1787 FT_BOOLEAN, BASE_NONE, TFS(&tfs_callback_status),
1788 0x0, "Status Of Callback Thread", HFILL }},
1790 { &hf_nisplus_cp_status, {
1791 "status", "nisplus.checkpoint.status", FT_UINT32, BASE_DEC,
1792 NULL, 0, "Checkpoint Status", HFILL }},
1794 { &hf_nisplus_cp_zticks, {
1795 "zticks", "nisplus.checkpoint.zticks", FT_UINT32, BASE_DEC,
1796 NULL, 0, "Service Ticks", HFILL }},
1798 { &hf_nisplus_cp_dticks, {
1799 "dticks", "nisplus.checkpoint.dticks", FT_UINT32, BASE_DEC,
1800 NULL, 0, "Database Ticks", HFILL }},
1802 { &hf_nisplus_zticks, {
1803 "zticks", "nisplus.zticks", FT_UINT32, BASE_DEC,
1804 NULL, 0, NULL, HFILL }},
1806 { &hf_nisplus_dticks, {
1807 "dticks", "nisplus.dticks", FT_UINT32, BASE_DEC,
1808 NULL, 0, NULL, HFILL }},
1810 { &hf_nisplus_aticks, {
1811 "aticks", "nisplus.aticks", FT_UINT32, BASE_DEC,
1812 NULL, 0, NULL, HFILL }},
1814 { &hf_nisplus_cticks, {
1815 "cticks", "nisplus.cticks", FT_UINT32, BASE_DEC,
1816 NULL, 0, NULL, HFILL }},
1820 static gint *ett[] = {
1821 &ett_nisplus,
1822 &ett_nisplus_object,
1823 &ett_nisplus_oid,
1824 &ett_nisplus_directory,
1825 &ett_nisplus_directory_mask,
1826 &ett_nisplus_access_mask,
1827 &ett_nisplus_server,
1828 &ett_nisplus_endpoint,
1829 &ett_nisplus_link,
1830 &ett_nisplus_attr,
1831 &ett_nisplus_entry,
1832 &ett_nisplus_entry_col,
1833 &ett_nisplus_entry_mask,
1834 &ett_nisplus_table,
1835 &ett_nisplus_table_col,
1836 &ett_nisplus_table_col_mask,
1837 &ett_nisplus_group,
1838 &ett_nisplus_grps,
1839 &ett_nisplus_tag,
1840 &ett_nisplus_log_entry,
1843 proto_nisplus = proto_register_protocol("NIS+",
1844 "NIS+", "nisplus");
1845 proto_register_field_array(proto_nisplus, hf, array_length(hf));
1846 proto_register_subtree_array(ett, array_length(ett));
1849 void
1850 proto_reg_handoff_nis(void)
1852 /* Register the protocol as RPC */
1853 rpc_init_prog(proto_nisplus, NIS_PROGRAM, ett_nisplus);
1854 /* Register the procedure tables */
1855 rpc_init_proc_table(NIS_PROGRAM, 3, nisplus3_proc, hf_nisplus_procedure_v3);
1863 /* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1864 callback protocol for NIS+
1865 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
1867 static int proto_nispluscb = -1;
1868 static int hf_nispluscb_procedure_v1 = -1;
1869 static int hf_nispluscb_entries = -1;
1870 static int hf_nispluscb_entry = -1;
1872 static gint ett_nispluscb = -1;
1873 static gint ett_nispluscb_entry = -1;
1875 static int
1876 dissect_cb_entry(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1878 proto_item* lock_item = NULL;
1879 /* proto_tree* lock_tree = NULL; */
1880 int old_offset = offset;
1882 lock_item = proto_tree_add_item(tree, hf_nispluscb_entry,
1883 tvb, offset, -1, ENC_NA);
1885 /* lock_tree = proto_item_add_subtree(lock_item, ett_nispluscb_entry); */
1887 /*XXXXX Not implemented yet*/
1889 proto_item_set_len(lock_item, offset-old_offset);
1890 return offset;
1893 static int
1894 dissect_cback_data(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
1896 offset = dissect_rpc_array(tvb, pinfo, tree, offset,
1897 dissect_cb_entry, hf_nispluscb_entries);
1899 return offset;
1902 /* proc number, "proc name", dissect_request, dissect_reply */
1903 /* NULL as function pointer means: type of arguments is "void". */
1904 static const vsff cb1_proc[] = {
1905 { CBPROC_NULL, "NULL",
1906 NULL, NULL },
1907 { CBPROC_RECEIVE, "RECEIVE",
1908 dissect_cback_data, dissect_callback_result },
1909 { CBPROC_FINISH, "FINISH",
1910 NULL, NULL },
1911 { CBPROC_ERROR, "ERROR",
1912 dissect_nisplus_error, NULL },
1913 { 0, NULL, NULL, NULL },
1915 static const value_string nispluscb1_proc_vals[] = {
1916 { CBPROC_NULL, "NULL" },
1917 { CBPROC_RECEIVE, "RECEIVE" },
1918 { CBPROC_FINISH, "FINISH" },
1919 { CBPROC_ERROR, "ERROR" },
1920 { 0, NULL }
1923 void
1924 proto_register_niscb(void)
1926 static hf_register_info hf[] = {
1927 { &hf_nispluscb_procedure_v1, {
1928 "V1 Procedure", "nispluscb.procedure_v1", FT_UINT32, BASE_DEC,
1929 VALS(nispluscb1_proc_vals), 0, NULL, HFILL }},
1930 { &hf_nispluscb_entries, {
1931 "entries", "nispluscb.entries", FT_NONE, BASE_NONE,
1932 NULL, 0, "NIS Callback Entries", HFILL }},
1934 { &hf_nispluscb_entry, {
1935 "entry", "nispluscb.entry", FT_NONE, BASE_NONE,
1936 NULL, 0, "NIS Callback Entry", HFILL }},
1940 static gint *ett[] = {
1941 &ett_nispluscb,
1942 &ett_nispluscb_entry,
1945 proto_nispluscb = proto_register_protocol("NIS+ Callback",
1946 "NIS+ CB", "nispluscb");
1947 proto_register_field_array(proto_nispluscb, hf, array_length(hf));
1948 proto_register_subtree_array(ett, array_length(ett));
1951 void
1952 proto_reg_handoff_niscb(void)
1954 /* Register the protocol as RPC */
1955 rpc_init_prog(proto_nispluscb, CB_PROGRAM, ett_nispluscb);
1956 /* Register the procedure tables */
1957 rpc_init_proc_table(CB_PROGRAM, 1, cb1_proc, hf_nispluscb_procedure_v1);