diff --git a/client.go b/client.go index e8aa5d6..5419c00 100644 --- a/client.go +++ b/client.go @@ -10,13 +10,14 @@ import ( "code.google.com/p/goprotobuf/proto" "crypto/tls" "encoding/binary" + "errors" + "io" + "log" "mumbleapp.com/grumble/pkg/blobstore" "mumbleapp.com/grumble/pkg/cryptstate" "mumbleapp.com/grumble/pkg/mumbleproto" - "io" - "log" - "net" "mumbleapp.com/grumble/pkg/packetdatastream" + "net" "runtime" "time" ) @@ -197,7 +198,7 @@ func (client *Client) RejectAuth(rejectType mumbleproto.Reject_RejectType, reaso } client.sendMessage(&mumbleproto.Reject{ - Type: mumbleproto.NewReject_RejectType(rejectType), + Type: rejectType.Enum(), Reason: reasonString, }) @@ -246,7 +247,7 @@ func (c *Client) sendPermissionDeniedType(denyType mumbleproto.PermissionDenied_ // Send permission denied by type (and user) func (c *Client) sendPermissionDeniedTypeUser(denyType mumbleproto.PermissionDenied_DenyType, user *Client) { pd := &mumbleproto.PermissionDenied{ - Type: mumbleproto.NewPermissionDenied_DenyType(denyType), + Type: denyType.Enum(), } if user != nil { pd.Session = proto.Uint32(uint32(user.Session)) @@ -264,7 +265,7 @@ func (c *Client) sendPermissionDenied(who *Client, where *Channel, what Permissi Permission: proto.Uint32(uint32(what)), ChannelId: proto.Uint32(uint32(where.Id)), Session: proto.Uint32(who.Session), - Type: mumbleproto.NewPermissionDenied_DenyType(mumbleproto.PermissionDenied_Permission), + Type: mumbleproto.PermissionDenied_Permission.Enum(), } err := c.sendMessage(pd) if err != nil { @@ -276,7 +277,7 @@ func (c *Client) sendPermissionDenied(who *Client, where *Channel, what Permissi // Send permission denied fallback func (client *Client) sendPermissionDeniedFallback(denyType mumbleproto.PermissionDenied_DenyType, version uint32, text string) { pd := &mumbleproto.PermissionDenied{ - Type: mumbleproto.NewPermissionDenied_DenyType(denyType), + Type: denyType.Enum(), } if client.Version < version { pd.Reason = proto.String(text) @@ -381,7 +382,11 @@ func (client *Client) sendMessage(msg interface{}) error { if kind == mumbleproto.MessageUDPTunnel { msgData = msg.([]byte) } else { - msgData, err = proto.Marshal(msg) + protoMsg, ok := (msg).(proto.Message) + if !ok { + return errors.New("client: exepcted a proto.Message") + } + msgData, err = proto.Marshal(protoMsg) if err != nil { return err } diff --git a/pkg/freezer/types.pb.go b/pkg/freezer/types.pb.go index 2eb90a3..92451c9 100644 --- a/pkg/freezer/types.pb.go +++ b/pkg/freezer/types.pb.go @@ -1,13 +1,16 @@ -// Code generated by protoc-gen-go from "types.proto" +// Code generated by protoc-gen-go. +// source: types.proto // DO NOT EDIT! package freezer import proto "code.google.com/p/goprotobuf/proto" -import "math" +import json "encoding/json" +import math "math" -// Reference proto & math imports to suppress error if they are not otherwise used. -var _ = proto.GetString +// Reference proto, json, and math imports to suppress error if they are not otherwise used. +var _ = proto.Marshal +var _ = &json.SyntaxError{} var _ = math.Inf type Server struct { @@ -15,20 +18,43 @@ type Server struct { BanList *BanList `protobuf:"bytes,3,opt,name=ban_list" json:"ban_list,omitempty"` Channels []*Channel `protobuf:"bytes,4,rep,name=channels" json:"channels,omitempty"` Users []*User `protobuf:"bytes,5,rep,name=users" json:"users,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Server) Reset() { *this = Server{} } func (this *Server) String() string { return proto.CompactTextString(this) } +func (*Server) ProtoMessage() {} + +func (this *Server) GetBanList() *BanList { + if this != nil { + return this.BanList + } + return nil +} type ConfigKeyValuePair struct { Key *string `protobuf:"bytes,1,req,name=key" json:"key,omitempty"` Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ConfigKeyValuePair) Reset() { *this = ConfigKeyValuePair{} } func (this *ConfigKeyValuePair) String() string { return proto.CompactTextString(this) } +func (*ConfigKeyValuePair) ProtoMessage() {} + +func (this *ConfigKeyValuePair) GetKey() string { + if this != nil && this.Key != nil { + return *this.Key + } + return "" +} + +func (this *ConfigKeyValuePair) GetValue() string { + if this != nil && this.Value != nil { + return *this.Value + } + return "" +} type Ban struct { Ip []byte `protobuf:"bytes,1,opt,name=ip" json:"ip,omitempty"` @@ -38,19 +64,70 @@ type Ban struct { Reason *string `protobuf:"bytes,5,opt,name=reason" json:"reason,omitempty"` Start *int64 `protobuf:"varint,6,opt,name=start" json:"start,omitempty"` Duration *uint32 `protobuf:"varint,7,opt,name=duration" json:"duration,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Ban) Reset() { *this = Ban{} } func (this *Ban) String() string { return proto.CompactTextString(this) } +func (*Ban) ProtoMessage() {} + +func (this *Ban) GetIp() []byte { + if this != nil { + return this.Ip + } + return nil +} + +func (this *Ban) GetMask() uint32 { + if this != nil && this.Mask != nil { + return *this.Mask + } + return 0 +} + +func (this *Ban) GetUsername() string { + if this != nil && this.Username != nil { + return *this.Username + } + return "" +} + +func (this *Ban) GetCertHash() string { + if this != nil && this.CertHash != nil { + return *this.CertHash + } + return "" +} + +func (this *Ban) GetReason() string { + if this != nil && this.Reason != nil { + return *this.Reason + } + return "" +} + +func (this *Ban) GetStart() int64 { + if this != nil && this.Start != nil { + return *this.Start + } + return 0 +} + +func (this *Ban) GetDuration() uint32 { + if this != nil && this.Duration != nil { + return *this.Duration + } + return 0 +} type BanList struct { Bans []*Ban `protobuf:"bytes,1,rep,name=bans" json:"bans,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *BanList) Reset() { *this = BanList{} } func (this *BanList) String() string { return proto.CompactTextString(this) } +func (*BanList) ProtoMessage() {} type User struct { Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` @@ -62,19 +139,91 @@ type User struct { CommentBlob *string `protobuf:"bytes,7,opt,name=comment_blob" json:"comment_blob,omitempty"` LastChannelId *uint32 `protobuf:"varint,8,opt,name=last_channel_id" json:"last_channel_id,omitempty"` LastActive *uint64 `protobuf:"varint,9,opt,name=last_active" json:"last_active,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *User) Reset() { *this = User{} } func (this *User) String() string { return proto.CompactTextString(this) } +func (*User) ProtoMessage() {} + +func (this *User) GetId() uint32 { + if this != nil && this.Id != nil { + return *this.Id + } + return 0 +} + +func (this *User) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *User) GetPassword() string { + if this != nil && this.Password != nil { + return *this.Password + } + return "" +} + +func (this *User) GetCertHash() string { + if this != nil && this.CertHash != nil { + return *this.CertHash + } + return "" +} + +func (this *User) GetEmail() string { + if this != nil && this.Email != nil { + return *this.Email + } + return "" +} + +func (this *User) GetTextureBlob() string { + if this != nil && this.TextureBlob != nil { + return *this.TextureBlob + } + return "" +} + +func (this *User) GetCommentBlob() string { + if this != nil && this.CommentBlob != nil { + return *this.CommentBlob + } + return "" +} + +func (this *User) GetLastChannelId() uint32 { + if this != nil && this.LastChannelId != nil { + return *this.LastChannelId + } + return 0 +} + +func (this *User) GetLastActive() uint64 { + if this != nil && this.LastActive != nil { + return *this.LastActive + } + return 0 +} type UserRemove struct { Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UserRemove) Reset() { *this = UserRemove{} } func (this *UserRemove) String() string { return proto.CompactTextString(this) } +func (*UserRemove) ProtoMessage() {} + +func (this *UserRemove) GetId() uint32 { + if this != nil && this.Id != nil { + return *this.Id + } + return 0 +} type Channel struct { Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` @@ -86,19 +235,70 @@ type Channel struct { Acl []*ACL `protobuf:"bytes,7,rep,name=acl" json:"acl,omitempty"` Groups []*Group `protobuf:"bytes,8,rep,name=groups" json:"groups,omitempty"` DescriptionBlob *string `protobuf:"bytes,9,opt,name=description_blob" json:"description_blob,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Channel) Reset() { *this = Channel{} } func (this *Channel) String() string { return proto.CompactTextString(this) } +func (*Channel) ProtoMessage() {} + +func (this *Channel) GetId() uint32 { + if this != nil && this.Id != nil { + return *this.Id + } + return 0 +} + +func (this *Channel) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *Channel) GetParentId() uint32 { + if this != nil && this.ParentId != nil { + return *this.ParentId + } + return 0 +} + +func (this *Channel) GetPosition() int64 { + if this != nil && this.Position != nil { + return *this.Position + } + return 0 +} + +func (this *Channel) GetInheritAcl() bool { + if this != nil && this.InheritAcl != nil { + return *this.InheritAcl + } + return false +} + +func (this *Channel) GetDescriptionBlob() string { + if this != nil && this.DescriptionBlob != nil { + return *this.DescriptionBlob + } + return "" +} type ChannelRemove struct { Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ChannelRemove) Reset() { *this = ChannelRemove{} } func (this *ChannelRemove) String() string { return proto.CompactTextString(this) } +func (*ChannelRemove) ProtoMessage() {} + +func (this *ChannelRemove) GetId() uint32 { + if this != nil && this.Id != nil { + return *this.Id + } + return 0 +} type ACL struct { UserId *uint32 `protobuf:"varint,1,opt,name=user_id" json:"user_id,omitempty"` @@ -107,11 +307,54 @@ type ACL struct { ApplySubs *bool `protobuf:"varint,4,opt,name=apply_subs" json:"apply_subs,omitempty"` Allow *uint32 `protobuf:"varint,5,opt,name=allow" json:"allow,omitempty"` Deny *uint32 `protobuf:"varint,6,opt,name=deny" json:"deny,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ACL) Reset() { *this = ACL{} } func (this *ACL) String() string { return proto.CompactTextString(this) } +func (*ACL) ProtoMessage() {} + +func (this *ACL) GetUserId() uint32 { + if this != nil && this.UserId != nil { + return *this.UserId + } + return 0 +} + +func (this *ACL) GetGroup() string { + if this != nil && this.Group != nil { + return *this.Group + } + return "" +} + +func (this *ACL) GetApplyHere() bool { + if this != nil && this.ApplyHere != nil { + return *this.ApplyHere + } + return false +} + +func (this *ACL) GetApplySubs() bool { + if this != nil && this.ApplySubs != nil { + return *this.ApplySubs + } + return false +} + +func (this *ACL) GetAllow() uint32 { + if this != nil && this.Allow != nil { + return *this.Allow + } + return 0 +} + +func (this *ACL) GetDeny() uint32 { + if this != nil && this.Deny != nil { + return *this.Deny + } + return 0 +} type Group struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` @@ -119,11 +362,33 @@ type Group struct { Inheritable *bool `protobuf:"varint,3,opt,name=inheritable" json:"inheritable,omitempty"` Add []uint32 `protobuf:"varint,4,rep,name=add" json:"add,omitempty"` Remove []uint32 `protobuf:"varint,5,rep,name=remove" json:"remove,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Group) Reset() { *this = Group{} } func (this *Group) String() string { return proto.CompactTextString(this) } +func (*Group) ProtoMessage() {} + +func (this *Group) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *Group) GetInherit() bool { + if this != nil && this.Inherit != nil { + return *this.Inherit + } + return false +} + +func (this *Group) GetInheritable() bool { + if this != nil && this.Inheritable != nil { + return *this.Inheritable + } + return false +} func init() { } diff --git a/pkg/freezer/walker.go b/pkg/freezer/walker.go index 82e08c1..53fdc52 100644 --- a/pkg/freezer/walker.go +++ b/pkg/freezer/walker.go @@ -174,7 +174,7 @@ func (walker *Walker) Next() (entries []interface{}, err error) { switch typeKind(kind) { case ServerType: server := &Server{} - err = proto.Unmarshal(buf, &server) + err = proto.Unmarshal(buf, server) if isEOF(err) { break } else if err != nil { diff --git a/pkg/mumbleproto/Mumble.pb.go b/pkg/mumbleproto/Mumble.pb.go index e274398..17d5d7a 100644 --- a/pkg/mumbleproto/Mumble.pb.go +++ b/pkg/mumbleproto/Mumble.pb.go @@ -1,13 +1,16 @@ -// Code generated by protoc-gen-go from "Mumble.proto" +// Code generated by protoc-gen-go. +// source: Mumble.proto // DO NOT EDIT! package mumbleproto import proto "code.google.com/p/goprotobuf/proto" -import "math" +import json "encoding/json" +import math "math" -// Reference proto & math imports to suppress error if they are not otherwise used. -var _ = proto.GetString +// Reference proto, json, and math imports to suppress error if they are not otherwise used. +var _ = proto.Marshal +var _ = &json.SyntaxError{} var _ = math.Inf type Reject_RejectType int32 @@ -44,13 +47,25 @@ var Reject_RejectType_value = map[string]int32{ "NoCertificate": 7, } -func NewReject_RejectType(x Reject_RejectType) *Reject_RejectType { - e := Reject_RejectType(x) - return &e +func (x Reject_RejectType) Enum() *Reject_RejectType { + p := new(Reject_RejectType) + *p = x + return p } func (x Reject_RejectType) String() string { return proto.EnumName(Reject_RejectType_name, int32(x)) } +func (x Reject_RejectType) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *Reject_RejectType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(Reject_RejectType_value, data, "Reject_RejectType") + if err != nil { + return err + } + *x = Reject_RejectType(value) + return nil +} type PermissionDenied_DenyType int32 @@ -65,19 +80,21 @@ const ( PermissionDenied_MissingCertificate PermissionDenied_DenyType = 7 PermissionDenied_UserName PermissionDenied_DenyType = 8 PermissionDenied_ChannelFull PermissionDenied_DenyType = 9 + PermissionDenied_NestingLimit PermissionDenied_DenyType = 10 ) var PermissionDenied_DenyType_name = map[int32]string{ - 0: "Text", - 1: "Permission", - 2: "SuperUser", - 3: "ChannelName", - 4: "TextTooLong", - 5: "H9K", - 6: "TemporaryChannel", - 7: "MissingCertificate", - 8: "UserName", - 9: "ChannelFull", + 0: "Text", + 1: "Permission", + 2: "SuperUser", + 3: "ChannelName", + 4: "TextTooLong", + 5: "H9K", + 6: "TemporaryChannel", + 7: "MissingCertificate", + 8: "UserName", + 9: "ChannelFull", + 10: "NestingLimit", } var PermissionDenied_DenyType_value = map[string]int32{ "Text": 0, @@ -90,15 +107,28 @@ var PermissionDenied_DenyType_value = map[string]int32{ "MissingCertificate": 7, "UserName": 8, "ChannelFull": 9, + "NestingLimit": 10, } -func NewPermissionDenied_DenyType(x PermissionDenied_DenyType) *PermissionDenied_DenyType { - e := PermissionDenied_DenyType(x) - return &e +func (x PermissionDenied_DenyType) Enum() *PermissionDenied_DenyType { + p := new(PermissionDenied_DenyType) + *p = x + return p } func (x PermissionDenied_DenyType) String() string { return proto.EnumName(PermissionDenied_DenyType_name, int32(x)) } +func (x PermissionDenied_DenyType) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *PermissionDenied_DenyType) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(PermissionDenied_DenyType_value, data, "PermissionDenied_DenyType") + if err != nil { + return err + } + *x = PermissionDenied_DenyType(value) + return nil +} type ContextActionModify_Context int32 @@ -119,13 +149,25 @@ var ContextActionModify_Context_value = map[string]int32{ "User": 4, } -func NewContextActionModify_Context(x ContextActionModify_Context) *ContextActionModify_Context { - e := ContextActionModify_Context(x) - return &e +func (x ContextActionModify_Context) Enum() *ContextActionModify_Context { + p := new(ContextActionModify_Context) + *p = x + return p } func (x ContextActionModify_Context) String() string { return proto.EnumName(ContextActionModify_Context_name, int32(x)) } +func (x ContextActionModify_Context) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *ContextActionModify_Context) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(ContextActionModify_Context_value, data, "ContextActionModify_Context") + if err != nil { + return err + } + *x = ContextActionModify_Context(value) + return nil +} type ContextActionModify_Operation int32 @@ -143,32 +185,81 @@ var ContextActionModify_Operation_value = map[string]int32{ "Remove": 1, } -func NewContextActionModify_Operation(x ContextActionModify_Operation) *ContextActionModify_Operation { - e := ContextActionModify_Operation(x) - return &e +func (x ContextActionModify_Operation) Enum() *ContextActionModify_Operation { + p := new(ContextActionModify_Operation) + *p = x + return p } func (x ContextActionModify_Operation) String() string { return proto.EnumName(ContextActionModify_Operation_name, int32(x)) } +func (x ContextActionModify_Operation) MarshalJSON() ([]byte, error) { + return json.Marshal(x.String()) +} +func (x *ContextActionModify_Operation) UnmarshalJSON(data []byte) error { + value, err := proto.UnmarshalJSONEnum(ContextActionModify_Operation_value, data, "ContextActionModify_Operation") + if err != nil { + return err + } + *x = ContextActionModify_Operation(value) + return nil +} type Version struct { Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` Release *string `protobuf:"bytes,2,opt,name=release" json:"release,omitempty"` Os *string `protobuf:"bytes,3,opt,name=os" json:"os,omitempty"` OsVersion *string `protobuf:"bytes,4,opt,name=os_version" json:"os_version,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Version) Reset() { *this = Version{} } func (this *Version) String() string { return proto.CompactTextString(this) } +func (*Version) ProtoMessage() {} + +func (this *Version) GetVersion() uint32 { + if this != nil && this.Version != nil { + return *this.Version + } + return 0 +} + +func (this *Version) GetRelease() string { + if this != nil && this.Release != nil { + return *this.Release + } + return "" +} + +func (this *Version) GetOs() string { + if this != nil && this.Os != nil { + return *this.Os + } + return "" +} + +func (this *Version) GetOsVersion() string { + if this != nil && this.OsVersion != nil { + return *this.OsVersion + } + return "" +} type UDPTunnel struct { Packet []byte `protobuf:"bytes,1,req,name=packet" json:"packet,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UDPTunnel) Reset() { *this = UDPTunnel{} } func (this *UDPTunnel) String() string { return proto.CompactTextString(this) } +func (*UDPTunnel) ProtoMessage() {} + +func (this *UDPTunnel) GetPacket() []byte { + if this != nil { + return this.Packet + } + return nil +} type Authenticate struct { Username *string `protobuf:"bytes,1,opt,name=username" json:"username,omitempty"` @@ -176,14 +267,36 @@ type Authenticate struct { Tokens []string `protobuf:"bytes,3,rep,name=tokens" json:"tokens,omitempty"` CeltVersions []int32 `protobuf:"varint,4,rep,name=celt_versions" json:"celt_versions,omitempty"` Opus *bool `protobuf:"varint,5,opt,name=opus,def=0" json:"opus,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Authenticate) Reset() { *this = Authenticate{} } func (this *Authenticate) String() string { return proto.CompactTextString(this) } +func (*Authenticate) ProtoMessage() {} const Default_Authenticate_Opus bool = false +func (this *Authenticate) GetUsername() string { + if this != nil && this.Username != nil { + return *this.Username + } + return "" +} + +func (this *Authenticate) GetPassword() string { + if this != nil && this.Password != nil { + return *this.Password + } + return "" +} + +func (this *Authenticate) GetOpus() bool { + if this != nil && this.Opus != nil { + return *this.Opus + } + return Default_Authenticate_Opus +} + type Ping struct { Timestamp *uint64 `protobuf:"varint,1,opt,name=timestamp" json:"timestamp,omitempty"` Good *uint32 `protobuf:"varint,2,opt,name=good" json:"good,omitempty"` @@ -196,20 +309,113 @@ type Ping struct { UdpPingVar *float32 `protobuf:"fixed32,9,opt,name=udp_ping_var" json:"udp_ping_var,omitempty"` TcpPingAvg *float32 `protobuf:"fixed32,10,opt,name=tcp_ping_avg" json:"tcp_ping_avg,omitempty"` TcpPingVar *float32 `protobuf:"fixed32,11,opt,name=tcp_ping_var" json:"tcp_ping_var,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Ping) Reset() { *this = Ping{} } func (this *Ping) String() string { return proto.CompactTextString(this) } +func (*Ping) ProtoMessage() {} + +func (this *Ping) GetTimestamp() uint64 { + if this != nil && this.Timestamp != nil { + return *this.Timestamp + } + return 0 +} + +func (this *Ping) GetGood() uint32 { + if this != nil && this.Good != nil { + return *this.Good + } + return 0 +} + +func (this *Ping) GetLate() uint32 { + if this != nil && this.Late != nil { + return *this.Late + } + return 0 +} + +func (this *Ping) GetLost() uint32 { + if this != nil && this.Lost != nil { + return *this.Lost + } + return 0 +} + +func (this *Ping) GetResync() uint32 { + if this != nil && this.Resync != nil { + return *this.Resync + } + return 0 +} + +func (this *Ping) GetUdpPackets() uint32 { + if this != nil && this.UdpPackets != nil { + return *this.UdpPackets + } + return 0 +} + +func (this *Ping) GetTcpPackets() uint32 { + if this != nil && this.TcpPackets != nil { + return *this.TcpPackets + } + return 0 +} + +func (this *Ping) GetUdpPingAvg() float32 { + if this != nil && this.UdpPingAvg != nil { + return *this.UdpPingAvg + } + return 0 +} + +func (this *Ping) GetUdpPingVar() float32 { + if this != nil && this.UdpPingVar != nil { + return *this.UdpPingVar + } + return 0 +} + +func (this *Ping) GetTcpPingAvg() float32 { + if this != nil && this.TcpPingAvg != nil { + return *this.TcpPingAvg + } + return 0 +} + +func (this *Ping) GetTcpPingVar() float32 { + if this != nil && this.TcpPingVar != nil { + return *this.TcpPingVar + } + return 0 +} type Reject struct { Type *Reject_RejectType `protobuf:"varint,1,opt,name=type,enum=mumbleproto.Reject_RejectType" json:"type,omitempty"` Reason *string `protobuf:"bytes,2,opt,name=reason" json:"reason,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *Reject) Reset() { *this = Reject{} } func (this *Reject) String() string { return proto.CompactTextString(this) } +func (*Reject) ProtoMessage() {} + +func (this *Reject) GetType() Reject_RejectType { + if this != nil && this.Type != nil { + return *this.Type + } + return 0 +} + +func (this *Reject) GetReason() string { + if this != nil && this.Reason != nil { + return *this.Reason + } + return "" +} type ServerConfig struct { MaxBandwidth *uint32 `protobuf:"varint,1,opt,name=max_bandwidth" json:"max_bandwidth,omitempty"` @@ -217,30 +423,103 @@ type ServerConfig struct { AllowHtml *bool `protobuf:"varint,3,opt,name=allow_html" json:"allow_html,omitempty"` MessageLength *uint32 `protobuf:"varint,4,opt,name=message_length" json:"message_length,omitempty"` ImageMessageLength *uint32 `protobuf:"varint,5,opt,name=image_message_length" json:"image_message_length,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ServerConfig) Reset() { *this = ServerConfig{} } func (this *ServerConfig) String() string { return proto.CompactTextString(this) } +func (*ServerConfig) ProtoMessage() {} + +func (this *ServerConfig) GetMaxBandwidth() uint32 { + if this != nil && this.MaxBandwidth != nil { + return *this.MaxBandwidth + } + return 0 +} + +func (this *ServerConfig) GetWelcomeText() string { + if this != nil && this.WelcomeText != nil { + return *this.WelcomeText + } + return "" +} + +func (this *ServerConfig) GetAllowHtml() bool { + if this != nil && this.AllowHtml != nil { + return *this.AllowHtml + } + return false +} + +func (this *ServerConfig) GetMessageLength() uint32 { + if this != nil && this.MessageLength != nil { + return *this.MessageLength + } + return 0 +} + +func (this *ServerConfig) GetImageMessageLength() uint32 { + if this != nil && this.ImageMessageLength != nil { + return *this.ImageMessageLength + } + return 0 +} type ServerSync struct { Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` MaxBandwidth *uint32 `protobuf:"varint,2,opt,name=max_bandwidth" json:"max_bandwidth,omitempty"` WelcomeText *string `protobuf:"bytes,3,opt,name=welcome_text" json:"welcome_text,omitempty"` Permissions *uint64 `protobuf:"varint,4,opt,name=permissions" json:"permissions,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ServerSync) Reset() { *this = ServerSync{} } func (this *ServerSync) String() string { return proto.CompactTextString(this) } +func (*ServerSync) ProtoMessage() {} + +func (this *ServerSync) GetSession() uint32 { + if this != nil && this.Session != nil { + return *this.Session + } + return 0 +} + +func (this *ServerSync) GetMaxBandwidth() uint32 { + if this != nil && this.MaxBandwidth != nil { + return *this.MaxBandwidth + } + return 0 +} + +func (this *ServerSync) GetWelcomeText() string { + if this != nil && this.WelcomeText != nil { + return *this.WelcomeText + } + return "" +} + +func (this *ServerSync) GetPermissions() uint64 { + if this != nil && this.Permissions != nil { + return *this.Permissions + } + return 0 +} type ChannelRemove struct { ChannelId *uint32 `protobuf:"varint,1,req,name=channel_id" json:"channel_id,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ChannelRemove) Reset() { *this = ChannelRemove{} } func (this *ChannelRemove) String() string { return proto.CompactTextString(this) } +func (*ChannelRemove) ProtoMessage() {} + +func (this *ChannelRemove) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} type ChannelState struct { ChannelId *uint32 `protobuf:"varint,1,opt,name=channel_id" json:"channel_id,omitempty"` @@ -253,25 +532,104 @@ type ChannelState struct { Temporary *bool `protobuf:"varint,8,opt,name=temporary,def=0" json:"temporary,omitempty"` Position *int32 `protobuf:"varint,9,opt,name=position,def=0" json:"position,omitempty"` DescriptionHash []byte `protobuf:"bytes,10,opt,name=description_hash" json:"description_hash,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ChannelState) Reset() { *this = ChannelState{} } func (this *ChannelState) String() string { return proto.CompactTextString(this) } +func (*ChannelState) ProtoMessage() {} const Default_ChannelState_Temporary bool = false const Default_ChannelState_Position int32 = 0 +func (this *ChannelState) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} + +func (this *ChannelState) GetParent() uint32 { + if this != nil && this.Parent != nil { + return *this.Parent + } + return 0 +} + +func (this *ChannelState) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *ChannelState) GetDescription() string { + if this != nil && this.Description != nil { + return *this.Description + } + return "" +} + +func (this *ChannelState) GetTemporary() bool { + if this != nil && this.Temporary != nil { + return *this.Temporary + } + return Default_ChannelState_Temporary +} + +func (this *ChannelState) GetPosition() int32 { + if this != nil && this.Position != nil { + return *this.Position + } + return Default_ChannelState_Position +} + +func (this *ChannelState) GetDescriptionHash() []byte { + if this != nil { + return this.DescriptionHash + } + return nil +} + type UserRemove struct { Session *uint32 `protobuf:"varint,1,req,name=session" json:"session,omitempty"` Actor *uint32 `protobuf:"varint,2,opt,name=actor" json:"actor,omitempty"` Reason *string `protobuf:"bytes,3,opt,name=reason" json:"reason,omitempty"` Ban *bool `protobuf:"varint,4,opt,name=ban" json:"ban,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UserRemove) Reset() { *this = UserRemove{} } func (this *UserRemove) String() string { return proto.CompactTextString(this) } +func (*UserRemove) ProtoMessage() {} + +func (this *UserRemove) GetSession() uint32 { + if this != nil && this.Session != nil { + return *this.Session + } + return 0 +} + +func (this *UserRemove) GetActor() uint32 { + if this != nil && this.Actor != nil { + return *this.Actor + } + return 0 +} + +func (this *UserRemove) GetReason() string { + if this != nil && this.Reason != nil { + return *this.Reason + } + return "" +} + +func (this *UserRemove) GetBan() bool { + if this != nil && this.Ban != nil { + return *this.Ban + } + return false +} type UserState struct { Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` @@ -293,23 +651,165 @@ type UserState struct { TextureHash []byte `protobuf:"bytes,17,opt,name=texture_hash" json:"texture_hash,omitempty"` PrioritySpeaker *bool `protobuf:"varint,18,opt,name=priority_speaker" json:"priority_speaker,omitempty"` Recording *bool `protobuf:"varint,19,opt,name=recording" json:"recording,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UserState) Reset() { *this = UserState{} } func (this *UserState) String() string { return proto.CompactTextString(this) } +func (*UserState) ProtoMessage() {} + +func (this *UserState) GetSession() uint32 { + if this != nil && this.Session != nil { + return *this.Session + } + return 0 +} + +func (this *UserState) GetActor() uint32 { + if this != nil && this.Actor != nil { + return *this.Actor + } + return 0 +} + +func (this *UserState) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *UserState) GetUserId() uint32 { + if this != nil && this.UserId != nil { + return *this.UserId + } + return 0 +} + +func (this *UserState) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} + +func (this *UserState) GetMute() bool { + if this != nil && this.Mute != nil { + return *this.Mute + } + return false +} + +func (this *UserState) GetDeaf() bool { + if this != nil && this.Deaf != nil { + return *this.Deaf + } + return false +} + +func (this *UserState) GetSuppress() bool { + if this != nil && this.Suppress != nil { + return *this.Suppress + } + return false +} + +func (this *UserState) GetSelfMute() bool { + if this != nil && this.SelfMute != nil { + return *this.SelfMute + } + return false +} + +func (this *UserState) GetSelfDeaf() bool { + if this != nil && this.SelfDeaf != nil { + return *this.SelfDeaf + } + return false +} + +func (this *UserState) GetTexture() []byte { + if this != nil { + return this.Texture + } + return nil +} + +func (this *UserState) GetPluginContext() []byte { + if this != nil { + return this.PluginContext + } + return nil +} + +func (this *UserState) GetPluginIdentity() string { + if this != nil && this.PluginIdentity != nil { + return *this.PluginIdentity + } + return "" +} + +func (this *UserState) GetComment() string { + if this != nil && this.Comment != nil { + return *this.Comment + } + return "" +} + +func (this *UserState) GetHash() string { + if this != nil && this.Hash != nil { + return *this.Hash + } + return "" +} + +func (this *UserState) GetCommentHash() []byte { + if this != nil { + return this.CommentHash + } + return nil +} + +func (this *UserState) GetTextureHash() []byte { + if this != nil { + return this.TextureHash + } + return nil +} + +func (this *UserState) GetPrioritySpeaker() bool { + if this != nil && this.PrioritySpeaker != nil { + return *this.PrioritySpeaker + } + return false +} + +func (this *UserState) GetRecording() bool { + if this != nil && this.Recording != nil { + return *this.Recording + } + return false +} type BanList struct { Bans []*BanList_BanEntry `protobuf:"bytes,1,rep,name=bans" json:"bans,omitempty"` Query *bool `protobuf:"varint,2,opt,name=query,def=0" json:"query,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *BanList) Reset() { *this = BanList{} } func (this *BanList) String() string { return proto.CompactTextString(this) } +func (*BanList) ProtoMessage() {} const Default_BanList_Query bool = false +func (this *BanList) GetQuery() bool { + if this != nil && this.Query != nil { + return *this.Query + } + return Default_BanList_Query +} + type BanList_BanEntry struct { Address []byte `protobuf:"bytes,1,req,name=address" json:"address,omitempty"` Mask *uint32 `protobuf:"varint,2,req,name=mask" json:"mask,omitempty"` @@ -318,11 +818,61 @@ type BanList_BanEntry struct { Reason *string `protobuf:"bytes,5,opt,name=reason" json:"reason,omitempty"` Start *string `protobuf:"bytes,6,opt,name=start" json:"start,omitempty"` Duration *uint32 `protobuf:"varint,7,opt,name=duration" json:"duration,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *BanList_BanEntry) Reset() { *this = BanList_BanEntry{} } func (this *BanList_BanEntry) String() string { return proto.CompactTextString(this) } +func (*BanList_BanEntry) ProtoMessage() {} + +func (this *BanList_BanEntry) GetAddress() []byte { + if this != nil { + return this.Address + } + return nil +} + +func (this *BanList_BanEntry) GetMask() uint32 { + if this != nil && this.Mask != nil { + return *this.Mask + } + return 0 +} + +func (this *BanList_BanEntry) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *BanList_BanEntry) GetHash() string { + if this != nil && this.Hash != nil { + return *this.Hash + } + return "" +} + +func (this *BanList_BanEntry) GetReason() string { + if this != nil && this.Reason != nil { + return *this.Reason + } + return "" +} + +func (this *BanList_BanEntry) GetStart() string { + if this != nil && this.Start != nil { + return *this.Start + } + return "" +} + +func (this *BanList_BanEntry) GetDuration() uint32 { + if this != nil && this.Duration != nil { + return *this.Duration + } + return 0 +} type TextMessage struct { Actor *uint32 `protobuf:"varint,1,opt,name=actor" json:"actor,omitempty"` @@ -330,11 +880,26 @@ type TextMessage struct { ChannelId []uint32 `protobuf:"varint,3,rep,name=channel_id" json:"channel_id,omitempty"` TreeId []uint32 `protobuf:"varint,4,rep,name=tree_id" json:"tree_id,omitempty"` Message *string `protobuf:"bytes,5,req,name=message" json:"message,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *TextMessage) Reset() { *this = TextMessage{} } func (this *TextMessage) String() string { return proto.CompactTextString(this) } +func (*TextMessage) ProtoMessage() {} + +func (this *TextMessage) GetActor() uint32 { + if this != nil && this.Actor != nil { + return *this.Actor + } + return 0 +} + +func (this *TextMessage) GetMessage() string { + if this != nil && this.Message != nil { + return *this.Message + } + return "" +} type PermissionDenied struct { Permission *uint32 `protobuf:"varint,1,opt,name=permission" json:"permission,omitempty"` @@ -343,11 +908,54 @@ type PermissionDenied struct { Reason *string `protobuf:"bytes,4,opt,name=reason" json:"reason,omitempty"` Type *PermissionDenied_DenyType `protobuf:"varint,5,opt,name=type,enum=mumbleproto.PermissionDenied_DenyType" json:"type,omitempty"` Name *string `protobuf:"bytes,6,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *PermissionDenied) Reset() { *this = PermissionDenied{} } func (this *PermissionDenied) String() string { return proto.CompactTextString(this) } +func (*PermissionDenied) ProtoMessage() {} + +func (this *PermissionDenied) GetPermission() uint32 { + if this != nil && this.Permission != nil { + return *this.Permission + } + return 0 +} + +func (this *PermissionDenied) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} + +func (this *PermissionDenied) GetSession() uint32 { + if this != nil && this.Session != nil { + return *this.Session + } + return 0 +} + +func (this *PermissionDenied) GetReason() string { + if this != nil && this.Reason != nil { + return *this.Reason + } + return "" +} + +func (this *PermissionDenied) GetType() PermissionDenied_DenyType { + if this != nil && this.Type != nil { + return *this.Type + } + return 0 +} + +func (this *PermissionDenied) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} type ACL struct { ChannelId *uint32 `protobuf:"varint,1,req,name=channel_id" json:"channel_id,omitempty"` @@ -355,15 +963,37 @@ type ACL struct { Groups []*ACL_ChanGroup `protobuf:"bytes,3,rep,name=groups" json:"groups,omitempty"` Acls []*ACL_ChanACL `protobuf:"bytes,4,rep,name=acls" json:"acls,omitempty"` Query *bool `protobuf:"varint,5,opt,name=query,def=0" json:"query,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ACL) Reset() { *this = ACL{} } func (this *ACL) String() string { return proto.CompactTextString(this) } +func (*ACL) ProtoMessage() {} const Default_ACL_InheritAcls bool = true const Default_ACL_Query bool = false +func (this *ACL) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} + +func (this *ACL) GetInheritAcls() bool { + if this != nil && this.InheritAcls != nil { + return *this.InheritAcls + } + return Default_ACL_InheritAcls +} + +func (this *ACL) GetQuery() bool { + if this != nil && this.Query != nil { + return *this.Query + } + return Default_ACL_Query +} + type ACL_ChanGroup struct { Name *string `protobuf:"bytes,1,req,name=name" json:"name,omitempty"` Inherited *bool `protobuf:"varint,2,opt,name=inherited,def=1" json:"inherited,omitempty"` @@ -372,16 +1002,45 @@ type ACL_ChanGroup struct { Add []uint32 `protobuf:"varint,5,rep,name=add" json:"add,omitempty"` Remove []uint32 `protobuf:"varint,6,rep,name=remove" json:"remove,omitempty"` InheritedMembers []uint32 `protobuf:"varint,7,rep,name=inherited_members" json:"inherited_members,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ACL_ChanGroup) Reset() { *this = ACL_ChanGroup{} } func (this *ACL_ChanGroup) String() string { return proto.CompactTextString(this) } +func (*ACL_ChanGroup) ProtoMessage() {} const Default_ACL_ChanGroup_Inherited bool = true const Default_ACL_ChanGroup_Inherit bool = true const Default_ACL_ChanGroup_Inheritable bool = true +func (this *ACL_ChanGroup) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} + +func (this *ACL_ChanGroup) GetInherited() bool { + if this != nil && this.Inherited != nil { + return *this.Inherited + } + return Default_ACL_ChanGroup_Inherited +} + +func (this *ACL_ChanGroup) GetInherit() bool { + if this != nil && this.Inherit != nil { + return *this.Inherit + } + return Default_ACL_ChanGroup_Inherit +} + +func (this *ACL_ChanGroup) GetInheritable() bool { + if this != nil && this.Inheritable != nil { + return *this.Inheritable + } + return Default_ACL_ChanGroup_Inheritable +} + type ACL_ChanACL struct { ApplyHere *bool `protobuf:"varint,1,opt,name=apply_here,def=1" json:"apply_here,omitempty"` ApplySubs *bool `protobuf:"varint,2,opt,name=apply_subs,def=1" json:"apply_subs,omitempty"` @@ -390,81 +1049,229 @@ type ACL_ChanACL struct { Group *string `protobuf:"bytes,5,opt,name=group" json:"group,omitempty"` Grant *uint32 `protobuf:"varint,6,opt,name=grant" json:"grant,omitempty"` Deny *uint32 `protobuf:"varint,7,opt,name=deny" json:"deny,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ACL_ChanACL) Reset() { *this = ACL_ChanACL{} } func (this *ACL_ChanACL) String() string { return proto.CompactTextString(this) } +func (*ACL_ChanACL) ProtoMessage() {} const Default_ACL_ChanACL_ApplyHere bool = true const Default_ACL_ChanACL_ApplySubs bool = true const Default_ACL_ChanACL_Inherited bool = true +func (this *ACL_ChanACL) GetApplyHere() bool { + if this != nil && this.ApplyHere != nil { + return *this.ApplyHere + } + return Default_ACL_ChanACL_ApplyHere +} + +func (this *ACL_ChanACL) GetApplySubs() bool { + if this != nil && this.ApplySubs != nil { + return *this.ApplySubs + } + return Default_ACL_ChanACL_ApplySubs +} + +func (this *ACL_ChanACL) GetInherited() bool { + if this != nil && this.Inherited != nil { + return *this.Inherited + } + return Default_ACL_ChanACL_Inherited +} + +func (this *ACL_ChanACL) GetUserId() uint32 { + if this != nil && this.UserId != nil { + return *this.UserId + } + return 0 +} + +func (this *ACL_ChanACL) GetGroup() string { + if this != nil && this.Group != nil { + return *this.Group + } + return "" +} + +func (this *ACL_ChanACL) GetGrant() uint32 { + if this != nil && this.Grant != nil { + return *this.Grant + } + return 0 +} + +func (this *ACL_ChanACL) GetDeny() uint32 { + if this != nil && this.Deny != nil { + return *this.Deny + } + return 0 +} + type QueryUsers struct { Ids []uint32 `protobuf:"varint,1,rep,name=ids" json:"ids,omitempty"` Names []string `protobuf:"bytes,2,rep,name=names" json:"names,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *QueryUsers) Reset() { *this = QueryUsers{} } func (this *QueryUsers) String() string { return proto.CompactTextString(this) } +func (*QueryUsers) ProtoMessage() {} type CryptSetup struct { Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` ClientNonce []byte `protobuf:"bytes,2,opt,name=client_nonce" json:"client_nonce,omitempty"` ServerNonce []byte `protobuf:"bytes,3,opt,name=server_nonce" json:"server_nonce,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *CryptSetup) Reset() { *this = CryptSetup{} } func (this *CryptSetup) String() string { return proto.CompactTextString(this) } +func (*CryptSetup) ProtoMessage() {} + +func (this *CryptSetup) GetKey() []byte { + if this != nil { + return this.Key + } + return nil +} + +func (this *CryptSetup) GetClientNonce() []byte { + if this != nil { + return this.ClientNonce + } + return nil +} + +func (this *CryptSetup) GetServerNonce() []byte { + if this != nil { + return this.ServerNonce + } + return nil +} type ContextActionModify struct { Action *string `protobuf:"bytes,1,req,name=action" json:"action,omitempty"` Text *string `protobuf:"bytes,2,opt,name=text" json:"text,omitempty"` Context *uint32 `protobuf:"varint,3,opt,name=context" json:"context,omitempty"` Operation *ContextActionModify_Operation `protobuf:"varint,4,opt,name=operation,enum=mumbleproto.ContextActionModify_Operation" json:"operation,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ContextActionModify) Reset() { *this = ContextActionModify{} } func (this *ContextActionModify) String() string { return proto.CompactTextString(this) } +func (*ContextActionModify) ProtoMessage() {} + +func (this *ContextActionModify) GetAction() string { + if this != nil && this.Action != nil { + return *this.Action + } + return "" +} + +func (this *ContextActionModify) GetText() string { + if this != nil && this.Text != nil { + return *this.Text + } + return "" +} + +func (this *ContextActionModify) GetContext() uint32 { + if this != nil && this.Context != nil { + return *this.Context + } + return 0 +} + +func (this *ContextActionModify) GetOperation() ContextActionModify_Operation { + if this != nil && this.Operation != nil { + return *this.Operation + } + return 0 +} type ContextAction struct { Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` ChannelId *uint32 `protobuf:"varint,2,opt,name=channel_id" json:"channel_id,omitempty"` Action *string `protobuf:"bytes,3,req,name=action" json:"action,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *ContextAction) Reset() { *this = ContextAction{} } func (this *ContextAction) String() string { return proto.CompactTextString(this) } +func (*ContextAction) ProtoMessage() {} + +func (this *ContextAction) GetSession() uint32 { + if this != nil && this.Session != nil { + return *this.Session + } + return 0 +} + +func (this *ContextAction) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} + +func (this *ContextAction) GetAction() string { + if this != nil && this.Action != nil { + return *this.Action + } + return "" +} type UserList struct { Users []*UserList_User `protobuf:"bytes,1,rep,name=users" json:"users,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UserList) Reset() { *this = UserList{} } func (this *UserList) String() string { return proto.CompactTextString(this) } +func (*UserList) ProtoMessage() {} type UserList_User struct { UserId *uint32 `protobuf:"varint,1,req,name=user_id" json:"user_id,omitempty"` Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UserList_User) Reset() { *this = UserList_User{} } func (this *UserList_User) String() string { return proto.CompactTextString(this) } +func (*UserList_User) ProtoMessage() {} + +func (this *UserList_User) GetUserId() uint32 { + if this != nil && this.UserId != nil { + return *this.UserId + } + return 0 +} + +func (this *UserList_User) GetName() string { + if this != nil && this.Name != nil { + return *this.Name + } + return "" +} type VoiceTarget struct { Id *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` Targets []*VoiceTarget_Target `protobuf:"bytes,2,rep,name=targets" json:"targets,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *VoiceTarget) Reset() { *this = VoiceTarget{} } func (this *VoiceTarget) String() string { return proto.CompactTextString(this) } +func (*VoiceTarget) ProtoMessage() {} + +func (this *VoiceTarget) GetId() uint32 { + if this != nil && this.Id != nil { + return *this.Id + } + return 0 +} type VoiceTarget_Target struct { Session []uint32 `protobuf:"varint,1,rep,name=session" json:"session,omitempty"` @@ -472,41 +1279,121 @@ type VoiceTarget_Target struct { Group *string `protobuf:"bytes,3,opt,name=group" json:"group,omitempty"` Links *bool `protobuf:"varint,4,opt,name=links,def=0" json:"links,omitempty"` Children *bool `protobuf:"varint,5,opt,name=children,def=0" json:"children,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *VoiceTarget_Target) Reset() { *this = VoiceTarget_Target{} } func (this *VoiceTarget_Target) String() string { return proto.CompactTextString(this) } +func (*VoiceTarget_Target) ProtoMessage() {} const Default_VoiceTarget_Target_Links bool = false const Default_VoiceTarget_Target_Children bool = false +func (this *VoiceTarget_Target) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} + +func (this *VoiceTarget_Target) GetGroup() string { + if this != nil && this.Group != nil { + return *this.Group + } + return "" +} + +func (this *VoiceTarget_Target) GetLinks() bool { + if this != nil && this.Links != nil { + return *this.Links + } + return Default_VoiceTarget_Target_Links +} + +func (this *VoiceTarget_Target) GetChildren() bool { + if this != nil && this.Children != nil { + return *this.Children + } + return Default_VoiceTarget_Target_Children +} + type PermissionQuery struct { ChannelId *uint32 `protobuf:"varint,1,opt,name=channel_id" json:"channel_id,omitempty"` Permissions *uint32 `protobuf:"varint,2,opt,name=permissions" json:"permissions,omitempty"` Flush *bool `protobuf:"varint,3,opt,name=flush,def=0" json:"flush,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *PermissionQuery) Reset() { *this = PermissionQuery{} } func (this *PermissionQuery) String() string { return proto.CompactTextString(this) } +func (*PermissionQuery) ProtoMessage() {} const Default_PermissionQuery_Flush bool = false +func (this *PermissionQuery) GetChannelId() uint32 { + if this != nil && this.ChannelId != nil { + return *this.ChannelId + } + return 0 +} + +func (this *PermissionQuery) GetPermissions() uint32 { + if this != nil && this.Permissions != nil { + return *this.Permissions + } + return 0 +} + +func (this *PermissionQuery) GetFlush() bool { + if this != nil && this.Flush != nil { + return *this.Flush + } + return Default_PermissionQuery_Flush +} + type CodecVersion struct { Alpha *int32 `protobuf:"varint,1,req,name=alpha" json:"alpha,omitempty"` Beta *int32 `protobuf:"varint,2,req,name=beta" json:"beta,omitempty"` PreferAlpha *bool `protobuf:"varint,3,req,name=prefer_alpha,def=1" json:"prefer_alpha,omitempty"` Opus *bool `protobuf:"varint,4,opt,name=opus,def=0" json:"opus,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *CodecVersion) Reset() { *this = CodecVersion{} } func (this *CodecVersion) String() string { return proto.CompactTextString(this) } +func (*CodecVersion) ProtoMessage() {} const Default_CodecVersion_PreferAlpha bool = true const Default_CodecVersion_Opus bool = false +func (this *CodecVersion) GetAlpha() int32 { + if this != nil && this.Alpha != nil { + return *this.Alpha + } + return 0 +} + +func (this *CodecVersion) GetBeta() int32 { + if this != nil && this.Beta != nil { + return *this.Beta + } + return 0 +} + +func (this *CodecVersion) GetPreferAlpha() bool { + if this != nil && this.PreferAlpha != nil { + return *this.PreferAlpha + } + return Default_CodecVersion_PreferAlpha +} + +func (this *CodecVersion) GetOpus() bool { + if this != nil && this.Opus != nil { + return *this.Opus + } + return Default_CodecVersion_Opus +} + type UserStats struct { Session *uint32 `protobuf:"varint,1,opt,name=session" json:"session,omitempty"` StatsOnly *bool `protobuf:"varint,2,opt,name=stats_only,def=0" json:"stats_only,omitempty"` @@ -527,46 +1414,218 @@ type UserStats struct { Idlesecs *uint32 `protobuf:"varint,17,opt,name=idlesecs" json:"idlesecs,omitempty"` StrongCertificate *bool `protobuf:"varint,18,opt,name=strong_certificate,def=0" json:"strong_certificate,omitempty"` Opus *bool `protobuf:"varint,19,opt,name=opus,def=0" json:"opus,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UserStats) Reset() { *this = UserStats{} } func (this *UserStats) String() string { return proto.CompactTextString(this) } +func (*UserStats) ProtoMessage() {} const Default_UserStats_StatsOnly bool = false const Default_UserStats_StrongCertificate bool = false const Default_UserStats_Opus bool = false +func (this *UserStats) GetSession() uint32 { + if this != nil && this.Session != nil { + return *this.Session + } + return 0 +} + +func (this *UserStats) GetStatsOnly() bool { + if this != nil && this.StatsOnly != nil { + return *this.StatsOnly + } + return Default_UserStats_StatsOnly +} + +func (this *UserStats) GetFromClient() *UserStats_Stats { + if this != nil { + return this.FromClient + } + return nil +} + +func (this *UserStats) GetFromServer() *UserStats_Stats { + if this != nil { + return this.FromServer + } + return nil +} + +func (this *UserStats) GetUdpPackets() uint32 { + if this != nil && this.UdpPackets != nil { + return *this.UdpPackets + } + return 0 +} + +func (this *UserStats) GetTcpPackets() uint32 { + if this != nil && this.TcpPackets != nil { + return *this.TcpPackets + } + return 0 +} + +func (this *UserStats) GetUdpPingAvg() float32 { + if this != nil && this.UdpPingAvg != nil { + return *this.UdpPingAvg + } + return 0 +} + +func (this *UserStats) GetUdpPingVar() float32 { + if this != nil && this.UdpPingVar != nil { + return *this.UdpPingVar + } + return 0 +} + +func (this *UserStats) GetTcpPingAvg() float32 { + if this != nil && this.TcpPingAvg != nil { + return *this.TcpPingAvg + } + return 0 +} + +func (this *UserStats) GetTcpPingVar() float32 { + if this != nil && this.TcpPingVar != nil { + return *this.TcpPingVar + } + return 0 +} + +func (this *UserStats) GetVersion() *Version { + if this != nil { + return this.Version + } + return nil +} + +func (this *UserStats) GetAddress() []byte { + if this != nil { + return this.Address + } + return nil +} + +func (this *UserStats) GetBandwidth() uint32 { + if this != nil && this.Bandwidth != nil { + return *this.Bandwidth + } + return 0 +} + +func (this *UserStats) GetOnlinesecs() uint32 { + if this != nil && this.Onlinesecs != nil { + return *this.Onlinesecs + } + return 0 +} + +func (this *UserStats) GetIdlesecs() uint32 { + if this != nil && this.Idlesecs != nil { + return *this.Idlesecs + } + return 0 +} + +func (this *UserStats) GetStrongCertificate() bool { + if this != nil && this.StrongCertificate != nil { + return *this.StrongCertificate + } + return Default_UserStats_StrongCertificate +} + +func (this *UserStats) GetOpus() bool { + if this != nil && this.Opus != nil { + return *this.Opus + } + return Default_UserStats_Opus +} + type UserStats_Stats struct { Good *uint32 `protobuf:"varint,1,opt,name=good" json:"good,omitempty"` Late *uint32 `protobuf:"varint,2,opt,name=late" json:"late,omitempty"` Lost *uint32 `protobuf:"varint,3,opt,name=lost" json:"lost,omitempty"` Resync *uint32 `protobuf:"varint,4,opt,name=resync" json:"resync,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *UserStats_Stats) Reset() { *this = UserStats_Stats{} } func (this *UserStats_Stats) String() string { return proto.CompactTextString(this) } +func (*UserStats_Stats) ProtoMessage() {} + +func (this *UserStats_Stats) GetGood() uint32 { + if this != nil && this.Good != nil { + return *this.Good + } + return 0 +} + +func (this *UserStats_Stats) GetLate() uint32 { + if this != nil && this.Late != nil { + return *this.Late + } + return 0 +} + +func (this *UserStats_Stats) GetLost() uint32 { + if this != nil && this.Lost != nil { + return *this.Lost + } + return 0 +} + +func (this *UserStats_Stats) GetResync() uint32 { + if this != nil && this.Resync != nil { + return *this.Resync + } + return 0 +} type SuggestConfig struct { Version *uint32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` Positional *bool `protobuf:"varint,2,opt,name=positional" json:"positional,omitempty"` PushToTalk *bool `protobuf:"varint,3,opt,name=push_to_talk" json:"push_to_talk,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *SuggestConfig) Reset() { *this = SuggestConfig{} } func (this *SuggestConfig) String() string { return proto.CompactTextString(this) } +func (*SuggestConfig) ProtoMessage() {} + +func (this *SuggestConfig) GetVersion() uint32 { + if this != nil && this.Version != nil { + return *this.Version + } + return 0 +} + +func (this *SuggestConfig) GetPositional() bool { + if this != nil && this.Positional != nil { + return *this.Positional + } + return false +} + +func (this *SuggestConfig) GetPushToTalk() bool { + if this != nil && this.PushToTalk != nil { + return *this.PushToTalk + } + return false +} type RequestBlob struct { SessionTexture []uint32 `protobuf:"varint,1,rep,name=session_texture" json:"session_texture,omitempty"` SessionComment []uint32 `protobuf:"varint,2,rep,name=session_comment" json:"session_comment,omitempty"` ChannelDescription []uint32 `protobuf:"varint,3,rep,name=channel_description" json:"channel_description,omitempty"` - XXX_unrecognized []byte `json:",omitempty"` + XXX_unrecognized []byte `json:"-"` } func (this *RequestBlob) Reset() { *this = RequestBlob{} } func (this *RequestBlob) String() string { return proto.CompactTextString(this) } +func (*RequestBlob) ProtoMessage() {} func init() { proto.RegisterEnum("mumbleproto.Reject_RejectType", Reject_RejectType_name, Reject_RejectType_value) diff --git a/pkg/mumbleproto/Mumble.proto b/pkg/mumbleproto/Mumble.proto index 12ebfa3..fe5638f 100644 --- a/pkg/mumbleproto/Mumble.proto +++ b/pkg/mumbleproto/Mumble.proto @@ -145,6 +145,7 @@ message PermissionDenied { MissingCertificate = 7; UserName = 8; ChannelFull = 9; + NestingLimit = 10; } optional uint32 permission = 1; optional uint32 channel_id = 2; diff --git a/ssh.go b/ssh.go index e9169bf..6b21484 100644 --- a/ssh.go +++ b/ssh.go @@ -3,9 +3,9 @@ package main import ( "bytes" "code.google.com/p/go.crypto/ssh" + "code.google.com/p/go.crypto/ssh/terminal" "crypto/rand" "errors" - "exp/terminal" "fmt" "io" "io/ioutil"