Guest User

Untitled

a guest
Mar 17th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.11 KB | None | 0 0
  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. */
  22. syntax = "proto3";
  23.  
  24. message PBDNSMessage {
  25. enum Type {
  26. Dummy = 0;
  27. DNSQueryType = 1;
  28. DNSResponseType = 2;
  29. DNSOutgoingQueryType = 3;
  30. DNSIncomingResponseType = 4;
  31. }
  32. enum SocketFamily {
  33. Dummy1 = 0;
  34. INET = 1; // IPv4 (RFC 791)
  35. INET6 = 2; // IPv6 (RFC 2460)
  36. }
  37. enum SocketProtocol {
  38. Dummy2 = 0;
  39. UDP = 1; // User Datagram Protocol (RFC 768)
  40. TCP = 2; // Transmission Control Protocol (RFC 793)
  41. }
  42. enum PolicyType {
  43. Dummy3 = 0;
  44. UNKNOWN = 1; // No policy applied, or unknown type
  45. QNAME = 2; // Policy matched on the QName
  46. CLIENTIP = 3; // Policy matched on the client IP
  47. RESPONSEIP = 4; // Policy matched on one of the IPs contained in the answer
  48. NSDNAME = 5; // Policy matched on the name of one nameserver involved
  49. NSIP = 6; // Policy matched on the IP of one nameserver involved
  50. }
  51. Type type = 1;
  52. bytes messageId = 2; // UUID, shared by the query and the response
  53. bytes serverIdentity = 3; // UUID of the server emitting the protobuf message
  54. SocketFamily socketFamily = 4;
  55. SocketProtocol socketProtocol = 5;
  56. bytes from = 6; // DNS requestor (client)
  57. bytes to = 7; // DNS responder (server)
  58. uint64 inBytes = 8; // Size of the query or response on the wire
  59. uint32 timeSec = 9; // Time of message reception (seconds since epoch)
  60. uint32 timeUsec = 10; // Time of message reception (additional micro-seconds)
  61. uint32 id = 11; // ID of the query/response as found in the DNS header
  62.  
  63. message DNSQuestion {
  64. string qName = 1;
  65. uint32 qType = 2;
  66. uint32 qClass = 3;
  67. }
  68. DNSQuestion question = 12;
  69.  
  70. message DNSResponse {
  71. message DNSRR {
  72. string name = 1;
  73. uint32 type = 2;
  74. uint32 class = 3;
  75. uint32 ttl = 4;
  76. bytes rdata = 5;
  77. }
  78. uint32 rcode = 1;
  79. repeated DNSRR rrs = 2;
  80. string appliedPolicy = 3; // Filtering policy (RPZ or Lua) applied
  81. repeated string tags = 4; // Additional tags
  82. uint32 queryTimeSec = 5; // Time of the corresponding query reception (seconds since epoch)
  83. uint32 queryTimeUsec = 6; // Time of the corresponding query reception (additional micro-seconds)
  84. PolicyType appliedPolicyType = 7; // Type of the filtering policy (RPZ or Lua) applied
  85. }
  86.  
  87. DNSResponse response = 13;
  88. bytes originalRequestorSubnet = 14; // EDNS Client Subnet value
  89. string requestorId = 15; // Username of the requestor
  90. bytes initialRequestId = 16; // UUID of the incoming query that initiated this outgoing query or incoming response
  91. bytes deviceId = 17; // Device ID of the requestor (could be mac address IP address or e.g. IMEI)
  92. }
Add Comment
Please, Sign In to add comment