Prep for the 0.9.14 release
[metze/wireshark/wip.git] / packet-ypxfr.c
index a53a81b0641c2818ee98e596fba0a925e70985ad..b478f82f3e400e508650bcdff2bc767f98f06ba0 100644 (file)
@@ -1,10 +1,10 @@
 /* packet-ypxfr.c
  * Routines for ypxfr dissection
  *
- * $Id: packet-ypxfr.c,v 1.2 1999/11/16 11:43:04 guy Exp $
+ * $Id: packet-ypxfr.c,v 1.9 2002/11/01 00:48:39 sahlberg Exp $
  *
  * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@unicom.net>
+ * By Gerald Combs <gerald@zing.org>
  * Copyright 1998 Gerald Combs
  *
  * Copied from packet-smb.c
 #endif
 
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
 
 #include "packet-rpc.h"
 #include "packet-ypxfr.h"
 
 static int proto_ypxfr = -1;
+static int hf_ypxfr_procedure_v1 = -1;
 
 static gint ett_ypxfr = -1;
 
 /* proc number, "proc name", dissect_request, dissect_reply */
-/* NULL as function pointer means: take the generic one. */
-const vsff ypxfr1_proc[] = {
-       { YPXFRPROC_NULL,       "NULL",         NULL,                           NULL },
-       { YPXFRPROC_GETMAP,     "GETMAP",               NULL,                           NULL },
-       { 0,    NULL,           NULL,                           NULL }
+/* NULL as function pointer means: type of arguments is "void". */
+static const vsff ypxfr1_proc[] = {
+       { YPXFRPROC_NULL,       "NULL",         NULL,           NULL },
+       { YPXFRPROC_GETMAP,     "GETMAP",       NULL,           NULL },
+       { 0,                    NULL,           NULL,           NULL }
+};
+static const value_string ypxfr1_proc_vals[] = {
+       { YPXFRPROC_NULL,       "NULL" },
+       { YPXFRPROC_GETMAP,     "GETMAP" },
+       { 0,                    NULL }
 };
 /* end of YPXFR version 1 */
 
 void
 proto_register_ypxfr(void)
 {
+       static hf_register_info hf[] = {
+               { &hf_ypxfr_procedure_v1, {
+                       "V1 Procedure", "ypxfr.procedure_v1", FT_UINT32, BASE_DEC,
+                       VALS(ypxfr1_proc_vals), 0, "V1 Procedure", HFILL }}
+       };
+
        static gint *ett[] = {
                &ett_ypxfr
        };
 
-       proto_ypxfr = proto_register_protocol("Yellow Pages Transfer", "ypxfr");
+       proto_ypxfr = proto_register_protocol("Yellow Pages Transfer",
+           "YPXFR", "ypxfr");
+       proto_register_field_array(proto_ypxfr, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));
+}
 
+void
+proto_reg_handoff_ypxfr(void)
+{
        /* Register the protocol as RPC */
        rpc_init_prog(proto_ypxfr, YPXFR_PROGRAM, ett_ypxfr);
        /* Register the procedure tables */
-       rpc_init_proc_table(YPXFR_PROGRAM, 1, ypxfr1_proc);
+       rpc_init_proc_table(YPXFR_PROGRAM, 1, ypxfr1_proc, hf_ypxfr_procedure_v1);
 }
-