Skip to main content

MapRequest

Struct MapRequest 

Source
pub struct MapRequest<'a> {
Show 18 fields pub version: CapabilityVersion, pub compress: &'a str, pub keep_alive: bool, pub node_key: NodePublicKey, pub disco_key: DiscoPublicKey, pub hardware_attestation_key: Option<Vec<u8>>, pub hardware_attestation_key_signature: Option<Vec<u8>>, pub hardware_attestation_key_signature_timestamp: Option<DateTime<Utc>>, pub stream: bool, pub host_info: Option<HostInfo<'a>>, pub map_session_handle: &'a str, pub map_session_seq: i64, pub endpoints: Vec<Endpoint>, pub tka_head: &'a str, pub read_only: Option<bool>, pub omit_peers: bool, pub debug_flags: Vec<&'a str>, pub connection_handle_for_test: &'a str,
}
Expand description

Sent by a Tailscale node to the control server to either update the control plane about its current state, or to start a long-poll of network map updates. Includes a copy of the node’s current set of WireGuard endpoints and general host information.

The request is JSON-encoded and sent to the control server via an HTTP POST to https://<control-server>/machine/map.

Fields§

§version: CapabilityVersion

The capability version of this Tailscale node. Incremented whenever the client code (in any client, Go/Rust/etc) changes enough that we want to signal to the control server that we’re capable of something different.

See the CapabilityVersion enum for info the changes introduced with each version.

§compress: &'a str

Either “zstd” to receive MapResponses compressed with zstd, or “” to receive MapResponses with no compression.

§keep_alive: bool

Whether the control server should periodically send application-level keep-alives back to this Tailscale node.

§node_key: NodePublicKey

The public key of this Tailscale node.

§disco_key: DiscoPublicKey

The public key this Tailscale node will use with the Disco protocol to establish direct connections with peer nodes in the Tailnet.

§hardware_attestation_key: Option<Vec<u8>>

If populated, the public key of the node’s hardware-backed identity attestation key.

§hardware_attestation_key_signature: Option<Vec<u8>>

If populated, the signature of “$UNIX_TIMESTAMP|$NODE_PUBLIC_KEY” as signed by the hardware attestation key.

§hardware_attestation_key_signature_timestamp: Option<DateTime<Utc>>

If populated, the time at which the MapRequest::hardware_attestation_key_signature was created.

§stream: bool

Whether or not this Tailscale node wants to receive multiple MapResponses over the same HTTP connection, referred to as “long-polling” or a “map poll”.

If false, the control server will send a single MapResponse and then close the connection. If true and MapRequest::version >= 68, the server will treat this as a read-only request and ignore MapRequest::host_info and any other fields that might be set.

§host_info: Option<HostInfo<'a>>

Current information about this Tailscale node’s host. Although it is always included in a MapRequest, a control server may choose to ignore it when MapRequest::stream is true and MapRequest::version >= 68.

§map_session_handle: &'a str

If non-empty, indicates a request to reattach to a previous map session after a previous map session was interrupted for whatever reason. Its value is an opaque string.

When set, the Tailscale node must also send MapRequest::map_session_seq to specify the last processed message in that prior session. The control server may choose to ignore the request for any reason and start a new map session. This is only applicable when MapRequest::stream is true.

§map_session_seq: i64

The sequence number in the map session (identified by MapRequest::map_session_handle that was most recently processed by this Tailscale node. It is only applicable when MapRequest::map_session_handle is specified. If the control server chooses to honor the MapRequest::map_session_handle request, only sequence numbers greater than this value will be returned.

§endpoints: Vec<Endpoint>

The client’s magicsock UDP ip:port endpoints (IPv4 or IPv6).

These can be ignored if stream is true and version >= 68.

§tka_head: &'a str

Describes the hash of the latest AUM applied to the local Tailnet Key Authority, if one is operating.

§read_only: Option<bool>
👎Deprecated:

do not use; must always be omitted/false

Deprecated. In the past, was set by Tailscale nodes when they wanted to fetch the full MapResponse from the control server without updating their MapRequest::endpoints. The intended use was for clients to discover the DERP map at start-up before their first real endpoint update.

This value must always be omitted or set to false as of MapRequest::version >= 68.

§omit_peers: bool

Whether the Tailscale node is okay with the MapResponse::peers list being omitted in the MapResponse. If true, the behavior of the control server varies based on the MapRequest::stream and MapRequest::read_only flags:

§debug_flags: Vec<&'a str>

A list of strings specifying debugging and development features to enable in handling this MapRequest. The values are deliberately unspecified, as they get added and removed all the time during development, and offer no compatibility promise. To roll out semantic changes, bump the CapabilityVersion instead.

Current valid values are:

  • "warn-ip-forwarding-off": node is trying to be a subnet router, but their IP forwarding is broken.
  • "warn-router-unhealthy": node’s subnet router implementation is having problems.
§connection_handle_for_test: &'a str

If non-empty, an opaque string sent by the Tailscale node that identifies this specific connection to the control server. The server may choose to use this handle to identify the connection for debugging or testing purposes. It has no semantic meaning.

Trait Implementations§

Source§

impl<'a> Clone for MapRequest<'a>

Source§

fn clone(&self) -> MapRequest<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for MapRequest<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for MapRequest<'a>

Source§

fn default() -> MapRequest<'a>

Returns the “default value” for a type. Read more
Source§

impl<'de: 'a, 'a> Deserialize<'de> for MapRequest<'a>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a> Serialize for MapRequest<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for MapRequest<'a>

§

impl<'a> RefUnwindSafe for MapRequest<'a>

§

impl<'a> Send for MapRequest<'a>

§

impl<'a> Sync for MapRequest<'a>

§

impl<'a> Unpin for MapRequest<'a>

§

impl<'a> UnsafeUnpin for MapRequest<'a>

§

impl<'a> UnwindSafe for MapRequest<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.