Documentation
¶
Overview ¶
Package msgcontrol contains types, constants, and interfaces related to control messages.
Control message interface definitions are sealed within this package.
Index ¶
- type ClientHello
- type ControlMessage
- type ControlMessageType
- type Disconnect
- type EndpointUpdate
- type HomeRelayUpdate
- type Logon
- type LogonAccept
- type LogonAuthenticate
- type LogonDeviceKey
- type LogonReject
- type Logout
- type PeerAddition
- type PeerRemove
- type PeerUpdate
- type Ping
- type Pong
- type Properties
- type RelayUpdate
- type RetryStrategyType
- type ServerHello
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientHello ¶
type ClientHello struct {
ClientNodePub key.NodePublic
}
func (*ClientHello) CMsgType ¶
func (c *ClientHello) CMsgType() ControlMessageType
type ControlMessage ¶
type ControlMessage interface {
CMsgType() ControlMessageType
}
type ControlMessageType ¶
type ControlMessageType byte
const ( ClientHelloType ControlMessageType = iota ServerHelloType LogonType LogonAuthenticateType LogonDeviceKeyType LogonAcceptType LogonRejectType PingType PongType )
const ( EndpointUpdateType ControlMessageType = (1 << 8) - (iota + 1) HomeRelayUpdateType PeerAdditionType PeerUpdateType PeerRemoveType RelayUpdateType LogoutType DisconnectType )
type Disconnect ¶
type Disconnect struct { Reason string RetryStrategy RetryStrategyType `json:",omitempty"` RetryAfter time.Duration `json:",omitempty"` }
-> client
func (*Disconnect) CMsgType ¶
func (c *Disconnect) CMsgType() ControlMessageType
type EndpointUpdate ¶
-> control
func (*EndpointUpdate) CMsgType ¶
func (c *EndpointUpdate) CMsgType() ControlMessageType
type HomeRelayUpdate ¶
type HomeRelayUpdate struct {
HomeRelay int64
}
-> control
func (*HomeRelayUpdate) CMsgType ¶
func (c *HomeRelayUpdate) CMsgType() ControlMessageType
type Logon ¶
type Logon struct { SessKey key.SessionPublic // check data encrypted with sharedkey (control pub x nodekey priv) NodeKeyAttestation []byte // check data encrypted with sharedkey (control pub x sesskey priv) SessKeyAttestation []byte ResumeSessionID *string `json:",omitempty"` }
func (*Logon) CMsgType ¶
func (c *Logon) CMsgType() ControlMessageType
type LogonAccept ¶
func (*LogonAccept) CMsgType ¶
func (c *LogonAccept) CMsgType() ControlMessageType
type LogonAuthenticate ¶
type LogonAuthenticate struct {
AuthenticateURL string
}
func (*LogonAuthenticate) CMsgType ¶
func (c *LogonAuthenticate) CMsgType() ControlMessageType
type LogonDeviceKey ¶
type LogonDeviceKey struct {
DeviceKey string
}
func (*LogonDeviceKey) CMsgType ¶
func (c *LogonDeviceKey) CMsgType() ControlMessageType
type LogonReject ¶
type LogonReject struct { Reason string RetryStrategy RetryStrategyType `json:",omitempty"` RetryAfter time.Duration `json:",omitempty"` }
func (*LogonReject) CMsgType ¶
func (c *LogonReject) CMsgType() ControlMessageType
type Logout ¶
type Logout struct{}
-> control
func (*Logout) CMsgType ¶
func (c *Logout) CMsgType() ControlMessageType
type PeerAddition ¶
type PeerAddition struct { PubKey key.NodePublic SessKey key.SessionPublic IPv4 netip.Addr IPv6 netip.Addr Endpoints []netip.AddrPort HomeRelay int64 Properties Properties }
-> client
func (*PeerAddition) CMsgType ¶
func (c *PeerAddition) CMsgType() ControlMessageType
type PeerRemove ¶
type PeerRemove struct {
PubKey key.NodePublic
}
-> client
func (*PeerRemove) CMsgType ¶
func (c *PeerRemove) CMsgType() ControlMessageType
type PeerUpdate ¶
type PeerUpdate struct { PubKey key.NodePublic SessKey *key.SessionPublic `json:",omitempty"` Endpoints []netip.AddrPort `json:",omitempty"` HomeRelay *int64 `json:",omitempty"` Properties *Properties `json:",omitempty"` }
-> client
func (*PeerUpdate) CMsgType ¶
func (c *PeerUpdate) CMsgType() ControlMessageType
type Ping ¶
type Ping struct { // random data encrypted with shared key (control priv x client pub) // to be signed with shared key of nodekey and sesskey CheckData []byte }
func (*Ping) CMsgType ¶
func (c *Ping) CMsgType() ControlMessageType
type Pong ¶
type Pong struct { // check data encrypted with sharedkey (control pub x nodekey priv) NodeKeyAttestation []byte // check data encrypted with sharedkey (control pub x sesskey priv) SessKeyAttestation []byte }
func (*Pong) CMsgType ¶
func (c *Pong) CMsgType() ControlMessageType
type Properties ¶
type RelayUpdate ¶
type RelayUpdate struct {
Relays []relay.Information
}
-> client
func (*RelayUpdate) CMsgType ¶
func (c *RelayUpdate) CMsgType() ControlMessageType
type RetryStrategyType ¶
type RetryStrategyType byte
const ( // Cannot retry, abort NoRetryStrategy RetryStrategyType = iota // Regenerate session Key RegenerateSessionKey // Retry without session ID RecreateSession )
func (RetryStrategyType) Error ¶
func (r RetryStrategyType) Error() string
type ServerHello ¶
type ServerHello struct { ControlNodePub key.ControlPublic // random data encrypted with shared key (control priv x client pub) // to be signed with shared key of nodekey and sesskey CheckData []byte }
func (*ServerHello) CMsgType ¶
func (c *ServerHello) CMsgType() ControlMessageType
Click to show internal directories.
Click to hide internal directories.