Coverage Report

Created: 2026-09-28 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-nisplus.c
Line
Count
Source
1
/* packet-nisplus.c
2
 * 2001  Ronnie Sahlberg   <See AUTHORS for email>
3
 *
4
 * Wireshark - Network traffic analyzer
5
 * By Gerald Combs <gerald@wireshark.org>
6
 * Copyright 1998 Gerald Combs
7
 *
8
 * SPDX-License-Identifier: GPL-2.0-or-later
9
 */
10
11
#include "config.h"
12
13
#include <epan/tfs.h>
14
#include <wsutil/array.h>
15
#include "packet-rpc.h"
16
#include "packet-nisplus.h"
17
18
void proto_register_nis(void);
19
void proto_reg_handoff_nis(void);
20
void proto_register_niscb(void);
21
void proto_reg_handoff_niscb(void);
22
23
static int proto_nisplus;
24
static int hf_nisplus_procedure_v3;
25
static int hf_nisplus_object;
26
static int hf_nisplus_oid;
27
static int hf_nisplus_object_ctime;
28
static int hf_nisplus_object_mtime;
29
static int hf_nisplus_object_name;
30
static int hf_nisplus_object_owner;
31
static int hf_nisplus_object_group;
32
static int hf_nisplus_object_domain;
33
static int hf_nisplus_object_ttl;
34
static int hf_nisplus_object_type;
35
static int hf_nisplus_object_private;
36
static int hf_nisplus_directory;
37
static int hf_nisplus_directory_name;
38
static int hf_nisplus_directory_type;
39
static int hf_nisplus_directory_ttl;
40
static int hf_nisplus_directory_mask;
41
static int hf_nisplus_directory_mask_list;
42
static int hf_nisplus_access_mask;
43
static int hf_nisplus_mask_world_read;
44
static int hf_nisplus_mask_world_modify;
45
static int hf_nisplus_mask_world_create;
46
static int hf_nisplus_mask_world_destroy;
47
static int hf_nisplus_mask_group_read;
48
static int hf_nisplus_mask_group_modify;
49
static int hf_nisplus_mask_group_create;
50
static int hf_nisplus_mask_group_destroy;
51
static int hf_nisplus_mask_owner_read;
52
static int hf_nisplus_mask_owner_modify;
53
static int hf_nisplus_mask_owner_create;
54
static int hf_nisplus_mask_owner_destroy;
55
static int hf_nisplus_mask_nobody_read;
56
static int hf_nisplus_mask_nobody_modify;
57
static int hf_nisplus_mask_nobody_create;
58
static int hf_nisplus_mask_nobody_destroy;
59
static int hf_nisplus_server_name;
60
static int hf_nisplus_key_type;
61
static int hf_nisplus_key_data;
62
static int hf_nisplus_servers;
63
static int hf_nisplus_cbservers;
64
static int hf_nisplus_server;
65
static int hf_nisplus_endpoints;
66
static int hf_nisplus_endpoint;
67
static int hf_nisplus_endpoint_uaddr;
68
static int hf_nisplus_endpoint_family;
69
static int hf_nisplus_endpoint_proto;
70
static int hf_nisplus_link;
71
static int hf_nisplus_attrs_array;
72
static int hf_nisplus_attr;
73
static int hf_nisplus_attr_name;
74
static int hf_nisplus_attr_val;
75
static int hf_nisplus_entry;
76
static int hf_nisplus_entry_type;
77
static int hf_nisplus_entry_cols;
78
static int hf_nisplus_entry_col;
79
/* static int hf_nisplus_entry_flags; */
80
static int hf_nisplus_entry_val;
81
static int hf_nisplus_entry_mask;
82
static int hf_nisplus_entry_mask_binary;
83
static int hf_nisplus_entry_mask_crypt;
84
static int hf_nisplus_entry_mask_xdr;
85
static int hf_nisplus_entry_mask_modified;
86
static int hf_nisplus_entry_mask_asn;
87
static int hf_nisplus_table;
88
static int hf_nisplus_table_type;
89
static int hf_nisplus_table_maxcol;
90
static int hf_nisplus_table_sep;
91
static int hf_nisplus_table_cols;
92
static int hf_nisplus_table_col;
93
static int hf_nisplus_table_path;
94
static int hf_nisplus_table_col_name;
95
static int hf_nisplus_table_col_mask;
96
static int hf_nisplus_table_col_mask_binary;
97
static int hf_nisplus_table_col_mask_encrypted;
98
static int hf_nisplus_table_col_mask_xdr;
99
static int hf_nisplus_table_col_mask_searchable;
100
static int hf_nisplus_table_col_mask_casesensitive;
101
static int hf_nisplus_table_col_mask_modified;
102
static int hf_nisplus_table_col_mask_asn;
103
static int hf_nisplus_group;
104
static int hf_nisplus_group_flags;
105
static int hf_nisplus_grps;
106
static int hf_nisplus_group_name;
107
static int hf_nisplus_ib_flags;
108
static int hf_nisplus_ib_bufsize;
109
static int hf_nisplus_cookie;
110
static int hf_nisplus_fd_dirname;
111
static int hf_nisplus_fd_requester;
112
static int hf_nisplus_taglist;
113
static int hf_nisplus_tag;
114
static int hf_nisplus_tag_type;
115
static int hf_nisplus_tag_val;
116
static int hf_nisplus_dump_dir;
117
static int hf_nisplus_dump_time;
118
static int hf_nisplus_dummy;
119
static int hf_nisplus_ping_dir;
120
static int hf_nisplus_ping_time;
121
static int hf_nisplus_error;
122
static int hf_nisplus_dir_data;
123
static int hf_nisplus_signature;
124
static int hf_nisplus_log_entries;
125
static int hf_nisplus_log_entry;
126
static int hf_nisplus_log_type;
127
static int hf_nisplus_log_time;
128
static int hf_nisplus_log_principal;
129
static int hf_nisplus_callback_status;
130
static int hf_nisplus_cp_status;
131
static int hf_nisplus_cp_zticks;
132
static int hf_nisplus_cp_dticks;
133
static int hf_nisplus_zticks;
134
static int hf_nisplus_dticks;
135
static int hf_nisplus_aticks;
136
static int hf_nisplus_cticks;
137
138
static int ett_nisplus;
139
static int ett_nisplus_object;
140
static int ett_nisplus_oid;
141
static int ett_nisplus_directory;
142
static int ett_nisplus_directory_mask;
143
static int ett_nisplus_access_mask;
144
static int ett_nisplus_server;
145
static int ett_nisplus_endpoint;
146
static int ett_nisplus_link;
147
static int ett_nisplus_attr;
148
static int ett_nisplus_entry;
149
static int ett_nisplus_entry_col;
150
static int ett_nisplus_entry_mask;
151
static int ett_nisplus_table;
152
static int ett_nisplus_table_col;
153
static int ett_nisplus_table_col_mask;
154
static int ett_nisplus_group;
155
static int ett_nisplus_grps;
156
static int ett_nisplus_tag;
157
static int ett_nisplus_log_entry;
158
159
160
16
#define NIS_MASK_TABLE_BINARY   0x00000001
161
16
#define NIS_MASK_TABLE_CRYPT    0x00000002
162
16
#define NIS_MASK_TABLE_XDR      0x00000004
163
16
#define NIS_MASK_TABLE_SRCH     0x00000008
164
16
#define NIS_MASK_TABLE_CASE     0x00000010
165
16
#define NIS_MASK_TABLE_MODIFIED 0x00000020
166
16
#define NIS_MASK_TABLE_ASN      0x00000040
167
168
169
16
#define NIS_MASK_ENTRY_BINARY   0x00000001
170
16
#define NIS_MASK_ENTRY_CRYPT    0x00000002
171
16
#define NIS_MASK_ENTRY_XDR      0x00000004
172
16
#define NIS_MASK_ENTRY_MODIFIED 0x00000008
173
16
#define NIS_MASK_ENTRY_ASN      0x00000040
174
175
176
16
#define NIS_MASK_WORLD_READ     0x00000001
177
16
#define NIS_MASK_WORLD_MODIFY   0x00000002
178
16
#define NIS_MASK_WORLD_CREATE   0x00000004
179
16
#define NIS_MASK_WORLD_DESTROY  0x00000008
180
16
#define NIS_MASK_GROUP_READ     0x00000010
181
16
#define NIS_MASK_GROUP_MODIFY   0x00000020
182
16
#define NIS_MASK_GROUP_CREATE   0x00000040
183
16
#define NIS_MASK_GROUP_DESTROY  0x00000080
184
16
#define NIS_MASK_OWNER_READ     0x00000100
185
16
#define NIS_MASK_OWNER_MODIFY   0x00000200
186
16
#define NIS_MASK_OWNER_CREATE   0x00000400
187
16
#define NIS_MASK_OWNER_DESTROY  0x00000800
188
16
#define NIS_MASK_NOBODY_READ    0x00001000
189
16
#define NIS_MASK_NOBODY_MODIFY  0x00002000
190
16
#define NIS_MASK_NOBODY_CREATE  0x00004000
191
16
#define NIS_MASK_NOBODY_DESTROY 0x00008000
192
193
194
static const value_string key_type[] = {
195
#define NIS_KEY_NONE    0
196
  { NIS_KEY_NONE,   "No Public Key (unix/sys auth)" },
197
#define NIS_KEY_DH    1
198
  { NIS_KEY_DH,   "Diffie-Hellman"  },
199
#define NIS_KEY_RSA   2
200
  { NIS_KEY_RSA,    "RSA" },
201
#define NIS_KEY_KERB    3
202
  { NIS_KEY_KERB,   "Kerberos"  },
203
#define NIS_KEY_DHEXT   4
204
  { NIS_KEY_DHEXT,    "Extended Diffie-Hellman for RPC-GSS" },
205
  { 0,  NULL  },
206
};
207
208
static const value_string obj_type[] = {
209
0
#define NIS_BOGUS_OBJ   0
210
  { NIS_BOGUS_OBJ,    "Bogus Object"  },
211
0
#define NIS_NO_OBJ    1
212
  { NIS_NO_OBJ,   "NULL Object" },
213
0
#define NIS_DIRECTORY_OBJ 2
214
  { NIS_DIRECTORY_OBJ,  "Directory Object"  },
215
0
#define NIS_GROUP_OBJ   3
216
  { NIS_GROUP_OBJ,    "Group Object"  },
217
0
#define NIS_TABLE_OBJ   4
218
  { NIS_TABLE_OBJ,    "Table Object"  },
219
0
#define NIS_ENTRY_OBJ   5
220
  { NIS_ENTRY_OBJ,    "Entry Object"  },
221
0
#define NIS_LINK_OBJ    6
222
  { NIS_LINK_OBJ,   "Link Object" },
223
0
#define NIS_PRIVATE_OBJ   7
224
  { NIS_PRIVATE_OBJ,  "Private Object"  },
225
  { 0,  NULL  },
226
};
227
228
static const value_string ns_type[] = {
229
#define NIS_TYPE_UNKNOWN  0
230
  { NIS_TYPE_UNKNOWN, "UNKNOWN" },
231
#define NIS_TYPE_NIS    1
232
  { NIS_TYPE_NIS, "NIS Plus Service"  },
233
#define NIS_TYPE_SUNYP    2
234
  { NIS_TYPE_SUNYP, "Old NIS Service (YP)"  },
235
#define NIS_TYPE_IVY    3
236
  { NIS_TYPE_IVY, "NIS Plus Plus Service" },
237
#define NIS_TYPE_DNS    4
238
  { NIS_TYPE_DNS, "Domain Name Service (DNS)" },
239
#define NIS_TYPE_X500   5
240
  { NIS_TYPE_X500,  "ISO/CCITT X.500 Service" },
241
#define NIS_TYPE_DNANS    6
242
  { NIS_TYPE_DNANS, "Digital DECNet Name Service" },
243
#define NIS_TYPE_XCHS   7
244
  { NIS_TYPE_XCHS,  "Xerox ClearingHouse Service" },
245
#define NIS_TYPE_CDS    8
246
  { NIS_TYPE_CDS, "CDS" },
247
  { 0,  NULL  },
248
};
249
250
251
252
253
static unsigned
254
dissect_nisplus_time(tvbuff_t *tvb, unsigned offset, proto_tree *tree, int hfindex)
255
0
{
256
0
  nstime_t ts;
257
258
0
  ts.nsecs = 0;
259
0
  ts.secs = tvb_get_ntohl(tvb, offset);
260
0
  offset += 4;
261
262
0
  proto_tree_add_time(tree, hfindex, tvb, offset, 4, &ts);
263
264
0
  return offset;
265
0
}
266
267
static int
268
dissect_group(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
269
0
{
270
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
271
0
      hf_nisplus_group_name, offset, NULL);
272
273
0
  return offset;
274
0
}
275
276
277
static unsigned
278
dissect_group_obj(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree)
279
0
{
280
0
  proto_item* lock_item = NULL;
281
0
  proto_tree* lock_tree = NULL;
282
0
  int old_offset = offset;
283
284
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_group,
285
0
      tvb, offset, -1, ENC_NA);
286
287
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_group);
288
289
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
290
0
      hf_nisplus_group_flags, offset);
291
292
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
293
0
      dissect_group, hf_nisplus_grps);
294
295
0
  proto_item_set_len(lock_item, offset-old_offset);
296
0
  return offset;
297
0
}
298
299
300
static unsigned
301
dissect_access_rights(tvbuff_t *tvb, unsigned offset, proto_tree *tree)
302
0
{
303
0
  static int * const flags[] = {
304
0
    &hf_nisplus_mask_world_read,
305
0
    &hf_nisplus_mask_world_modify,
306
0
    &hf_nisplus_mask_world_create,
307
0
    &hf_nisplus_mask_world_destroy,
308
0
    &hf_nisplus_mask_group_read,
309
0
    &hf_nisplus_mask_group_modify,
310
0
    &hf_nisplus_mask_group_create,
311
0
    &hf_nisplus_mask_group_destroy,
312
0
    &hf_nisplus_mask_owner_read,
313
0
    &hf_nisplus_mask_owner_modify,
314
0
    &hf_nisplus_mask_owner_create,
315
0
    &hf_nisplus_mask_owner_destroy,
316
0
    &hf_nisplus_mask_nobody_read,
317
0
    &hf_nisplus_mask_nobody_modify,
318
0
    &hf_nisplus_mask_nobody_create,
319
0
    &hf_nisplus_mask_nobody_destroy,
320
0
    NULL
321
0
  };
322
323
0
  proto_tree_add_bitmask(tree, tvb, offset, hf_nisplus_access_mask, ett_nisplus_access_mask, flags, ENC_BIG_ENDIAN);
324
0
  offset += 4;
325
326
0
  return offset;
327
0
}
328
329
static int
330
dissect_table(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
331
0
{
332
0
  proto_item* lock_item;
333
0
  proto_tree* lock_tree;
334
0
  int old_offset = offset;
335
0
  static int * const flags[] = {
336
0
    &hf_nisplus_table_col_mask_binary,
337
0
    &hf_nisplus_table_col_mask_encrypted,
338
0
    &hf_nisplus_table_col_mask_xdr,
339
0
    &hf_nisplus_table_col_mask_searchable,
340
0
    &hf_nisplus_table_col_mask_casesensitive,
341
0
    &hf_nisplus_table_col_mask_modified,
342
0
    &hf_nisplus_table_col_mask_asn,
343
0
    NULL
344
0
  };
345
346
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_table_col,
347
0
      tvb, offset, -1, ENC_NA);
348
349
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_table_col);
350
351
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
352
0
      hf_nisplus_table_col_name, offset, NULL);
353
354
0
  proto_tree_add_bitmask(lock_tree, tvb, offset, hf_nisplus_table_col_mask, ett_nisplus_table_col_mask, flags, ENC_BIG_ENDIAN);
355
0
  offset += 4;
356
357
0
  offset = dissect_access_rights(tvb, offset, lock_tree);
358
359
0
  proto_item_set_len(lock_item, offset-old_offset);
360
0
  return offset;
361
0
}
362
363
static int
364
dissect_table_obj(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree)
365
0
{
366
0
  proto_item* lock_item = NULL;
367
0
  proto_tree* lock_tree = NULL;
368
0
  int old_offset = offset;
369
370
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_table,
371
0
      tvb, offset, -1, ENC_NA);
372
373
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_table);
374
375
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
376
0
      hf_nisplus_table_type, offset, NULL);
377
378
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
379
0
      hf_nisplus_table_maxcol, offset);
380
381
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
382
0
      hf_nisplus_table_sep, offset);
383
384
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
385
0
      dissect_table, hf_nisplus_table_cols);
386
387
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
388
0
      hf_nisplus_table_path, offset, NULL);
389
390
0
  proto_item_set_len(lock_item, offset-old_offset);
391
0
  return offset;
392
0
}
393
394
static int
395
dissect_entry(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
396
0
{
397
0
  proto_item* lock_item;
398
0
  proto_tree* lock_tree;
399
0
  int old_offset = offset;
400
0
  static int * const flags[] = {
401
0
    &hf_nisplus_entry_mask_binary,
402
0
    &hf_nisplus_entry_mask_crypt,
403
0
    &hf_nisplus_entry_mask_xdr,
404
0
    &hf_nisplus_entry_mask_modified,
405
0
    &hf_nisplus_entry_mask_asn,
406
0
    NULL
407
0
  };
408
409
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_entry_col,
410
0
      tvb, offset, -1, ENC_NA);
411
412
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_entry_col);
413
414
0
  proto_tree_add_bitmask(lock_tree, tvb, offset, hf_nisplus_entry_mask, ett_nisplus_entry_mask, flags, ENC_BIG_ENDIAN);
415
0
  offset += 4;
416
417
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
418
0
      hf_nisplus_entry_val, offset, NULL);
419
420
0
  proto_item_set_len(lock_item, offset-old_offset);
421
0
  return offset;
422
0
}
423
424
static int
425
dissect_entry_obj(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree)
426
0
{
427
0
  proto_item* lock_item = NULL;
428
0
  proto_tree* lock_tree = NULL;
429
0
  int old_offset = offset;
430
431
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_entry,
432
0
      tvb, offset, -1, ENC_NA);
433
434
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_entry);
435
436
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
437
0
      hf_nisplus_entry_type, offset, NULL);
438
439
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
440
0
      dissect_entry, hf_nisplus_entry_cols);
441
442
0
  proto_item_set_len(lock_item, offset-old_offset);
443
0
  return offset;
444
0
}
445
446
static int
447
dissect_attr(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
448
0
{
449
0
  proto_item* lock_item = NULL;
450
0
  proto_tree* lock_tree = NULL;
451
0
  int old_offset = offset;
452
453
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_attr,
454
0
      tvb, offset, -1, ENC_NA);
455
456
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_attr);
457
458
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
459
0
      hf_nisplus_attr_name, offset, NULL);
460
461
0
  offset = dissect_rpc_data(tvb, pinfo, lock_tree,
462
0
      hf_nisplus_attr_val, offset);
463
464
0
  proto_item_set_len(lock_item, offset-old_offset);
465
0
  return offset;
466
0
}
467
468
static int
469
dissect_link_obj(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree)
470
0
{
471
0
  proto_item* lock_item = NULL;
472
0
  proto_tree* lock_tree = NULL;
473
0
  int old_offset = offset;
474
475
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_link,
476
0
      tvb, offset, -1, ENC_NA);
477
478
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_link);
479
480
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
481
0
      hf_nisplus_object_type, offset);
482
483
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
484
0
      dissect_attr, hf_nisplus_attrs_array);
485
486
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
487
0
      hf_nisplus_object_name, offset, NULL);
488
489
0
  proto_item_set_len(lock_item, offset-old_offset);
490
0
  return offset;
491
0
}
492
493
494
static int
495
dissect_endpoint(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
496
0
{
497
0
  proto_item* lock_item = NULL;
498
0
  proto_tree* lock_tree = NULL;
499
0
  int old_offset = offset;
500
501
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_endpoint,
502
0
      tvb, offset, -1, ENC_NA);
503
504
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_endpoint);
505
506
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
507
0
      hf_nisplus_endpoint_uaddr, offset, NULL);
508
509
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
510
0
      hf_nisplus_endpoint_family, offset, NULL);
511
512
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
513
0
      hf_nisplus_endpoint_proto, offset, NULL);
514
515
0
  proto_item_set_len(lock_item, offset-old_offset);
516
0
  return offset;
517
0
}
518
519
520
static int
521
dissect_directory_server(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
522
0
{
523
0
  proto_item* lock_item = NULL;
524
0
  proto_tree* lock_tree = NULL;
525
0
  int old_offset = offset;
526
527
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_server,
528
0
      tvb, offset, -1, ENC_NA);
529
530
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_server);
531
532
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
533
0
      hf_nisplus_server_name, offset, NULL);
534
535
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
536
0
      dissect_endpoint, hf_nisplus_endpoints);
537
538
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
539
0
      hf_nisplus_key_type, offset);
540
541
0
  offset = dissect_rpc_data(tvb, pinfo, lock_tree,
542
0
      hf_nisplus_key_data, offset);
543
544
0
  proto_item_set_len(lock_item, offset-old_offset);
545
0
  return offset;
546
0
}
547
548
549
static int
550
dissect_directory_mask(tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
551
0
{
552
0
  proto_item* lock_item = NULL;
553
0
  proto_tree* lock_tree = NULL;
554
0
  int old_offset = offset;
555
556
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_directory_mask,
557
0
      tvb, offset, -1, ENC_NA);
558
559
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_directory_mask);
560
561
0
  offset = dissect_access_rights(tvb, offset, lock_tree);
562
563
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
564
0
      hf_nisplus_object_type, offset);
