Coverage Report

Created: 2026-05-14 06:28

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-ypserv.c
Line
Count
Source
1
/* packet-ypserv.c
2
 * Routines for ypserv dissection
3
 *
4
 * Wireshark - Network traffic analyzer
5
 * By Gerald Combs <gerald@wireshark.org>
6
 * Copyright 1998 Gerald Combs
7
 *
8
 * Copied from packet-smb.c
9
 *
10
 * 2001 Ronnie Sahlberg <See AUTHORS for email>
11
 *   Added all remaining dissectors for this protocol
12
 *
13
 * SPDX-License-Identifier: GPL-2.0-or-later
14
 */
15
16
#include "config.h"
17
18
#include <epan/packet.h>
19
#include <epan/tfs.h>
20
#include <wsutil/array.h>
21
#include "packet-rpc.h"
22
#include "packet-ypserv.h"
23
24
void proto_register_ypserv(void);
25
void proto_reg_handoff_ypserv(void);
26
27
static int proto_ypserv;
28
static int hf_ypserv_procedure_v1;
29
static int hf_ypserv_procedure_v2;
30
static int hf_ypserv_domain;
31
static int hf_ypserv_servesdomain;
32
static int hf_ypserv_map;
33
static int hf_ypserv_key;
34
static int hf_ypserv_peer;
35
static int hf_ypserv_more;
36
static int hf_ypserv_ordernum;
37
static int hf_ypserv_transid;
38
static int hf_ypserv_prog;
39
static int hf_ypserv_port;
40
static int hf_ypserv_value;
41
static int hf_ypserv_status;
42
static int hf_ypserv_map_parms;
43
static int hf_ypserv_xfrstat;
44
45
static int ett_ypserv;
46
static int ett_ypserv_map_parms;
47
48
static const value_string ypstat[] =
49
{
50
  { 1,  "YP_TRUE" },
51
  { 2,  "YP_NOMORE" },
52
  { 0,  "YP_FALSE"  },
53
  { -1, "YP_NOMAP"  },
54
  { -2, "YP_NODOM"  },
55
  { -3, "YP_NOKEY"  },
56
  { -4, "YP_BADOP"  },
57
  { -5, "YP_BADDB"  },
58
  { -6, "YP_YPERR"  },
59
  { -7, "YP_BADARGS"  },
60
  { -8, "YP_VERS" },
61
  { 0,  NULL  },
62
};
63
64
static const value_string xfrstat[] =
65
{
66
  { 1,  "YPXFR_SUCC"  },
67
  { 2,  "YPXFR_AGE" },
68
  { -1, "YPXFR_NOMAP" },
69
  { -2, "YPXFR_NODOM" },
70
  { -3, "YPXFR_RSRC"  },
71
  { -4, "YPXFR_RPC" },
72
  { -5, "YPXFR_MADDR" },
73
  { -6, "YPXFR_YPERR" },
74
  { -7, "YPXFR_BADARGS" },
75
  { -8, "YPXFR_DBM" },
76
  { -9, "YPXFR_FILE"  },
77
  { -10,  "YPXFR_SKEW"  },
78
  { -11,  "YPXFR_CLEAR" },
79
  { -12,  "YPXFR_FORCE" },
80
  { -13,  "YPXFR_XFRERR"  },
81
  { -14,  "YPXFR_REFUSED" },
82
  { 0,  NULL  },
83
};
84
85
static int
86
dissect_ypserv_status(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int32_t *rstatus)
87
0
{
88
0
  int32_t status;
89
0
  const char *err;
90
91
0
  status=tvb_get_ntohl(tvb, offset);
92
0
  if(rstatus){
93
0
    *rstatus=status;
94
0
  }
95
0
  offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_status, offset);
96
97
0
  if(status<0){
98
0
    err=val_to_str(pinfo->pool, status, ypstat, "Unknown error:%u");
99
0
    col_append_fstr(pinfo->cinfo, COL_INFO," %s", err);
100
101
0
    proto_item_append_text(tree, " Error:%s", err);
102
0
  }
103
104
0
  return offset;
