Documentation
¶
Index ¶
- func Creds(cs []plugin.UserCred) string
- func Relay(r plugin.RelayForward) string
- func Spec(s plugin.InboundSpec) string
- func State(in []Inbound) string
- func StateRelays(in []Inbound, warp *plugin.WarpSpec, relays []plugin.RelayForward) string
- func StateWarp(in []Inbound, warp *plugin.WarpSpec) string
- func Warp(w plugin.WarpSpec) string
- type Inbound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 StateRelays ¶ added in v0.1.65
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 ¶
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).