statehash

package
v0.1.80-dev.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Creds

func Creds(cs []plugin.UserCred) string

func Relay added in v0.1.65

func Relay(r plugin.RelayForward) string

Relay is the hash line of one forward: "relay" + "\x1f" + join("\x1f", id, network, port, to_host, to_port). It has six fields, so it can never be mistaken for an inbound line (three) or the warp line (two).

func Spec

func Spec(s plugin.InboundSpec) string

Spec hashes the fields listed in agent.proto. settings_json is hashed as the exact bytes received. Tunnel (L3 protocols) is appended only when it is set, so the hash of every spec without one is exactly what it was before Tunnel existed.

func State

func State(in []Inbound) string

func StateRelays added in v0.1.65

func StateRelays(in []Inbound, warp *plugin.WarpSpec, relays []plugin.RelayForward) string

StateRelays is StateWarp plus the forwarded ports: one Relay line each, sorted among themselves, after the warp line. An empty list adds nothing, so the result is StateWarp(in, warp) byte for byte, and a delta that clears the list and a full state without one hash alike.

func StateWarp

func StateWarp(in []Inbound, warp *plugin.WarpSpec) string

StateWarp is State plus the node-level WARP configuration. With warp == nil the result is State(in) byte for byte; otherwise one extra line "warp" + "\x1f" + Warp(*warp) follows the sorted inbound lines (it is never sorted among them: an inbound line has three fields, this one has two).

func Warp

func Warp(w plugin.WarpSpec) string

Warp hashes the node-level WARP configuration (agent.proto, STATE HASH). Ports are joined by ",", reserved is lowercase hex; every other field is hashed as it stands.

Types

type Inbound

type Inbound struct {
	Spec  plugin.InboundSpec
	Creds []plugin.UserCred
}

Inbound is one inbound as a node holds it (also what Engine.Observed returns).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL