Skip to content

The checks ​

A diagnosis runs the checks of a mode, which is a bit set, and the mode is turned into a plan you can read before anything is probed.

The checks ​

the checkRustSwiftshared KotlinAndroidC
pingNetCheckType::PingCheck.pingCheck.Ping0MarsSdtCheckPing
dnsNetCheckType::DnsCheck.dnsCheck.Dns1MarsSdtCheckDns
dns against another server, to compare withNetCheckType::NewDnsCheck.newDnsCheck.NewDns2MarsSdtCheckNewDns
tcpNetCheckType::TcpCheck.tcpCheck.Tcp3MarsSdtCheckTcp
httpNetCheckType::HttpCheck.httpCheck.Http4MarsSdtCheckHttp
traceroute — planned, no probe asked for it yetNetCheckType::TracerouteCheck.tracerouteCheck.Traceroute—MarsSdtCheckTraceroute
the request's own buffer — sameNetCheckType::ReqBufCheck.reqBufCheck.ReqBuf—MarsSdtCheckReqBuf

The bits the mode is made of ​

the bitRustshared Kotlin, AndroidSwiftCwhat it puts in the plan
NET_CHECK_BASICNET_CHECK_BASICCheckMode.K_BASIC.basicNET_CHECK_BASICa ping and a dns check — the two the C++ starts with
NET_CHECK_LONGNET_CHECK_LONGK_LONG.longNET_CHECK_LONGa tcp check: a noop out to the long link's hosts
NET_CHECK_SHORTNET_CHECK_SHORTK_SHORT.shortNET_CHECK_SHORTan http check: the net-check CGI, and the short link's hosts

They OR together — NET_CHECK_BASIC | NET_CHECK_LONG is a run of three checks — and 0 is no checks at all, and no seam runs it: a mode with none of the three bits in it is refused everywhere — Rust and the shared Kotlin answer false, Android through the same call, the C ABI MARS_SDT_ERR_BAD_ARG. What an app gets for 0 is a start that did not happen and no report at all, and not an empty one. It is not "run everything", which is 1 | 2 | 4 — Mode.all in Swift.

Swift takes them as a set, mode: [.basic, .long], and Objective-C keeps the integer: mode: NET_CHECK_BASIC | NET_CHECK_LONG.

NET_CHECK_SHORT is the one that needs its hosts: that bit with a shortLink of nothing is a plan of an http check with nothing to check, and a run whose report says nothing about the short link.

Reading the plan first ​

whatRustSwiftshared Kotlin, AndroidC
the plan, in the order the checks will runsdt.plan()MarsSdt.planSdtLogic.plan()mars_sdt_plan

The shared Kotlin hands it back as Checks and Android as the integers themselves, and the integers of the plan are the detectType of every entry of the report — so one vocabulary names both.

Where to go next ​

  • The probes — what each check asks the app for, and what an answer is made of.
  • Getting started — the dependency and a whole diagnosis, on every platform that carries SDT.

MIT, like the upstream project.