105
0
}
106
107
static int
108
dissect_domain_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
109
0
{
110
0
  proto_item_append_text(tree, " DOMAIN call");
111
112
0
  return dissect_rpc_string(tvb,pinfo,tree,hf_ypserv_domain,0,NULL);
113
0
}
114
115
static int
116
dissect_domain_nonack_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
117
0
{
118
0
  proto_item_append_text(tree, " DOMAIN_NONACK call");
119
120
0
  return dissect_rpc_string(tvb,pinfo,tree,hf_ypserv_domain,0,NULL);
121
0
}
122
123
static int
124
dissect_maplist_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
125
0
{
126
0
  proto_item_append_text(tree, " MAPLIST call");
127
128
0
  return dissect_rpc_string(tvb,pinfo,tree,hf_ypserv_domain,0,NULL);
129
0
}
130
131
static int
132
dissect_domain_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
133
0
{
134
0
  int offset = 0;
135
0
  proto_item_append_text(tree, " DOMAIN reply");
136
137
0
  proto_tree_add_item(tree, hf_ypserv_servesdomain, tvb,
138
0
      offset, 4, ENC_BIG_ENDIAN);
139
140
0
  offset += 4;
141
0
  return offset;
142
0
}
143
144
static int
145
dissect_domain_nonack_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
146
0
{
147
0
  int offset = 0;
148
0
  proto_item_append_text(tree, " DOMAIN_NONACK reply");
149
150
0
  proto_tree_add_item(tree, hf_ypserv_servesdomain, tvb,
151
0
      offset, 4, ENC_BIG_ENDIAN);
152
153
0
  offset += 4;
154
0
  return offset;
155
0
}
156
157
static int
158
dissect_match_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
159
0
{
160
0
  const char *str;
161
0
  int offset = 0;
162
163
0
  proto_item_append_text(tree, " MATCH call");
164
165
  /*domain*/
166
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_domain, offset, &str);
167
0
  col_append_fstr(pinfo->cinfo, COL_INFO," %s/", str);
168
0
  proto_item_append_text(tree, " %s/", str);
169
170
  /*map*/
171
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_map, offset, &str);
172
0
  col_append_fstr(pinfo->cinfo, COL_INFO,"%s/", str);
173
0
  proto_item_append_text(tree, "%s/", str);
174
175
  /*key*/
176
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_key, offset, &str);
177
0
  col_append_str(pinfo->cinfo, COL_INFO, str);
178
0
  proto_item_append_text(tree, "%s", str);
179
180
0
  return offset;
181
0
}
182
183
static int
184
dissect_match_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
185
0
{
186
0
  int32_t status;
187
0
  const char *str;
188
0
  int offset = 0;
189
190
0
  proto_item_append_text(tree, " MATCH reply");
191
192
0
  offset = dissect_ypserv_status(tvb, offset, pinfo, tree, &status);
193
194
0
  if(status>=0){
195
0
    offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_value,offset, &str);
196
0
    col_append_fstr(pinfo->cinfo, COL_INFO," %s", str);
197
0
    proto_item_append_text(tree, " %s", str);
198
199
0
  } else {
200
0
    offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_value,offset, NULL);
201
0
  }
202
203
0
  return offset;
204
0
}
205
206
207
static int
208
dissect_first_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
209
0
{
210
0
  int offset = 0;
211
0
  proto_item_append_text(tree, " FIRST call");
212
213
  /*
214
   * XXX - does Sun's "yp.x" lie, and claim that the argument to a
215
   * FIRST call is a "ypreq_key" rather than a "ypreq_nokey"?
216
   * You presumably need the key for NEXT, as "next" is "next
217
   * after some entry", and the key tells you which entry, but
218
   * you don't need a key for FIRST, as there's only one entry that
219
   * is the first entry.
220
   *
221
   * The NIS server originally used DBM, which has a "firstkey()"
222
   * call, with no argument, and a "nextkey()" argument, with
223
   * a key argument.  (Heck, it might *still* use DBM.)
224
   *
225
   * Given that, and given that at least one FIRST call from a Sun
226
   * running Solaris 8 (the Sun on which I'm typing this, in fact)
227
   * had a "ypreq_nokey" as the argument, I'm assuming that "yp.x"
228
   * is buggy.
229
   */
230
231
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_domain, offset, NULL);
232
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_map, offset, NULL);
233
234
0
  return offset;
