]>
Commit | Line | Data |
---|---|---|
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 |
22 | syntax = "proto2"; |
23 | ||
d8c19b98 RG |
24 | message 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 RG |
48 | optional bytes messageId = 2; // UUID, shared by the query and the response |
49 | optional bytes serverIdentity = 3; // UUID 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; | |
aa7929a3 | 73 | } |
d8c19b98 RG |
74 | optional uint32 rcode = 1; |
75 | repeated DNSRR rrs = 2; | |
0caa1aa8 RG |
76 | optional string appliedPolicy = 3; // Filtering policy (RPZ or Lua) applied |
77 | repeated string tags = 4; // Additional tags | |
78 | optional uint32 queryTimeSec = 5; // Time of the corresponding query reception (seconds since epoch) | |
79 | optional uint32 queryTimeUsec = 6; // Time of the corresponding query reception (additional micro-seconds) | |
f3da83fe | 80 | optional PolicyType appliedPolicyType = 7; // Type of the filtering policy (RPZ or Lua) applied |
d8c19b98 RG |
81 | } |
82 | ||
83 | optional DNSResponse response = 13; | |
0caa1aa8 RG |
84 | optional bytes originalRequestorSubnet = 14; // EDNS Client Subnet value |
85 | optional string requestorId = 15; // Username of the requestor | |
4898a348 | 86 | optional bytes initialRequestId = 16; // UUID of the incoming query that initiated this outgoing query or incoming response |
590388d2 | 87 | optional bytes deviceId = 17; // Device ID of the requestor (could be mac address IP address or e.g. IMEI) |
d8c19b98 | 88 | } |