messages

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package messages provides native Go structs for Mumble protocol messages. Field layout and wire encoding match the Mumble spec for client compatibility. See docs/protocol/control-messages.md.

Index

Constants

View Source
const (
	UserStateSetSession        uint32 = 1 << 0
	UserStateSetActor          uint32 = 1 << 1
	UserStateSetName           uint32 = 1 << 2
	UserStateSetUserID         uint32 = 1 << 3
	UserStateSetChannelID      uint32 = 1 << 4
	UserStateSetMute           uint32 = 1 << 5
	UserStateSetDeaf           uint32 = 1 << 6
	UserStateSetSuppress       uint32 = 1 << 7
	UserStateSetSelfMute       uint32 = 1 << 8
	UserStateSetSelfDeaf       uint32 = 1 << 9
	UserStateSetTexture        uint32 = 1 << 10
	UserStateSetPluginContext  uint32 = 1 << 11
	UserStateSetPluginIdentity uint32 = 1 << 12
	UserStateSetComment        uint32 = 1 << 13
)

UserState field presence bits (which fields were present in the wire data).

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	ChannelID   uint32
	InheritACLs bool
	Query       bool
}

ACL (type 13) - minimal for handlers to receive.

func (*ACL) Marshal

func (m *ACL) Marshal() ([]byte, error)

func (*ACL) Unmarshal

func (m *ACL) Unmarshal(data []byte) error

type Authenticate

type Authenticate struct {
	Username     string
	Password     string
	Tokens       []string
	CeltVersions []int32
	Opus         bool
	ClientType   int32
}

Authenticate (type 2).

func (*Authenticate) Marshal

func (m *Authenticate) Marshal() ([]byte, error)

func (*Authenticate) Unmarshal

func (m *Authenticate) Unmarshal(data []byte) error

type BanEntry

type BanEntry struct {
	Address  []byte
	Mask     uint32
	Name     string
	Hash     string
	Reason   string
	Start    string
	Duration uint32
}

BanEntry (embedded in BanList).

type BanList

type BanList struct {
	Bans  []BanEntry
	Query bool
}

BanList (type 10).

func (*BanList) Marshal

func (m *BanList) Marshal() ([]byte, error)

func (*BanList) Unmarshal

func (m *BanList) Unmarshal(data []byte) error

type ChannelRemove

type ChannelRemove struct {
	ChannelID uint32
}

ChannelRemove (type 6).

func (*ChannelRemove) Marshal

func (m *ChannelRemove) Marshal() ([]byte, error)

func (*ChannelRemove) Unmarshal

func (m *ChannelRemove) Unmarshal(data []byte) error

type ChannelState

type ChannelState struct {
	ChannelID         uint32
	Parent            uint32
	HasParent         bool // if true, parent field is sent on wire; root omits parent
	Name              string
	Links             []uint32
	Description       string
	LinksAdd          []uint32
	LinksRemove       []uint32
	Temporary         bool
	Position          int32
	DescriptionHash   []byte
	MaxUsers          uint32
	IsEnterRestricted bool
	CanEnter          bool
}

ChannelState (type 7).

func (*ChannelState) Marshal

func (m *ChannelState) Marshal() ([]byte, error)

func (*ChannelState) Unmarshal

func (m *ChannelState) Unmarshal(data []byte) error

type CodecVersion

type CodecVersion struct {
	Alpha       int32
	Beta        int32
	PreferAlpha bool
	Opus        bool
}

CodecVersion (type 21).

func (*CodecVersion) Marshal

func (m *CodecVersion) Marshal() ([]byte, error)

func (*CodecVersion) Unmarshal

func (m *CodecVersion) Unmarshal(data []byte) error

type ContextAction

type ContextAction struct {
	Session   uint32
	ChannelID uint32
	Action    string
}

ContextAction (type 17).

func (*ContextAction) Marshal

func (m *ContextAction) Marshal() ([]byte, error)

func (*ContextAction) Unmarshal

func (m *ContextAction) Unmarshal(data []byte) error

type ContextActionModify

type ContextActionModify struct {
	Action    string
	Text      string
	Context   uint32
	Operation uint32
}

ContextActionModify (type 16) - minimal stub for server-sent.

func (*ContextActionModify) Marshal

func (m *ContextActionModify) Marshal() ([]byte, error)

func (*ContextActionModify) Unmarshal

func (m *ContextActionModify) Unmarshal(data []byte) error

type CryptSetup

type CryptSetup struct {
	Key         []byte
	ClientNonce []byte
	ServerNonce []byte
}

CryptSetup (type 15).

func (*CryptSetup) Marshal

