From Olivier Biot:
[obnox/wireshark/wip.git] / packet-dcerpc-rs_repadm.c
1 /* packet-dcerpc-rs_repadm.c
2  *
3  * Routines for dcerpc Registry server administration operations.
4  * Copyright 2002, Jaime Fournier <jafour1@yahoo.com>
5  * This information is based off the released idl files from opengroup.
6  * ftp://ftp.opengroup.org/pub/dce122/dce/src/security.tar.gz  security/idl/rs_repadm.idl
7  *
8  * $Id: packet-dcerpc-rs_repadm.c,v 1.3 2003/06/26 04:30:29 tpot Exp $
9  *
10  * Ethereal - Network traffic analyzer
11  * By Gerald Combs <gerald@ethereal.com>
12  * Copyright 1998 Gerald Combs
13  *
14  * This program is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU General Public License
16  * as published by the Free Software Foundation; either version 2
17  * of the License, or (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
27  */
28
29 #ifdef HAVE_CONFIG_H
30 #include "config.h"
31 #endif
32
33
34 #ifdef HAVE_SYS_TYPES_H
35 #include <sys/types.h>
36 #endif
37
38 #include <string.h>
39
40 #include <glib.h>
41 #include <epan/packet.h>
42 #include "packet-dcerpc.h"
43
44
45 static int proto_rs_repadm = -1;
46 static int hf_rs_repadm_opnum = -1;
47
48
49 static gint ett_rs_repadm = -1;
50
51
52 static e_uuid_t uuid_rs_repadm = { 0x5b8c2fa8, 0xb60b, 0x11c9, { 0xbe, 0x0f, 0x08, 0x00, 0x1e, 0x01, 0x8f, 0xa0 } };
53 static guint16  ver_rs_repadm = 1.1;
54
55
56
57          
58 static dcerpc_sub_dissector rs_repadm_dissectors[] = {
59     { 0, "rs_rep_admin_stop", NULL, NULL},
60     { 1, "rs_rep_admin_maint", NULL, NULL},
61     { 2, "rs_rep_admin_mkey", NULL, NULL},
62     { 3, "rs_rep_admin_info", NULL, NULL},
63     { 4, "rs_rep_admin_info_full", NULL, NULL},
64     { 5, "rs_rep_admin_destroy", NULL, NULL},
65     { 6, "rs_rep_admin_init_replica", NULL, NULL},
66     { 7, "rs_rep_admin_change_master", NULL, NULL},
67     { 8, "rs_rep_admin_become_master", NULL, NULL},
68     { 9, "rs_rep_admin_become_slave", NULL, NULL},
69     { 10, "rs_rep_admin_set_sw_rev", NULL, NULL},
70     { 11, "rs_rep_admin_get_sw_vers_info", NULL, NULL},
71     { 0, NULL, NULL, NULL }
72 };
73
74
75 void
76 proto_register_rs_repadm (void)
77 {
78         static hf_register_info hf[] = {
79         { &hf_rs_repadm_opnum,
80                 { "Operation", "rs_repadmin.opnum", FT_UINT16, BASE_DEC, NULL, 0x0, "Operation", HFILL }}
81         };
82
83         static gint *ett[] = {
84                 &ett_rs_repadm,
85         };
86         proto_rs_repadm = proto_register_protocol ("Registry server administration operations.", "RS_REPADM", "rs_repadm");
87         proto_register_field_array (proto_rs_repadm, hf, array_length (hf));
88         proto_register_subtree_array (ett, array_length (ett));
89 }
90
91 void
92 proto_reg_handoff_rs_repadm (void)
93 {
94         header_field_info *hf_info;
95
96         /* Register the protocol as dcerpc */
97         dcerpc_init_uuid (proto_rs_repadm, ett_rs_repadm, &uuid_rs_repadm, ver_rs_repadm, rs_repadm_dissectors, hf_rs_repadm_opnum);
98
99         /* Set opnum strings from subdissector list */
100
101         hf_info = proto_registrar_get_nth(hf_rs_repadm_opnum);
102         hf_info->strings = value_string_from_subdissectors(
103                 rs_repadm_dissectors, array_length(rs_repadm_dissectors));
104 }