235
0
}
236
237
238
static int
239
dissect_first_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
240
0
{
241
0
  int offset = 0;
242
0
  proto_item_append_text(tree, " FIRST reply");
243
244
0
  offset = dissect_ypserv_status(tvb, offset, pinfo, tree, NULL);
245
246
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_value, offset, NULL);
247
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_key, offset, NULL);
248
249
0
  return offset;
250
0
}
251
252
static int
253
dissect_next_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
254
0
{
255
0
  int offset = 0;
256
0
  proto_item_append_text(tree, " NEXT reply");
257
258
0
  offset = dissect_ypserv_status(tvb, offset, pinfo, tree, NULL);
259
260
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_value, offset, NULL);
261
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_key, offset, NULL);
262
263
0
  return offset;
264
0
}
265
266
267
static int
268
dissect_next_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
269
0
{
270
0
  int offset = 0;
271
0
  proto_item_append_text(tree, " NEXT call");
272
273
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_domain, offset, NULL);
274
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_map, offset, NULL);
275
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_key, offset, NULL);
276
277
0
  return offset;
278
0
}
279
280
static int
281
dissect_xfr_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
282
0
{
283
0
  proto_item *sub_item=NULL;
284
0
  proto_tree *sub_tree=NULL;
285
0
  int offset = 0;
286
0
  int start_offset = offset;
287
288
0
  proto_item_append_text(tree, " XFR call");
289
290
0
  if(tree){
291
0
    sub_item = proto_tree_add_item(tree, hf_ypserv_map_parms, tvb,
292
0
        offset, -1, ENC_NA);
293
0
    if(sub_item)
294
0
      sub_tree = proto_item_add_subtree(sub_item, ett_ypserv_map_parms);
295
0
  }
296
297
0
  offset = dissect_rpc_string(tvb, pinfo, sub_tree, hf_ypserv_domain, offset, NULL);
298
299
0
  offset = dissect_rpc_string(tvb, pinfo, sub_tree, hf_ypserv_map, offset, NULL);
300
301
0
  offset = dissect_rpc_uint32(tvb, sub_tree, hf_ypserv_ordernum, offset);
302
303
0
  offset = dissect_rpc_string(tvb, pinfo, sub_tree, hf_ypserv_peer, offset, NULL);
304
305
0
  proto_tree_add_item(tree, hf_ypserv_transid, tvb, offset, 4, ENC_BIG_ENDIAN);
306
0
  offset += 4;
307
308
0
  offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_prog, offset);
309
0
  offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_port, offset);
310
311
0
  if(sub_item)
312
0
    proto_item_set_len(sub_item, offset - start_offset);
313
314
0
  return offset;
315
0
}
316
317
static int
318
dissect_clear_call(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
319
0
{
320
0
  int offset = 0;
321
0
  proto_item_append_text(tree, " CLEAR call");
322
323
0
  return offset;
324
0
}
325
326
static int
327
dissect_clear_reply(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
328
0
{
329
0
  proto_item_append_text(tree, " CLEAR reply");
330
331
0
  return 0;
332
0
}
333
334
static int
335
dissect_xfr_reply(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
336
0
{
337
0
  int offset = 0;
338
0
  proto_item_append_text(tree, " XFR reply");
339
340
0
  proto_tree_add_item(tree, hf_ypserv_transid, tvb, offset, 4, ENC_BIG_ENDIAN);
341
0
  offset += 4;
342
343
0
  offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_xfrstat, offset);
344
345
0
  return offset;
346
0
}
347
348
static int
349
dissect_order_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
350
0
{
351
0
  const char *str;
352
0
  int offset = 0;
353
354
0
  proto_item_append_text(tree, " ORDER call");
355
356
  /*domain*/
357
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_domain, offset, &str);
358
0
  col_append_fstr(pinfo->cinfo, COL_INFO," %s/", str);
359
0
  proto_item_append_text(tree, " %s/", str);
360
361
  /*map*/
362
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_map, offset, &str);
363
0
  col_append_str(pinfo->cinfo, COL_INFO, str);
364
0
  proto_item_append_text(tree, "%s", str);
365
366
0
  return offset;
367
0
}
368
369
static int
370
dissect_all_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
371
0
{
372
0
  int offset = 0;
373
0
  proto_item_append_text(tree, " ALL call");
374
375
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_domain, offset, NULL);
376
377
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_map, offset, NULL);
378
379
0
  return offset;
380
0
}
381
382
static int
383
dissect_master_call(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
384
0
{
385
0
  int offset = 0;
386
0
  proto_item_append_text(tree, " MASTER call");
387
388
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_domain, offset, NULL);
389
390
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_map, offset, NULL);
391
392
0
  return offset;
393
0
}
394
395
static int
396
dissect_all_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
397
0
{
398
0
  uint32_t  more;
399
0
  int offset = 0;
400
401
0
  proto_item_append_text(tree, " ALL reply");
402
403
0
  for (;;) {
404
0
    more = tvb_get_ntohl(tvb, offset);
405
406
0
    offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_more, offset);
407
0
    if (!more)
408
0
      break;
409
0
    offset = dissect_ypserv_status(tvb, offset, pinfo, tree, NULL);
410
411
0
    offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_value, offset, NULL);
412
0
    offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_key, offset, NULL);
413
0
  }
414
415
0
  return offset;
416
0
}
417
418
static int
419
dissect_master_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
420
0
{
421
0
  int offset = 0;
422
0
  proto_item_append_text(tree, " MASTER reply");
423
424
0
  offset = dissect_ypserv_status(tvb, offset, pinfo, tree, NULL);
425
426
0
  offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_peer, offset, NULL);
427
428
0
  return offset;
429
0
}
430
431
432
static int
433
dissect_order_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
434
0
{
435
0
  uint32_t num;
436
0
  int offset = 0;
437
438
0
  proto_item_append_text(tree, " ORDER reply");
439
440
0
  offset = dissect_ypserv_status(tvb, offset, pinfo, tree, NULL);
441
442
  /*order number*/
443
0
  num=tvb_get_ntohl(tvb, offset);
444
0
  offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_ordernum, offset);
445
0
  col_append_fstr(pinfo->cinfo, COL_INFO," 0x%08x", num);
446
0
  proto_item_append_text(tree, " 0x%08x", num);
447
448
0
  return offset;
449
0
}
450
451
452
static int
453
dissect_maplist_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
454
0
{
455
0
  int offset = 0;
456
0
  proto_item_append_text(tree, " MAPLIST reply");
457
458
0
  offset = dissect_ypserv_status(tvb, offset, pinfo, tree, NULL);
459
0
  while(tvb_get_ntohl(tvb,offset)){
460
0
    offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_more, offset);
461
0
    offset = dissect_rpc_string(tvb, pinfo, tree, hf_ypserv_map, offset, NULL);
462
463
0
  }
464
0
  offset = dissect_rpc_uint32(tvb, tree, hf_ypserv_more, offset);
465
0
  return offset;
