Revert "WHY??? git add -f bin/default/librpc/gen_ndr/packet-dcerpc-*"
[metze/samba/wip.git] / bin / default / librpc / gen_ndr / packet-dcerpc-dns.c
1 /* DO NOT EDIT
2         This filter was automatically generated
3         from /home/metze/devel/samba/4.0/master4-franky/librpc/idl/dns.idl and /home/metze/devel/samba/4.0/master4-franky/librpc/idl/dns.cnf.
4         
5         Pidl is a perl based IDL compiler for DCE/RPC idl files.
6         It is maintained by the Samba team, not the Wireshark team.
7         Instructions on how to download and install Pidl can be
8         found at http://wiki.wireshark.org/Pidl
9
10         $Id$
11 */
12
13
14 #include "config.h"
15 #ifdef _MSC_VER
16 #pragma warning(disable:4005)
17 #pragma warning(disable:4013)
18 #pragma warning(disable:4018)
19 #pragma warning(disable:4101)
20 #endif
21
22 #include <glib.h>
23 #include <string.h>
24 #include <epan/packet.h>
25
26 #include "packet-dcerpc.h"
27 #include "packet-dcerpc-nt.h"
28 #include "packet-windows-common.h"
29 #include "packet-dcerpc-dns.h"
30
31 /* Ett declarations */
32 static gint ett_dcerpc_dns = -1;
33 static gint ett_dns_dns_operation = -1;
34 static gint ett_dns_dns_name_question = -1;
35 static gint ett_dns_dns_rdata_data = -1;
36 static gint ett_dns_dns_soa_record = -1;
37 static gint ett_dns_dns_hinfo_record = -1;
38 static gint ett_dns_dns_mx_record = -1;
39 static gint ett_dns_dns_txt_record = -1;
40 static gint ett_dns_dns_rp_record = -1;
41 static gint ett_dns_dns_srv_record = -1;
42 static gint ett_dns_dns_opt_record = -1;
43 static gint ett_dns_dns_tkey_record = -1;
44 static gint ett_dns_dns_tsig_record = -1;
45 static gint ett_dns_dns_fake_tsig_rec = -1;
46 static gint ett_dns_dns_rdata = -1;
47 static gint ett_dns_dns_res_rec = -1;
48 static gint ett_dns_dns_name_packet = -1;
49
50
51 /* Header field declarations */
52 static gint hf_dns_dns_hinfo_record_cpu = -1;
53 static gint hf_dns_decode_dns_name_packet_packet = -1;
54 static gint hf_dns_dns_srv_record_target = -1;
55 static gint hf_dns_dns_soa_record_minimum = -1;
56 static gint hf_dns_dns_srv_record_priority = -1;
57 static gint hf_dns_dns_operation_DNS_FLAG_REPLY = -1;
58 static gint hf_dns_opnum = -1;
59 static gint hf_dns_dns_srv_record_weight = -1;
60 static gint hf_dns_dns_operation_DNS_FLAG_BROADCAST = -1;
61 static gint hf_dns_dns_tsig_record_algorithm_name = -1;
62 static gint hf_dns_dns_tkey_record_inception = -1;
63 static gint hf_dns_dns_res_rec_rdata = -1;
64 static gint hf_dns_dns_tsig_record_error = -1;
65 static gint hf_dns_dns_rdata_tkey_record = -1;
66 static gint hf_dns_dns_tsig_record_original_id = -1;
67 static gint hf_dns_dns_name_packet_arcount = -1;
68 static gint hf_dns_dns_fake_tsig_rec_original_id = -1;
69 static gint hf_dns_dns_fake_tsig_rec_time = -1;
70 static gint hf_dns_dns_rdata_mx_record = -1;
71 static gint hf_dns_dns_tsig_record_mac = -1;
72 static gint hf_dns_dns_tsig_record_time_prefix = -1;
73 static gint hf_dns_dns_res_rec_length = -1;
74 static gint hf_dns_dns_rdata_soa_record = -1;
75 static gint hf_dns_dns_fake_tsig_rec_error = -1;
76 static gint hf_dns_dns_mx_record_preference = -1;
77 static gint hf_dns_dns_soa_record_retry = -1;
78 static gint hf_dns_dns_rp_record_mbox = -1;
79 static gint hf_dns_dns_fake_tsig_rec_ttl = -1;
80 static gint hf_dns_dns_fake_tsig_rec_name = -1;
81 static gint hf_dns_dns_tsig_record_fudge = -1;
82 static gint hf_dns_dns_res_rec_rr_type = -1;
83 static gint hf_dns_dns_operation_DNS_RCODE = -1;
84 static gint hf_dns_dns_rdata_ipv4_record = -1;
85 static gint hf_dns_dns_fake_tsig_rec_other_data = -1;
86 static gint hf_dns_dns_fake_tsig_rec_rr_class = -1;
87 static gint hf_dns_dns_hinfo_record_os = -1;
88 static gint hf_dns_dns_name_packet_additional = -1;
89 static gint hf_dns_dns_srv_record_port = -1;
90 static gint hf_dns_dns_name_packet_qdcount = -1;
91 static gint hf_dns_dns_rdata_data_data = -1;
92 static gint hf_dns_dns_rdata_ptr_record = -1;
93 static gint hf_dns_dns_fake_tsig_rec_algorithm_name = -1;
94 static gint hf_dns_dns_rdata_rp_record = -1;
95 static gint hf_dns_dns_soa_record_mname = -1;
96 static gint hf_dns_dns_tsig_record_mac_size = -1;
97 static gint hf_dns_dns_fake_tsig_rec_time_prefix = -1;
98 static gint hf_dns_dns_res_rec_ttl = -1;
99 static gint hf_dns_dns_soa_record_serial = -1;
100 static gint hf_dns_dns_tsig_record_time = -1;
101 static gint hf_dns_dns_soa_record_rname = -1;
102 static gint hf_dns_dns_operation_DNS_FLAG_RECURSION_DESIRED = -1;
103 static gint hf_dns_dns_tkey_record_error = -1;
104 static gint hf_dns_dns_hinfo_record_os_length = -1;
105 static gint hf_dns_dns_tsig_record_other_data = -1;
106 static gint hf_dns_dns_txt_record_length = -1;
107 static gint hf_dns_dns_operation_DNS_OPCODE = -1;
108 static gint hf_dns_dns_soa_record_refresh = -1;
109 static gint hf_dns_dns_rdata_ipv6_record = -1;
110 static gint hf_dns_dns_operation_DNS_FLAG_AUTHORITATIVE = -1;
111 static gint hf_dns_dns_fake_tsig_rec_fudge = -1;
112 static gint hf_dns_dns_rdata_opt_record = -1;
113 static gint hf_dns_dns_rdata_tsig_record = -1;
114 static gint hf_dns_dns_tkey_record_other_size = -1;
115 static gint hf_dns_dns_name_packet_nscount = -1;
116 static gint hf_dns_dns_res_rec_name = -1;
117 static gint hf_dns_dns_name_packet_nsrecs = -1;
118 static gint hf_dns_dns_tkey_record_expiration = -1;
119 static gint hf_dns_dns_hinfo_record_cpu_length = -1;
120 static gint hf_dns_dns_name_question_question_type = -1;
121 static gint hf_dns_dns_txt_record_txt = -1;
122 static gint hf_dns_dns_tkey_record_other_data = -1;
123 static gint hf_dns_dns_tkey_record_algorithm = -1;
124 static gint hf_dns_dns_rdata_srv_record = -1;
125 static gint hf_dns_dns_tkey_record_key_size = -1;
126 static gint hf_dns_dns_tkey_record_key_data = -1;
127 static gint hf_dns_dns_rdata_data_length = -1;
128 static gint hf_dns_dns_name_packet_questions = -1;
129 static gint hf_dns_dns_fake_tsig_rec_other_size = -1;
130 static gint hf_dns_dns_rdata_hinfo_record = -1;
131 static gint hf_dns_dns_name_packet_answers = -1;
132 static gint hf_dns_dns_res_rec_unexpected = -1;
133 static gint hf_dns_dns_soa_record_expire = -1;
134 static gint hf_dns_dns_mx_record_exchange = -1;
135 static gint hf_dns_dns_rdata_ns_record = -1;
136 static gint hf_dns_dns_name_question_question_class = -1;
137 static gint hf_dns_dns_operation_DNS_FLAG_RECURSION_AVAIL = -1;
138 static gint hf_dns_dns_opt_record_option_code = -1;
139 static gint hf_dns_dns_tsig_record_other_size = -1;
140 static gint hf_dns_dns_rdata_cname_record = -1;
141 static gint hf_dns_dns_operation_DNS_FLAG_TRUNCATION = -1;
142 static gint hf_dns_dns_name_question_name = -1;
143 static gint hf_dns_dns_rdata_txt_record = -1;
144 static gint hf_dns_dns_name_packet_operation = -1;
145 static gint hf_dns_dns_name_packet_id = -1;
146 static gint hf_dns_dns_res_rec_rr_class = -1;
147 static gint hf_dns_dns_rp_record_txt = -1;
148 static gint hf_dns_dns_opt_record_option_length = -1;
149 static gint hf_dns_dns_opt_record_option_data = -1;
150 static gint hf_dns_dns_name_packet_ancount = -1;
151 static gint hf_dns_dns_tkey_record_mode = -1;
152
153 static gint proto_dcerpc_dns = -1;
154 /* Version information */
155
156
157 static e_uuid_t uuid_dcerpc_dns = {
158         0xa047c001, 0x5f22, 0x40b0,
159         { 0x9d, 0x52, 0x70, 0x42, 0xc4, 0x3f, 0x71, 0x1a }
160 };
161 static guint16 ver_dcerpc_dns = 0;
162
163 static const true_false_string dns_operation_DNS_RCODE_tfs = {
164    "DNS_RCODE is SET",
165    "DNS_RCODE is NOT SET",
166 };
167 static const true_false_string dns_operation_DNS_FLAG_BROADCAST_tfs = {
168    "DNS_FLAG_BROADCAST is SET",
169    "DNS_FLAG_BROADCAST is NOT SET",
170 };
171 static const true_false_string dns_operation_DNS_FLAG_RECURSION_AVAIL_tfs = {
172    "DNS_FLAG_RECURSION_AVAIL is SET",
173    "DNS_FLAG_RECURSION_AVAIL is NOT SET",
174 };
175 static const true_false_string dns_operation_DNS_FLAG_RECURSION_DESIRED_tfs = {
176    "DNS_FLAG_RECURSION_DESIRED is SET",
177    "DNS_FLAG_RECURSION_DESIRED is NOT SET",
178 };
179 static const true_false_string dns_operation_DNS_FLAG_TRUNCATION_tfs = {
180    "DNS_FLAG_TRUNCATION is SET",
181    "DNS_FLAG_TRUNCATION is NOT SET",
182 };
183 static const true_false_string dns_operation_DNS_FLAG_AUTHORITATIVE_tfs = {
184    "DNS_FLAG_AUTHORITATIVE is SET",
185    "DNS_FLAG_AUTHORITATIVE is NOT SET",
186 };
187 static const true_false_string dns_operation_DNS_OPCODE_tfs = {
188    "DNS_OPCODE is SET",
189    "DNS_OPCODE is NOT SET",
190 };
191 static const true_false_string dns_operation_DNS_FLAG_REPLY_tfs = {
192    "DNS_FLAG_REPLY is SET",
193    "DNS_FLAG_REPLY is NOT SET",
194 };
195 const value_string dns_dns_opcode_vals[] = {
196         { DNS_OPCODE_QUERY, "DNS_OPCODE_QUERY" },
197         { DNS_OPCODE_IQUERY, "DNS_OPCODE_IQUERY" },
198         { DNS_OPCODE_STATUS, "DNS_OPCODE_STATUS" },
199         { DNS_OPCODE_UPDATE, "DNS_OPCODE_UPDATE" },
200         { DNS_OPCODE_RELEASE, "DNS_OPCODE_RELEASE" },
201         { DNS_OPCODE_WACK, "DNS_OPCODE_WACK" },
202         { DNS_OPCODE_REFRESH, "DNS_OPCODE_REFRESH" },
203         { DNS_OPCODE_REFRESH2, "DNS_OPCODE_REFRESH2" },
204         { DNS_OPCODE_MULTI_HOME_REG, "DNS_OPCODE_MULTI_HOME_REG" },
205 { 0, NULL }
206 };
207 const value_string dns_dns_rcode_vals[] = {
208         { DNS_RCODE_OK, "DNS_RCODE_OK" },
209         { DNS_RCODE_FORMERR, "DNS_RCODE_FORMERR" },
210         { DNS_RCODE_SERVFAIL, "DNS_RCODE_SERVFAIL" },
211         { DNS_RCODE_NXDOMAIN, "DNS_RCODE_NXDOMAIN" },
212         { DNS_RCODE_NOTIMP, "DNS_RCODE_NOTIMP" },
213         { DNS_RCODE_REFUSED, "DNS_RCODE_REFUSED" },
214         { DNS_RCODE_YXDOMAIN, "DNS_RCODE_YXDOMAIN" },
215         { DNS_RCODE_YXRRSET, "DNS_RCODE_YXRRSET" },
216         { DNS_RCODE_NXRRSET, "DNS_RCODE_NXRRSET" },
217         { DNS_RCODE_NOTAUTH, "DNS_RCODE_NOTAUTH" },
218         { DNS_RCODE_NOTZONE, "DNS_RCODE_NOTZONE" },
219         { DNS_RCODE_BADSIG, "DNS_RCODE_BADSIG" },
220         { DNS_RCODE_BADKEY, "DNS_RCODE_BADKEY" },
221         { DNS_RCODE_BADTIME, "DNS_RCODE_BADTIME" },
222         { DNS_RCODE_BADMODE, "DNS_RCODE_BADMODE" },
223         { DNS_RCODE_BADNAME, "DNS_RCODE_BADNAME" },
224         { DNS_RCODE_BADALG, "DNS_RCODE_BADALG" },
225 { 0, NULL }
226 };
227 const value_string dns_dns_qclass_vals[] = {
228         { DNS_QCLASS_IN, "DNS_QCLASS_IN" },
229         { DNS_QCLASS_NONE, "DNS_QCLASS_NONE" },
230         { DNS_QCLASS_ANY, "DNS_QCLASS_ANY" },
231 { 0, NULL }
232 };
233 const value_string dns_dns_qtype_vals[] = {
234         { DNS_QTYPE_ZERO, "DNS_QTYPE_ZERO" },
235         { DNS_QTYPE_A, "DNS_QTYPE_A" },
236         { DNS_QTYPE_NS, "DNS_QTYPE_NS" },
237         { DNS_QTYPE_MD, "DNS_QTYPE_MD" },
238         { DNS_QTYPE_MF, "DNS_QTYPE_MF" },
239         { DNS_QTYPE_CNAME, "DNS_QTYPE_CNAME" },
240         { DNS_QTYPE_SOA, "DNS_QTYPE_SOA" },
241         { DNS_QTYPE_MB, "DNS_QTYPE_MB" },
242         { DNS_QTYPE_MG, "DNS_QTYPE_MG" },
243         { DNS_QTYPE_MR, "DNS_QTYPE_MR" },
244         { DNS_QTYPE_NULL, "DNS_QTYPE_NULL" },
245         { DNS_QTYPE_WKS, "DNS_QTYPE_WKS" },
246         { DNS_QTYPE_PTR, "DNS_QTYPE_PTR" },
247         { DNS_QTYPE_HINFO, "DNS_QTYPE_HINFO" },
248         { DNS_QTYPE_MINFO, "DNS_QTYPE_MINFO" },
249         { DNS_QTYPE_MX, "DNS_QTYPE_MX" },
250         { DNS_QTYPE_TXT, "DNS_QTYPE_TXT" },
251         { DNS_QTYPE_RP, "DNS_QTYPE_RP" },
252         { DNS_QTYPE_AFSDB, "DNS_QTYPE_AFSDB" },
253         { DNS_QTYPE_X25, "DNS_QTYPE_X25" },
254         { DNS_QTYPE_ISDN, "DNS_QTYPE_ISDN" },
255         { DNS_QTYPE_RT, "DNS_QTYPE_RT" },
256         { DNS_QTYPE_SIG, "DNS_QTYPE_SIG" },
257         { DNS_QTYPE_KEY, "DNS_QTYPE_KEY" },
258         { DNS_QTYPE_AAAA, "DNS_QTYPE_AAAA" },
259         { DNS_QTYPE_LOC, "DNS_QTYPE_LOC" },
260         { DNS_QTYPE_NXT, "DNS_QTYPE_NXT" },
261         { DNS_QTYPE_NETBIOS, "DNS_QTYPE_NETBIOS" },
262         { DNS_QTYPE_SRV, "DNS_QTYPE_SRV" },
263         { DNS_QTYPE_ATMA, "DNS_QTYPE_ATMA" },
264         { DNS_QTYPE_NAPTR, "DNS_QTYPE_NAPTR" },
265         { DNS_QTYPE_DNAME, "DNS_QTYPE_DNAME" },
266         { DNS_QTYPE_OPT, "DNS_QTYPE_OPT" },
267         { DNS_QTYPE_DS, "DNS_QTYPE_DS" },
268         { DNS_QTYPE_RRSIG, "DNS_QTYPE_RRSIG" },
269         { DNS_QTYPE_NSEC, "DNS_QTYPE_NSEC" },
270         { DNS_QTYPE_DNSKEY, "DNS_QTYPE_DNSKEY" },
271         { DNS_QTYPE_DHCID, "DNS_QTYPE_DHCID" },
272         { DNS_QTYPE_TKEY, "DNS_QTYPE_TKEY" },
273         { DNS_QTYPE_TSIG, "DNS_QTYPE_TSIG" },
274         { DNS_QTYPE_AXFR, "DNS_QTYPE_AXFR" },
275         { DNS_QTYPE_MAILB, "DNS_QTYPE_MAILB" },
276         { DNS_QTYPE_MAILA, "DNS_QTYPE_MAILA" },
277         { DNS_QTYPE_ALL, "DNS_QTYPE_ALL" },
278 { 0, NULL }
279 };
280 const value_string dns_dns_tkey_mode_vals[] = {
281         { DNS_TKEY_MODE_NULL, "DNS_TKEY_MODE_NULL" },
282         { DNS_TKEY_MODE_SERVER, "DNS_TKEY_MODE_SERVER" },
283         { DNS_TKEY_MODE_DH, "DNS_TKEY_MODE_DH" },
284         { DNS_TKEY_MODE_GSSAPI, "DNS_TKEY_MODE_GSSAPI" },
285         { DNS_TKEY_MODE_CLIENT, "DNS_TKEY_MODE_CLIENT" },
286         { DNS_TKEY_MODE_DELETE, "DNS_TKEY_MODE_DELETE" },
287         { DNS_TKEY_MODE_LAST, "DNS_TKEY_MODE_LAST" },
288 { 0, NULL }
289 };
290 static int dns_dissect_element_name_question_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
291 static int dns_dissect_element_name_question_question_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
292 static int dns_dissect_element_name_question_question_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
293 static int dns_dissect_element_rdata_data_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
294 static int dns_dissect_element_rdata_data_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
295 static int dns_dissect_element_rdata_data_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
296 static int dns_dissect_element_soa_record_mname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
297 static int dns_dissect_element_soa_record_rname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
298 static int dns_dissect_element_soa_record_serial(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
299 static int dns_dissect_element_soa_record_refresh(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
300 static int dns_dissect_element_soa_record_retry(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
301 static int dns_dissect_element_soa_record_expire(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
302 static int dns_dissect_element_soa_record_minimum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
303 static int dns_dissect_element_hinfo_record_cpu_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
304 static int dns_dissect_element_hinfo_record_cpu(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
305 static int dns_dissect_element_hinfo_record_cpu_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
306 static int dns_dissect_element_hinfo_record_os_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
307 static int dns_dissect_element_hinfo_record_os(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
308 static int dns_dissect_element_hinfo_record_os_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
309 static int dns_dissect_element_mx_record_preference(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
310 static int dns_dissect_element_mx_record_exchange(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
311 static int dns_dissect_element_txt_record_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
312 static int dns_dissect_element_txt_record_txt(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
313 static int dns_dissect_element_txt_record_txt_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
314 static int dns_dissect_element_rp_record_mbox(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
315 static int dns_dissect_element_rp_record_txt(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
316 static int dns_dissect_element_srv_record_priority(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
317 static int dns_dissect_element_srv_record_weight(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
318 static int dns_dissect_element_srv_record_port(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
319 static int dns_dissect_element_srv_record_target(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
320 static int dns_dissect_element_opt_record_option_code(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
321 static int dns_dissect_element_opt_record_option_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
322 static int dns_dissect_element_opt_record_option_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
323 static int dns_dissect_element_opt_record_option_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
324 static int dns_dissect_element_tkey_record_algorithm(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
325 static int dns_dissect_element_tkey_record_inception(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
326 static int dns_dissect_element_tkey_record_expiration(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
327 static int dns_dissect_element_tkey_record_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
328 static int dns_dissect_element_tkey_record_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
329 static int dns_dissect_element_tkey_record_key_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
330 static int dns_dissect_element_tkey_record_key_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
331 static int dns_dissect_element_tkey_record_key_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
332 static int dns_dissect_element_tkey_record_other_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
333 static int dns_dissect_element_tkey_record_other_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
334 static int dns_dissect_element_tkey_record_other_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
335 static int dns_dissect_element_tsig_record_algorithm_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
336 static int dns_dissect_element_tsig_record_time_prefix(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
337 static int dns_dissect_element_tsig_record_time(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
338 static int dns_dissect_element_tsig_record_fudge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
339 static int dns_dissect_element_tsig_record_mac_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
340 static int dns_dissect_element_tsig_record_mac(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
341 static int dns_dissect_element_tsig_record_mac_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
342 static int dns_dissect_element_tsig_record_original_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
343 static int dns_dissect_element_tsig_record_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
344 static int dns_dissect_element_tsig_record_other_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
345 static int dns_dissect_element_tsig_record_other_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
346 static int dns_dissect_element_tsig_record_other_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
347 static int dns_dissect_element_fake_tsig_rec_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
348 static int dns_dissect_element_fake_tsig_rec_rr_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
349 static int dns_dissect_element_fake_tsig_rec_ttl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
350 static int dns_dissect_element_fake_tsig_rec_algorithm_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
351 static int dns_dissect_element_fake_tsig_rec_time_prefix(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
352 static int dns_dissect_element_fake_tsig_rec_time(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
353 static int dns_dissect_element_fake_tsig_rec_fudge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
354 static int dns_dissect_element_fake_tsig_rec_original_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
355 static int dns_dissect_element_fake_tsig_rec_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
356 static int dns_dissect_element_fake_tsig_rec_other_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
357 static int dns_dissect_element_fake_tsig_rec_other_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
358 static int dns_dissect_element_fake_tsig_rec_other_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
359 static int dns_dissect_element_rdata_ipv4_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
360 static int dns_dissect_element_rdata_ns_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
361 static int dns_dissect_element_rdata_cname_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
362 static int dns_dissect_element_rdata_soa_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
363 static int dns_dissect_element_rdata_ptr_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
364 static int dns_dissect_element_rdata_hinfo_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
365 static int dns_dissect_element_rdata_mx_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
366 static int dns_dissect_element_rdata_txt_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
367 static int dns_dissect_element_rdata_rp_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
368 static int dns_dissect_element_rdata_ipv6_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
369 static int dns_dissect_element_rdata_srv_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
370 static int dns_dissect_element_rdata_opt_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
371 static int dns_dissect_element_rdata_tsig_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
372 static int dns_dissect_element_rdata_tkey_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
373 static int dns_dissect_element_res_rec_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
374 static int dns_dissect_element_res_rec_rr_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type);
375 static int dns_dissect_element_res_rec_rr_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
376 static int dns_dissect_element_res_rec_ttl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
377 static int dns_dissect_element_res_rec_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
378 static int dns_dissect_element_res_rec_rdata(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type);
379 static int dns_dissect_element_res_rec_unexpected(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
380 static int dns_dissect_element_name_packet_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
381 static int dns_dissect_element_name_packet_operation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
382 static int dns_dissect_element_name_packet_qdcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
383 static int dns_dissect_element_name_packet_ancount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
384 static int dns_dissect_element_name_packet_nscount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
385 static int dns_dissect_element_name_packet_arcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
386 static int dns_dissect_element_name_packet_questions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
387 static int dns_dissect_element_name_packet_questions_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
388 static int dns_dissect_element_name_packet_answers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
389 static int dns_dissect_element_name_packet_answers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
390 static int dns_dissect_element_name_packet_nsrecs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
391 static int dns_dissect_element_name_packet_nsrecs_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
392 static int dns_dissect_element_name_packet_additional(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
393 static int dns_dissect_element_name_packet_additional_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
394 static int dns_dissect_element_decode_dns_name_packet_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_);
395
396
397 /* IDL: bitmap { */
398 /* IDL:         DNS_RCODE =  0x000F , */
399 /* IDL:         DNS_FLAG_BROADCAST =  0x0010 , */
400 /* IDL:         DNS_FLAG_RECURSION_AVAIL =  0x0080 , */
401 /* IDL:         DNS_FLAG_RECURSION_DESIRED =  0x0100 , */
402 /* IDL:         DNS_FLAG_TRUNCATION =  0x0200 , */
403 /* IDL:         DNS_FLAG_AUTHORITATIVE =  0x0400 , */
404 /* IDL:         DNS_OPCODE =  0x7800 , */
405 /* IDL:         DNS_FLAG_REPLY =  0x8000 , */
406 /* IDL: } */
407
408 int
409 dns_dissect_bitmap_operation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
410 {
411         proto_item *item = NULL;
412         proto_tree *tree = NULL;
413
414         guint16 flags;
415         ALIGN_TO_2_BYTES;
416
417         if (parent_tree) {
418                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, 2, DREP_ENC_INTEGER(drep));
419                 tree = proto_item_add_subtree(item,ett_dns_dns_operation);
420         }
421
422         offset = dissect_ndr_uint16(tvb, offset, pinfo, NULL, drep, -1, &flags);
423         proto_item_append_text(item, ": ");
424
425         if (!flags)
426                 proto_item_append_text(item, "(No values set)");
427
428         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_RCODE, tvb, offset-2, 2, flags);
429         if (flags&( 0x000F )){
430                 proto_item_append_text(item, "DNS_RCODE");
431                 if (flags & (~( 0x000F )))
432                         proto_item_append_text(item, ", ");
433         }
434         flags&=(~( 0x000F ));
435
436         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_FLAG_BROADCAST, tvb, offset-2, 2, flags);
437         if (flags&( 0x0010 )){
438                 proto_item_append_text(item, "DNS_FLAG_BROADCAST");
439                 if (flags & (~( 0x0010 )))
440                         proto_item_append_text(item, ", ");
441         }
442         flags&=(~( 0x0010 ));
443
444         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_FLAG_RECURSION_AVAIL, tvb, offset-2, 2, flags);
445         if (flags&( 0x0080 )){
446                 proto_item_append_text(item, "DNS_FLAG_RECURSION_AVAIL");
447                 if (flags & (~( 0x0080 )))
448                         proto_item_append_text(item, ", ");
449         }
450         flags&=(~( 0x0080 ));
451
452         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_FLAG_RECURSION_DESIRED, tvb, offset-2, 2, flags);
453         if (flags&( 0x0100 )){
454                 proto_item_append_text(item, "DNS_FLAG_RECURSION_DESIRED");
455                 if (flags & (~( 0x0100 )))
456                         proto_item_append_text(item, ", ");
457         }
458         flags&=(~( 0x0100 ));
459
460         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_FLAG_TRUNCATION, tvb, offset-2, 2, flags);
461         if (flags&( 0x0200 )){
462                 proto_item_append_text(item, "DNS_FLAG_TRUNCATION");
463                 if (flags & (~( 0x0200 )))
464                         proto_item_append_text(item, ", ");
465         }
466         flags&=(~( 0x0200 ));
467
468         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_FLAG_AUTHORITATIVE, tvb, offset-2, 2, flags);
469         if (flags&( 0x0400 )){
470                 proto_item_append_text(item, "DNS_FLAG_AUTHORITATIVE");
471                 if (flags & (~( 0x0400 )))
472                         proto_item_append_text(item, ", ");
473         }
474         flags&=(~( 0x0400 ));
475
476         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_OPCODE, tvb, offset-2, 2, flags);
477         if (flags&( 0x7800 )){
478                 proto_item_append_text(item, "DNS_OPCODE");
479                 if (flags & (~( 0x7800 )))
480                         proto_item_append_text(item, ", ");
481         }
482         flags&=(~( 0x7800 ));
483
484         proto_tree_add_boolean(tree, hf_dns_dns_operation_DNS_FLAG_REPLY, tvb, offset-2, 2, flags);
485         if (flags&( 0x8000 )){
486                 proto_item_append_text(item, "DNS_FLAG_REPLY");
487                 if (flags & (~( 0x8000 )))
488                         proto_item_append_text(item, ", ");
489         }
490         flags&=(~( 0x8000 ));
491
492         if (flags) {
493                 proto_item_append_text(item, "Unknown bitmap value 0x%x", flags);
494         }
495
496         return offset;
497 }
498
499
500 /* IDL: enum { */
501 /* IDL:         DNS_OPCODE_QUERY=(0x0<<11), */
502 /* IDL:         DNS_OPCODE_IQUERY=(0x1<<11), */
503 /* IDL:         DNS_OPCODE_STATUS=(0x2<<11), */
504 /* IDL:         DNS_OPCODE_UPDATE=(0x5<<11), */
505 /* IDL:         DNS_OPCODE_RELEASE=(0x6<<11), */
506 /* IDL:         DNS_OPCODE_WACK=(0x7<<11), */
507 /* IDL:         DNS_OPCODE_REFRESH=(0x8<<11), */
508 /* IDL:         DNS_OPCODE_REFRESH2=(0x9<<11), */
509 /* IDL:         DNS_OPCODE_MULTI_HOME_REG=(0xf<<11), */
510 /* IDL: } */
511
512 int
513 dns_dissect_enum_opcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
514 {
515         guint1632 parameter=0;
516         if(param){
517                 parameter=(guint1632)*param;
518         }
519         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
520         if(param){
521                 *param=(guint32)parameter;
522         }
523         return offset;
524 }
525
526
527 /* IDL: enum { */
528 /* IDL:         DNS_RCODE_OK=0x00, */
529 /* IDL:         DNS_RCODE_FORMERR=0x01, */
530 /* IDL:         DNS_RCODE_SERVFAIL=0x02, */
531 /* IDL:         DNS_RCODE_NXDOMAIN=0x03, */
532 /* IDL:         DNS_RCODE_NOTIMP=0x04, */
533 /* IDL:         DNS_RCODE_REFUSED=0x05, */
534 /* IDL:         DNS_RCODE_YXDOMAIN=0x06, */
535 /* IDL:         DNS_RCODE_YXRRSET=0x07, */
536 /* IDL:         DNS_RCODE_NXRRSET=0x08, */
537 /* IDL:         DNS_RCODE_NOTAUTH=0x09, */
538 /* IDL:         DNS_RCODE_NOTZONE=0x0A, */
539 /* IDL:         DNS_RCODE_BADSIG=0x10, */
540 /* IDL:         DNS_RCODE_BADKEY=0x11, */
541 /* IDL:         DNS_RCODE_BADTIME=0x12, */
542 /* IDL:         DNS_RCODE_BADMODE=0x13, */
543 /* IDL:         DNS_RCODE_BADNAME=0x14, */
544 /* IDL:         DNS_RCODE_BADALG=0x15, */
545 /* IDL: } */
546
547 int
548 dns_dissect_enum_rcode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
549 {
550         guint1632 parameter=0;
551         if(param){
552                 parameter=(guint1632)*param;
553         }
554         offset = dissect_ndr_uint1632(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
555         if(param){
556                 *param=(guint32)parameter;
557         }
558         return offset;
559 }
560
561
562 /* IDL: enum { */
563 /* IDL:         DNS_QCLASS_IN=0x0001, */
564 /* IDL:         DNS_QCLASS_NONE=0x00FE, */
565 /* IDL:         DNS_QCLASS_ANY=0x00FF, */
566 /* IDL: } */
567
568 int
569 dns_dissect_enum_qclass(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
570 {
571         guint16 parameter=0;
572         if(param){
573                 parameter=(guint16)*param;
574         }
575         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
576         if(param){
577                 *param=(guint32)parameter;
578         }
579         return offset;
580 }
581
582
583 /* IDL: enum { */
584 /* IDL:         DNS_QTYPE_ZERO=0x0000, */
585 /* IDL:         DNS_QTYPE_A=0x0001, */
586 /* IDL:         DNS_QTYPE_NS=0x0002, */
587 /* IDL:         DNS_QTYPE_MD=0x0003, */
588 /* IDL:         DNS_QTYPE_MF=0x0004, */
589 /* IDL:         DNS_QTYPE_CNAME=0x0005, */
590 /* IDL:         DNS_QTYPE_SOA=0x0006, */
591 /* IDL:         DNS_QTYPE_MB=0x0007, */
592 /* IDL:         DNS_QTYPE_MG=0x0008, */
593 /* IDL:         DNS_QTYPE_MR=0x0009, */
594 /* IDL:         DNS_QTYPE_NULL=0x000A, */
595 /* IDL:         DNS_QTYPE_WKS=0x000B, */
596 /* IDL:         DNS_QTYPE_PTR=0x000C, */
597 /* IDL:         DNS_QTYPE_HINFO=0x000D, */
598 /* IDL:         DNS_QTYPE_MINFO=0x000E, */
599 /* IDL:         DNS_QTYPE_MX=0x000F, */
600 /* IDL:         DNS_QTYPE_TXT=0x0010, */
601 /* IDL:         DNS_QTYPE_RP=0x0011, */
602 /* IDL:         DNS_QTYPE_AFSDB=0x0012, */
603 /* IDL:         DNS_QTYPE_X25=0x0013, */
604 /* IDL:         DNS_QTYPE_ISDN=0x0014, */
605 /* IDL:         DNS_QTYPE_RT=0x0015, */
606 /* IDL:         DNS_QTYPE_SIG=0x0018, */
607 /* IDL:         DNS_QTYPE_KEY=0x0019, */
608 /* IDL:         DNS_QTYPE_AAAA=0x001C, */
609 /* IDL:         DNS_QTYPE_LOC=0x001D, */
610 /* IDL:         DNS_QTYPE_NXT=0x001E, */
611 /* IDL:         DNS_QTYPE_NETBIOS=0x0020, */
612 /* IDL:         DNS_QTYPE_SRV=0x0021, */
613 /* IDL:         DNS_QTYPE_ATMA=0x0022, */
614 /* IDL:         DNS_QTYPE_NAPTR=0x0023, */
615 /* IDL:         DNS_QTYPE_DNAME=0x0027, */
616 /* IDL:         DNS_QTYPE_OPT=0x0029, */
617 /* IDL:         DNS_QTYPE_DS=0x002B, */
618 /* IDL:         DNS_QTYPE_RRSIG=0x002E, */
619 /* IDL:         DNS_QTYPE_NSEC=0x002F, */
620 /* IDL:         DNS_QTYPE_DNSKEY=0x0030, */
621 /* IDL:         DNS_QTYPE_DHCID=0x0031, */
622 /* IDL:         DNS_QTYPE_TKEY=0x00F9, */
623 /* IDL:         DNS_QTYPE_TSIG=0x00FA, */
624 /* IDL:         DNS_QTYPE_AXFR=0x00FC, */
625 /* IDL:         DNS_QTYPE_MAILB=0x00FD, */
626 /* IDL:         DNS_QTYPE_MAILA=0x00FE, */
627 /* IDL:         DNS_QTYPE_ALL=0x00FF, */
628 /* IDL: } */
629
630 int
631 dns_dissect_enum_qtype(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
632 {
633         guint16 parameter=0;
634         if(param){
635                 parameter=(guint16)*param;
636         }
637         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
638         if(param){
639                 *param=(guint32)parameter;
640         }
641         return offset;
642 }
643
644
645 /* IDL: enum { */
646 /* IDL:         DNS_TKEY_MODE_NULL=0x0000, */
647 /* IDL:         DNS_TKEY_MODE_SERVER=0x0001, */
648 /* IDL:         DNS_TKEY_MODE_DH=0x0002, */
649 /* IDL:         DNS_TKEY_MODE_GSSAPI=0x0003, */
650 /* IDL:         DNS_TKEY_MODE_CLIENT=0x0004, */
651 /* IDL:         DNS_TKEY_MODE_DELETE=0x0005, */
652 /* IDL:         DNS_TKEY_MODE_LAST=0xFFFF, */
653 /* IDL: } */
654
655 int
656 dns_dissect_enum_tkey_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 *param _U_)
657 {
658         guint16 parameter=0;
659         if(param){
660                 parameter=(guint16)*param;
661         }
662         offset = dissect_ndr_uint16(tvb, offset, pinfo, tree, drep, hf_index, &parameter);
663         if(param){
664                 *param=(guint32)parameter;
665         }
666         return offset;
667 }
668
669
670 /* IDL: struct { */
671 /* IDL:         dns_string name; */
672 /* IDL:         dns_qtype question_type; */
673 /* IDL:         dns_qclass question_class; */
674 /* IDL: } */
675
676 static int
677 dns_dissect_element_name_question_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
678 {
679         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_name_question_name,0);
680
681         return offset;
682 }
683
684 static int
685 dns_dissect_element_name_question_question_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
686 {
687         offset = dns_dissect_enum_qtype(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_question_question_type, 0);
688
689         return offset;
690 }
691
692 static int
693 dns_dissect_element_name_question_question_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
694 {
695         offset = dns_dissect_enum_qclass(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_question_question_class, 0);
696
697         return offset;
698 }
699
700 int
701 dns_dissect_struct_name_question(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
702 {
703         proto_item *item = NULL;
704         proto_tree *tree = NULL;
705         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
706         int old_offset;
707
708         ALIGN_TO_4_BYTES;
709
710         old_offset = offset;
711
712         if (parent_tree) {
713                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
714                 tree = proto_item_add_subtree(item, ett_dns_dns_name_question);
715         }
716         
717         offset = dns_dissect_element_name_question_name(tvb, offset, pinfo, tree, drep);
718
719         offset = dns_dissect_element_name_question_question_type(tvb, offset, pinfo, tree, drep);
720
721         offset = dns_dissect_element_name_question_question_class(tvb, offset, pinfo, tree, drep);
722
723
724         proto_item_set_len(item, offset-old_offset);
725
726
727         if (di->call_data->flags & DCERPC_IS_NDR64) {
728                 ALIGN_TO_4_BYTES;
729         }
730
731         return offset;
732 }
733
734
735 /* IDL: struct { */
736 /* IDL:         uint16 length; */
737 /* IDL:         uint8 data[length]; */
738 /* IDL: } */
739
740 static int
741 dns_dissect_element_rdata_data_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
742 {
743         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_rdata_data_length, 0);
744
745         return offset;
746 }
747
748 static int
749 dns_dissect_element_rdata_data_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
750 {
751
752         return offset;
753 }
754
755 static int
756 dns_dissect_element_rdata_data_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
757 {
758         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_rdata_data_data, 0);
759
760         return offset;
761 }
762
763 int
764 dns_dissect_struct_rdata_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
765 {
766         proto_item *item = NULL;
767         proto_tree *tree = NULL;
768         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
769         int old_offset;
770
771         ALIGN_TO_2_BYTES;
772
773         old_offset = offset;
774
775         if (parent_tree) {
776                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
777                 tree = proto_item_add_subtree(item, ett_dns_dns_rdata_data);
778         }
779         
780         offset = dns_dissect_element_rdata_data_length(tvb, offset, pinfo, tree, drep);
781
782         offset = dns_dissect_element_rdata_data_data(tvb, offset, pinfo, tree, drep);
783
784
785         proto_item_set_len(item, offset-old_offset);
786
787
788         if (di->call_data->flags & DCERPC_IS_NDR64) {
789                 ALIGN_TO_2_BYTES;
790         }
791
792         return offset;
793 }
794
795
796 /* IDL: struct { */
797 /* IDL:         dns_string mname; */
798 /* IDL:         dns_string rname; */
799 /* IDL:         uint32 serial; */
800 /* IDL:         uint32 refresh; */
801 /* IDL:         uint32 retry; */
802 /* IDL:         uint32 expire; */
803 /* IDL:         uint32 minimum; */
804 /* IDL: } */
805
806 static int
807 dns_dissect_element_soa_record_mname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
808 {
809         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_soa_record_mname,0);
810
811         return offset;
812 }
813
814 static int
815 dns_dissect_element_soa_record_rname(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
816 {
817         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_soa_record_rname,0);
818
819         return offset;
820 }
821
822 static int
823 dns_dissect_element_soa_record_serial(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
824 {
825         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_soa_record_serial, 0);
826
827         return offset;
828 }
829
830 static int
831 dns_dissect_element_soa_record_refresh(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
832 {
833         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_soa_record_refresh, 0);
834
835         return offset;
836 }
837
838 static int
839 dns_dissect_element_soa_record_retry(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
840 {
841         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_soa_record_retry, 0);
842
843         return offset;
844 }
845
846 static int
847 dns_dissect_element_soa_record_expire(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
848 {
849         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_soa_record_expire, 0);
850
851         return offset;
852 }
853
854 static int
855 dns_dissect_element_soa_record_minimum(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
856 {
857         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_soa_record_minimum, 0);
858
859         return offset;
860 }
861
862 int
863 dns_dissect_struct_soa_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
864 {
865         proto_item *item = NULL;
866         proto_tree *tree = NULL;
867         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
868         int old_offset;
869
870         ALIGN_TO_4_BYTES;
871
872         old_offset = offset;
873
874         if (parent_tree) {
875                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
876                 tree = proto_item_add_subtree(item, ett_dns_dns_soa_record);
877         }
878         
879         offset = dns_dissect_element_soa_record_mname(tvb, offset, pinfo, tree, drep);
880
881         offset = dns_dissect_element_soa_record_rname(tvb, offset, pinfo, tree, drep);
882
883         offset = dns_dissect_element_soa_record_serial(tvb, offset, pinfo, tree, drep);
884
885         offset = dns_dissect_element_soa_record_refresh(tvb, offset, pinfo, tree, drep);
886
887         offset = dns_dissect_element_soa_record_retry(tvb, offset, pinfo, tree, drep);
888
889         offset = dns_dissect_element_soa_record_expire(tvb, offset, pinfo, tree, drep);
890
891         offset = dns_dissect_element_soa_record_minimum(tvb, offset, pinfo, tree, drep);
892
893
894         proto_item_set_len(item, offset-old_offset);
895
896
897         if (di->call_data->flags & DCERPC_IS_NDR64) {
898                 ALIGN_TO_4_BYTES;
899         }
900
901         return offset;
902 }
903
904
905 /* IDL: struct { */
906 /* IDL:         [value(strlen(cpu))] uint8 cpu_length; */
907 /* IDL:         [charset(DOS)] uint8 cpu[cpu_length]; */
908 /* IDL:         [value(strlen(os))] uint8 os_length; */
909 /* IDL:         [charset(DOS)] uint8 os[os_length]; */
910 /* IDL: } */
911
912 static int
913 dns_dissect_element_hinfo_record_cpu_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
914 {
915         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_hinfo_record_cpu_length, 0);
916
917         return offset;
918 }
919
920 static int
921 dns_dissect_element_hinfo_record_cpu(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
922 {
923
924         return offset;
925 }
926
927 static int
928 dns_dissect_element_hinfo_record_cpu_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
929 {
930         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_hinfo_record_cpu, 0);
931
932         return offset;
933 }
934
935 static int
936 dns_dissect_element_hinfo_record_os_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
937 {
938         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_hinfo_record_os_length, 0);
939
940         return offset;
941 }
942
943 static int
944 dns_dissect_element_hinfo_record_os(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
945 {
946
947         return offset;
948 }
949
950 static int
951 dns_dissect_element_hinfo_record_os_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
952 {
953         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_hinfo_record_os, 0);
954
955         return offset;
956 }
957
958 int
959 dns_dissect_struct_hinfo_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
960 {
961         proto_item *item = NULL;
962         proto_tree *tree = NULL;
963         int old_offset;
964
965
966         old_offset = offset;
967
968         if (parent_tree) {
969                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
970                 tree = proto_item_add_subtree(item, ett_dns_dns_hinfo_record);
971         }
972         
973         offset = dns_dissect_element_hinfo_record_cpu_length(tvb, offset, pinfo, tree, drep);
974
975         offset = dns_dissect_element_hinfo_record_cpu(tvb, offset, pinfo, tree, drep);
976
977         offset = dns_dissect_element_hinfo_record_os_length(tvb, offset, pinfo, tree, drep);
978
979         offset = dns_dissect_element_hinfo_record_os(tvb, offset, pinfo, tree, drep);
980
981
982         proto_item_set_len(item, offset-old_offset);
983
984
985         return offset;
986 }
987
988
989 /* IDL: struct { */
990 /* IDL:         uint16 preference; */
991 /* IDL:         dns_string exchange; */
992 /* IDL: } */
993
994 static int
995 dns_dissect_element_mx_record_preference(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
996 {
997         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_mx_record_preference, 0);
998
999         return offset;
1000 }
1001
1002 static int
1003 dns_dissect_element_mx_record_exchange(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1004 {
1005         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_mx_record_exchange,0);
1006
1007         return offset;
1008 }
1009
1010 int
1011 dns_dissect_struct_mx_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1012 {
1013         proto_item *item = NULL;
1014         proto_tree *tree = NULL;
1015         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1016         int old_offset;
1017
1018         ALIGN_TO_4_BYTES;
1019
1020         old_offset = offset;
1021
1022         if (parent_tree) {
1023                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1024                 tree = proto_item_add_subtree(item, ett_dns_dns_mx_record);
1025         }
1026         
1027         offset = dns_dissect_element_mx_record_preference(tvb, offset, pinfo, tree, drep);
1028
1029         offset = dns_dissect_element_mx_record_exchange(tvb, offset, pinfo, tree, drep);
1030
1031
1032         proto_item_set_len(item, offset-old_offset);
1033
1034
1035         if (di->call_data->flags & DCERPC_IS_NDR64) {
1036                 ALIGN_TO_4_BYTES;
1037         }
1038
1039         return offset;
1040 }
1041
1042
1043 /* IDL: struct { */
1044 /* IDL:         [value(strlen(txt))] uint8 length; */
1045 /* IDL:         [charset(DOS)] uint8 txt[length]; */
1046 /* IDL: } */
1047
1048 static int
1049 dns_dissect_element_txt_record_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1050 {
1051         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_txt_record_length, 0);
1052
1053         return offset;
1054 }
1055
1056 static int
1057 dns_dissect_element_txt_record_txt(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1058 {
1059
1060         return offset;
1061 }
1062
1063 static int
1064 dns_dissect_element_txt_record_txt_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1065 {
1066         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_txt_record_txt, 0);
1067
1068         return offset;
1069 }
1070
1071 int
1072 dns_dissect_struct_txt_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1073 {
1074         proto_item *item = NULL;
1075         proto_tree *tree = NULL;
1076         int old_offset;
1077
1078
1079         old_offset = offset;
1080
1081         if (parent_tree) {
1082                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1083                 tree = proto_item_add_subtree(item, ett_dns_dns_txt_record);
1084         }
1085         
1086         offset = dns_dissect_element_txt_record_length(tvb, offset, pinfo, tree, drep);
1087
1088         offset = dns_dissect_element_txt_record_txt(tvb, offset, pinfo, tree, drep);
1089
1090
1091         proto_item_set_len(item, offset-old_offset);
1092
1093
1094         return offset;
1095 }
1096
1097
1098 /* IDL: struct { */
1099 /* IDL:         dns_string mbox; */
1100 /* IDL:         dns_string txt; */
1101 /* IDL: } */
1102
1103 static int
1104 dns_dissect_element_rp_record_mbox(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1105 {
1106         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_rp_record_mbox,0);
1107
1108         return offset;
1109 }
1110
1111 static int
1112 dns_dissect_element_rp_record_txt(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1113 {
1114         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_rp_record_txt,0);
1115
1116         return offset;
1117 }
1118
1119 int
1120 dns_dissect_struct_rp_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1121 {
1122         proto_item *item = NULL;
1123         proto_tree *tree = NULL;
1124         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1125         int old_offset;
1126
1127         ALIGN_TO_4_BYTES;
1128
1129         old_offset = offset;
1130
1131         if (parent_tree) {
1132                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1133                 tree = proto_item_add_subtree(item, ett_dns_dns_rp_record);
1134         }
1135         
1136         offset = dns_dissect_element_rp_record_mbox(tvb, offset, pinfo, tree, drep);
1137
1138         offset = dns_dissect_element_rp_record_txt(tvb, offset, pinfo, tree, drep);
1139
1140
1141         proto_item_set_len(item, offset-old_offset);
1142
1143
1144         if (di->call_data->flags & DCERPC_IS_NDR64) {
1145                 ALIGN_TO_4_BYTES;
1146         }
1147
1148         return offset;
1149 }
1150
1151
1152 /* IDL: struct { */
1153 /* IDL:         uint16 priority; */
1154 /* IDL:         uint16 weight; */
1155 /* IDL:         uint16 port; */
1156 /* IDL:         dns_string target; */
1157 /* IDL: } */
1158
1159 static int
1160 dns_dissect_element_srv_record_priority(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1161 {
1162         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_srv_record_priority, 0);
1163
1164         return offset;
1165 }
1166
1167 static int
1168 dns_dissect_element_srv_record_weight(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1169 {
1170         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_srv_record_weight, 0);
1171
1172         return offset;
1173 }
1174
1175 static int
1176 dns_dissect_element_srv_record_port(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1177 {
1178         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_srv_record_port, 0);
1179
1180         return offset;
1181 }
1182
1183 static int
1184 dns_dissect_element_srv_record_target(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1185 {
1186         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_srv_record_target,0);
1187
1188         return offset;
1189 }
1190
1191 int
1192 dns_dissect_struct_srv_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1193 {
1194         proto_item *item = NULL;
1195         proto_tree *tree = NULL;
1196         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1197         int old_offset;
1198
1199         ALIGN_TO_4_BYTES;
1200
1201         old_offset = offset;
1202
1203         if (parent_tree) {
1204                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1205                 tree = proto_item_add_subtree(item, ett_dns_dns_srv_record);
1206         }
1207         
1208         offset = dns_dissect_element_srv_record_priority(tvb, offset, pinfo, tree, drep);
1209
1210         offset = dns_dissect_element_srv_record_weight(tvb, offset, pinfo, tree, drep);
1211
1212         offset = dns_dissect_element_srv_record_port(tvb, offset, pinfo, tree, drep);
1213
1214         offset = dns_dissect_element_srv_record_target(tvb, offset, pinfo, tree, drep);
1215
1216
1217         proto_item_set_len(item, offset-old_offset);
1218
1219
1220         if (di->call_data->flags & DCERPC_IS_NDR64) {
1221                 ALIGN_TO_4_BYTES;
1222         }
1223
1224         return offset;
1225 }
1226
1227
1228 /* IDL: struct { */
1229 /* IDL:         uint16 option_code; */
1230 /* IDL:         uint16 option_length; */
1231 /* IDL:         uint8 option_data[option_length]; */
1232 /* IDL: } */
1233
1234 static int
1235 dns_dissect_element_opt_record_option_code(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1236 {
1237         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_opt_record_option_code, 0);
1238
1239         return offset;
1240 }
1241
1242 static int
1243 dns_dissect_element_opt_record_option_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1244 {
1245         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_opt_record_option_length, 0);
1246
1247         return offset;
1248 }
1249
1250 static int
1251 dns_dissect_element_opt_record_option_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1252 {
1253
1254         return offset;
1255 }
1256
1257 static int
1258 dns_dissect_element_opt_record_option_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1259 {
1260         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_opt_record_option_data, 0);
1261
1262         return offset;
1263 }
1264
1265 int
1266 dns_dissect_struct_opt_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1267 {
1268         proto_item *item = NULL;
1269         proto_tree *tree = NULL;
1270         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1271         int old_offset;
1272
1273         ALIGN_TO_2_BYTES;
1274
1275         old_offset = offset;
1276
1277         if (parent_tree) {
1278                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1279                 tree = proto_item_add_subtree(item, ett_dns_dns_opt_record);
1280         }
1281         
1282         offset = dns_dissect_element_opt_record_option_code(tvb, offset, pinfo, tree, drep);
1283
1284         offset = dns_dissect_element_opt_record_option_length(tvb, offset, pinfo, tree, drep);
1285
1286         offset = dns_dissect_element_opt_record_option_data(tvb, offset, pinfo, tree, drep);
1287
1288
1289         proto_item_set_len(item, offset-old_offset);
1290
1291
1292         if (di->call_data->flags & DCERPC_IS_NDR64) {
1293                 ALIGN_TO_2_BYTES;
1294         }
1295
1296         return offset;
1297 }
1298
1299
1300 /* IDL: struct { */
1301 /* IDL:         dns_string algorithm; */
1302 /* IDL:         uint32 inception; */
1303 /* IDL:         uint32 expiration; */
1304 /* IDL:         dns_tkey_mode mode; */
1305 /* IDL:         uint16 error; */
1306 /* IDL:         uint16 key_size; */
1307 /* IDL:         uint8 key_data[key_size]; */
1308 /* IDL:         uint16 other_size; */
1309 /* IDL:         uint8 other_data[other_size]; */
1310 /* IDL: } */
1311
1312 static int
1313 dns_dissect_element_tkey_record_algorithm(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1314 {
1315         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_tkey_record_algorithm,0);
1316
1317         return offset;
1318 }
1319
1320 static int
1321 dns_dissect_element_tkey_record_inception(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1322 {
1323         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_inception, 0);
1324
1325         return offset;
1326 }
1327
1328 static int
1329 dns_dissect_element_tkey_record_expiration(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1330 {
1331         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_expiration, 0);
1332
1333         return offset;
1334 }
1335
1336 static int
1337 dns_dissect_element_tkey_record_mode(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1338 {
1339         offset = dns_dissect_enum_tkey_mode(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_mode, 0);
1340
1341         return offset;
1342 }
1343
1344 static int
1345 dns_dissect_element_tkey_record_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1346 {
1347         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_error, 0);
1348
1349         return offset;
1350 }
1351
1352 static int
1353 dns_dissect_element_tkey_record_key_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1354 {
1355         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_key_size, 0);
1356
1357         return offset;
1358 }
1359
1360 static int
1361 dns_dissect_element_tkey_record_key_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1362 {
1363
1364         return offset;
1365 }
1366
1367 static int
1368 dns_dissect_element_tkey_record_key_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1369 {
1370         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_key_data, 0);
1371
1372         return offset;
1373 }
1374
1375 static int
1376 dns_dissect_element_tkey_record_other_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1377 {
1378         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_other_size, 0);
1379
1380         return offset;
1381 }
1382
1383 static int
1384 dns_dissect_element_tkey_record_other_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1385 {
1386
1387         return offset;
1388 }
1389
1390 static int
1391 dns_dissect_element_tkey_record_other_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1392 {
1393         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_tkey_record_other_data, 0);
1394
1395         return offset;
1396 }
1397
1398 int
1399 dns_dissect_struct_tkey_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1400 {
1401         proto_item *item = NULL;
1402         proto_tree *tree = NULL;
1403         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1404         int old_offset;
1405
1406         ALIGN_TO_4_BYTES;
1407
1408         old_offset = offset;
1409
1410         if (parent_tree) {
1411                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1412                 tree = proto_item_add_subtree(item, ett_dns_dns_tkey_record);
1413         }
1414         
1415         offset = dns_dissect_element_tkey_record_algorithm(tvb, offset, pinfo, tree, drep);
1416
1417         offset = dns_dissect_element_tkey_record_inception(tvb, offset, pinfo, tree, drep);
1418
1419         offset = dns_dissect_element_tkey_record_expiration(tvb, offset, pinfo, tree, drep);
1420
1421         offset = dns_dissect_element_tkey_record_mode(tvb, offset, pinfo, tree, drep);
1422
1423         offset = dns_dissect_element_tkey_record_error(tvb, offset, pinfo, tree, drep);
1424
1425         offset = dns_dissect_element_tkey_record_key_size(tvb, offset, pinfo, tree, drep);
1426
1427         offset = dns_dissect_element_tkey_record_key_data(tvb, offset, pinfo, tree, drep);
1428
1429         offset = dns_dissect_element_tkey_record_other_size(tvb, offset, pinfo, tree, drep);
1430
1431         offset = dns_dissect_element_tkey_record_other_data(tvb, offset, pinfo, tree, drep);
1432
1433
1434         proto_item_set_len(item, offset-old_offset);
1435
1436
1437         if (di->call_data->flags & DCERPC_IS_NDR64) {
1438                 ALIGN_TO_4_BYTES;
1439         }
1440
1441         return offset;
1442 }
1443
1444
1445 /* IDL: struct { */
1446 /* IDL:         dns_string algorithm_name; */
1447 /* IDL:         uint16 time_prefix; */
1448 /* IDL:         uint32 time; */
1449 /* IDL:         uint16 fudge; */
1450 /* IDL:         uint16 mac_size; */
1451 /* IDL:         uint8 mac[mac_size]; */
1452 /* IDL:         uint16 original_id; */
1453 /* IDL:         uint16 error; */
1454 /* IDL:         uint16 other_size; */
1455 /* IDL:         uint8 other_data[other_size]; */
1456 /* IDL: } */
1457
1458 static int
1459 dns_dissect_element_tsig_record_algorithm_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1460 {
1461         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_tsig_record_algorithm_name,0);
1462
1463         return offset;
1464 }
1465
1466 static int
1467 dns_dissect_element_tsig_record_time_prefix(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1468 {
1469         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_time_prefix, 0);
1470
1471         return offset;
1472 }
1473
1474 static int
1475 dns_dissect_element_tsig_record_time(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1476 {
1477         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_time, 0);
1478
1479         return offset;
1480 }
1481
1482 static int
1483 dns_dissect_element_tsig_record_fudge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1484 {
1485         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_fudge, 0);
1486
1487         return offset;
1488 }
1489
1490 static int
1491 dns_dissect_element_tsig_record_mac_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1492 {
1493         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_mac_size, 0);
1494
1495         return offset;
1496 }
1497
1498 static int
1499 dns_dissect_element_tsig_record_mac(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1500 {
1501
1502         return offset;
1503 }
1504
1505 static int
1506 dns_dissect_element_tsig_record_mac_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1507 {
1508         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_mac, 0);
1509
1510         return offset;
1511 }
1512
1513 static int
1514 dns_dissect_element_tsig_record_original_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1515 {
1516         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_original_id, 0);
1517
1518         return offset;
1519 }
1520
1521 static int
1522 dns_dissect_element_tsig_record_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1523 {
1524         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_error, 0);
1525
1526         return offset;
1527 }
1528
1529 static int
1530 dns_dissect_element_tsig_record_other_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1531 {
1532         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_other_size, 0);
1533
1534         return offset;
1535 }
1536
1537 static int
1538 dns_dissect_element_tsig_record_other_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1539 {
1540
1541         return offset;
1542 }
1543
1544 static int
1545 dns_dissect_element_tsig_record_other_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1546 {
1547         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_tsig_record_other_data, 0);
1548
1549         return offset;
1550 }
1551
1552 int
1553 dns_dissect_struct_tsig_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1554 {
1555         proto_item *item = NULL;
1556         proto_tree *tree = NULL;
1557         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1558         int old_offset;
1559
1560         ALIGN_TO_4_BYTES;
1561
1562         old_offset = offset;
1563
1564         if (parent_tree) {
1565                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1566                 tree = proto_item_add_subtree(item, ett_dns_dns_tsig_record);
1567         }
1568         
1569         offset = dns_dissect_element_tsig_record_algorithm_name(tvb, offset, pinfo, tree, drep);
1570
1571         offset = dns_dissect_element_tsig_record_time_prefix(tvb, offset, pinfo, tree, drep);
1572
1573         offset = dns_dissect_element_tsig_record_time(tvb, offset, pinfo, tree, drep);
1574
1575         offset = dns_dissect_element_tsig_record_fudge(tvb, offset, pinfo, tree, drep);
1576
1577         offset = dns_dissect_element_tsig_record_mac_size(tvb, offset, pinfo, tree, drep);
1578
1579         offset = dns_dissect_element_tsig_record_mac(tvb, offset, pinfo, tree, drep);
1580
1581         offset = dns_dissect_element_tsig_record_original_id(tvb, offset, pinfo, tree, drep);
1582
1583         offset = dns_dissect_element_tsig_record_error(tvb, offset, pinfo, tree, drep);
1584
1585         offset = dns_dissect_element_tsig_record_other_size(tvb, offset, pinfo, tree, drep);
1586
1587         offset = dns_dissect_element_tsig_record_other_data(tvb, offset, pinfo, tree, drep);
1588
1589
1590         proto_item_set_len(item, offset-old_offset);
1591
1592
1593         if (di->call_data->flags & DCERPC_IS_NDR64) {
1594                 ALIGN_TO_4_BYTES;
1595         }
1596
1597         return offset;
1598 }
1599
1600
1601 /* IDL: struct { */
1602 /* IDL:         dns_string name; */
1603 /* IDL:         dns_qclass rr_class; */
1604 /* IDL:         uint32 ttl; */
1605 /* IDL:         dns_string algorithm_name; */
1606 /* IDL:         uint16 time_prefix; */
1607 /* IDL:         uint32 time; */
1608 /* IDL:         uint16 fudge; */
1609 /* IDL:         uint16 original_id; */
1610 /* IDL:         uint16 error; */
1611 /* IDL:         uint16 other_size; */
1612 /* IDL:         uint8 other_data[other_size]; */
1613 /* IDL: } */
1614
1615 static int
1616 dns_dissect_element_fake_tsig_rec_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1617 {
1618         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_fake_tsig_rec_name,0);
1619
1620         return offset;
1621 }
1622
1623 static int
1624 dns_dissect_element_fake_tsig_rec_rr_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1625 {
1626         offset = dns_dissect_enum_qclass(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_rr_class, 0);
1627
1628         return offset;
1629 }
1630
1631 static int
1632 dns_dissect_element_fake_tsig_rec_ttl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1633 {
1634         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_ttl, 0);
1635
1636         return offset;
1637 }
1638
1639 static int
1640 dns_dissect_element_fake_tsig_rec_algorithm_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1641 {
1642         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_fake_tsig_rec_algorithm_name,0);
1643
1644         return offset;
1645 }
1646
1647 static int
1648 dns_dissect_element_fake_tsig_rec_time_prefix(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1649 {
1650         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_time_prefix, 0);
1651
1652         return offset;
1653 }
1654
1655 static int
1656 dns_dissect_element_fake_tsig_rec_time(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1657 {
1658         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_time, 0);
1659
1660         return offset;
1661 }
1662
1663 static int
1664 dns_dissect_element_fake_tsig_rec_fudge(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1665 {
1666         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_fudge, 0);
1667
1668         return offset;
1669 }
1670
1671 static int
1672 dns_dissect_element_fake_tsig_rec_original_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1673 {
1674         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_original_id, 0);
1675
1676         return offset;
1677 }
1678
1679 static int
1680 dns_dissect_element_fake_tsig_rec_error(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1681 {
1682         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_error, 0);
1683
1684         return offset;
1685 }
1686
1687 static int
1688 dns_dissect_element_fake_tsig_rec_other_size(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1689 {
1690         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_other_size, 0);
1691
1692         return offset;
1693 }
1694
1695 static int
1696 dns_dissect_element_fake_tsig_rec_other_data(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1697 {
1698
1699         return offset;
1700 }
1701
1702 static int
1703 dns_dissect_element_fake_tsig_rec_other_data_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1704 {
1705         offset = PIDL_dissect_uint8(tvb, offset, pinfo, tree, drep, hf_dns_dns_fake_tsig_rec_other_data, 0);
1706
1707         return offset;
1708 }
1709
1710 int
1711 dns_dissect_struct_fake_tsig_rec(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1712 {
1713         proto_item *item = NULL;
1714         proto_tree *tree = NULL;
1715         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
1716         int old_offset;
1717
1718
1719         old_offset = offset;
1720
1721         if (parent_tree) {
1722                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
1723                 tree = proto_item_add_subtree(item, ett_dns_dns_fake_tsig_rec);
1724         }
1725         
1726         offset = dns_dissect_element_fake_tsig_rec_name(tvb, offset, pinfo, tree, drep);
1727
1728         offset = dns_dissect_element_fake_tsig_rec_rr_class(tvb, offset, pinfo, tree, drep);
1729
1730         offset = dns_dissect_element_fake_tsig_rec_ttl(tvb, offset, pinfo, tree, drep);
1731
1732         offset = dns_dissect_element_fake_tsig_rec_algorithm_name(tvb, offset, pinfo, tree, drep);
1733
1734         offset = dns_dissect_element_fake_tsig_rec_time_prefix(tvb, offset, pinfo, tree, drep);
1735
1736         offset = dns_dissect_element_fake_tsig_rec_time(tvb, offset, pinfo, tree, drep);
1737
1738         offset = dns_dissect_element_fake_tsig_rec_fudge(tvb, offset, pinfo, tree, drep);
1739
1740         offset = dns_dissect_element_fake_tsig_rec_original_id(tvb, offset, pinfo, tree, drep);
1741
1742         offset = dns_dissect_element_fake_tsig_rec_error(tvb, offset, pinfo, tree, drep);
1743
1744         offset = dns_dissect_element_fake_tsig_rec_other_size(tvb, offset, pinfo, tree, drep);
1745
1746         offset = dns_dissect_element_fake_tsig_rec_other_data(tvb, offset, pinfo, tree, drep);
1747
1748
1749         proto_item_set_len(item, offset-old_offset);
1750
1751
1752         if (di->call_data->flags & DCERPC_IS_NDR64) {
1753                 ALIGN_TO_4_BYTES;
1754         }
1755
1756         return offset;
1757 }
1758
1759
1760 /* IDL: [public(1)] [nodiscriminant(1)] [flag(LIBNDR_FLAG_NOALIGN)] union { */
1761 /* IDL: [case(DNS_QTYPE_A)] [case(DNS_QTYPE_A)] ipv4address ipv4_record; */
1762 /* IDL: [case(DNS_QTYPE_NS)] [case(DNS_QTYPE_NS)] dns_string ns_record; */
1763 /* IDL: [case(DNS_QTYPE_CNAME)] [case(DNS_QTYPE_CNAME)] dns_string cname_record; */
1764 /* IDL: [case(DNS_QTYPE_SOA)] [case(DNS_QTYPE_SOA)] dns_soa_record soa_record; */
1765 /* IDL: [case(DNS_QTYPE_PTR)] [case(DNS_QTYPE_PTR)] dns_string ptr_record; */
1766 /* IDL: [case(DNS_QTYPE_HINFO)] [case(DNS_QTYPE_HINFO)] dns_hinfo_record hinfo_record; */
1767 /* IDL: [case(DNS_QTYPE_MX)] [case(DNS_QTYPE_MX)] dns_mx_record mx_record; */
1768 /* IDL: [case(DNS_QTYPE_TXT)] [case(DNS_QTYPE_TXT)] dns_txt_record txt_record; */
1769 /* IDL: [case(DNS_QTYPE_RP)] [case(DNS_QTYPE_RP)] dns_rp_record rp_record; */
1770 /* IDL: [case(DNS_QTYPE_AAAA)] [case(DNS_QTYPE_AAAA)] ipv6address ipv6_record; */
1771 /* IDL: [case(DNS_QTYPE_SRV)] [case(DNS_QTYPE_SRV)] dns_srv_record srv_record; */
1772 /* IDL: [case(DNS_QTYPE_OPT)] [case(DNS_QTYPE_OPT)] dns_opt_record opt_record; */
1773 /* IDL: [case(DNS_QTYPE_TSIG)] [case(DNS_QTYPE_TSIG)] dns_tsig_record tsig_record; */
1774 /* IDL: [case(DNS_QTYPE_TKEY)] [case(DNS_QTYPE_TKEY)] dns_tkey_record tkey_record; */
1775 /* IDL: [default] ; */
1776 /* IDL: } */
1777
1778 static int
1779 dns_dissect_element_rdata_ipv4_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1780 {
1781         offset = dns_dissect_struct_ipv4address(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_ipv4_record,0);
1782
1783         return offset;
1784 }
1785
1786 static int
1787 dns_dissect_element_rdata_ns_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1788 {
1789         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_ns_record,0);
1790
1791         return offset;
1792 }
1793
1794 static int
1795 dns_dissect_element_rdata_cname_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1796 {
1797         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_cname_record,0);
1798
1799         return offset;
1800 }
1801
1802 static int
1803 dns_dissect_element_rdata_soa_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1804 {
1805         offset = dns_dissect_struct_soa_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_soa_record,0);
1806
1807         return offset;
1808 }
1809
1810 static int
1811 dns_dissect_element_rdata_ptr_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1812 {
1813         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_ptr_record,0);
1814
1815         return offset;
1816 }
1817
1818 static int
1819 dns_dissect_element_rdata_hinfo_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1820 {
1821         offset = dns_dissect_struct_hinfo_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_hinfo_record,0);
1822
1823         return offset;
1824 }
1825
1826 static int
1827 dns_dissect_element_rdata_mx_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1828 {
1829         offset = dns_dissect_struct_mx_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_mx_record,0);
1830
1831         return offset;
1832 }
1833
1834 static int
1835 dns_dissect_element_rdata_txt_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1836 {
1837         offset = dns_dissect_struct_txt_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_txt_record,0);
1838
1839         return offset;
1840 }
1841
1842 static int
1843 dns_dissect_element_rdata_rp_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1844 {
1845         offset = dns_dissect_struct_rp_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_rp_record,0);
1846
1847         return offset;
1848 }
1849
1850 static int
1851 dns_dissect_element_rdata_ipv6_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1852 {
1853         offset = dns_dissect_struct_ipv6address(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_ipv6_record,0);
1854
1855         return offset;
1856 }
1857
1858 static int
1859 dns_dissect_element_rdata_srv_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1860 {
1861         offset = dns_dissect_struct_srv_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_srv_record,0);
1862
1863         return offset;
1864 }
1865
1866 static int
1867 dns_dissect_element_rdata_opt_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1868 {
1869         offset = dns_dissect_struct_opt_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_opt_record,0);
1870
1871         return offset;
1872 }
1873
1874 static int
1875 dns_dissect_element_rdata_tsig_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1876 {
1877         offset = dns_dissect_struct_tsig_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_tsig_record,0);
1878
1879         return offset;
1880 }
1881
1882 static int
1883 dns_dissect_element_rdata_tkey_record(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1884 {
1885         offset = dns_dissect_struct_tkey_record(tvb,offset,pinfo,tree,drep,hf_dns_dns_rdata_tkey_record,0);
1886
1887         return offset;
1888 }
1889
1890 static int
1891 dns_dissect_rdata(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
1892 {
1893         proto_item *item = NULL;
1894         proto_tree *tree = NULL;
1895         int old_offset;
1896         guint32 level = param;
1897
1898         old_offset = offset;
1899         if (parent_tree) {
1900                 item = proto_tree_add_text(parent_tree, tvb, offset, -1, "dns_rdata");
1901                 tree = proto_item_add_subtree(item, ett_dns_dns_rdata);
1902         }
1903
1904         switch(level) {
1905                 case DNS_QTYPE_A:
1906                         offset = dns_dissect_element_rdata_ipv4_record(tvb, offset, pinfo, tree, drep);
1907                 break;
1908
1909                 case DNS_QTYPE_NS:
1910                         offset = dns_dissect_element_rdata_ns_record(tvb, offset, pinfo, tree, drep);
1911                 break;
1912
1913                 case DNS_QTYPE_CNAME:
1914                         offset = dns_dissect_element_rdata_cname_record(tvb, offset, pinfo, tree, drep);
1915                 break;
1916
1917                 case DNS_QTYPE_SOA:
1918                         offset = dns_dissect_element_rdata_soa_record(tvb, offset, pinfo, tree, drep);
1919                 break;
1920
1921                 case DNS_QTYPE_PTR:
1922                         offset = dns_dissect_element_rdata_ptr_record(tvb, offset, pinfo, tree, drep);
1923                 break;
1924
1925                 case DNS_QTYPE_HINFO:
1926                         offset = dns_dissect_element_rdata_hinfo_record(tvb, offset, pinfo, tree, drep);
1927                 break;
1928
1929                 case DNS_QTYPE_MX:
1930                         offset = dns_dissect_element_rdata_mx_record(tvb, offset, pinfo, tree, drep);
1931                 break;
1932
1933                 case DNS_QTYPE_TXT:
1934                         offset = dns_dissect_element_rdata_txt_record(tvb, offset, pinfo, tree, drep);
1935                 break;
1936
1937                 case DNS_QTYPE_RP:
1938                         offset = dns_dissect_element_rdata_rp_record(tvb, offset, pinfo, tree, drep);
1939                 break;
1940
1941                 case DNS_QTYPE_AAAA:
1942                         offset = dns_dissect_element_rdata_ipv6_record(tvb, offset, pinfo, tree, drep);
1943                 break;
1944
1945                 case DNS_QTYPE_SRV:
1946                         offset = dns_dissect_element_rdata_srv_record(tvb, offset, pinfo, tree, drep);
1947                 break;
1948
1949                 case DNS_QTYPE_OPT:
1950                         offset = dns_dissect_element_rdata_opt_record(tvb, offset, pinfo, tree, drep);
1951                 break;
1952
1953                 case DNS_QTYPE_TSIG:
1954                         offset = dns_dissect_element_rdata_tsig_record(tvb, offset, pinfo, tree, drep);
1955                 break;
1956
1957                 case DNS_QTYPE_TKEY:
1958                         offset = dns_dissect_element_rdata_tkey_record(tvb, offset, pinfo, tree, drep);
1959                 break;
1960
1961                 default:
1962                 break;
1963         }
1964         proto_item_set_len(item, offset-old_offset);
1965
1966
1967         return offset;
1968 }
1969
1970 /* IDL: struct { */
1971 /* IDL:         dns_string name; */
1972 /* IDL:         dns_qtype rr_type; */
1973 /* IDL:         dns_qclass rr_class; */
1974 /* IDL:         uint32 ttl; */
1975 /* IDL:         uint16 length; */
1976 /* IDL:         [switch_is(rr_type)] dns_rdata rdata; */
1977 /* IDL:         DATA_BLOB unexpected; */
1978 /* IDL: } */
1979
1980 static int
1981 dns_dissect_element_res_rec_name(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1982 {
1983         offset = dns_dissect_struct_dns_string(tvb,offset,pinfo,tree,drep,hf_dns_dns_res_rec_name,0);
1984
1985         return offset;
1986 }
1987
1988 static int
1989 dns_dissect_element_res_rec_rr_type(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type)
1990 {
1991         offset = dns_dissect_enum_qtype(tvb, offset, pinfo, tree, drep, hf_dns_dns_res_rec_rr_type, rr_type);
1992
1993         return offset;
1994 }
1995
1996 static int
1997 dns_dissect_element_res_rec_rr_class(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
1998 {
1999         offset = dns_dissect_enum_qclass(tvb, offset, pinfo, tree, drep, hf_dns_dns_res_rec_rr_class, 0);
2000
2001         return offset;
2002 }
2003
2004 static int
2005 dns_dissect_element_res_rec_ttl(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2006 {
2007         offset = PIDL_dissect_uint32(tvb, offset, pinfo, tree, drep, hf_dns_dns_res_rec_ttl, 0);
2008
2009         return offset;
2010 }
2011
2012 static int
2013 dns_dissect_element_res_rec_length(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2014 {
2015         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_res_rec_length, 0);
2016
2017         return offset;
2018 }
2019
2020 static int
2021 dns_dissect_element_res_rec_rdata(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_, guint16 *rr_type)
2022 {
2023         offset = dns_dissect_rdata(tvb, offset, pinfo, tree, drep, hf_dns_dns_res_rec_rdata, *rr_type);
2024
2025         return offset;
2026 }
2027
2028 static int
2029 dns_dissect_element_res_rec_unexpected(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2030 {
2031         offset = dissect_ndr_datablob(tvb, offset, pinfo, tree, drep, hf_dns_dns_res_rec_unexpected, 0);
2032
2033         return offset;
2034 }
2035
2036 int
2037 dns_dissect_struct_res_rec(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2038 {
2039         guint16 rr_type;
2040         proto_item *item = NULL;
2041         proto_tree *tree = NULL;
2042         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2043         int old_offset;
2044
2045
2046         old_offset = offset;
2047
2048         if (parent_tree) {
2049                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2050                 tree = proto_item_add_subtree(item, ett_dns_dns_res_rec);
2051         }
2052         
2053         offset = dns_dissect_element_res_rec_name(tvb, offset, pinfo, tree, drep);
2054
2055         offset = dns_dissect_element_res_rec_rr_type(tvb, offset, pinfo, tree, drep, &rr_type);
2056
2057         offset = dns_dissect_element_res_rec_rr_class(tvb, offset, pinfo, tree, drep);
2058
2059         offset = dns_dissect_element_res_rec_ttl(tvb, offset, pinfo, tree, drep);
2060
2061         offset = dns_dissect_element_res_rec_length(tvb, offset, pinfo, tree, drep);
2062
2063         offset = dns_dissect_element_res_rec_rdata(tvb, offset, pinfo, tree, drep, &rr_type);
2064
2065         offset = dns_dissect_element_res_rec_unexpected(tvb, offset, pinfo, tree, drep);
2066
2067
2068         proto_item_set_len(item, offset-old_offset);
2069
2070
2071         if (di->call_data->flags & DCERPC_IS_NDR64) {
2072                 ALIGN_TO_4_BYTES;
2073         }
2074
2075         return offset;
2076 }
2077
2078
2079 /* IDL: struct { */
2080 /* IDL:         uint16 id; */
2081 /* IDL:         dns_operation operation; */
2082 /* IDL:         uint16 qdcount; */
2083 /* IDL:         uint16 ancount; */
2084 /* IDL:         uint16 nscount; */
2085 /* IDL:         uint16 arcount; */
2086 /* IDL:         dns_name_question questions[qdcount]; */
2087 /* IDL:         dns_res_rec answers[ancount]; */
2088 /* IDL:         dns_res_rec nsrecs[nscount]; */
2089 /* IDL:         dns_res_rec additional[arcount]; */
2090 /* IDL: } */
2091
2092 static int
2093 dns_dissect_element_name_packet_id(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2094 {
2095         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_packet_id, 0);
2096
2097         return offset;
2098 }
2099
2100 static int
2101 dns_dissect_element_name_packet_operation(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2102 {
2103         offset = dns_dissect_bitmap_operation(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_packet_operation, 0);
2104
2105         return offset;
2106 }
2107
2108 static int
2109 dns_dissect_element_name_packet_qdcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2110 {
2111         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_packet_qdcount, 0);
2112
2113         return offset;
2114 }
2115
2116 static int
2117 dns_dissect_element_name_packet_ancount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2118 {
2119         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_packet_ancount, 0);
2120
2121         return offset;
2122 }
2123
2124 static int
2125 dns_dissect_element_name_packet_nscount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2126 {
2127         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_packet_nscount, 0);
2128
2129         return offset;
2130 }
2131
2132 static int
2133 dns_dissect_element_name_packet_arcount(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2134 {
2135         offset = PIDL_dissect_uint16(tvb, offset, pinfo, tree, drep, hf_dns_dns_name_packet_arcount, 0);
2136
2137         return offset;
2138 }
2139
2140 static int
2141 dns_dissect_element_name_packet_questions(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2142 {
2143
2144         return offset;
2145 }
2146
2147 static int
2148 dns_dissect_element_name_packet_questions_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2149 {
2150         offset = dns_dissect_struct_name_question(tvb,offset,pinfo,tree,drep,hf_dns_dns_name_packet_questions,0);
2151
2152         return offset;
2153 }
2154
2155 static int
2156 dns_dissect_element_name_packet_answers(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2157 {
2158
2159         return offset;
2160 }
2161
2162 static int
2163 dns_dissect_element_name_packet_answers_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2164 {
2165         offset = dns_dissect_struct_res_rec(tvb,offset,pinfo,tree,drep,hf_dns_dns_name_packet_answers,0);
2166
2167         return offset;
2168 }
2169
2170 static int
2171 dns_dissect_element_name_packet_nsrecs(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2172 {
2173
2174         return offset;
2175 }
2176
2177 static int
2178 dns_dissect_element_name_packet_nsrecs_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2179 {
2180         offset = dns_dissect_struct_res_rec(tvb,offset,pinfo,tree,drep,hf_dns_dns_name_packet_nsrecs,0);
2181
2182         return offset;
2183 }
2184
2185 static int
2186 dns_dissect_element_name_packet_additional(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2187 {
2188
2189         return offset;
2190 }
2191
2192 static int
2193 dns_dissect_element_name_packet_additional_(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2194 {
2195         offset = dns_dissect_struct_res_rec(tvb,offset,pinfo,tree,drep,hf_dns_dns_name_packet_additional,0);
2196
2197         return offset;
2198 }
2199
2200 int
2201 dns_dissect_struct_name_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *parent_tree _U_, guint8 *drep _U_, int hf_index _U_, guint32 param _U_)
2202 {
2203         proto_item *item = NULL;
2204         proto_tree *tree = NULL;
2205         dcerpc_info *di = (dcerpc_info *)pinfo->private_data;
2206         int old_offset;
2207
2208
2209         old_offset = offset;
2210
2211         if (parent_tree) {
2212                 item = proto_tree_add_item(parent_tree, hf_index, tvb, offset, -1, ENC_NA);
2213                 tree = proto_item_add_subtree(item, ett_dns_dns_name_packet);
2214         }
2215         
2216         offset = dns_dissect_element_name_packet_id(tvb, offset, pinfo, tree, drep);
2217
2218         offset = dns_dissect_element_name_packet_operation(tvb, offset, pinfo, tree, drep);
2219
2220         offset = dns_dissect_element_name_packet_qdcount(tvb, offset, pinfo, tree, drep);
2221
2222         offset = dns_dissect_element_name_packet_ancount(tvb, offset, pinfo, tree, drep);
2223
2224         offset = dns_dissect_element_name_packet_nscount(tvb, offset, pinfo, tree, drep);
2225
2226         offset = dns_dissect_element_name_packet_arcount(tvb, offset, pinfo, tree, drep);
2227
2228         offset = dns_dissect_element_name_packet_questions(tvb, offset, pinfo, tree, drep);
2229
2230         offset = dns_dissect_element_name_packet_answers(tvb, offset, pinfo, tree, drep);
2231
2232         offset = dns_dissect_element_name_packet_nsrecs(tvb, offset, pinfo, tree, drep);
2233
2234         offset = dns_dissect_element_name_packet_additional(tvb, offset, pinfo, tree, drep);
2235
2236
2237         proto_item_set_len(item, offset-old_offset);
2238
2239
2240         if (di->call_data->flags & DCERPC_IS_NDR64) {
2241                 ALIGN_TO_4_BYTES;
2242         }
2243
2244         return offset;
2245 }
2246
2247 static int
2248 dns_dissect_element_decode_dns_name_packet_packet(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2249 {
2250         offset = dns_dissect_struct_name_packet(tvb,offset,pinfo,tree,drep,hf_dns_decode_dns_name_packet_packet,0);
2251
2252         return offset;
2253 }
2254
2255 /* IDL: void decode_dns_name_packet( */
2256 /* IDL: [in] dns_name_packet packet */
2257 /* IDL: ); */
2258
2259 static int
2260 dns_dissect_decode_dns_name_packet_response(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2261 {
2262         pinfo->dcerpc_procedure_name="decode_dns_name_packet";
2263         return offset;
2264 }
2265
2266 static int
2267 dns_dissect_decode_dns_name_packet_request(tvbuff_t *tvb _U_, int offset _U_, packet_info *pinfo _U_, proto_tree *tree _U_, guint8 *drep _U_)
2268 {
2269         pinfo->dcerpc_procedure_name="decode_dns_name_packet";
2270         offset = dns_dissect_element_decode_dns_name_packet_packet(tvb, offset, pinfo, tree, drep);
2271         offset = dissect_deferred_pointers(pinfo, tvb, offset, drep);
2272         return offset;
2273 }
2274
2275
2276 static dcerpc_sub_dissector dns_dissectors[] = {
2277         { 0, "decode_dns_name_packet",
2278            dns_dissect_decode_dns_name_packet_request, dns_dissect_decode_dns_name_packet_response},
2279         { 0, NULL, NULL, NULL }
2280 };
2281
2282 void proto_register_dcerpc_dns(void)
2283 {
2284         static hf_register_info hf[] = {
2285         { &hf_dns_dns_hinfo_record_cpu,
2286           { "Cpu", "dns.dns_hinfo_record.cpu", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2287         { &hf_dns_decode_dns_name_packet_packet,
2288           { "Packet", "dns.decode_dns_name_packet.packet", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2289         { &hf_dns_dns_srv_record_target,
2290           { "Target", "dns.dns_srv_record.target", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2291         { &hf_dns_dns_soa_record_minimum,
2292           { "Minimum", "dns.dns_soa_record.minimum", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2293         { &hf_dns_dns_srv_record_priority,
2294           { "Priority", "dns.dns_srv_record.priority", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2295         { &hf_dns_dns_operation_DNS_FLAG_REPLY,
2296           { "Dns Flag Reply", "dns.dns_operation.DNS_FLAG_REPLY", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_FLAG_REPLY_tfs), ( 0x8000 ), NULL, HFILL }},
2297         { &hf_dns_opnum,
2298           { "Operation", "dns.opnum", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2299         { &hf_dns_dns_srv_record_weight,
2300           { "Weight", "dns.dns_srv_record.weight", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2301         { &hf_dns_dns_operation_DNS_FLAG_BROADCAST,
2302           { "Dns Flag Broadcast", "dns.dns_operation.DNS_FLAG_BROADCAST", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_FLAG_BROADCAST_tfs), ( 0x0010 ), NULL, HFILL }},
2303         { &hf_dns_dns_tsig_record_algorithm_name,
2304           { "Algorithm Name", "dns.dns_tsig_record.algorithm_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2305         { &hf_dns_dns_tkey_record_inception,
2306           { "Inception", "dns.dns_tkey_record.inception", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2307         { &hf_dns_dns_res_rec_rdata,
2308           { "Rdata", "dns.dns_res_rec.rdata", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2309         { &hf_dns_dns_tsig_record_error,
2310           { "Error", "dns.dns_tsig_record.error", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2311         { &hf_dns_dns_rdata_tkey_record,
2312           { "Tkey Record", "dns.dns_rdata.tkey_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2313         { &hf_dns_dns_tsig_record_original_id,
2314           { "Original Id", "dns.dns_tsig_record.original_id", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2315         { &hf_dns_dns_name_packet_arcount,
2316           { "Arcount", "dns.dns_name_packet.arcount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2317         { &hf_dns_dns_fake_tsig_rec_original_id,
2318           { "Original Id", "dns.dns_fake_tsig_rec.original_id", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2319         { &hf_dns_dns_fake_tsig_rec_time,
2320           { "Time", "dns.dns_fake_tsig_rec.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2321         { &hf_dns_dns_rdata_mx_record,
2322           { "Mx Record", "dns.dns_rdata.mx_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2323         { &hf_dns_dns_tsig_record_mac,
2324           { "Mac", "dns.dns_tsig_record.mac", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2325         { &hf_dns_dns_tsig_record_time_prefix,
2326           { "Time Prefix", "dns.dns_tsig_record.time_prefix", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2327         { &hf_dns_dns_res_rec_length,
2328           { "Length", "dns.dns_res_rec.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2329         { &hf_dns_dns_rdata_soa_record,
2330           { "Soa Record", "dns.dns_rdata.soa_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2331         { &hf_dns_dns_fake_tsig_rec_error,
2332           { "Error", "dns.dns_fake_tsig_rec.error", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2333         { &hf_dns_dns_mx_record_preference,
2334           { "Preference", "dns.dns_mx_record.preference", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2335         { &hf_dns_dns_soa_record_retry,
2336           { "Retry", "dns.dns_soa_record.retry", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2337         { &hf_dns_dns_rp_record_mbox,
2338           { "Mbox", "dns.dns_rp_record.mbox", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2339         { &hf_dns_dns_fake_tsig_rec_ttl,
2340           { "Ttl", "dns.dns_fake_tsig_rec.ttl", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2341         { &hf_dns_dns_fake_tsig_rec_name,
2342           { "Name", "dns.dns_fake_tsig_rec.name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2343         { &hf_dns_dns_tsig_record_fudge,
2344           { "Fudge", "dns.dns_tsig_record.fudge", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2345         { &hf_dns_dns_res_rec_rr_type,
2346           { "Rr Type", "dns.dns_res_rec.rr_type", FT_UINT16, BASE_DEC, VALS(dns_dns_qtype_vals), 0, NULL, HFILL }},
2347         { &hf_dns_dns_operation_DNS_RCODE,
2348           { "Dns Rcode", "dns.dns_operation.DNS_RCODE", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_RCODE_tfs), ( 0x000F ), NULL, HFILL }},
2349         { &hf_dns_dns_rdata_ipv4_record,
2350           { "Ipv4 Record", "dns.dns_rdata.ipv4_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2351         { &hf_dns_dns_fake_tsig_rec_other_data,
2352           { "Other Data", "dns.dns_fake_tsig_rec.other_data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2353         { &hf_dns_dns_fake_tsig_rec_rr_class,
2354           { "Rr Class", "dns.dns_fake_tsig_rec.rr_class", FT_UINT16, BASE_DEC, VALS(dns_dns_qclass_vals), 0, NULL, HFILL }},
2355         { &hf_dns_dns_hinfo_record_os,
2356           { "Os", "dns.dns_hinfo_record.os", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2357         { &hf_dns_dns_name_packet_additional,
2358           { "Additional", "dns.dns_name_packet.additional", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2359         { &hf_dns_dns_srv_record_port,
2360           { "Port", "dns.dns_srv_record.port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2361         { &hf_dns_dns_name_packet_qdcount,
2362           { "Qdcount", "dns.dns_name_packet.qdcount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2363         { &hf_dns_dns_rdata_data_data,
2364           { "Data", "dns.dns_rdata_data.data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2365         { &hf_dns_dns_rdata_ptr_record,
2366           { "Ptr Record", "dns.dns_rdata.ptr_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2367         { &hf_dns_dns_fake_tsig_rec_algorithm_name,
2368           { "Algorithm Name", "dns.dns_fake_tsig_rec.algorithm_name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2369         { &hf_dns_dns_rdata_rp_record,
2370           { "Rp Record", "dns.dns_rdata.rp_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2371         { &hf_dns_dns_soa_record_mname,
2372           { "Mname", "dns.dns_soa_record.mname", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2373         { &hf_dns_dns_tsig_record_mac_size,
2374           { "Mac Size", "dns.dns_tsig_record.mac_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2375         { &hf_dns_dns_fake_tsig_rec_time_prefix,
2376           { "Time Prefix", "dns.dns_fake_tsig_rec.time_prefix", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2377         { &hf_dns_dns_res_rec_ttl,
2378           { "Ttl", "dns.dns_res_rec.ttl", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2379         { &hf_dns_dns_soa_record_serial,
2380           { "Serial", "dns.dns_soa_record.serial", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2381         { &hf_dns_dns_tsig_record_time,
2382           { "Time", "dns.dns_tsig_record.time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2383         { &hf_dns_dns_soa_record_rname,
2384           { "Rname", "dns.dns_soa_record.rname", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2385         { &hf_dns_dns_operation_DNS_FLAG_RECURSION_DESIRED,
2386           { "Dns Flag Recursion Desired", "dns.dns_operation.DNS_FLAG_RECURSION_DESIRED", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_FLAG_RECURSION_DESIRED_tfs), ( 0x0100 ), NULL, HFILL }},
2387         { &hf_dns_dns_tkey_record_error,
2388           { "Error", "dns.dns_tkey_record.error", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2389         { &hf_dns_dns_hinfo_record_os_length,
2390           { "Os Length", "dns.dns_hinfo_record.os_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2391         { &hf_dns_dns_tsig_record_other_data,
2392           { "Other Data", "dns.dns_tsig_record.other_data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2393         { &hf_dns_dns_txt_record_length,
2394           { "Length", "dns.dns_txt_record.length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2395         { &hf_dns_dns_operation_DNS_OPCODE,
2396           { "Dns Opcode", "dns.dns_operation.DNS_OPCODE", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_OPCODE_tfs), ( 0x7800 ), NULL, HFILL }},
2397         { &hf_dns_dns_soa_record_refresh,
2398           { "Refresh", "dns.dns_soa_record.refresh", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2399         { &hf_dns_dns_rdata_ipv6_record,
2400           { "Ipv6 Record", "dns.dns_rdata.ipv6_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2401         { &hf_dns_dns_operation_DNS_FLAG_AUTHORITATIVE,
2402           { "Dns Flag Authoritative", "dns.dns_operation.DNS_FLAG_AUTHORITATIVE", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_FLAG_AUTHORITATIVE_tfs), ( 0x0400 ), NULL, HFILL }},
2403         { &hf_dns_dns_fake_tsig_rec_fudge,
2404           { "Fudge", "dns.dns_fake_tsig_rec.fudge", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2405         { &hf_dns_dns_rdata_opt_record,
2406           { "Opt Record", "dns.dns_rdata.opt_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2407         { &hf_dns_dns_rdata_tsig_record,
2408           { "Tsig Record", "dns.dns_rdata.tsig_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2409         { &hf_dns_dns_tkey_record_other_size,
2410           { "Other Size", "dns.dns_tkey_record.other_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2411         { &hf_dns_dns_name_packet_nscount,
2412           { "Nscount", "dns.dns_name_packet.nscount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2413         { &hf_dns_dns_res_rec_name,
2414           { "Name", "dns.dns_res_rec.name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2415         { &hf_dns_dns_name_packet_nsrecs,
2416           { "Nsrecs", "dns.dns_name_packet.nsrecs", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2417         { &hf_dns_dns_tkey_record_expiration,
2418           { "Expiration", "dns.dns_tkey_record.expiration", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2419         { &hf_dns_dns_hinfo_record_cpu_length,
2420           { "Cpu Length", "dns.dns_hinfo_record.cpu_length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2421         { &hf_dns_dns_name_question_question_type,
2422           { "Question Type", "dns.dns_name_question.question_type", FT_UINT16, BASE_DEC, VALS(dns_dns_qtype_vals), 0, NULL, HFILL }},
2423         { &hf_dns_dns_txt_record_txt,
2424           { "Txt", "dns.dns_txt_record.txt", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2425         { &hf_dns_dns_tkey_record_other_data,
2426           { "Other Data", "dns.dns_tkey_record.other_data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2427         { &hf_dns_dns_tkey_record_algorithm,
2428           { "Algorithm", "dns.dns_tkey_record.algorithm", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2429         { &hf_dns_dns_rdata_srv_record,
2430           { "Srv Record", "dns.dns_rdata.srv_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2431         { &hf_dns_dns_tkey_record_key_size,
2432           { "Key Size", "dns.dns_tkey_record.key_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2433         { &hf_dns_dns_tkey_record_key_data,
2434           { "Key Data", "dns.dns_tkey_record.key_data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2435         { &hf_dns_dns_rdata_data_length,
2436           { "Length", "dns.dns_rdata_data.length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2437         { &hf_dns_dns_name_packet_questions,
2438           { "Questions", "dns.dns_name_packet.questions", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2439         { &hf_dns_dns_fake_tsig_rec_other_size,
2440           { "Other Size", "dns.dns_fake_tsig_rec.other_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2441         { &hf_dns_dns_rdata_hinfo_record,
2442           { "Hinfo Record", "dns.dns_rdata.hinfo_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2443         { &hf_dns_dns_name_packet_answers,
2444           { "Answers", "dns.dns_name_packet.answers", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2445         { &hf_dns_dns_res_rec_unexpected,
2446           { "Unexpected", "dns.dns_res_rec.unexpected", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2447         { &hf_dns_dns_soa_record_expire,
2448           { "Expire", "dns.dns_soa_record.expire", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2449         { &hf_dns_dns_mx_record_exchange,
2450           { "Exchange", "dns.dns_mx_record.exchange", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2451         { &hf_dns_dns_rdata_ns_record,
2452           { "Ns Record", "dns.dns_rdata.ns_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2453         { &hf_dns_dns_name_question_question_class,
2454           { "Question Class", "dns.dns_name_question.question_class", FT_UINT16, BASE_DEC, VALS(dns_dns_qclass_vals), 0, NULL, HFILL }},
2455         { &hf_dns_dns_operation_DNS_FLAG_RECURSION_AVAIL,
2456           { "Dns Flag Recursion Avail", "dns.dns_operation.DNS_FLAG_RECURSION_AVAIL", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_FLAG_RECURSION_AVAIL_tfs), ( 0x0080 ), NULL, HFILL }},
2457         { &hf_dns_dns_opt_record_option_code,
2458           { "Option Code", "dns.dns_opt_record.option_code", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2459         { &hf_dns_dns_tsig_record_other_size,
2460           { "Other Size", "dns.dns_tsig_record.other_size", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2461         { &hf_dns_dns_rdata_cname_record,
2462           { "Cname Record", "dns.dns_rdata.cname_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2463         { &hf_dns_dns_operation_DNS_FLAG_TRUNCATION,
2464           { "Dns Flag Truncation", "dns.dns_operation.DNS_FLAG_TRUNCATION", FT_BOOLEAN, 16, TFS(&dns_operation_DNS_FLAG_TRUNCATION_tfs), ( 0x0200 ), NULL, HFILL }},
2465         { &hf_dns_dns_name_question_name,
2466           { "Name", "dns.dns_name_question.name", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2467         { &hf_dns_dns_rdata_txt_record,
2468           { "Txt Record", "dns.dns_rdata.txt_record", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2469         { &hf_dns_dns_name_packet_operation,
2470           { "Operation", "dns.dns_name_packet.operation", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
2471         { &hf_dns_dns_name_packet_id,
2472           { "Id", "dns.dns_name_packet.id", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2473         { &hf_dns_dns_res_rec_rr_class,
2474           { "Rr Class", "dns.dns_res_rec.rr_class", FT_UINT16, BASE_DEC, VALS(dns_dns_qclass_vals), 0, NULL, HFILL }},
2475         { &hf_dns_dns_rp_record_txt,
2476           { "Txt", "dns.dns_rp_record.txt", FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
2477         { &hf_dns_dns_opt_record_option_length,
2478           { "Option Length", "dns.dns_opt_record.option_length", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2479         { &hf_dns_dns_opt_record_option_data,
2480           { "Option Data", "dns.dns_opt_record.option_data", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2481         { &hf_dns_dns_name_packet_ancount,
2482           { "Ancount", "dns.dns_name_packet.ancount", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2483         { &hf_dns_dns_tkey_record_mode,
2484           { "Mode", "dns.dns_tkey_record.mode", FT_UINT16, BASE_DEC, VALS(dns_dns_tkey_mode_vals), 0, NULL, HFILL }},
2485         };
2486
2487
2488         static gint *ett[] = {
2489                 &ett_dcerpc_dns,
2490                 &ett_dns_dns_operation,
2491                 &ett_dns_dns_name_question,
2492                 &ett_dns_dns_rdata_data,
2493                 &ett_dns_dns_soa_record,
2494                 &ett_dns_dns_hinfo_record,
2495                 &ett_dns_dns_mx_record,
2496                 &ett_dns_dns_txt_record,
2497                 &ett_dns_dns_rp_record,
2498                 &ett_dns_dns_srv_record,
2499                 &ett_dns_dns_opt_record,
2500                 &ett_dns_dns_tkey_record,
2501                 &ett_dns_dns_tsig_record,
2502                 &ett_dns_dns_fake_tsig_rec,
2503                 &ett_dns_dns_rdata,
2504                 &ett_dns_dns_res_rec,
2505                 &ett_dns_dns_name_packet,
2506         };
2507
2508         proto_dcerpc_dns = proto_register_protocol("DNS records", "DNS", "dns");
2509         proto_register_field_array(proto_dcerpc_dns, hf, array_length (hf));
2510         proto_register_subtree_array(ett, array_length(ett));
2511 }
2512
2513 void proto_reg_handoff_dcerpc_dns(void)
2514 {
2515         dcerpc_init_uuid(proto_dcerpc_dns, ett_dcerpc_dns,
2516                 &uuid_dcerpc_dns, ver_dcerpc_dns,
2517                 dns_dissectors, hf_dns_opnum);
2518 }