func (m *CryptSetup) Marshal() ([]byte, error)

func (*CryptSetup) Unmarshal

func (m *CryptSetup) Unmarshal(data []byte) error

type DenyType

type DenyType uint32
const (
	DenyText                 DenyType = 0
	DenyPermission           DenyType = 1
	DenySuperUser            DenyType = 2
	DenyChannelName          DenyType = 3
	DenyTextTooLong          DenyType = 4
	DenyH9K                  DenyType = 5
	DenyTemporaryChannel     DenyType = 6
	DenyMissingCertificate   DenyType = 7
	DenyUserName             DenyType = 8
	DenyChannelFull          DenyType = 9
	DenyNestingLimit         DenyType = 10
	DenyChannelCountLimit    DenyType = 11
	DenyChannelListenerLimit DenyType = 12
	DenyUserListenerLimit    DenyType = 13
)

type Message

type Message interface {
	Marshal() ([]byte, error)
	Unmarshal([]byte) error
}

Message is the interface for protocol messages that can be marshaled/unmarshaled.

type PermissionDenied

type PermissionDenied struct {
	Permission uint32
	ChannelID  uint32
	Session    uint32
	Reason     string
	Type       DenyType
	Name       string
}

PermissionDenied (type 12).

func (*PermissionDenied) Marshal

func (m *PermissionDenied) Marshal() ([]byte, error)

func (*PermissionDenied) Unmarshal

func (m *PermissionDenied) Unmarshal(data []byte) error

type PermissionQuery

type PermissionQuery struct {
	ChannelID   uint32
	Permissions uint32
	Flush       bool
}

PermissionQuery (type 20).

func (*PermissionQuery) Marshal

func (m *PermissionQuery) Marshal() ([]byte, error)

func (*PermissionQuery) Unmarshal

func (m *PermissionQuery) Unmarshal(data []byte) error

type Ping

type Ping struct {
	Timestamp  uint64
	Good       uint32
	Late       uint32
	Lost       uint32
	Resync     uint32
	UDPPackets uint32
	TCPPackets uint32
	UDPPingAvg float32
	UDPPingVar float32
	TCPPingAvg float32
	TCPPingVar float32
}

Ping (type 3).

func (*Ping) Marshal

func (m *Ping) Marshal() ([]byte, error)

func (*Ping) Unmarshal

func (m *Ping) Unmarshal(data []byte) error

type PluginDataTransmission

type PluginDataTransmission struct {
	SenderSession    uint32
	ReceiverSessions []uint32
	Data             []byte
	DataID           string
}

PluginDataTransmission (type 26).

func (*PluginDataTransmission) Marshal

func (m *PluginDataTransmission) Marshal() ([]byte, error)

func (*PluginDataTransmission) Unmarshal

func (m *PluginDataTransmission) Unmarshal(data []byte) error

type QueryUsers

type QueryUsers struct {
	IDs   []uint32
	Names []string
}

QueryUsers (type 14).

func (*QueryUsers) Marshal

func (m *QueryUsers) Marshal() ([]byte, error)

func (*QueryUsers) Unmarshal

func (m *QueryUsers) Unmarshal(data []byte) error

type Reject

type Reject struct {
	Type   RejectType
	Reason string
}

Reject (type 4).

func (*Reject) Marshal

func (m *Reject) Marshal() ([]byte, error)

func (*Reject) Unmarshal

func (m *Reject) Unmarshal(data []byte) error

type RejectType

type RejectType uint32

Enums

const (
	RejectNone              RejectType = 0
	RejectWrongVersion      RejectType = 1
	RejectInvalidUsername   RejectType = 2
	RejectWrongUserPW       RejectType = 3
	RejectWrongServerPW     RejectType = 4
	RejectUsernameInUse     RejectType = 5
	RejectServerFull        RejectType = 6
	RejectNoCertificate     RejectType = 7
	RejectAuthenticatorFail RejectType = 8
	RejectNoNewConnections  RejectType = 9
)

type RequestBlob

type RequestBlob struct {
	SessionTexture     []uint32
	SessionComment     []uint32
	ChannelDescription []uint32
}

RequestBlob (type 23).

func (*RequestBlob) Marshal

func (m *RequestBlob) Marshal() ([]byte, error)

func (*RequestBlob) Unmarshal

func (m *RequestBlob) Unmarshal(data []byte) error

type ServerConfig

type ServerConfig struct {
	MaxBandwidth       uint32
	WelcomeText        string
	AllowHTML          bool
	MessageLength      uint32
	ImageMessageLength uint32
	MaxUsers           uint32
	RecordingAllowed   bool
}

