From Jaime Fournier: DCE/RPC UKIKVOTE interface
[obnox/wireshark/wip.git] / packet-dcerpc-ubikvote.c
diff --git a/packet-dcerpc-ubikvote.c b/packet-dcerpc-ubikvote.c
new file mode 100644 (file)
index 0000000..2362882
--- /dev/null
@@ -0,0 +1,102 @@
+/* packet-dcerpc-ubikvote.c\r
+ *\r
+ * Routines for dcerpc Ubik Voting  routines.\r
+ * Copyright 2002, Jaime Fournier <jafour1@yahoo.com>\r
+ * This information is based off the released idl files from opengroup.\r
+ * ftp://ftp.opengroup.org/pub/dce122/dce/src/file.tar.gz file/ncsubik/ubikvote_proc.idl\r
+ *\r
+ * $Id: packet-dcerpc-ubikvote.c,v 1.1 2002/09/12 09:06:23 sahlberg Exp $\r
+ *\r
+ * Ethereal - Network traffic analyzer\r
+ * By Gerald Combs <gerald@ethereal.com>\r
+ * Copyright 1998 Gerald Combs\r
+ *\r
+ * This program is free software; you can redistribute it and/or\r
+ * modify it under the terms of the GNU General Public License\r
+ * as published by the Free Software Foundation; either version 2\r
+ * of the License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+ */\r
+\r
+#ifdef HAVE_CONFIG_H\r
+#include "config.h"\r
+#endif\r
+\r
+\r
+#ifdef HAVE_SYS_TYPES_H\r
+#include <sys/types.h>\r
+#endif\r
+\r
+#include <string.h>\r
+\r
+#include <glib.h>\r
+#include <epan/packet.h>\r
+#include "packet-dcerpc.h"\r
+\r
+\r
+static int proto_ubikvote = -1;\r
+static int hf_ubikvote_opnum = -1;\r
+\r
+\r
+static gint ett_ubikvote = -1;\r
+\r
+\r
+static e_uuid_t uuid_ubikvote = { 0x4d37f2dd, 0xed43, 0x0003, { 0x02, 0xc0, 0x37, 0xcf, 0x1e, 0x00, 0x00, 0x00 } };\r
+static guint16  ver_ubikvote = 4;\r
+\r
+\r
+static dcerpc_sub_dissector ubikvote_dissectors[] = {\r
+       { 0, "Beacon", NULL, NULL},\r
+       { 1, "Debug", NULL, NULL},\r
+       { 2, "SDebug", NULL, NULL},\r
+       { 3, "GetServerInterfaces", NULL, NULL},\r
+       { 4, "GetSyncSite", NULL, NULL},\r
+       { 5, "DebugV2", NULL, NULL},\r
+       { 6, "SDebugV2", NULL, NULL},\r
+       { 7, "GetSyncSiteIdentity", NULL, NULL},\r
+        { 0, NULL, NULL, NULL }\r
+};\r
+\r
+static const value_string ubikvote_opnum_vals[] = {\r
+       { 0, "Beacon" },\r
+       { 1, "Debug" },\r
+       { 2, "SDebug" },\r
+       { 3, "GetServerInterfaces" },\r
+       { 4, "GetSyncSite" },\r
+       { 5, "DebugV2" },\r
+       { 6, "SDebugV2" },\r
+       { 7, "GetSyncSiteIdentity" },\r
+        { 0, NULL }\r
+};\r
+\r
+void\r
+proto_register_ubikvote (void)\r
+{\r
+       static hf_register_info hf[] = {\r
+         { &hf_ubikvote_opnum,\r
+           { "Operation", "ubikvote.opnum", FT_UINT16, BASE_DEC,\r
+             VALS(ubikvote_opnum_vals), 0x0, "Operation", HFILL }}\r
+       };\r
+\r
+       static gint *ett[] = {\r
+               &ett_ubikvote,\r
+       };\r
+       proto_ubikvote = proto_register_protocol ("DCE/RPC FLDB", "UBIKVOTE", "ubikvote");\r
+       proto_register_field_array (proto_ubikvote, hf, array_length (hf));\r
+       proto_register_subtree_array (ett, array_length (ett));\r
+}\r
+\r
+void\r
+proto_reg_handoff_ubikvote (void)\r
+{\r
+       /* Register the protocol as dcerpc */\r
+       dcerpc_init_uuid (proto_ubikvote, ett_ubikvote, &uuid_ubikvote, ver_ubikvote, ubikvote_dissectors, hf_ubikvote_opnum);\r
+}\r