Expand description
§ts_control
Client for the Tailscale control plane.
Modules§
- tls
- Re-exported TLS types from the
tokio-rustls/ringstack used bycert/serve, so embedders can nameget_certificate/listen_tlsreturn types without taking their own directtokio-rustlsdependency (and risking a second, mismatched crypto provider).
Structs§
- Async
Control Client - A client to communicate with control.
- Config
- Configuration for the control server.
- Control
Dialer - Manages state for control dial plan and handles selection of successive dial candidates.
- DEFAULT_
CONTROL_ SERVER - The default
Urlof the control plane server (aka “coordination server”). - Derp
Region - A single derp
Region, holding the region info and all the server info. - Dial
Candidate - A candidate endpoint for a control plane connection.
- DnsConfig
- Owned DNS configuration distilled from the control MapResponse for the MagicDNS responder.
- DnsResolver
- An upstream DNS resolver to forward non-overlay queries to (Go
tailcfg.DNSResolver). - Endpoint
- An endpoint (address + port) on which a peer can be reached.
- Exit
Proxy Config - Transport-only description of an upstream proxy that exit-node egress is routed through, so a cloud exit node egresses via the proxy’s (e.g. residential) IP rather than its own origin IP.
- Extra
Record - A control-pushed static host record (Go
tailcfg.DNSConfig.ExtraRecords). MagicDNS answers these alongside tailnet peer names. OnlyA/AAAArecords are kept; other record types are dropped, since the responder only serves address records. - Funnel
Options - Options for a Funnel listener (mirrors
tsnet.FunnelOption). - Node
- A node in a tailnet.
- Peer
Change - An incremental update to a single already-known peer
Node, carried inMapResponse::peers_changed_patch. - Serve
Config - Configuration for terminating TLS on one tailnet port for one MagicDNS name.
- Serve
State - A complete multi-port Serve configuration for one node (mirrors upstream
ipn.ServeConfig’s per-portTCPmap). Stored on the device and reconciled into one accept loop per port by the Serve runtime;set_serve_configREPLACES the whole config (Go semantics). - SshAccept
- Details of an accepted SSH connection.
- SshAction
- The action taken when a rule matches. Mirrors
tailcfg.SSHAction. - SshConn
Identity - The identity of an incoming SSH connection, resolved from the connecting peer.
- SshPolicy
- An owned Tailscale SSH policy. Mirrors
tailcfg.SSHPolicy. - SshPrincipal
- A principal an
SshRulematches against. Mirrorstailcfg.SSHPrincipal. A principal matches ifanyis set, or any populated field matches the connection identity. - SshRule
- A single SSH policy rule. Mirrors
tailcfg.SSHRule. - Stable
Node Id - The stable ID of a node.
- State
Update - An update to the netmap state produced from a mapresponse.
- Tailnet
Address - Addresses for a node within a tailnet.
- TkaBootstrap
Request - Request body for
GET /machine/tka/bootstrap(Gotailcfg.TKABootstrapRequest): ask control for the genesis AUM needed to initialize TKA. - TkaBootstrap
Response - Response to
GET /machine/tka/bootstrap(Gotailcfg.TKABootstrapResponse): the genesis AUM (so the node can build its initialAuthority) and the disablement secret. - TkaStatus
- The control plane’s view of this tailnet’s Tailnet Lock state (Go
tailcfg.TKAInfo). - TkaSync
Offer Request - Request body for
GET /machine/tka/sync/offer(Gotailcfg.TKASyncOfferRequest): the node’s current chain head + a sparse ancestor sample, so control can compute what to send back. - TkaSync
Offer Response - Response to
GET /machine/tka/sync/offer(Gotailcfg.TKASyncOfferResponse): control’s own offer (its head + ancestors) plus the AUMs it computed the node is missing. - TkaSync
Send Request - Request body for
GET /machine/tka/sync/send(Gotailcfg.TKASyncSendRequest): the node’s (post-Inform) head plus the AUMs control is missing. - TkaSync
Send Response - Response to
GET /machine/tka/sync/send(Gotailcfg.TKASyncSendResponse): control’s resulting head after applying the node’s AUMs. - TunConfig
- Transport-only parameters for
TransportMode::Tun. - User
Profile - Display-friendly identity for the user that owns a
Node, resolved from the netmap’sUserProfilestable (Gotailcfg.UserProfile). Owned counterpart of the borrow-boundts_control_serde::UserProfile. Keyed byUserProfile::id(==Node::user_id).
Enums§
- Cert
Error - Errors from certificate acquisition / TLS material assembly.
- Dial
Mode - The mode with which to connect to the control plane.
- Dial
Plan - A plan to connect to the control plane, supplied as part of a netmap update.
- Endpoint
Type - Distinguishes different sources of
MapRequest::endpointsvalues. - Error
- An error which occurred while connecting to the control server or control plane.
- Exit
Node Selector - How this node selects which peer to use as its exit node (
--exit-nodein the Go client). - Exit
Proxy Scheme - Upstream-proxy wire protocol for
ExitProxyConfig. Mirrorsts_forwarder::ProxyScheme; kept as a separate type here becausets_controlmust not depend onts_forwarder(the runtime converts between them at the boundary). - Funnel
Error - Why a Funnel listen request was denied or could not be served.
- IdToken
Error - Errors from an ID-token request.
- Internal
Error Kind - What kind of internal error has occurred.
- Logout
Error - Errors from a logout request.
- Logout
Internal Error Kind - The internal failure kinds a logout request can surface.
- Operation
- The phase of connecting the control plane to a Tailnet in which an error occurs.
- Peer
Update - An update to the peers recorded in the netmap.
- Resolver
Transport - The transport of a
Resolver. Only plaintext UDP is forwarded today; encrypted transports are dropped at parse time (seeResolver::from_serde). - Serve
Target - What to do with a stream once TLS is terminated (or, for
ServeTarget::TcpForward, a raw TCP stream with no TLS). - Service
Error - Why a VIP-service listen request was refused. Fail-closed by construction: there is no variant that yields a usable listen address without a genuine control-assigned VIP on a tagged host.
- Service
Mode - How a VIP service terminates incoming connections (a scoped mirror of tsnet’s
ServiceMode). - SetDns
Error - Errors from a set-dns request.
- SetDns
Internal Error Kind - The internal failure kinds a set-dns request can surface.
- SshDecision
- The outcome of evaluating an
SshPolicyagainst a connection. - SshDeny
Reason - Why a connection was denied. Mirrors Go’s
rejected/rejectedUserresults plus an explicit reject action. - TkaSync
Error - Errors from a TKA-sync RPC.
- TkaSync
Internal Error Kind - The internal failure kinds a TKA-sync request can surface (kept coarse for the public surface).
- Transport
Mode - How the node’s application overlay data path is realized.
Constants§
- DEFAULT_
PERSISTENT_ KEEPALIVE - Default WireGuard persistent-keepalive interval: 25s.
- MISSING_
CERT_ RPC - Names exactly what this fork is missing to issue a real cert, surfaced
verbatim in
CertError::Unimplementedso the gap is self-documenting at runtime. There is no controlcert/<domain>RPC in real Tailscale — the node is the ACME client and only needs control to publish the DNS-01 TXT viaPOST /machine/set-dns(which a self-hosted control plane typically 501s). See the module docs. - MISSING_
FUNNEL_ RELAY - Names what is needed to actually receive public Funnel ingress on a node whose client-side
listener is up. This is Tailscale infrastructure, not buildable in this fork: the public DNS
<node>.<tailnet>.ts.net:443→ relay mapping plus the ingress relay itself (a Tailscale-operated tailnet peer that POSTs the public client’s bytes to this node’s peerAPI/v0/ingress). Against real Tailscale SaaS (with a Funnel-enabled ACL) control stands these up automatically andlisten_funnel’s listener serves real public traffic; against a self-hosted control plane no relay exists, so the listener is correct but never fed. Surfaced verbatim inFunnelError::Unsupportedfor callers that want to flag the relay gap.
Statics§
Traits§
- TcpDialer
- Creates a TCP connection on the basis of a specific
DialCandidate.
Functions§
- accept_
tls - Terminate TLS on a single already-accepted overlay stream.
- certified_
key_ from_ pem - Assemble a
CertifiedKeyfrom a PEM chain + PEM private key, using the ring crypto provider’s signing-key loader (matching the rest of the TLS stack —ts_tls_utilistokio-rustls/ring). This is the assembly helper a future real issuance path (or a test) feeds the control-returned chain into. - complete_
connection - Complete a connection to control over the supplied I/O
stream. - convert_
derp_ map - Convert a derp map from the
ts_control_serderepresentation to thets_derprepresentation. - fetch_
id_ token - Request an OIDC ID token for this node from control, scoped to
audience(theaudclaim of the returned JWT). Opens a fresh Noise channel and POSTs to/machine/id-token. Returns the signed JWT string on success. - funnel_
access - Check whether
nodemay funnel onport, mirroring Go’sipn.NodeCanFunnel+ipn.CheckFunnelPortgate. Pure and fail-closed: a missing attribute or out-of-range port denies. This is the access decision; it does not build a listener. - get_
certificate - Obtain a
CertifiedKeyfor a node’s MagicDNSname. - is_
tailnet_ name - Returns
trueifnamelooks like a tailnet MagicDNS name we may serve a cert for. We only ever mint/serve certs for tailnet names — never arbitrary public hostnames — to avoid being turned into a cert oracle for off-tailnet origins. - is_
tailscale_ ip - Whether
addrfalls in a range Tailscale assigns to nodes: the CGNAT range for IPv4 (100.64.0.0/10, excluding the ChromeOS VM carve-out100.115.92.0/23) and the Tailscale ULA for IPv6 (fd7a:115c:a1e0::/48). - listen_
funnel - Build a
TlsAcceptorterminating public Funnel ingress forcfg.nameoncfg.port(liketsnet’sListenFunnel). - listen_
tls - Obtain a certificate for
cfg.nameand build aTlsAcceptorfor it. - logout
- Log this node out of the tailnet: deregister it by expiring its current node key.
- resolve_
service_ listen - Resolve the overlay
core::net::SocketAddra node should bind to host VIP servicenameinmode, enforcing the three fail-closed preconditions (valid name, tagged host, control-assigned VIP). See the module docs. - services_
hash - Compute the
HostInfo.ServicesHashfor a node’s advertised VIP services, mirroring Go’svipServiceHash. - set_dns
- Publish a DNS record for this node via control (
POST /machine/set-dns). - tka_
bootstrap - Fetch the TKA bootstrap (genesis AUM) from control: the entry point that gives a node with no
chain yet the initial AUM to build its
Authorityfrom, before the offer/send catch-up (GotkaFetchBootstrap).headis the node’s current known head (empty when it has none). Fresh Noise channel, bounded by [TKA_SYNC_TIMEOUT]. - tka_
sync_ offer - Send a TKA
sync/offerto control: our chainoffer, returning control’s response (its own offer + the AUMs we are missing). Opens a fresh Noise channel, bounded by [TKA_SYNC_TIMEOUT]. - tka_
sync_ send - Send a TKA
sync/sendto control: our (post-Inform)sendrequest with the AUMs control is missing, returning control’s resulting head. Fresh Noise channel, bounded by [TKA_SYNC_TIMEOUT]. - tls_
acceptor - Build a
TlsAcceptorfor an already-obtainedCertifiedKey. - validate_
service_ name - Validate a Tailscale VIP service name (
tailcfg.ServiceName.Validate): it must carry thesvc:prefix (ts_control_serde::SERVICE_NAME_PREFIX) followed by a valid DNS label (1–63 chars, ASCII alphanumeric or-, not starting/ending with-). Returns the bare label on success. Fail-closed: anything malformed is rejected so a listener can never bind for a bogus service name.
Type Aliases§
- DerpMap
- The full derp state, a map of
ts_derp::RegionIds toRegions. - Filter
Update - The components of a packet filter update.
- Node
CapMap - An owned node-capability map (
Node.CapMapin Go:map[NodeCapability][]RawMessage). - NodeId
- The unique id of a node.
- UserId
- A unique integer ID for a
User.