statehash

package
v0.1.90-dev.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 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 BridgeDial

func BridgeDial(d plugin.BridgeDial) string

BridgeDial is the hash line of one entry an exit calls: "bridge_dial" + "�" + join("�", entry_node_id, host, port, sni, pin_sha256, path, pool, panel_via, join(",", targets as relay_id:network:port, sorted)).

func BridgeServe

func BridgeServe(b plugin.BridgeServe) string

BridgeServe is the hash line of the entry side of the bridge: "bridge_serve" + "�" + join("�", port, path, join(",", sorted exit_node_ids), panel_via).

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).

A reverse-relay forward (a mode other than "" and "dnat", or an exit_node_id) adds two fields, mode and exit_node_id, so the line of a plain forward is what it was before the bridge existed; a mode of "dnat" counts as "".

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 StateBridge

func StateBridge(in []Inbound, warp *plugin.WarpSpec, relays []plugin.RelayForward, serve *plugin.BridgeServe, dials []plugin.BridgeDial) string

StateBridge is StateRelays plus the bridge of the reverse relays: the bridge_serve line (only when serve is set and not empty), then one bridge_dial line per dial, sorted among themselves, after the relay lines. A nil or empty serve and no dials add nothing, so the result is StateRelays(in, warp, relays) byte for byte.

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