feat: dnsping using step-by-step (#831)

Reference issue for this pull request: https://github.com/ooni/probe/issues/2159

This diff refactors the `dnsping` experiment to use the [step-by-step measurement style](https://github.com/ooni/probe-cli/blob/master/docs/design/dd-003-step-by-step.md).

Co-authored-by: decfox <decfox@github.com>
Co-authored-by: Simone Basso <bassosimone@gmail.com>
This commit is contained in:
DecFox 2022-07-08 23:12:24 +05:30 committed by GitHub
commit 5501b2201a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 747 additions and 77 deletions

View file

@ -303,6 +303,28 @@ type Trace interface {
// can use functionality exported by the ./internal/testingx pkg.
TimeNow() time.Time
// OnDNSRoundTripForLookupHost is used with a DNSTransport and called
// when the RoundTrip terminates.
//
// Arguments:
//
// - started is when we called transport.RoundTrip
//
// - reso is the parent resolver for the trace;
//
// - query is the non-nil DNS query we use for the RoundTrip
//
// - response is a valid DNS response, obtained after the RoundTrip;
//
// - addrs is the list of addresses obtained after the RoundTrip, which
// is empty if the RoundTrip failed
//
// - err is the result of DNSLookup; either an error or nil
//
// - finished is the time right after the RoundTrip
OnDNSRoundTripForLookupHost(started time.Time, reso Resolver, query DNSQuery,
response DNSResponse, addrs []string, err error, finished time.Time)
// OnConnectDone is called when connect terminates.
//
// Arguments: