As the gtk2 directory is no longer needed (GTK1 and 2 are using the same sources...
[obnox/wireshark/wip.git] / epan / dissectors / packet-dcerpc-dnsserver.c
1 /* packet-dcerpc-dnsserver.c
2  * Routines for SMB \PIPE\DNSSERVER packet disassembly
3  * Copyright 2001, 2002 Tim Potter <tpot@samba.org>
4  *
5  * $Id$
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@ethereal.com>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29
30 #include <glib.h>
31 #include <epan/packet.h>
32 #include "packet-dcerpc.h"
33 #include "packet-dcerpc-nt.h"
34 #include "packet-dcerpc-dnsserver.h"
35 #include "smb.h"
36
37 /* Global hf index fields */
38
39 static int hf_rc = -1;
40
41 static int proto_dcerpc_dnsserver = -1;
42 static int hf_opnum = -1;
43
44 static gint ett_dnsserver = -1;
45
46 static e_uuid_t uuid_dcerpc_dnsserver = {
47         0x50abc2a4, 0x574d, 0x40b3,
48         { 0x9d, 0x66, 0xee, 0x4f, 0xd5, 0xfb, 0xa0, 0x76 }
49 };
50
51 static guint16 ver_dcerpc_dnsserver = 5;
52
53 static dcerpc_sub_dissector dcerpc_dnsserver_dissectors[] = {
54         { DNSSERVER_DNSSRV_OPERATION, "DnssrvOperation", 
55           NULL, NULL },
56         { DNSSERVER_DNSSRV_QUERY, "DnssrvQuery", 
57           NULL, NULL },
58         { DNSSERVER_DNSSRV_COMPLEX_OPERATION, "DnssrvComplexOperation", 
59           NULL, NULL },
60         { DNSSERVER_DNSSRV_ENUM_RECORDS, "DnssrvEnumRecords", 
61           NULL, NULL }, 
62         { DNSSERVER_DNSSRV_UPDATE_RECORD, "DnssrvUpdateRecord", 
63           NULL, NULL },
64         { DNSSERVER_DNSSRV_OPERATION_2, "DnssrvOperation2", 
65           NULL, NULL },
66         { DNSSERVER_DNSSRV_QUERY_2, "DnssrvQuery2", 
67           NULL, NULL },
68         { DNSSERVER_DNSSRV_COMPLEX_OPERATION_2, "DnssrvComplexOperation2", 
69           NULL, NULL },
70         { DNSSERVER_DNSSRV_ENUM_RECORDS_2, "DnssrvEnumRecords2", 
71           NULL, NULL },
72         { DNSSERVER_DNSSRV_UPDATE_RECORD_2, "DnssrvUpdateRecord2", 
73           NULL, NULL },
74         { 0, NULL, NULL,  NULL }
75 };
76
77 void
78 proto_register_dcerpc_dnsserver(void)
79 {
80         static hf_register_info hf[] = {
81
82                 /* Global indexes */
83
84                 { &hf_rc,
85                   { "Return code", "dnsserver.rc", FT_UINT32, BASE_HEX,
86                     VALS(NT_errors), 0x0, "Return code", HFILL }},
87
88                 { &hf_opnum,
89                   { "Operation", "dnsserver.opnum", FT_UINT16, BASE_DEC,
90                     NULL, 0x0, "Operation", HFILL }},
91         };
92
93         static gint *ett[] = {
94                 &ett_dnsserver
95         };
96
97         proto_dcerpc_dnsserver = proto_register_protocol(
98                 "Windows 2000 DNS", "DNSSERVER", "dnsserver");
99
100         proto_register_field_array(proto_dcerpc_dnsserver, hf, array_length(hf));
101
102         proto_register_subtree_array(ett, array_length(ett));
103 }
104
105 void
106 proto_reg_handoff_dcerpc_dnsserver(void)
107 {
108         /* Register protocol as dcerpc */
109
110         dcerpc_init_uuid(
111                 proto_dcerpc_dnsserver, ett_dnsserver, &uuid_dcerpc_dnsserver,
112                 ver_dcerpc_dnsserver, dcerpc_dnsserver_dissectors, hf_opnum);
113 }