]> git.ipfire.org Git - thirdparty/pdns.git/blame - pdns/dnsmessage.proto
Merge pull request #8223 from PowerDNS/omoerbeek-patch-1
[thirdparty/pdns.git] / pdns / dnsmessage.proto
CommitLineData
12471842
PL
1/*
2 * This file is part of PowerDNS or dnsdist.
3 * Copyright -- PowerDNS.COM B.V. and its contributors
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * In addition, for the avoidance of any doubt, permission is granted to
10 * link this program with OpenSSL and to (re)distribute the binaries
11 * produced as the result of such linking.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
2e14d4bb
RG
22syntax = "proto2";
23
d8c19b98
RG
24message PBDNSMessage {
25 enum Type {
26 DNSQueryType = 1;
27 DNSResponseType = 2;
4898a348
RG
28 DNSOutgoingQueryType = 3;
29 DNSIncomingResponseType = 4;
d8c19b98
RG
30 }
31 enum SocketFamily {
0caa1aa8
RG
32 INET = 1; // IPv4 (RFC 791)
33 INET6 = 2; // IPv6 (RFC 2460)
d8c19b98
RG
34 }
35 enum SocketProtocol {
0caa1aa8
RG
36 UDP = 1; // User Datagram Protocol (RFC 768)
37 TCP = 2; // Transmission Control Protocol (RFC 793)
d8c19b98 38 }
f3da83fe
RG
39 enum PolicyType {
40 UNKNOWN = 1; // No policy applied, or unknown type
41 QNAME = 2; // Policy matched on the QName
42 CLIENTIP = 3; // Policy matched on the client IP
43 RESPONSEIP = 4; // Policy matched on one of the IPs contained in the answer
44 NSDNAME = 5; // Policy matched on the name of one nameserver involved
45 NSIP = 6; // Policy matched on the IP of one nameserver involved
46 }
d8c19b98 47 required Type type = 1;
0caa1aa8 48 optional bytes messageId = 2; // UUID, shared by the query and the response
c165308b 49 optional bytes serverIdentity = 3; // ID of the server emitting the protobuf message
d8c19b98
RG
50 optional SocketFamily socketFamily = 4;
51 optional SocketProtocol socketProtocol = 5;
0caa1aa8
RG
52 optional bytes from = 6; // DNS requestor (client)
53 optional bytes to = 7; // DNS responder (server)
54 optional uint64 inBytes = 8; // Size of the query or response on the wire
55 optional uint32 timeSec = 9; // Time of message reception (seconds since epoch)
56 optional uint32 timeUsec = 10; // Time of message reception (additional micro-seconds)
57 optional uint32 id = 11; // ID of the query/response as found in the DNS header
d8c19b98
RG
58
59 message DNSQuestion {
60 optional string qName = 1;
61 optional uint32 qType = 2;
62 optional uint32 qClass = 3;
63 }
64 optional DNSQuestion question = 12;
65
66 message DNSResponse {
67 message DNSRR {
68 optional string name = 1;
69 optional uint32 type = 2;
70 optional uint32 class = 3;
71 optional uint32 ttl = 4;
72 optional bytes rdata = 5;
d6399006 73 optional bool udr = 6; // True if this is the first time this RR has been seen for this question
aa7929a3 74 }
57f8413e 75 optional uint32 rcode = 1; // DNS Response code, or 65536 for a network error including a timeout
d8c19b98 76 repeated DNSRR rrs = 2;
0caa1aa8
RG
77 optional string appliedPolicy = 3; // Filtering policy (RPZ or Lua) applied
78 repeated string tags = 4; // Additional tags
79 optional uint32 queryTimeSec = 5; // Time of the corresponding query reception (seconds since epoch)
80 optional uint32 queryTimeUsec = 6; // Time of the corresponding query reception (additional micro-seconds)
f3da83fe 81 optional PolicyType appliedPolicyType = 7; // Type of the filtering policy (RPZ or Lua) applied
d8c19b98
RG
82 }
83
84 optional DNSResponse response = 13;
0caa1aa8
RG
85 optional bytes originalRequestorSubnet = 14; // EDNS Client Subnet value
86 optional string requestorId = 15; // Username of the requestor
4898a348 87 optional bytes initialRequestId = 16; // UUID of the incoming query that initiated this outgoing query or incoming response
590388d2 88 optional bytes deviceId = 17; // Device ID of the requestor (could be mac address IP address or e.g. IMEI)
d6399006 89 optional bool newlyObservedDomain = 18; // True if the domain has not been seen before
0a6a45c8 90 optional string deviceName = 19; // Device name of the requestor
d8c19b98 91}