]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
dnstap: represent DoT and DoH
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 4 Jan 2021 15:28:52 +0000 (16:28 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Tue, 12 Jan 2021 10:55:03 +0000 (11:55 +0100)
(instead of marking them as TCP)
This includes latest dnstap.proto, except for keeping our local changes
of the licensing comment.
https://github.com/dnstap/dnstap.pb/blob/master/dnstap.proto

modules/dnstap/dnstap.c
modules/dnstap/dnstap.proto
modules/dnstap/meson.build

index 7a12e3a584f409c92c59eee31ed5bb20180f855f..d32f02a5316024ec6ed90af0ce90eb38f369d236 100644 (file)
@@ -126,7 +126,11 @@ static int dnstap_log(kr_layer_t *ctx, enum dnstap_log_phase phase) {
        }
 
        if (req->qsource.dst_addr) {
-               if (req->qsource.flags.tcp) {
+               if (req->qsource.flags.http) {
+                       m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__DOH;
+               } else if (req->qsource.flags.tls) {
+                       m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__DOT;
+               } else if (req->qsource.flags.tcp) {
                        m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__TCP;
                } else {
                        m.socket_protocol = DNSTAP__SOCKET_PROTOCOL__UDP;
index 301c32edc58dca2cc3f2610ec05feefe75300b03..f2b72738ee9e9391d1f043226afde4b6cae2e3e8 100644 (file)
@@ -49,11 +49,12 @@ enum SocketFamily {
     INET6 = 2;  // IPv6 (RFC 2460)
 }
 
-// SocketProtocol: the transport protocol of a socket. This specifies how to
-// interpret "transport port" fields.
+// SocketProtocol: the protocol used to transport a DNS message.
 enum SocketProtocol {
-    UDP = 1;    // User Datagram Protocol (RFC 768)
-    TCP = 2;    // Transmission Control Protocol (RFC 793)
+    UDP = 1;    // DNS over UDP transport (RFC 1035 section 4.2.1)
+    TCP = 2;    // DNS over TCP transport (RFC 1035 section 4.2.2)
+    DOT = 3;    // DNS over TLS (RFC 7858)
+    DOH = 4;    // DNS over HTTPS (RFC 8484)
 }
 
 // Message: a wire-format (RFC 1035 section 4) DNS message and associated
@@ -159,6 +160,16 @@ message Message {
         // TOOL_RESPONSE is a DNS response message received by a DNS software
         // tool from a DNS server, from the perspective of the tool.
         TOOL_RESPONSE = 12;
+
+        // UPDATE_QUERY is a DNS update query message received from a resolver
+        // by an authoritative name server, from the perspective of the
+        // authoritative name server.
+        UPDATE_QUERY = 13;
+
+        // UPDATE_RESPONSE is a DNS update response message sent from an
+        // authoritative name server to a resolver, from the perspective of the
+        // authoritative name server.
+        UPDATE_RESPONSE = 14;
     }
 
     // One of the Type values described above.
index bca503330c9a8c04fd555ed2a1bfcd792cccdd09..7bf73b7c89e6ee0defbea6269ccd567727d3ff51 100644 (file)
@@ -32,6 +32,7 @@ if build_dnstap
       '--proto_path', meson.current_source_dir(),
       meson.current_source_dir() / 'dnstap.proto',
     ],
+    input: [ 'dnstap.proto' ],
     output: [
       'dnstap.pb-c.h',
       'dnstap.pb-c.c',