smbd: check for previous versions in check_any_access_fsp()
[Samba.git] / librpc / idl / dns.idl
blobec8668aa212672344f39cba61606791de28cd0ac
1 #include "idl_types.h"
3 /*
4 IDL structures for DNS operations
6 DNS is not traditionally encoded using IDL/NDR. This is a bit of an
7 experiment, and I may well switch us back to a more traditional
8 encoding if it doesn't work out
9 */
11 import "misc.idl", "dnsp.idl";
13 helper("librpc/ndr/ndr_dns.h"),
14 helpstring("DNS records"),
15 version(0.0),
16 uuid("a047c001-5f22-40b0-9d52-7042c43f711a")
18 interface dns
20 const int DNS_SERVICE_PORT = 53;
21 const int DNS_MAX_LABELS = 127;
22 const int DNS_MAX_DOMAIN_LENGTH = 253;
23 const int DNS_MAX_LABEL_LENGTH = 63;
25 typedef [public,bitmap16bit] bitmap {
26 DNS_RCODE = 0x001F,
27 DNS_FLAG_RECURSION_AVAIL = 0x0080,
28 DNS_FLAG_RECURSION_DESIRED = 0x0100,
29 DNS_FLAG_TRUNCATION = 0x0200,
30 DNS_FLAG_AUTHORITATIVE = 0x0400,
31 DNS_OPCODE = 0x7800,
32 DNS_FLAG_REPLY = 0x8000
33 } dns_operation;
35 /* the opcodes are in the operation field, masked with
36 DNS_OPCODE */
37 typedef [public] enum {
38 DNS_OPCODE_QUERY = (0x0<<11),
39 DNS_OPCODE_IQUERY = (0x1<<11),
40 DNS_OPCODE_STATUS = (0x2<<11),
41 DNS_OPCODE_UPDATE = (0x5<<11),
42 DNS_OPCODE_RELEASE = (0x6<<11),
43 DNS_OPCODE_WACK = (0x7<<11),
44 DNS_OPCODE_REFRESH = (0x8<<11),
45 DNS_OPCODE_REFRESH2 = (0x9<<11),
46 DNS_OPCODE_MULTI_HOME_REG = (0xf<<11)
47 } dns_opcode;
49 /* rcode values */
50 typedef [public] enum {
51 DNS_RCODE_OK = 0x00,
52 DNS_RCODE_FORMERR = 0x01,
53 DNS_RCODE_SERVFAIL = 0x02,
54 DNS_RCODE_NXDOMAIN = 0x03,
55 DNS_RCODE_NOTIMP = 0x04,
56 DNS_RCODE_REFUSED = 0x05,
57 DNS_RCODE_YXDOMAIN = 0x06,
58 DNS_RCODE_YXRRSET = 0x07,
59 DNS_RCODE_NXRRSET = 0x08,
60 DNS_RCODE_NOTAUTH = 0x09,
61 DNS_RCODE_NOTZONE = 0x0A,
62 DNS_RCODE_BADSIG = 0x10,
63 DNS_RCODE_BADKEY = 0x11,
64 DNS_RCODE_BADTIME = 0x12,
65 DNS_RCODE_BADMODE = 0x13,
66 DNS_RCODE_BADNAME = 0x14,
67 DNS_RCODE_BADALG = 0x15
68 } dns_rcode;
70 typedef [public,enum16bit] enum {
71 DNS_QCLASS_IN = 0x0001,
72 DNS_QCLASS_NONE = 0x00FE,
73 DNS_QCLASS_ANY = 0x00FF
74 } dns_qclass;
76 /* These vese values could have been merged with NBT_QTYPE values, but
77 DNS_QTYPE_SRV and NBT_QTYPE_STATUS have the same numeric value. */
78 typedef [public,enum16bit] enum {
79 DNS_QTYPE_ZERO = 0x0000,
80 DNS_QTYPE_A = 0x0001,
81 DNS_QTYPE_NS = 0x0002,
82 DNS_QTYPE_MD = 0x0003,
83 DNS_QTYPE_MF = 0x0004,
84 DNS_QTYPE_CNAME = 0x0005,
85 DNS_QTYPE_SOA = 0x0006,
86 DNS_QTYPE_MB = 0x0007,
87 DNS_QTYPE_MG = 0x0008,
88 DNS_QTYPE_MR = 0x0009,
89 DNS_QTYPE_NULL = 0x000A,
90 DNS_QTYPE_WKS = 0x000B,
91 DNS_QTYPE_PTR = 0x000C,
92 DNS_QTYPE_HINFO = 0x000D,
93 DNS_QTYPE_MINFO = 0x000E,
94 DNS_QTYPE_MX = 0x000F,
95 DNS_QTYPE_TXT = 0x0010,
96 DNS_QTYPE_RP = 0x0011,
97 DNS_QTYPE_AFSDB = 0x0012,
98 DNS_QTYPE_X25 = 0x0013,
99 DNS_QTYPE_ISDN = 0x0014,
100 DNS_QTYPE_RT = 0x0015,
101 DNS_QTYPE_SIG = 0x0018,
102 DNS_QTYPE_KEY = 0x0019,
103 DNS_QTYPE_AAAA = 0x001C,
104 DNS_QTYPE_LOC = 0x001D,
105 DNS_QTYPE_NXT = 0x001E,
106 DNS_QTYPE_NETBIOS= 0x0020,
107 DNS_QTYPE_SRV = 0x0021,
108 DNS_QTYPE_ATMA = 0x0022,
109 DNS_QTYPE_NAPTR = 0x0023,
110 DNS_QTYPE_CERT = 0x0025,
111 DNS_QTYPE_DNAME = 0x0027,
112 DNS_QTYPE_OPT = 0x0029,
113 DNS_QTYPE_DS = 0x002B,
114 DNS_QTYPE_SSHFP = 0x002C,
115 DNS_QTYPE_IPSECKEY = 0x002D,
116 DNS_QTYPE_RRSIG = 0x002E,
117 DNS_QTYPE_NSEC = 0x002F,
118 DNS_QTYPE_DNSKEY = 0x0030,
119 DNS_QTYPE_DHCID = 0x0031,
120 DNS_QTYPE_NSEC3 = 0x0032,
121 DNS_QTYPE_NSEC3PARAM = 0x0033,
122 DNS_QTYPE_TLSA = 0x0034,
123 DNS_QTYPE_CDS = 0x003B,
124 DNS_QTYPE_CDNSKEY = 0x003C,
125 DNS_QTYPE_SVCB = 0x0040,
126 DNS_QTYPE_HTTPS = 0x0041,
127 DNS_QTYPE_TKEY = 0x00F9,
128 DNS_QTYPE_TSIG = 0x00FA,
129 DNS_QTYPE_IXFR = 0x00FB,
130 DNS_QTYPE_AXFR = 0x00FC,
131 DNS_QTYPE_MAILB = 0x00FD,
132 DNS_QTYPE_MAILA = 0x00FE,
133 DNS_QTYPE_ALL = 0x00FF,
134 DNS_QTYPE_URI = 0x0100,
135 DNS_QTYPE_CAA = 0x0101
136 } dns_qtype;
138 typedef [public,enum16bit] enum {
139 DNS_TKEY_MODE_NULL = 0x0000,
140 DNS_TKEY_MODE_SERVER = 0x0001,
141 DNS_TKEY_MODE_DH = 0x0002,
142 DNS_TKEY_MODE_GSSAPI = 0x0003,
143 DNS_TKEY_MODE_CLIENT = 0x0004,
144 DNS_TKEY_MODE_DELETE = 0x0005,
145 DNS_TKEY_MODE_LAST = 0xFFFF
146 } dns_tkey_mode;
148 typedef [public] struct {
149 dns_string name;
150 dns_qtype question_type;
151 dns_qclass question_class;
152 } dns_name_question;
154 typedef [public] struct {
155 uint16 length;
156 uint8 data[length];
157 } dns_rdata_data;
159 typedef struct {
160 dns_string mname;
161 dns_string rname;
162 uint32 serial;
163 uint32 refresh;
164 uint32 retry;
165 uint32 expire;
166 uint32 minimum;
167 } dns_soa_record;
169 typedef [public] struct {
170 uint16 preference;
171 dns_string exchange;
172 } dns_mx_record;
174 typedef [public,nopull] struct {
175 dnsp_string_list txt;
176 } dns_txt_record;
178 typedef [public] struct {
179 dns_string mbox;
180 dns_string txt;
182 } dns_rp_record;
184 typedef [public] struct {
185 uint16 priority;
186 uint16 weight;
187 uint16 port;
188 dns_string target;
189 } dns_srv_record;
191 typedef [public] struct {
192 uint16 option_code;
193 uint16 option_length;
194 uint8 option_data[option_length];
195 } dns_opt_record;
197 typedef [flag(NDR_NO_COMP),public] struct {
198 dns_string algorithm;
199 uint32 inception;
200 uint32 expiration;
201 dns_tkey_mode mode;
202 uint16 error;
203 uint16 key_size;
204 uint8 key_data[key_size];
205 uint16 other_size;
206 uint8 other_data[other_size];
207 } dns_tkey_record;
209 typedef [flag(NDR_NO_COMP),public] struct {
210 dns_string algorithm_name;
211 uint16 time_prefix; /* 0 until February 2106*/
212 uint32 time;
213 uint16 fudge;
214 uint16 mac_size;
215 uint8 mac[mac_size];
216 uint16 original_id;
217 uint16 error;
218 uint16 other_size;
219 uint8 other_data[other_size];
220 } dns_tsig_record;
222 typedef [flag(NDR_NO_COMP|NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
223 dns_string name;
224 dns_qclass rr_class;
225 uint32 ttl;
226 dns_string algorithm_name;
227 uint16 time_prefix; /* 0 until February 2106*/
228 uint32 time;
229 uint16 fudge;
230 uint16 error;
231 uint16 other_size;
232 uint8 other_data[other_size];
233 } dns_fake_tsig_rec;
235 typedef [nodiscriminant,public,flag(NDR_NOALIGN)] union {
236 [case(DNS_QTYPE_A)] ipv4address ipv4_record;
237 [case(DNS_QTYPE_NS)] dns_string ns_record;
238 [case(DNS_QTYPE_CNAME)] dns_string cname_record;
239 [case(DNS_QTYPE_SOA)] dns_soa_record soa_record;
240 [case(DNS_QTYPE_PTR)] dns_string ptr_record;
241 [case(DNS_QTYPE_HINFO)] dnsp_hinfo hinfo_record;
242 [case(DNS_QTYPE_MX)] dns_mx_record mx_record;
243 [case(DNS_QTYPE_TXT)] dns_txt_record txt_record;
244 [case(DNS_QTYPE_RP)] dns_rp_record rp_record;
245 [case(DNS_QTYPE_AAAA)] ipv6address ipv6_record;
246 [case(DNS_QTYPE_SRV)] dns_srv_record srv_record;
247 [case(DNS_QTYPE_OPT)] dns_opt_record opt_record;
248 [case(DNS_QTYPE_TSIG)] dns_tsig_record tsig_record;
249 [case(DNS_QTYPE_TKEY)] dns_tkey_record tkey_record;
250 [default];
251 } dns_rdata;
253 typedef [flag(LIBNDR_PRINT_ARRAY_HEX|NDR_NOALIGN),nopush,nopull] struct {
254 dns_string name;
255 dns_qtype rr_type;
256 dns_qclass rr_class;
257 uint32 ttl;
258 uint16 length; /* Should be set to either UINT16_MAX or 0 */
259 [switch_is(rr_type)] dns_rdata rdata;
260 DATA_BLOB unexpected;
261 } dns_res_rec;
263 typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
264 uint16 id;
265 dns_operation operation;
266 uint16 qdcount;
267 uint16 ancount;
268 uint16 nscount;
269 uint16 arcount;
270 dns_name_question questions[qdcount];
271 dns_res_rec answers[ancount];
272 dns_res_rec nsrecs[nscount];
273 dns_res_rec additional[arcount];
274 } dns_name_packet;
277 this is a convenience hook for ndrdump
279 [nopython] void decode_dns_name_packet(
280 [in] dns_name_packet packet