ServerConfig (type 24).

func (*ServerConfig) Marshal

func (m *ServerConfig) Marshal() ([]byte, error)

func (*ServerConfig) Unmarshal

func (m *ServerConfig) Unmarshal(data []byte) error

type ServerSync

type ServerSync struct {
	Session      uint32
	MaxBandwidth uint32
	WelcomeText  string
	Permissions  uint64
}

ServerSync (type 5).

func (*ServerSync) Marshal

func (m *ServerSync) Marshal() ([]byte, error)

func (*ServerSync) Unmarshal

func (m *ServerSync) Unmarshal(data []byte) error

type SuggestConfig

type SuggestConfig struct {
	VersionV1  uint32
	VersionV2  uint64
	Positional bool
	PushToTalk bool
}

SuggestConfig (type 25).

func (*SuggestConfig) Marshal

func (m *SuggestConfig) Marshal() ([]byte, error)

func (*SuggestConfig) Unmarshal

func (m *SuggestConfig) Unmarshal(data []byte) error

type TextMessage

type TextMessage struct {
	Actor     uint32
	Session   []uint32
	ChannelID []uint32
	TreeID    []uint32
	Message   string
}

TextMessage (type 11).

func (*TextMessage) Marshal

func (m *TextMessage) Marshal() ([]byte, error)

func (*TextMessage) Unmarshal

func (m *TextMessage) Unmarshal(data []byte) error

type UserList

type UserList struct{}

UserList (type 18) - minimal stub.

func (*UserList) Marshal

func (m *UserList) Marshal() ([]byte, error)

func (*UserList) Unmarshal

func (m *UserList) Unmarshal([]byte) error

type UserRemove

type UserRemove struct {
	Session uint32
	Actor   uint32
	Reason  string
	Ban     bool
}

UserRemove (type 8).

func (*UserRemove) Marshal

func (m *UserRemove) Marshal() ([]byte, error)

func (*UserRemove) Unmarshal

func (m *UserRemove) Unmarshal(data []byte) error

type UserState

type UserState struct {
	Session                   uint32
	Actor                     uint32
	Name                      string
	UserID                    uint32
	ChannelID                 uint32
	Mute                      bool
	Deaf                      bool
	Suppress                  bool
	SelfMute                  bool
	SelfDeaf                  bool
	Texture                   []byte
	PluginContext             []byte
	PluginIdentity            string
	Comment                   string
	Hash                      string
	CommentHash               []byte
	TextureHash               []byte
	PrioritySpeaker           bool
	Recording                 bool
	TemporaryAccessTokens     []string
	ListeningChannelAdd       []uint32
	ListeningChannelRemove    []uint32
	ListeningVolumeAdjustment []VolumeAdjustment

	// SetFields indicates which fields were present in the wire data during Unmarshal.
	// Used by handlers to avoid overwriting with default zero values.
	SetFields uint32
}

UserState (type 9).

func (*UserState) Marshal

func (m *UserState) Marshal() ([]byte, error)

func (*UserState) Unmarshal

func (m *UserState) Unmarshal(data []byte) error

type UserStats

type UserStats struct {
	Session uint32
}

UserStats (type 22) - minimal stub.

func (*UserStats) Marshal

func (m *UserStats) Marshal() ([]byte, error)

func (*UserStats) Unmarshal

func (m *UserStats) Unmarshal(data []byte) error

type Version

type Version struct {
	VersionV1   uint32
	VersionV2   uint64
	Release     string
	OS          string
	OSVersion   string
	CryptoModes uint32 // bitmask: bit0=lite, bit1=legacy, bit2=secure
}

Version (type 0). Field nums from Mumble.proto.

func (*Version) Marshal

func (m *Version) Marshal() ([]byte, error)

func (*Version) Unmarshal

func (m *Version) Unmarshal(data []byte) error

type VoiceTarget

type VoiceTarget struct {
	ID      uint32
	Targets []VoiceTargetTarget
}

VoiceTarget (type 19).

func (*VoiceTarget) Marshal

func (m *VoiceTarget) Marshal() ([]byte, error)

func (*VoiceTarget) Unmarshal

func (m *VoiceTarget) Unmarshal(data []byte) error

type VoiceTargetTarget

type VoiceTargetTarget struct {
	Session   []uint32
	ChannelID uint32
	Group     string
	Links     bool
	Children  bool
}

type VolumeAdjustment

type VolumeAdjustment struct {
	ListeningChannel uint32
	VolumeAdjustment float32
}

UserState.VolumeAdjustment

Jump to

Keyboard shortcuts

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