@@ -16,6 +16,9 @@ import (
1616type DNSSummary struct {
1717 // dnscrypt, dns53, doh, odoh, dot, preset, fixed, etc.
1818 Type string
19+ // Flow ID that spawned this DNS query, if Origin is "tunnel".
20+ // Otherwise, it is randomly generated uint64 as hex.
21+ FID string
1922 // DNS Transport ID
2023 ID string
2124 // owner uid that sent this request. May be empty.
@@ -113,8 +116,8 @@ func (s *DNSSummary) String() string {
113116 if s == nil {
114117 return "<nil>"
115118 }
116- return fmt .Sprintf ("id: %s (%s by %s), t: %s, q: %s (do? %t), a: %s (cache? %t / ad? %t), code: %d, ttl: %d, by: %s / via: %s / relay: %s, status: %d, blocklists: %s / upstreamBlocks? %t, msg: %s, loc: %s" ,
117- s .ID , s .Type , s .Origin , core .FmtSecsFloat (s .Latency ), s .QName , s .DO , s .RData , s .Cached , s .AD , s .RCode , s .RTtl , s .Server , s .PID , s .RPID , s .Status , s .Blocklists , s .UpstreamBlocks , s .Msg , s .Region )
119+ return fmt .Sprintf ("id: %s (fid: %s / %s by %s), t: %s, q: %s (do? %t), a: %s (cache? %t / ad? %t), code: %d, ttl: %d, by: %s / via: %s / relay: %s, status: %d, blocklists: %s / upstreamBlocks? %t, msg: %s, loc: %s" ,
120+ s .ID , s .FID , s . Type , s .Origin , core .FmtSecsFloat (s .Latency ), s .QName , s .DO , s .RData , s .Cached , s .AD , s .RCode , s .RTtl , s .Server , s .PID , s .RPID , s .Status , s .Blocklists , s .UpstreamBlocks , s .Msg , s .Region )
118121}
119122
120123// DNSListener receives Summaries.
@@ -127,7 +130,7 @@ type DNSListener interface {
127130 // The listener may return DNSOpts to specify if another upstream should override that answer.
128131 // Another round of OnQuery is NOT called in this case, and OnResponse is called once after processing
129132 // DNSOpts returned by OnUpstreamAnswer if it has a non-empty TIDCSV (overriding the original TIDCSV).
130- OnUpstreamAnswer (smm * DNSSummary , forPref * DNSOpts , unmodifiedipcsv string ) * DNSOpts
133+ OnUpstreamAnswer (who string , smm * DNSSummary , forPref * DNSOpts , unmodifiedipcsv string ) * DNSOpts
131134 // OnResponse is called when a DNS response is received. May be called twice for the same query,
132135 // for instance, when different options are requested through OnUpstreamAnswer.
133136 OnResponse (* DNSSummary )
0 commit comments