Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * This file is part of PowerDNS or dnsdist.
- * Copyright -- PowerDNS.COM B.V. and its contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
- *
- * In addition, for the avoidance of any doubt, permission is granted to
- * link this program with OpenSSL and to (re)distribute the binaries
- * produced as the result of such linking.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
- syntax = "proto3";
- message PBDNSMessage {
- enum Type {
- Dummy = 0;
- DNSQueryType = 1;
- DNSResponseType = 2;
- DNSOutgoingQueryType = 3;
- DNSIncomingResponseType = 4;
- }
- enum SocketFamily {
- Dummy1 = 0;
- INET = 1; // IPv4 (RFC 791)
- INET6 = 2; // IPv6 (RFC 2460)
- }
- enum SocketProtocol {
- Dummy2 = 0;
- UDP = 1; // User Datagram Protocol (RFC 768)
- TCP = 2; // Transmission Control Protocol (RFC 793)
- }
- enum PolicyType {
- Dummy3 = 0;
- UNKNOWN = 1; // No policy applied, or unknown type
- QNAME = 2; // Policy matched on the QName
- CLIENTIP = 3; // Policy matched on the client IP
- RESPONSEIP = 4; // Policy matched on one of the IPs contained in the answer
- NSDNAME = 5; // Policy matched on the name of one nameserver involved
- NSIP = 6; // Policy matched on the IP of one nameserver involved
- }
- Type type = 1;
- bytes messageId = 2; // UUID, shared by the query and the response
- bytes serverIdentity = 3; // UUID of the server emitting the protobuf message
- SocketFamily socketFamily = 4;
- SocketProtocol socketProtocol = 5;
- bytes from = 6; // DNS requestor (client)
- bytes to = 7; // DNS responder (server)
- uint64 inBytes = 8; // Size of the query or response on the wire
- uint32 timeSec = 9; // Time of message reception (seconds since epoch)
- uint32 timeUsec = 10; // Time of message reception (additional micro-seconds)
- uint32 id = 11; // ID of the query/response as found in the DNS header
- message DNSQuestion {
- string qName = 1;
- uint32 qType = 2;
- uint32 qClass = 3;
- }
- DNSQuestion question = 12;
- message DNSResponse {
- message DNSRR {
- string name = 1;
- uint32 type = 2;
- uint32 class = 3;
- uint32 ttl = 4;
- bytes rdata = 5;
- }
- uint32 rcode = 1;
- repeated DNSRR rrs = 2;
- string appliedPolicy = 3; // Filtering policy (RPZ or Lua) applied
- repeated string tags = 4; // Additional tags
- uint32 queryTimeSec = 5; // Time of the corresponding query reception (seconds since epoch)
- uint32 queryTimeUsec = 6; // Time of the corresponding query reception (additional micro-seconds)
- PolicyType appliedPolicyType = 7; // Type of the filtering policy (RPZ or Lua) applied
- }
- DNSResponse response = 13;
- bytes originalRequestorSubnet = 14; // EDNS Client Subnet value
- string requestorId = 15; // Username of the requestor
- bytes initialRequestId = 16; // UUID of the incoming query that initiated this outgoing query or incoming response
- bytes deviceId = 17; // Device ID of the requestor (could be mac address IP address or e.g. IMEI)
- }
Add Comment
Please, Sign In to add comment