565
566
0
  proto_item_set_len(lock_item, offset-old_offset);
567
0
  return offset;
568
0
}
569
570
static int
571
dissect_directory_obj(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree)
572
0
{
573
0
  proto_item* lock_item = NULL;
574
0
  proto_tree* lock_tree = NULL;
575
0
  int old_offset = offset;
576
577
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_directory,
578
0
      tvb, offset, -1, ENC_NA);
579
580
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_directory);
581
582
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
583
0
      hf_nisplus_directory_name, offset, NULL);
584
585
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
586
0
      hf_nisplus_directory_type, offset);
587
588
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
589
0
      dissect_directory_server, hf_nisplus_servers);
590
591
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
592
0
      hf_nisplus_directory_ttl, offset);
593
594
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
595
0
      dissect_directory_mask, hf_nisplus_directory_mask_list);
596
597
0
  proto_item_set_len(lock_item, offset-old_offset);
598
0
  return offset;
599
0
}
600
601
static int
602
dissect_nisplus_oid(tvbuff_t *tvb, unsigned offset, proto_tree *tree)
603
0
{
604
0
  proto_item* lock_item = NULL;
605
0
  proto_tree* lock_tree = NULL;
606
0
  int old_offset = offset;
607
608
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_oid, tvb,
609
0
      offset, -1, ENC_NA);
610
611
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_oid);
612
613
0
  offset = dissect_nisplus_time(tvb, offset, lock_tree,
614
0
      hf_nisplus_object_ctime);
615
616
0
  offset = dissect_nisplus_time(tvb, offset, lock_tree,
617
0
      hf_nisplus_object_mtime);
618
619
0
  proto_item_set_len(lock_item, offset-old_offset);
620
0
  return offset;
621
0
}
622
623
static int
624
dissect_nisplus_object(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
625
0
{
626
0
  proto_item* lock_item = NULL;
627
0
  proto_tree* lock_tree = NULL;
628
0
  int32_t type;
629
0
  int old_offset = offset;
630
631
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_object, tvb,
632
0
      offset, -1, ENC_NA);
633
634
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_object);
635
636
0
  offset = dissect_nisplus_oid(tvb, offset, lock_tree);
637
638
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
639
0
      hf_nisplus_object_name, offset, NULL);
640
641
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
642
0
      hf_nisplus_object_owner, offset, NULL);
643
644
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
645
0
      hf_nisplus_object_group, offset, NULL);
646
647
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
648
0
      hf_nisplus_object_domain, offset, NULL);
649
650
0
  offset = dissect_access_rights(tvb, offset, lock_tree);
651
652
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
653
0
      hf_nisplus_object_ttl, offset);
654
655
0
  type = tvb_get_ntohl(tvb, offset);
656
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
657
0
      hf_nisplus_object_type, offset);
658
0
  switch (type) {
659
0
  case  NIS_DIRECTORY_OBJ:
660
0
    offset = dissect_directory_obj(tvb, offset, pinfo, lock_tree);
661
0
    break;
662
0
  case  NIS_GROUP_OBJ:
663
0
    offset = dissect_group_obj(tvb, offset, pinfo, lock_tree);
664
0
    break;
665
0
  case  NIS_TABLE_OBJ:
666
0
    offset = dissect_table_obj(tvb, offset, pinfo, lock_tree);
667
0
    break;
668
0
  case  NIS_ENTRY_OBJ:
669
0
    offset = dissect_entry_obj(tvb, offset, pinfo, lock_tree);
670
0
    break;
671
0
  case  NIS_LINK_OBJ:
672
0
    offset = dissect_link_obj(tvb, offset, pinfo, lock_tree);
673
0
    break;
674
0
  case  NIS_PRIVATE_OBJ:
675
0
    offset = dissect_rpc_data(tvb, pinfo, lock_tree,
676
0
        hf_nisplus_object_private, offset);
677
0
    break;
678
0
  case  NIS_NO_OBJ:
679
0
    break;
680
0
  case  NIS_BOGUS_OBJ:
681
0
    break;
682
0
  default:
683
0
    break;
684
0
  };
685
686
0
  proto_item_set_len(lock_item, offset-old_offset);
687
0
  return offset;
688
0
}
689
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
690
  end of nis object, that's right, all this was the definition of
691
  ONE SINGLE struct.
692
*/
693
694
695
696
static int
697
dissect_ns_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
698
0
{
699
0
  unsigned offset = 0;
700
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
701
0
      hf_nisplus_object_name, offset, NULL);
702
703
0
  offset = dissect_rpc_array(tvb, pinfo, tree, offset,
704
0
      dissect_nisplus_object, hf_nisplus_object);
705
706
0
  return offset;
707
0
}
708
709
static int
710
dissect_ib_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
711
0
{
712
0
  unsigned offset = 0;
713
714
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
715
0
      hf_nisplus_object_name, offset, NULL);
716
717
0
  offset = dissect_rpc_array(tvb, pinfo, tree, offset,
718
0
      dissect_attr, hf_nisplus_attrs_array);
719
720
0
  offset = dissect_rpc_uint32(tvb, tree,
721
0
      hf_nisplus_ib_flags, offset);
722
723
0
  offset = dissect_rpc_array(tvb, pinfo, tree, offset,
724
0
      dissect_nisplus_object, hf_nisplus_object);
725
726
0
  offset = dissect_rpc_array(tvb, pinfo, tree, offset,
727
0
      dissect_directory_server, hf_nisplus_cbservers);
728
729
0
  offset = dissect_rpc_uint32(tvb, tree,
730
0
      hf_nisplus_ib_bufsize, offset);
731
732
0
  offset = dissect_rpc_data(tvb, pinfo, tree,
733
0
      hf_nisplus_cookie, offset);
734
735
0
  return offset;
736
0
}
737
738
static int
739
dissect_fd_args(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
740
0
{
741
0
  unsigned offset = 0;
742
743
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
744
0
      hf_nisplus_fd_dirname, offset, NULL);
745
746
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
747
0
      hf_nisplus_fd_requester, offset, NULL);
748
749
0
  return offset;
750
0
}
751
752
static int
753
dissect_nisplus_tag(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
754
0
{
755
0
  proto_item* lock_item = NULL;
756
0
  proto_tree* lock_tree = NULL;
757
0
  int old_offset = offset;
758
759
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_tag, tvb,
760
0
      offset, -1, ENC_NA);
761
762
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_tag);
763
764
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
765
0
      hf_nisplus_tag_type, offset);
766
767
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
768
0
      hf_nisplus_tag_val, offset, NULL);
769
770
0
  proto_item_set_len(lock_item, offset-old_offset);
771
0
  return offset;