466
0
}
467
468
469
/* proc number, "proc name", dissect_request, dissect_reply */
470
471
/* someone please get me a version 1 trace */
472
473
static const vsff ypserv1_proc[] = {
474
  { 0, "NULL",
475
    dissect_rpc_void, dissect_rpc_void },
476
  { YPPROC_DOMAIN, "DOMAIN",
477
    dissect_rpc_unknown, dissect_rpc_unknown },
478
  { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK",
479
    dissect_rpc_unknown, dissect_rpc_unknown },
480
  { YPPROC_MATCH, "MATCH",
481
    dissect_rpc_unknown, dissect_rpc_unknown },
482
  { YPPROC_FIRST, "FIRST",
483
    dissect_rpc_unknown, dissect_rpc_unknown },
484
  { YPPROC_NEXT,  "NEXT",
485
    dissect_rpc_unknown, dissect_rpc_unknown },
486
  { YPPROC_XFR,   "XFR",
487
    dissect_rpc_unknown, dissect_rpc_unknown },
488
  { YPPROC_CLEAR, "CLEAR",
489
    dissect_rpc_unknown, dissect_rpc_unknown },
490
  { YPPROC_ALL,   "ALL",
491
    dissect_rpc_unknown, dissect_rpc_unknown },
492
  { YPPROC_MASTER,    "MASTER",
493
    dissect_rpc_unknown, dissect_rpc_unknown },
494
  { YPPROC_ORDER, "ORDER",
495
    dissect_rpc_unknown, dissect_rpc_unknown },
496
  { YPPROC_MAPLIST,   "MAPLIST",
497
    dissect_rpc_unknown, dissect_rpc_unknown },
498
  { 0, NULL, NULL, NULL }
499
};
500
501
static const value_string ypserv1_proc_vals[] = {
502
  { YPPROC_DOMAIN,        "DOMAIN" },
503
  { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK" },
504
  { YPPROC_MATCH,         "MATCH" },
505
  { YPPROC_FIRST,         "FIRST" },
506
  { YPPROC_NEXT,          "NEXT" },
507
  { YPPROC_XFR,           "XFR" },
508
  { YPPROC_CLEAR,         "CLEAR" },
509
  { YPPROC_ALL,           "ALL" },
510
  { YPPROC_MASTER,        "MASTER" },
511
  { YPPROC_ORDER,         "ORDER" },
512
  { YPPROC_MAPLIST,       "MAPLIST" },
513
  { 0, NULL }
514
};
515
516
/* end of YPServ version 1 */
517
518
/* proc number, "proc name", dissect_request, dissect_reply */
519
520
static const vsff ypserv2_proc[] = {
521
  { 0,                    "NULL",
522
    dissect_rpc_void, dissect_rpc_void },
523
  { YPPROC_DOMAIN,        "DOMAIN",
524
    dissect_domain_call, dissect_domain_reply },
525
  { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK",
526
    dissect_domain_nonack_call, dissect_domain_nonack_reply },
527
  { YPPROC_MATCH,         "MATCH",
528
    dissect_match_call, dissect_match_reply },
529
  { YPPROC_FIRST,         "FIRST",
530
    dissect_first_call, dissect_first_reply },
531
  { YPPROC_NEXT,          "NEXT",
532
    dissect_next_call, dissect_next_reply },
533
  { YPPROC_XFR,           "XFR",
534
    dissect_xfr_call, dissect_xfr_reply },
535
  { YPPROC_CLEAR,         "CLEAR",
536
    dissect_clear_call, dissect_clear_reply },
537
  { YPPROC_ALL,           "ALL",
538
    dissect_all_call, dissect_all_reply },
539
  { YPPROC_MASTER,        "MASTER",
540
    dissect_master_call, dissect_master_reply },
541
  { YPPROC_ORDER,         "ORDER",
542
    dissect_order_call, dissect_order_reply },
543
  { YPPROC_MAPLIST,       "MAPLIST",
544
    dissect_maplist_call, dissect_maplist_reply },
545
  { 0, NULL, NULL, NULL }
546
};
547
548
static const value_string ypserv2_proc_vals[] = {
549
  { YPPROC_DOMAIN,  "DOMAIN" },
550
  { YPPROC_DOMAIN_NONACK, "DOMAIN_NONACK" },
551
  { YPPROC_MATCH,   "MATCH" },
552
  { YPPROC_FIRST,   "FIRST" },
553
  { YPPROC_NEXT,    "NEXT" },
554
  { YPPROC_XFR,   "XFR" },
555
  { YPPROC_CLEAR,   "CLEAR" },
556
  { YPPROC_ALL,   "ALL" },
557
  { YPPROC_MASTER,  "MASTER" },
558
  { YPPROC_ORDER,   "ORDER" },
559
  { YPPROC_MAPLIST, "MAPLIST" },
560
  { 0, NULL }
561
};
562
563
/* end of YPServ version 2 */
564
565
566
static const rpc_prog_vers_info ypserv_vers_info[] = {
567
  { 1, ypserv1_proc, &hf_ypserv_procedure_v1 },
568
  { 2, ypserv2_proc, &hf_ypserv_procedure_v2 },
569
};
570
571
void
572
proto_register_ypserv(void)
573
15
{
574
15
  static hf_register_info hf[] = {
575
15
    { &hf_ypserv_procedure_v1, {
576
15
      "V1 Procedure", "ypserv.procedure_v1", FT_UINT32, BASE_DEC,
577
15
      VALS(ypserv1_proc_vals), 0, NULL, HFILL }},
578
15
    { &hf_ypserv_procedure_v2, {
579
15
      "V2 Procedure", "ypserv.procedure_v2", FT_UINT32, BASE_DEC,
580
15
      VALS(ypserv2_proc_vals), 0, NULL, HFILL }},
581
15
    { &hf_ypserv_domain, {
582
15
      "Domain", "ypserv.domain", FT_STRING, BASE_NONE,
583
15
      NULL, 0, NULL, HFILL }},
584
15
    { &hf_ypserv_servesdomain, {
585
15
      "Serves Domain", "ypserv.servesdomain", FT_BOOLEAN, BASE_NONE,
586
15
      TFS(&tfs_yes_no), 0x0, NULL, HFILL }},
587
15
    { &hf_ypserv_map, {
588
15
      "Map Name", "ypserv.map", FT_STRING, BASE_NONE,
589
15
      NULL, 0, NULL, HFILL }},
590
15
    { &hf_ypserv_peer, {
591
15
      "Peer Name", "ypserv.peer", FT_STRING, BASE_NONE,
592
15
      NULL, 0, NULL, HFILL }},
593
15
    { &hf_ypserv_more, {
594
15
      "More", "ypserv.more", FT_BOOLEAN, BASE_NONE,
595
15
      TFS(&tfs_yes_no), 0x0, NULL, HFILL }},
596
15
    { &hf_ypserv_ordernum, {
597
15
      "Order Number", "ypserv.ordernum", FT_UINT32, BASE_DEC,
598
15
      NULL, 0, "Order Number for XFR", HFILL }},
599
15
    { &hf_ypserv_transid, {
600
15
      "Host Transport ID", "ypserv.transid", FT_IPv4, BASE_NONE,
601
15
      NULL, 0, "Host Transport ID to use for XFR Callback", HFILL }},
602
15
    { &hf_ypserv_prog, {
603
15
      "Program Number", "ypserv.prog", FT_UINT32, BASE_DEC,
604
15
      NULL, 0, "Program Number to use for XFR Callback", HFILL }},
605
15
    { &hf_ypserv_port, {
606
15
      "Port", "ypserv.port", FT_UINT32, BASE_DEC,
607
15
      NULL, 0, "Port to use for XFR Callback", HFILL }},
608
15
    { &hf_ypserv_key, {
609
15
      "Key", "ypserv.key", FT_STRING, BASE_NONE,
610
15
      NULL, 0, NULL, HFILL }},
611
15
    { &hf_ypserv_value, {
612
15
      "Value", "ypserv.value", FT_STRING, BASE_NONE,
613
15
      NULL, 0, NULL, HFILL }},
614
15
    { &hf_ypserv_status, {
615
15
      "Status", "ypserv.status", FT_INT32, BASE_DEC,
616
15
      VALS(ypstat) , 0, NULL, HFILL }},
617
15
    { &hf_ypserv_map_parms, {
618
15
      "YP Map Parameters", "ypserv.map_parms", FT_NONE, BASE_NONE,
619
15
      NULL, 0, NULL, HFILL }},
620
15
    { &hf_ypserv_xfrstat, {
621
15
      "Xfrstat", "ypserv.xfrstat", FT_INT32, BASE_DEC,
622
15
      VALS(xfrstat), 0, NULL, HFILL }},
623
15
  };
624
15
  static int *ett[] = {
625
15
    &ett_ypserv,
626
15
    &ett_ypserv_map_parms,
627
15
  };
628
629
15
  proto_ypserv = proto_register_protocol("Yellow Pages Service",
630
15
      "YPSERV", "ypserv");
631
15
  proto_register_field_array(proto_ypserv, hf, array_length(hf));
632
15
  proto_register_subtree_array(ett, array_length(ett));
633
15
}
634
635
void
636
proto_reg_handoff_ypserv(void)
637
15
{
638
  /* Register the protocol as RPC */
639
15
  rpc_init_prog(proto_ypserv, YPSERV_PROGRAM, ett_ypserv,
640
      G_N_ELEMENTS(ypserv_vers_info), ypserv_vers_info);
641
15
}
642
643
/*
644
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
645
 *
646
 * Local variables:
647
 * c-basic-offset: 8
648
 * tab-width: 8
649
 * indent-tabs-mode: t
650
 * End:
651
 *
652
 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
653
 * :indentSize=8:tabSize=8:noTabs=false:
654
 */