772
0
}
773
774
static int
775
dissect_nisplus_taglist(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
776
0
{
777
0
  return dissect_rpc_array(tvb, pinfo, tree, 0,
778
0
      dissect_nisplus_tag, hf_nisplus_taglist);
779
0
}
780
781
static int
782
dissect_dump_args(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
783
0
{
784
0
  unsigned offset = 0;
785
786
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
787
0
      hf_nisplus_dump_dir, offset, NULL);
788
789
0
  offset = dissect_nisplus_time(tvb, offset, tree,
790
0
      hf_nisplus_dump_time);
791
792
0
  offset = dissect_rpc_array(tvb, pinfo, tree, offset,
793
0
      dissect_directory_server, hf_nisplus_cbservers);
794
795
0
  return offset;
796
0
}
797
798
static int
799
dissect_netobj(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
800
0
{
801
0
  return dissect_rpc_data(tvb, pinfo, tree, hf_nisplus_dummy, 0);
802
0
}
803
804
static int
805
dissect_nisname(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
806
0
{
807
0
  return dissect_rpc_string(tvb, pinfo, tree,
808
0
      hf_nisplus_object_name, 0, NULL);
809
0
}
810
811
static int
812
dissect_ping_args(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
813
0
{
814
0
  unsigned offset = 0;
815
816
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
817
0
      hf_nisplus_ping_dir, offset, NULL);
818
819
0
  offset = dissect_nisplus_time(tvb, offset, tree,
820
0
      hf_nisplus_ping_time);
821
822
0
  return offset;
823
0
}
824
825
826
static const value_string nis_error[] = {
827
#define NIS_SUCCESS   0
828
  { NIS_SUCCESS,    "A-ok, let's rock n roll" },
829
#define NIS_S_SUCCESS   1
830
  { NIS_S_SUCCESS,    "Name found (maybe)"  },
831
#define NIS_NOTFOUND    2
832
  { NIS_NOTFOUND,   "Name definitely not found" },
833
#define NIS_S_NOTFOUND    3
834
  { NIS_S_NOTFOUND,   "Name maybe not found"  },
835
#define NIS_CACHEEXPIRED  4
836
  { NIS_CACHEEXPIRED, "Name exists but cache out of date" },
837
#define NIS_NAMEUNREACHABLE 5
838
  { NIS_NAMEUNREACHABLE,  "Can't get there from here" },
839
#define NIS_UNKNOWNOBJ    6
840
  { NIS_UNKNOWNOBJ,   "Object type is bogus"  },
841
#define NIS_TRYAGAIN    7
842
  { NIS_TRYAGAIN,   "I'm busy, call back" },
843
#define NIS_SYSTEMERROR   8
844
  { NIS_SYSTEMERROR,  "Generic system error"  },
845
#define NIS_CHAINBROKEN   9
846
  { NIS_CHAINBROKEN,  "First/Next warning"  },
847
#define NIS_PERMISSION    10
848
  { NIS_PERMISSION,   "Not enough permission to access" },
849
#define NIS_NOTOWNER    11
850
  { NIS_NOTOWNER,   "You don't own it, sorry" },
851
#define NIS_NOT_ME    12
852
  { NIS_NOT_ME,   "I don't serve this name" },
853
#define NIS_NOMEMORY    13
854
  { NIS_NOMEMORY,   "Outta VM! Help!" },
855
#define NIS_NAMEEXISTS    14
856
  { NIS_NAMEEXISTS,   "Can't create over another name"  },
857
#define NIS_NOTMASTER   15
858
  { NIS_NOTMASTER,    "I'm just a secondary, don't ask me"  },
859
#define NIS_INVALIDOBJ    16
860
  { NIS_INVALIDOBJ,   "Object is broken somehow"  },
861
#define NIS_BADNAME   17
862
  { NIS_BADNAME,    "Unparsable name" },
863
#define NIS_NOCALLBACK    18
864
  { NIS_NOCALLBACK,   "Couldn't talk to call back proc" },
865
#define NIS_CBRESULTS   19
866
  { NIS_CBRESULTS,    "Results being called back to you"  },
867
#define NIS_NOSUCHNAME    20
868
  { NIS_NOSUCHNAME,   "Name unknown"  },
869
#define NIS_NOTUNIQUE   21
870
  { NIS_NOTUNIQUE,    "Value is not unique (entry)" },
871
#define NIS_IBMODERROR    22
872
  { NIS_IBMODERROR,   "Inf. Base. Modify error."  },
873
#define NIS_NOSUCHTABLE   23
874
  { NIS_NOSUCHTABLE,  "Name for table was wrong"  },
875
#define NIS_TYPEMISMATCH  24
876
  { NIS_TYPEMISMATCH, "Entry and table type mismatch" },
877
#define NIS_LINKNAMEERROR 25
878
  { NIS_LINKNAMEERROR,  "Link points to bogus name" },
879
#define NIS_PARTIAL   26
880
  { NIS_PARTIAL,    "Partial success, found table"  },
881
#define NIS_TOOMANYATTRS  27
882
  { NIS_TOOMANYATTRS, "Too many attributes" },
883
#define NIS_RPCERROR    28
884
  { NIS_RPCERROR,   "RPC error encountered" },
885
#define NIS_BADATTRIBUTE  29
886
  { NIS_BADATTRIBUTE, "Bad or invalid attribute"  },
887
#define NIS_NOTSEARCHABLE 30
888
  { NIS_NOTSEARCHABLE,  "Non-searchable object searched"  },
889
#define NIS_CBERROR   31
890
  { NIS_CBERROR,    "Error during callback (svc crash)" },
891
#define NIS_FOREIGNNS   32
892
  { NIS_FOREIGNNS,    "Foreign Namespace" },
893
#define NIS_BADOBJECT   33
894
  { NIS_BADOBJECT,    "Malformed object structure"  },
895
#define NIS_NOTSAMEOBJ    34
896
  { NIS_NOTSAMEOBJ,   "Object swapped during deletion"  },
897
#define NIS_MODFAIL   35
898
  { NIS_MODFAIL,    "Failure during a Modify."  },
899
#define NIS_BADREQUEST    36
900
  { NIS_BADREQUEST,   "Illegal query for table" },
901
#define NIS_NOTEMPTY    37
902
  { NIS_NOTEMPTY,   "Attempt to remove a non-empty tbl" },
903
#define NIS_COLDSTART_ERR 38
904
  { NIS_COLDSTART_ERR,  "Error accessing the cold start file" },
905
#define NIS_RESYNC    39
906
  { NIS_RESYNC,   "Transaction log too far out of date" },
907
#define NIS_FAIL    40
908
  { NIS_FAIL,   "NIS operation failed." },
909
#define NIS_UNAVAIL   41
910
  { NIS_UNAVAIL,    "NIS+ service is unavailable (client)"  },
911
#define NIS_RES2BIG   42
912
  { NIS_RES2BIG,    "NIS+ result too big for datagram"  },
913
#define NIS_SRVAUTH   43
914
  { NIS_SRVAUTH,    "NIS+ server wasn't authenticated." },
915
#define NIS_CLNTAUTH    44
916
  { NIS_CLNTAUTH,   "NIS+ Client wasn't authenticated." },
917
#define NIS_NOFILESPACE   45
918
  { NIS_NOFILESPACE,  "NIS+ server ran out of disk space" },
919
#define NIS_NOPROC    46
920
  { NIS_NOPROC,   "NIS+ server couldn't create new proc"  },
921
#define NIS_DUMPLATER   47
922
  { NIS_DUMPLATER,    "NIS+ server already has dump child"  },
923
  { 0,  NULL  },
924
};
925
926
static int
927
dissect_nisplus_result(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
928
0
{
929
0
  unsigned offset = 0;
930
931
0
  offset = dissect_rpc_uint32(tvb, tree,
932
0
      hf_nisplus_error, offset);
933
934
0
  offset = dissect_rpc_array(tvb, pinfo, tree, offset,
935
0
      dissect_nisplus_object, hf_nisplus_object);
936
937
0
  offset = dissect_rpc_data(tvb, pinfo, tree,
938
0
      hf_nisplus_cookie, offset);
939
940
0
  offset = dissect_rpc_uint32(tvb, tree,
941
0
      hf_nisplus_zticks, offset);
942
943
0
  offset = dissect_rpc_uint32(tvb, tree,
944
0
      hf_nisplus_dticks, offset);
945
946
0
  offset = dissect_rpc_uint32(tvb, tree,
947
0
      hf_nisplus_aticks, offset);
948
949
0
  offset = dissect_rpc_uint32(tvb, tree,
950
0
      hf_nisplus_cticks, offset);
951
952
0
  return offset;
953
0
}
954
955
static int
956
dissect_fd_result(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
957
0
{
958
0
  unsigned offset = 0;
959
960
0
  offset = dissect_rpc_uint32(tvb, tree,
961
0
      hf_nisplus_error, offset);
962
963
0
  offset = dissect_rpc_string(tvb, pinfo, tree,
964
0
      hf_nisplus_fd_dirname, offset, NULL);
965
966
0
  offset = dissect_rpc_data(tvb, pinfo, tree,
967
0
      hf_nisplus_dir_data, offset);
968
969
0
  offset = dissect_rpc_data(tvb, pinfo, tree,
970
0
      hf_nisplus_signature, offset);
971
972
0
  return offset;
973
0
}
974
975
static const value_string entry_type[] = {
976
#define LOG_NOP   0
977
  { LOG_NOP,    "NOP" },
978
#define LOG_ADD_NAME    1
979
  { LOG_ADD_NAME,   "Name Was Added"  },
980
#define LOG_REM_NAME    2
981
  { LOG_REM_NAME,   "Name Was Removed"  },
982
#define LOG_MOD_NAME_OLD  3
983
  { LOG_MOD_NAME_OLD, "Name Was Modified" },
984
#define LOG_MOD_NAME_NEW  4
985
  { LOG_MOD_NAME_NEW, "Name Was Modified" },
986
#define LOG_ADD_IBASE   5
987
  { LOG_ADD_IBASE,    "Entry Added To Information Base" },
988
#define LOG_REM_IBASE   6
989
  { LOG_REM_IBASE,    "Entry Removed From Information Base" },
990
#define LOG_MOD_IBASE   7
991
  { LOG_MOD_IBASE,    "Entry Modified In Information Base"  },
992
#define LOG_UPD_STAMP   8
993
  { LOG_UPD_STAMP,    "Update Timestamp"  },
994
  { 0,  NULL  },
995
};
996
static int
997
dissect_log_entry(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree, void* data _U_)
998
0
{
999
0
  proto_item* lock_item = NULL;
1000
0
  proto_tree* lock_tree = NULL;
1001
0
  int old_offset = offset;
1002
1003
0
  lock_item = proto_tree_add_item(tree, hf_nisplus_log_entry,
1004
0
      tvb, offset, -1, ENC_NA);
1005
1006
0
  lock_tree = proto_item_add_subtree(lock_item, ett_nisplus_log_entry);
1007
1008
0
  offset = dissect_nisplus_time(tvb, offset, lock_tree,
1009
0
      hf_nisplus_log_time);
1010
1011
0
  offset = dissect_rpc_uint32(tvb, lock_tree,
1012
0
      hf_nisplus_log_type, offset);
1013
1014
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
1015
0
      hf_nisplus_log_principal, offset, NULL);
1016
1017
0
  offset = dissect_rpc_string(tvb, pinfo, lock_tree,
1018
0
      hf_nisplus_directory_name, offset, NULL);
1019
1020
0
  offset = dissect_rpc_array(tvb, pinfo, lock_tree, offset,
1021
0
      dissect_attr, hf_nisplus_attrs_array);
1022
1023
0
  offset = dissect_nisplus_object(tvb, offset, pinfo, lock_tree, data);
1024
1025
0
  proto_item_set_len(lock_item, offset-old_offset);
1026
0
  return offset;
1027
0
}
1028
1029
static int
1030
dissect_log_result(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1031
0
{
1032
0
  unsigned offset = 0;
1033
1034
0
  offset = dissect_rpc_uint32(tvb, tree,
1035
0
      hf_nisplus_error, offset);
1036
1037
0
  offset = dissect_rpc_data(tvb, pinfo, tree,
1038
0
      hf_nisplus_cookie, offset);
1039
1040
0
  offset = dissect_rpc_array(tvb, pinfo, tree, offset,
1041
0
      dissect_log_entry, hf_nisplus_log_entries);
1042
1043
0
  return offset;
1044
0
}
1045
1046
static int
1047
dissect_callback_result(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1048
0
{
1049
0
  return dissect_rpc_bool(tvb, tree, hf_nisplus_callback_status, 0);
1050
0
}
1051
1052
static int
1053
dissect_change_time(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1054
0
{
1055
0
  return dissect_nisplus_time(tvb, 0, tree, hf_nisplus_log_time);
1056
0
}
1057
1058
static int
1059
dissect_cp_result(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1060
0
{
1061
0
  unsigned offset = 0;
1062
1063
0
  offset = dissect_rpc_uint32(tvb, tree,
1064
0
      hf_nisplus_cp_status, offset);
1065
1066
0
  offset = dissect_rpc_uint32(tvb, tree,
1067
0
      hf_nisplus_cp_zticks, offset);
1068
1069
0
  offset = dissect_rpc_uint32(tvb, tree,
1070
0
      hf_nisplus_cp_dticks, offset);
1071
1072
0
  return offset;
1073
0
}
1074
1075
static int
1076
dissect_nisplus_error(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1077
0
{
1078
0
  return dissect_rpc_uint32(tvb, tree, hf_nisplus_error, 0);
1079
0
}
1080
1081
/* proc number, "proc name", dissect_request, dissect_reply */
1082
static const vsff nisplus3_proc[] = {
1083
  { NISPROC_NULL,     "NULL",
1084
    dissect_rpc_void, dissect_rpc_void },
1085
  { NISPROC_LOOKUP,   "LOOKUP",
1086
    dissect_ns_request, dissect_nisplus_result },
1087
  { NISPROC_ADD,      "ADD",
1088
    dissect_ns_request, dissect_nisplus_result },
1089
  { NISPROC_MODIFY,   "MODIFY",
1090
    dissect_ns_request, dissect_nisplus_result },
1091
  { NISPROC_REMOVE,   "REMOVE",
1092
    dissect_ns_request, dissect_nisplus_result },
1093
  { NISPROC_IBLIST,   "IBLIST",
1094
    dissect_ib_request, dissect_nisplus_result },
1095
  { NISPROC_IBADD,    "IBADD",
1096
    dissect_ib_request, dissect_nisplus_result },
1097
  { NISPROC_IBMODIFY,   "IBMODIFY",
1098
    dissect_ib_request, dissect_nisplus_result },
1099
  { NISPROC_IBREMOVE,   "IBREMOVE",
1100
    dissect_ib_request, dissect_nisplus_result },
1101
  { NISPROC_IBFIRST,    "IBFIRST",
1102
    dissect_ib_request, dissect_nisplus_result },
1103
  { NISPROC_IBNEXT,   "IBNEXT",
1104
    dissect_ib_request, dissect_nisplus_result },
1105
  { NISPROC_FINDDIRECTORY,  "FINDDIRECTORY",
1106
    dissect_fd_args,  dissect_fd_result },
1107
  { NISPROC_STATUS,   "STATUS",
1108
    dissect_nisplus_taglist, dissect_nisplus_taglist },
1109
  { NISPROC_DUMPLOG,    "DUMPLOG",
1110
    dissect_dump_args,  dissect_log_result },
1111
  { NISPROC_DUMP,     "DUMP",
1112
    dissect_dump_args,  dissect_log_result },
1113
  { NISPROC_CALLBACK,   "CALLBACK",
1114
    dissect_netobj,   dissect_callback_result },
1115
  { NISPROC_CPTIME,   "CPTIME",
1116
    dissect_nisname,  dissect_change_time },
1117
  { NISPROC_CHECKPOINT,   "CHECKPOINT",
1118
    dissect_nisname,  dissect_cp_result },
1119
  { NISPROC_PING,     "PING",
1120
    dissect_ping_args,  dissect_rpc_void },
1121
  { NISPROC_SERVSTATE,    "SERVSTATE",
1122
    dissect_nisplus_taglist, dissect_nisplus_taglist },
1123
  { NISPROC_MKDIR,    "MKDIR",
1124
    dissect_nisname,  dissect_nisplus_error },
1125
  { NISPROC_RMDIR,    "RMDIR",
1126
    dissect_nisname,  dissect_nisplus_error },
1127
  { NISPROC_UPDKEYS,    "UPDKEYS",
1128
    dissect_nisname,  dissect_nisplus_error },
1129
  { 0,  NULL,   NULL,       NULL }
1130
};
1131
static const value_string nisplus3_proc_vals[] = {
1132
  { NISPROC_NULL,     "NULL" },
1133
  { NISPROC_LOOKUP,   "LOOKUP" },
1134
  { NISPROC_ADD,      "ADD" },
1135
  { NISPROC_MODIFY,   "MODIFY" },
1136
  { NISPROC_REMOVE,   "REMOVE" },
1137
  { NISPROC_IBLIST,   "IBLIST" },
1138
  { NISPROC_IBADD,    "IBADD" },
1139
  { NISPROC_IBMODIFY,   "IBMODIFY" },
1140
  { NISPROC_IBREMOVE,   "IBREMOVE" },
1141
  { NISPROC_IBFIRST,    "IBFIRST" },
1142
  { NISPROC_IBNEXT,   "IBNEXT" },
1143
  { NISPROC_FINDDIRECTORY,  "FINDDIRECTORY" },
1144
  { NISPROC_STATUS,   "STATUS" },
1145
  { NISPROC_DUMPLOG,    "DUMPLOG" },
1146
  { NISPROC_DUMP,     "DUMP" },
1147
  { NISPROC_CALLBACK,   "CALLBACK" },
1148
  { NISPROC_CPTIME,   "CPTIME" },
1149
  { NISPROC_CHECKPOINT,   "CHECKPOINT" },
1150
  { NISPROC_PING,     "PING" },
1151
  { NISPROC_SERVSTATE,    "SERVSTATE" },
1152
  { NISPROC_MKDIR,    "MKDIR" },
1153
  { NISPROC_RMDIR,    "RMDIR" },
1154
  { NISPROC_UPDKEYS,    "UPDKEYS" },
1155
  { 0,  NULL }
1156
};
1157
static const rpc_prog_vers_info nisplus_vers_info[] = {
1158
  { 3, nisplus3_proc, &hf_nisplus_procedure_v3 },
1159
};
1160
1161
1162
1163
void
1164
proto_register_nis(void)
1165
16
{
1166
16
  static const true_false_string tfs_col_binary = {
1167
16
    "column is binary",
1168
16
    "column is NOT binary"
1169
16
  };
1170
16
  static const true_false_string tfs_col_encrypted = {
1171
16
    "column is encrypted",
1172
16
    "column is NOT encrypted"
1173
16
  };
1174
16
  static const true_false_string tfs_col_xdr = {
1175
16
    "column is xdr encoded",
1176
16
    "column is NOT xdr encoded"
1177
16
  };
1178
16
  static const true_false_string tfs_col_searchable = {
1179
16
    "column is searchable",
1180
16
    "column is NOT searchable"
1181
16
  };
1182
16
  static const true_false_string tfs_col_casesensitive = {
1183
16
    "column is case sensitive",
1184
16
    "column is NOT case sensitive"
1185
16
  };
1186
16
  static const true_false_string tfs_col_modified = {
1187
16
    "column is modified",
1188
16
    "column is NOT modified"
1189
16
  };
1190
16
  static const true_false_string tfs_col_asn = {
1191
16
    "column is asn.1 encoded",
1192
16
    "column is NOT asn.1 encoded"
1193
16
  };
1194
1195
16
  static const true_false_string tfs_entry_binary = {
1196
16
    "entry is binary",
1197
16
    "entry is NOT binary"
1198
16
  };
1199
1200
16
  static const true_false_string tfs_entry_crypt = {
1201
16
    "entry is encrypted",
1202
16
    "entry is NOT encrypted"
1203
16
  };
1204
1205
16
  static const true_false_string tfs_entry_xdr = {
1206
16
    "entry is xdr encoded",
1207
16
    "entry is NOT xdr encoded"
1208
16
  };
1209
1210
16
  static const true_false_string tfs_entry_modified = {
1211
16
    "entry is modified",
1212
16
    "entry is NOT modified"
1213
16
  };
1214
1215
16
  static const true_false_string tfs_entry_asn = {
1216
16
    "entry is asn.1 encoded",
1217
16
    "entry is NOT asn.1 encoded"
1218
16
  };
1219
1220
16
  static const true_false_string tfs_world_read = {
1221
16
    "world can read",
1222
16
    "world can NOT read"
1223
16
  };
1224
1225
16
  static const true_false_string tfs_world_modify = {
1226
16
    "world can modify",
1227
16
    "world can NOT modify"
1228
16
  };
1229
1230
16
  static const true_false_string tfs_world_create = {
1231
16
    "world can create",
1232
16
    "world can NOT create"
1233
16
  };
1234
1235
16
  static const true_false_string tfs_world_destroy = {
1236
16
    "world can destroy",
1237
16
    "world can NOT destroy"
1238
16
  };
1239
1240
16
  static const true_false_string tfs_group_read = {
1241
16
    "group can read",
1242
16
    "group can NOT read"
1243
16
  };
1244
1245
16
  static const true_false_string tfs_group_modify = {
1246
16
    "group can modify",
1247
16
    "group can NOT modify"
1248
16
  };
1249
1250
16
  static const true_false_string tfs_group_create = {
1251
16
    "group can create",
1252
16
    "group can NOT create"
1253
16
  };
1254
1255
16
  static const true_false_string tfs_group_destroy = {
1256
16
    "group can destroy",
1257
16
    "group can NOT destroy"
1258
16
  };
1259
1260
16
  static const true_false_string tfs_owner_read = {
1261
16
    "owner can read",
1262
16
    "owner can NOT read"
1263
16
  };
1264
1265
16
  static const true_false_string tfs_owner_modify = {
1266
16
    "owner can modify",
1267
16
    "owner can NOT modify"
1268
16
  };
1269
1270
16
  static const true_false_string tfs_owner_create = {
1271
16
    "owner can create",
1272
16
    "owner can NOT create"
1273
16
  };
1274
1275
16
  static const true_false_string tfs_owner_destroy = {
1276
16
    "owner can destroy",
1277
16
    "owner can NOT destroy"
1278
16
  };
1279
1280
16
  static const true_false_string tfs_nobody_read = {
1281
16
    "nobody can read",
1282
16
    "nobody can NOT read"
1283
16
  };
1284
1285
16
  static const true_false_string tfs_nobody_modify = {
1286
16
    "nobody can modify",
1287
16
    "nobody can NOT modify"
1288
16
  };
1289
1290
16
  static const true_false_string tfs_nobody_create = {
1291
16
    "nobody can create",
1292
16
    "nobody can NOT create"
1293
16
  };
1294
1295
16
  static const true_false_string tfs_nobody_destroy = {
1296
16
    "nobody can destroy",
1297
16
    "nobody can NOT destroy"
1298
16
  };
1299
1300
16
  static const true_false_string tfs_callback_status = {
1301
16
    "callback is running",
1302
16
    "callback is not running"
1303
16
  };
1304
1305
1306
1307
1308
16
  static hf_register_info hf[] = {
1309
16
    { &hf_nisplus_procedure_v3, {
1310
16
      "V3 Procedure", "nisplus.procedure_v3", FT_UINT32, BASE_DEC,
1311
16
      VALS(nisplus3_proc_vals), 0, NULL, HFILL }},
1312
16
    { &hf_nisplus_object, {
1313
16
      "NIS Object", "nisplus.object", FT_NONE, BASE_NONE,
1314
16
      NULL, 0, NULL, HFILL }},
1315
1316
16
    { &hf_nisplus_oid, {
1317
16
      "Object Identity Verifier", "nisplus.object.oid", FT_NONE, BASE_NONE,
1318
16
      NULL, 0, "NIS Object Identity Verifier", HFILL }},
1319
1320
16
    { &hf_nisplus_object_name, {
1321
16
      "name", "nisplus.object.name", FT_STRING, BASE_NONE,
1322
16
      NULL, 0, "NIS Name For This Object", HFILL }},
1323
1324
16
    { &hf_nisplus_object_owner, {
1325
16
      "owner", "nisplus.object.owner", FT_STRING, BASE_NONE,
1326
16
      NULL, 0, "NIS Name Of Object Owner", HFILL }},
1327
1328
16
    { &hf_nisplus_object_group, {
1329
16
      "group", "nisplus.object.group", FT_STRING, BASE_NONE,
1330
16
      NULL, 0, "NIS Name Of Access Group", HFILL }},
1331
1332
16
    { &hf_nisplus_object_domain, {
1333
16
      "domain", "nisplus.object.domain", FT_STRING, BASE_NONE,
1334
16
      NULL, 0, "NIS Administrator For This Object", HFILL }},
1335
1336
16
    { &hf_nisplus_object_ttl, {
1337
16
      "ttl", "nisplus.object.ttl", FT_UINT32, BASE_DEC,
1338
16
      NULL, 0, "NIS Time To Live For This Object", HFILL }},
1339
1340
16
    { &hf_nisplus_object_private, {
1341
16
      "private", "nisplus.object.private", FT_BYTES, BASE_NONE,
1342
16
      NULL, 0, "NIS Private Object", HFILL }},
1343
1344
16
    { &hf_nisplus_directory, {
1345
16
      "directory", "nisplus.directory", FT_NONE, BASE_NONE,
1346
16
      NULL, 0, "NIS Directory Object", HFILL }},
1347
1348
16
    { &hf_nisplus_directory_name, {
1349
16
      "directory name", "nisplus.directory.name", FT_STRING, BASE_NONE,
1350
16
      NULL, 0, "Name Of Directory Being Served", HFILL }},
1351
1352
16
    { &hf_nisplus_directory_type, {
1353
16
      "type", "nisplus.directory.type", FT_UINT32, BASE_DEC,
1354
16
      VALS(ns_type), 0, "NIS Type Of Name Service", HFILL }},
1355
1356
16
    { &hf_nisplus_directory_ttl, {
1357
16
      "ttl", "nisplus.directory.ttl", FT_UINT32, BASE_DEC,
1358
16
      NULL, 0, "Time To Live", HFILL }},
1359
1360
16
    { &hf_nisplus_directory_mask, {
1361
16
      "mask", "nisplus.directory.mask", FT_NONE, BASE_NONE,
1362
16
      NULL, 0, "NIS Directory Create/Destroy Rights", HFILL }},
1363
1364
16
    { &hf_nisplus_directory_mask_list, {
1365
16
      "mask list", "nisplus.directory.mask_list", FT_NONE, BASE_NONE,
1366
16
      NULL, 0, "List Of Directory Create/Destroy Rights", HFILL }},
1367
1368
16
    { &hf_nisplus_mask_world_read, {
1369
16
      "WORLD READ", "nisplus.directory.mask.world_read",
1370
16
      FT_BOOLEAN, 32, TFS(&tfs_world_read),
1371
16
      NIS_MASK_WORLD_READ, "World Read Flag", HFILL }},
1372
1373
16
    { &hf_nisplus_mask_world_modify, {
1374
16
      "WORLD MODIFY", "nisplus.directory.mask.world_modify",
1375
16
      FT_BOOLEAN, 32, TFS(&tfs_world_modify),
1376
16
      NIS_MASK_WORLD_MODIFY, "World Modify Flag", HFILL }},
1377
1378
16
    { &hf_nisplus_mask_world_create, {
1379
16
      "WORLD CREATE", "nisplus.directory.mask.world_create",
1380
16
      FT_BOOLEAN, 32, TFS(&tfs_world_create),
1381
16
      NIS_MASK_WORLD_CREATE, "World Create Flag", HFILL }},
1382
1383
16
    { &hf_nisplus_mask_world_destroy, {
1384
16
      "WORLD DESTROY", "nisplus.directory.mask.world_destroy",
1385
16
      FT_BOOLEAN, 32, TFS(&tfs_world_destroy),
1386
16
      NIS_MASK_WORLD_DESTROY, "World Destroy Flag", HFILL }},
1387
1388
16
    { &hf_nisplus_mask_group_read, {
1389
16
      "GROUP READ", "nisplus.directory.mask.group_read",
1390
16
      FT_BOOLEAN, 32, TFS(&tfs_group_read),
1391
16
      NIS_MASK_GROUP_READ, "Group Read Flag", HFILL }},
1392
1393
16
    { &hf_nisplus_mask_group_modify, {
1394
16
      "GROUP MODIFY", "nisplus.directory.mask.group_modify",
1395
16
      FT_BOOLEAN, 32, TFS(&tfs_group_modify),
1396
16
      NIS_MASK_GROUP_MODIFY, "Group Modify Flag", HFILL }},
1397
1398
16
    { &hf_nisplus_mask_group_create, {
1399
16
      "GROUP CREATE", "nisplus.directory.mask.group_create",
1400
16
      FT_BOOLEAN, 32, TFS(&tfs_group_create),
1401
16
      NIS_MASK_GROUP_CREATE, "Group Create Flag", HFILL }},
1402
1403
16
    { &hf_nisplus_mask_group_destroy, {
1404
16
      "GROUP DESTROY", "nisplus.directory.mask.group_destroy",
1405
16
      FT_BOOLEAN, 32, TFS(&tfs_group_destroy),
1406
16
      NIS_MASK_GROUP_DESTROY, "Group Destroy Flag", HFILL }},
1407
1408
16
    { &hf_nisplus_mask_owner_read, {
1409
16
      "OWNER READ", "nisplus.directory.mask.owner_read",
1410
16
      FT_BOOLEAN, 32, TFS(&tfs_owner_read),
1411
16
      NIS_MASK_OWNER_READ, "Owner Read Flag", HFILL }},
1412
1413
16
    { &hf_nisplus_mask_owner_modify, {
1414
16
      "OWNER MODIFY", "nisplus.directory.mask.owner_modify",
1415
16
      FT_BOOLEAN, 32, TFS(&tfs_owner_modify),
1416
16
      NIS_MASK_OWNER_MODIFY, "Owner Modify Flag", HFILL }},
1417
1418
16
    { &hf_nisplus_mask_owner_create, {
1419
16
      "OWNER CREATE", "nisplus.directory.mask.owner_create",
1420
16
      FT_BOOLEAN, 32, TFS(&tfs_owner_create),
1421
16
      NIS_MASK_OWNER_CREATE, "Owner Create Flag", HFILL }},
1422
1423
16
    { &hf_nisplus_mask_owner_destroy, {
1424
16
      "OWNER DESTROY", "nisplus.directory.mask.owner_destroy",
1425
16
      FT_BOOLEAN, 32, TFS(&tfs_owner_destroy),
1426
16
      NIS_MASK_OWNER_DESTROY, "Owner Destroy Flag", HFILL }},
1427
1428
16
    { &hf_nisplus_mask_nobody_read, {
1429
16
      "NOBODY READ", "nisplus.directory.mask.nobody_read",
1430
16
      FT_BOOLEAN, 32, TFS(&tfs_nobody_read),
1431
16
      NIS_MASK_NOBODY_READ, "Nobody Read Flag", HFILL }},
1432
1433
16
    { &hf_nisplus_mask_nobody_modify, {
1434
16
      "NOBODY MODIFY", "nisplus.directory.mask.nobody_modify",
1435
16
      FT_BOOLEAN, 32, TFS(&tfs_nobody_modify),
1436
16
      NIS_MASK_NOBODY_MODIFY, "Nobody Modify Flag", HFILL }},
1437
1438
16
    { &hf_nisplus_mask_nobody_create, {
1439
16
      "NOBODY CREATE", "nisplus.directory.mask.nobody_create",
1440
16
      FT_BOOLEAN, 32, TFS(&tfs_nobody_create),
1441
16
      NIS_MASK_NOBODY_CREATE, "Nobody Create Flag", HFILL }},
1442
1443
16
    { &hf_nisplus_mask_nobody_destroy, {
1444
16
      "NOBODY DESTROY", "nisplus.directory.mask.nobody_destroy",
1445
16
      FT_BOOLEAN, 32, TFS(&tfs_nobody_destroy),
1446
16
      NIS_MASK_NOBODY_DESTROY, "Nobody Destroy Flag", HFILL }},
1447
1448
16
    { &hf_nisplus_access_mask, {
1449
16
      "access mask", "nisplus.access.mask", FT_UINT32, BASE_HEX,
1450
16
      NULL, 0, "NIS Access Mask", HFILL }},
1451
1452
16
    { &hf_nisplus_object_type, {
1453
16
      "type", "nisplus.object.type", FT_UINT32, BASE_DEC,
1454
16
      VALS(obj_type), 0, "NIS Type Of Object", HFILL }},
1455
1456
16
    { &hf_nisplus_servers, {
1457
16
      "nis servers", "nisplus.servers", FT_NONE, BASE_NONE,
1458
16
      NULL, 0, "NIS Servers For This Directory", HFILL }},
1459
1460
16
    { &hf_nisplus_cbservers, {
1461
16
      "nis servers", "nisplus.servers", FT_NONE, BASE_NONE,
1462
16
      NULL, 0, "Optional Callback Server", HFILL }},
1463
1464
16
    { &hf_nisplus_server, {
1465
16
      "server", "nisplus.server", FT_NONE, BASE_NONE,
1466
16
      NULL, 0, "NIS Server For This Directory", HFILL }},
1467
1468
16
    { &hf_nisplus_server_name, {
1469
16
      "name", "nisplus.server.name", FT_STRING, BASE_NONE,
1470
16
      NULL, 0, "Name Of NIS Server", HFILL }},
1471
1472
16
    { &hf_nisplus_key_type, {
1473
16
      "type", "nisplus.key.type", FT_UINT32, BASE_DEC,
1474
16
      VALS(key_type), 0, "Type Of Key", HFILL }},
1475
1476
16
    { &hf_nisplus_key_data, {
1477
16
      "key data", "nisplus.key.data", FT_BYTES, BASE_NONE,
1478
16
      NULL, 0, "Encryption Key", HFILL }},
1479
1480
16
    { &hf_nisplus_endpoints, {
1481
16
      "nis endpoints", "nisplus.endpoints", FT_NONE, BASE_NONE,
1482
16
      NULL, 0, "Endpoints For This NIS Server", HFILL }},
1483
1484
16
    { &hf_nisplus_endpoint, {
1485
16
      "endpoint", "nisplus.endpoint", FT_NONE, BASE_NONE,
1486
16
      NULL, 0, "Endpoint For This NIS Server", HFILL }},
1487
1488
16
    { &hf_nisplus_endpoint_uaddr, {
1489
16
      "addr", "nisplus.endpoint.uaddr", FT_STRING, BASE_NONE,
1490
16
      NULL, 0, "Address", HFILL }},
1491
1492
16
    { &hf_nisplus_endpoint_family, {
1493
16
      "family", "nisplus.endpoint.family", FT_STRING, BASE_NONE,
1494
16
      NULL, 0, "Transport Family", HFILL }},
1495
1496
16
    { &hf_nisplus_endpoint_proto, {
1497
16
      "proto", "nisplus.endpoint.proto", FT_STRING, BASE_NONE,
1498
16
      NULL, 0, "Protocol", HFILL }},
1499
1500
16
    { &hf_nisplus_link, {
1501
16
      "link", "nisplus.link", FT_NONE, BASE_NONE,
1502
16
      NULL, 0, "NIS Link Object", HFILL }},
1503
1504
16
    { &hf_nisplus_attrs_array, {
1505
16
      "Attributes", "nisplus.attributes", FT_NONE, BASE_NONE,
1506
16
      NULL, 0, "List Of Attributes", HFILL }},
1507
1508
16
    { &hf_nisplus_attr, {
1509
16
      "Attribute", "nisplus.attr", FT_NONE, BASE_NONE,
1510
16
      NULL, 0, NULL, HFILL }},
1511
1512
16
    { &hf_nisplus_attr_name, {
1513
16
      "name", "nisplus.attr.name", FT_STRING, BASE_NONE,
1514
16
      NULL, 0, "Attribute Name", HFILL }},
1515
1516
16
    { &hf_nisplus_attr_val, {
1517
16
      "val", "nisplus.attr.val", FT_BYTES, BASE_NONE,
1518
16
      NULL, 0, "Attribute Value", HFILL }},
1519
1520
16
    { &hf_nisplus_entry, {
1521
16
      "entry", "nisplus.entry", FT_NONE, BASE_NONE,
1522
16
      NULL, 0, "Entry Object", HFILL }},
1523
1524
16
    { &hf_nisplus_entry_type, {
1525
16
      "type", "nisplus.entry.type", FT_STRING, BASE_NONE,
1526
16
      NULL, 0, "Entry Type", HFILL }},
1527
1528
16
    { &hf_nisplus_entry_cols, {
1529
16
      "columns", "nisplus.entry.cols", FT_NONE, BASE_NONE,
1530
16
      NULL, 0, "Entry Columns", HFILL }},
1531
1532
16
    { &hf_nisplus_entry_col, {
1533
16
      "column", "nisplus.entry.col", FT_NONE, BASE_NONE,
1534
16
      NULL, 0, "Entry Column", HFILL }},
1535
1536
#if 0
1537
    { &hf_nisplus_entry_flags, {
1538
      "flags", "nisplus.entry.flags", FT_UINT32, BASE_HEX,
1539
      NULL, 0, "Entry Col Flags", HFILL }},
1540
#endif
1541
1542
16
    { &hf_nisplus_entry_val, {
1543
16
      "val", "nisplus.entry.val", FT_STRING, BASE_NONE,
1544
16
      NULL, 0, "Entry Value", HFILL }},
1545
1546
16
    { &hf_nisplus_entry_mask, {
1547
16
      "mask", "nisplus.entry.mask", FT_UINT32, BASE_HEX,
1548
16
      NULL, 0, "Entry Col Mask", HFILL }},
1549
1550
16
    { &hf_nisplus_entry_mask_binary, {
1551
16
      "BINARY", "nisplus.entry.mask.binary",
1552
16
      FT_BOOLEAN, 32, TFS(&tfs_entry_binary),
1553
16
      NIS_MASK_ENTRY_BINARY, "Is This Entry BINARY Flag", HFILL }},
1554
1555
16
    { &hf_nisplus_entry_mask_crypt, {
1556
16
      "ENCRYPTED", "nisplus.entry.mask.encrypted",
1557
16
      FT_BOOLEAN, 32, TFS(&tfs_entry_crypt),
1558
16
      NIS_MASK_ENTRY_CRYPT, "Is This Entry ENCRYPTED Flag", HFILL }},
1559
1560
16
    { &hf_nisplus_entry_mask_xdr, {
1561
16
      "XDR", "nisplus.entry.mask.xdr",
1562
16
      FT_BOOLEAN, 32, TFS(&tfs_entry_xdr),
1563
16
      NIS_MASK_ENTRY_XDR, "Is This Entry XDR Encoded Flag", HFILL }},
1564
1565
16
    { &hf_nisplus_entry_mask_modified, {
1566
16
      "MODIFIED", "nisplus.entry.mask.modified",
1567
16
      FT_BOOLEAN, 32, TFS(&tfs_entry_modified),
1568
16
      NIS_MASK_ENTRY_MODIFIED, "Is This Entry MODIFIED Flag", HFILL }},
1569
1570
16
    { &hf_nisplus_entry_mask_asn, {
1571
16
      "ASN.1", "nisplus.entry.mask.asn",
1572
16
      FT_BOOLEAN, 32, TFS(&tfs_entry_asn),
1573
16
      NIS_MASK_ENTRY_ASN, "Is This Entry ASN.1 Encoded Flag", HFILL }},
1574
1575
16
    { &hf_nisplus_table, {
1576
16
      "table", "nisplus.table", FT_NONE, BASE_NONE,
1577
16
      NULL, 0, "Table Object", HFILL }},
1578
1579
16
    { &hf_nisplus_table_type, {
1580
16
      "type", "nisplus.table.type", FT_STRING, BASE_NONE,
1581
16
      NULL, 0, "Table Type", HFILL }},
1582
1583
16
    { &hf_nisplus_table_maxcol, {
1584
16
      "max columns", "nisplus.table.maxcol", FT_UINT16, BASE_DEC,
1585
16
      NULL, 0, "Maximum Number Of Columns For Table", HFILL }},
1586
1587
16
    { &hf_nisplus_table_sep, {
1588
16
      "separator", "nisplus.table.separator", FT_UINT8, BASE_HEX,
1589
16
      NULL, 0, "Separator Character", HFILL }},
1590
1591
16
    { &hf_nisplus_table_cols, {
1592
16
      "columns", "nisplus.table.cols", FT_NONE, BASE_NONE,
1593
16
      NULL, 0, "Table Columns", HFILL }},
1594
1595
16
    { &hf_nisplus_table_col, {
1596
16
      "column", "nisplus.table.col", FT_NONE, BASE_NONE,
1597
16
      NULL, 0, "Table Column", HFILL }},
1598
1599
16
    { &hf_nisplus_table_path, {
1600
16
      "path", "nisplus.table.path", FT_STRING, BASE_NONE,
1601
16
      NULL, 0, "Table Path", HFILL }},
1602
1603
16
    { &hf_nisplus_table_col_name, {
1604
16
      "column name", "nisplus.table.col.name", FT_STRING, BASE_NONE,
1605
16
      NULL, 0, NULL, HFILL }},
1606
1607
16
    { &hf_nisplus_table_col_mask, {
1608
16
      "flags", "nisplus.table.col.flags", FT_UINT32, BASE_HEX,
1609
16
      NULL, 0, "Flags For This Column", HFILL }},
1610
1611
16
    { &hf_nisplus_table_col_mask_binary, {
1612
16
      "binary", "nisplus.table.flags.binary",
1613
16
      FT_BOOLEAN, 32, TFS(&tfs_col_binary),
1614
16
      NIS_MASK_TABLE_BINARY, "Is This Column BINARY", HFILL }},
1615
1616
16
    { &hf_nisplus_table_col_mask_encrypted, {
1617
16
      "encrypted", "nisplus.table.flags.encrypted",
1618
16
      FT_BOOLEAN, 32, TFS(&tfs_col_encrypted),
1619
16
      NIS_MASK_TABLE_CRYPT, "Is This Column ENCRYPTED", HFILL }},
1620
1621
16
    { &hf_nisplus_table_col_mask_xdr, {
1622
16
      "xdr", "nisplus.table.flags.xdr",
1623
16
      FT_BOOLEAN, 32, TFS(&tfs_col_xdr),
1624
16
      NIS_MASK_TABLE_XDR, "Is This Column XDR Encoded", HFILL }},
1625
1626
16
    { &hf_nisplus_table_col_mask_searchable, {
1627
16
      "searchable", "nisplus.table.flags.searchable",
1628
16
      FT_BOOLEAN, 32, TFS(&tfs_col_searchable),
1629
16
      NIS_MASK_TABLE_SRCH, "Is This Column SEARCHABLE", HFILL }},
1630
1631
16
    { &hf_nisplus_table_col_mask_casesensitive, {
1632
16
      "casesensitive", "nisplus.table.flags.casesensitive",
1633
16
      FT_BOOLEAN, 32, TFS(&tfs_col_casesensitive),
1634
16
      NIS_MASK_TABLE_CASE, "Is This Column CASESENSITIVE", HFILL }},
1635
1636
16
    { &hf_nisplus_table_col_mask_modified, {
1637
16
      "modified", "nisplus.table.flags.modified",
1638
16
      FT_BOOLEAN, 32, TFS(&tfs_col_modified),
1639
16
      NIS_MASK_TABLE_MODIFIED, "Is This Column MODIFIED", HFILL }},
1640
1641
16
    { &hf_nisplus_table_col_mask_asn, {
1642
16
      "asn", "nisplus.table.flags.asn",
1643
16
      FT_BOOLEAN, 32, TFS(&tfs_col_asn),
1644
16
      NIS_MASK_TABLE_ASN, "Is This Column ASN.1 Encoded", HFILL }},
1645
1646
16
    { &hf_nisplus_group, {
1647
16
      "Group", "nisplus.group", FT_NONE, BASE_NONE,
1648
16
      NULL, 0, "Group Object", HFILL }},
1649
1650
16
    { &hf_nisplus_grps, {
1651
16
      "Groups", "nisplus.grps", FT_NONE, BASE_NONE,
1652
16
      NULL, 0, "List Of Groups", HFILL }},
1653
1654
16
    { &hf_nisplus_group_flags, {
1655
16
      "flags", "nisplus.group.flags", FT_UINT32, BASE_HEX,
1656
16
      NULL, 0, "Group Object Flags", HFILL }},
1657
1658
16
    { &hf_nisplus_group_name, {
1659
16
      "group name", "nisplus.group.name", FT_STRING, BASE_NONE,
1660
16
      NULL, 0, "Name Of Group Member", HFILL }},
1661
1662
16
    { &hf_nisplus_object_ctime, {
1663
16
      "ctime", "nisplus.ctime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1664
16
      NULL, 0, "Time Of Creation", HFILL }},
1665
1666
16
    { &hf_nisplus_object_mtime, {
1667
16
      "mtime", "nisplus.mtime", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1668
16
      NULL, 0, "Time Last Modified", HFILL }},
1669
1670
16
    { &hf_nisplus_ib_flags, {
1671
16
      "flags", "nisplus.ib.flags", FT_UINT32, BASE_HEX,
1672
16
      NULL, 0, "Information Base Flags", HFILL }},
1673
1674
16
    { &hf_nisplus_ib_bufsize, {
1675
16
      "bufsize", "nisplus.ib.bufsize", FT_UINT32, BASE_HEX,
1676
16
      NULL, 0, "Optional First/NextBufSize", HFILL }},
1677
1678
16
    { &hf_nisplus_cookie, {
1679
16
      "cookie", "nisplus.cookie", FT_BYTES, BASE_NONE,
1680
16
      NULL, 0, NULL, HFILL }},
1681
1682
16
    { &hf_nisplus_fd_dirname, {
1683
16
      "dirname", "nisplus.fd.dirname", FT_STRING, BASE_NONE,
1684
16
      NULL, 0, "Directory Name", HFILL }},
1685
1686
16
    { &hf_nisplus_fd_requester, {
1687
16
      "requester", "nisplus.fd.requester", FT_STRING, BASE_NONE,
1688
16
      NULL, 0, "Host Principal Name For Signature", HFILL }},
1689
1690
16
    { &hf_nisplus_taglist, {
1691
16
      "taglist", "nisplus.taglist", FT_NONE, BASE_NONE,
1692
16
      NULL, 0, "List Of Tags", HFILL }},
1693
1694
16
    { &hf_nisplus_tag, {
1695
16
      "tag", "nisplus.tag", FT_NONE, BASE_NONE,
1696
16
      NULL, 0, NULL, HFILL }},
1697
1698
16
    { &hf_nisplus_tag_type, {
1699
16
      "type", "nisplus.tag.type", FT_UINT32, BASE_DEC,
1700
16
      NULL, 0, "Type Of Statistics Tag", HFILL }},
1701
1702
16
    { &hf_nisplus_tag_val, {
1703
16
      "value", "nisplus.tag.value", FT_STRING, BASE_NONE,
1704
16
      NULL, 0, "Value Of Statistics Tag", HFILL }},
1705
1706
16
    { &hf_nisplus_dump_dir, {
1707
16
      "directory", "nisplus.dump.dir", FT_STRING, BASE_NONE,
1708
16
      NULL, 0, "Directory To Dump", HFILL }},
1709
1710
16
    { &hf_nisplus_dump_time, {
1711
16
      "time", "nisplus.dump.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1712
16
      NULL, 0, "From This Timestamp", HFILL }},
1713
1714
16
    { &hf_nisplus_dummy, {
1715
16
      "dummy", "nisplus.dummy", FT_BYTES, BASE_NONE,
1716
16
      NULL, 0, NULL, HFILL }},
1717
1718
16
    { &hf_nisplus_ping_time, {
1719
16
      "time", "nisplus.ping.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1720
16
      NULL, 0, "Timestamp Of The Transaction", HFILL }},
1721
1722
16
    { &hf_nisplus_ping_dir, {
1723
16
      "directory", "nisplus.ping.dir", FT_STRING, BASE_NONE,
1724
16
      NULL, 0, "Directory That Had The Change", HFILL }},
1725
1726
16
    { &hf_nisplus_error, {
1727
16
      "status", "nisplus.status", FT_UINT32, BASE_DEC,
1728
16
      VALS(nis_error), 0, "NIS Status Code", HFILL }},
1729
1730
16
    { &hf_nisplus_dir_data, {
1731
16
      "data", "nisplus.fd.dir.data", FT_BYTES, BASE_NONE,
1732
16
      NULL, 0, "Directory Data In XDR Format", HFILL }},
1733
1734
16
    { &hf_nisplus_signature, {
1735
16
      "signature", "nisplus.fd.sig", FT_BYTES, BASE_NONE,
1736
16
      NULL, 0, "Signature Of The Source", HFILL }},
1737
1738
16
    { &hf_nisplus_log_entries, {
1739
16
      "log entries", "nisplus.log.entries", FT_NONE, BASE_NONE,
1740
16
      NULL, 0, NULL, HFILL }},
1741
1742
16
    { &hf_nisplus_log_entry, {
1743
16
      "log entry", "nisplus.log.entry", FT_NONE, BASE_NONE,
1744
16
      NULL, 0, NULL, HFILL }},
1745
1746
16
    { &hf_nisplus_log_time, {
1747
16
      "time", "nisplus.log.time", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL,
1748
16
      NULL, 0, "Time Of Log Entry", HFILL }},
1749
1750
16
    { &hf_nisplus_log_type, {
1751
16
      "type", "nisplus.log.entry.type", FT_UINT32, BASE_DEC,
1752
16
      VALS(entry_type), 0, "Type Of Entry In Transaction Log", HFILL }},
1753
1754
16
    { &hf_nisplus_log_principal, {
1755
16
      "principal", "nisplus.log.principal", FT_STRING, BASE_NONE,
1756
16
      NULL, 0, "Principal Making The Change", HFILL }},
1757
1758
16
    { &hf_nisplus_callback_status, {
1759
16
      "status", "nisplus.callback.status",
1760
16
      FT_BOOLEAN, BASE_NONE, TFS(&tfs_callback_status),
1761
16
      0x0, "Status Of Callback Thread", HFILL }},
1762
1763
16
    { &hf_nisplus_cp_status, {
1764
16
      "status", "nisplus.checkpoint.status", FT_UINT32, BASE_DEC,
1765
16
      NULL, 0, "Checkpoint Status", HFILL }},
1766
1767
16
    { &hf_nisplus_cp_zticks, {
1768
16
      "zticks", "nisplus.checkpoint.zticks", FT_UINT32, BASE_DEC,
1769
16
      NULL, 0, "Service Ticks", HFILL }},
1770
1771
16
    { &hf_nisplus_cp_dticks, {
1772
16
      "dticks", "nisplus.checkpoint.dticks", FT_UINT32, BASE_DEC,
1773
16
      NULL, 0, "Database Ticks", HFILL }},
1774
1775
16
    { &hf_nisplus_zticks, {
1776
16
      "zticks", "nisplus.zticks", FT_UINT32, BASE_DEC,
1777
16
      NULL, 0, NULL, HFILL }},
1778
1779
16
    { &hf_nisplus_dticks, {
1780
16
      "dticks", "nisplus.dticks", FT_UINT32, BASE_DEC,
1781
16
      NULL, 0, NULL, HFILL }},
1782
1783
16
    { &hf_nisplus_aticks, {
1784
16
      "aticks", "nisplus.aticks", FT_UINT32, BASE_DEC,
1785
16
      NULL, 0, NULL, HFILL }},
1786
1787
16
    { &hf_nisplus_cticks, {
1788
16
      "cticks", "nisplus.cticks", FT_UINT32, BASE_DEC,
1789
16
      NULL, 0, NULL, HFILL }},
1790
1791
16
  };
1792
1793
16
  static int *ett[] = {
1794
16
    &ett_nisplus,
1795
16
    &ett_nisplus_object,
1796
16
    &ett_nisplus_oid,
1797
16
    &ett_nisplus_directory,
1798
16
    &ett_nisplus_directory_mask,
1799
16
    &ett_nisplus_access_mask,
1800
16
    &ett_nisplus_server,
1801
16
    &ett_nisplus_endpoint,
1802
16
    &ett_nisplus_link,
1803
16
    &ett_nisplus_attr,
1804
16
    &ett_nisplus_entry,
1805
16
    &ett_nisplus_entry_col,
1806
16
    &ett_nisplus_entry_mask,
1807
16
    &ett_nisplus_table,
1808
16
    &ett_nisplus_table_col,
1809
16
    &ett_nisplus_table_col_mask,
1810
16
    &ett_nisplus_group,
1811
16
    &ett_nisplus_grps,
1812
16
    &ett_nisplus_tag,
1813
16
    &ett_nisplus_log_entry,
1814
16
  };
1815
1816
16
  proto_nisplus = proto_register_protocol("NIS+", "NIS+", "nisplus");
1817
16
  proto_register_field_array(proto_nisplus, hf, array_length(hf));
1818
16
  proto_register_subtree_array(ett, array_length(ett));
1819
16
}
1820
1821
void
1822
proto_reg_handoff_nis(void)
1823
16
{
1824
  /* Register the protocol as RPC */
1825
16
  rpc_init_prog(proto_nisplus, NIS_PROGRAM, ett_nisplus,
1826
16
      G_N_ELEMENTS(nisplus_vers_info), nisplus_vers_info);
1827
16
}
1828
1829
1830
1831
1832
1833
1834
/* xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1835
   callback protocol for NIS+
1836
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx */
1837
1838
static int proto_nispluscb;
1839
static int hf_nispluscb_procedure_v1;
1840
static int hf_nispluscb_entries;
1841
static int hf_nispluscb_entry;
1842
1843
static int ett_nispluscb;
1844
static int ett_nispluscb_entry;
1845
1846
static int
1847
dissect_cb_entry(tvbuff_t *tvb, unsigned offset, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
1848
0
{
1849
0
  proto_item* lock_item = NULL;
1850
  /* proto_tree* lock_tree = NULL; */
1851
0
  int old_offset = offset;
1852
1853
0
  lock_item = proto_tree_add_item(tree, hf_nispluscb_entry,
1854
0
      tvb, offset, -1, ENC_NA);
1855
1856
  /* lock_tree = proto_item_add_subtree(lock_item, ett_nispluscb_entry); */
1857
1858
/*XXXXX Not implemented yet*/
1859
1860
0
  proto_item_set_len(lock_item, offset-old_offset);
1861
0
  return offset;
1862
0
}
1863
1864
static int
1865
dissect_cback_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
1866
0
{
1867
0
  return dissect_rpc_array(tvb, pinfo, tree, 0,
1868
0
      dissect_cb_entry, hf_nispluscb_entries);
1869
0
}
1870
1871
/* proc number, "proc name", dissect_request, dissect_reply */
1872
static const vsff cb1_proc[] = {
1873
  { CBPROC_NULL,      "NULL",
1874
    dissect_rpc_void, dissect_rpc_void },
1875
  { CBPROC_RECEIVE,   "RECEIVE",
1876
    dissect_cback_data, dissect_callback_result },
1877
  { CBPROC_FINISH,    "FINISH",
1878
    dissect_rpc_void, dissect_rpc_void },
1879
  { CBPROC_ERROR,     "ERROR",
1880
    dissect_nisplus_error,  dissect_rpc_void },
1881
  { 0,  NULL, NULL, NULL },
1882
};
1883
static const value_string nispluscb1_proc_vals[] = {
1884
  { CBPROC_NULL,    "NULL" },
1885
  { CBPROC_RECEIVE, "RECEIVE" },
1886
  { CBPROC_FINISH,  "FINISH" },
1887
  { CBPROC_ERROR,   "ERROR" },
1888
  { 0,  NULL }
1889
};
1890
static const rpc_prog_vers_info nispluscb_vers_info[] = {
1891
  { 1, cb1_proc, &hf_nispluscb_procedure_v1 },
1892
};
1893
1894
void
1895
proto_register_niscb(void)
1896
16
{
1897
16
  static hf_register_info hf[] = {
1898
16
    { &hf_nispluscb_procedure_v1, {
1899
16
      "V1 Procedure", "nispluscb.procedure_v1", FT_UINT32, BASE_DEC,
1900
16
      VALS(nispluscb1_proc_vals), 0, NULL, HFILL }},
1901
16
    { &hf_nispluscb_entries, {
1902
16
      "entries", "nispluscb.entries", FT_NONE, BASE_NONE,
1903
16
      NULL, 0, "NIS Callback Entries", HFILL }},
1904
1905
16
    { &hf_nispluscb_entry, {
1906
16
      "entry", "nispluscb.entry", FT_NONE, BASE_NONE,
1907
16
      NULL, 0, "NIS Callback Entry", HFILL }},
1908
1909
16
  };
1910
1911
16
  static int *ett[] = {
1912
16
    &ett_nispluscb,
1913
16
    &ett_nispluscb_entry,
1914
16
  };
1915
1916
16
  proto_nispluscb = proto_register_protocol("NIS+ Callback",
1917
16
      "NIS+ CB", "nispluscb");
1918
16
  proto_register_field_array(proto_nispluscb, hf, array_length(hf));
1919
16
  proto_register_subtree_array(ett, array_length(ett));
1920
16
}
1921
1922
void
1923
proto_reg_handoff_niscb(void)
1924
16
{
1925
  /* Register the protocol as RPC */
1926
16
  rpc_init_prog(proto_nispluscb, CB_PROGRAM, ett_nispluscb,
1927
      G_N_ELEMENTS(nispluscb_vers_info), nispluscb_vers_info);
1928
16
}
1929
1930
/*
1931
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
1932
 *
1933
 * Local variables:
1934
 * c-basic-offset: 8
1935
 * tab-width: 8
1936
 * indent-tabs-mode: t
1937
 * End:
1938
 *
1939
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
1940
 * :indentSize=8:tabSize=8:noTabs=false:
1941
 */