Beispiel #1
0
func (o *Device) DecodeXDRFrom(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	_AddressesSize := int(xr.ReadUint32())
	if _AddressesSize < 0 {
		return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 16)
	}
	if _AddressesSize > 16 {
		return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 16)
	}
	o.Addresses = make([]string, _AddressesSize)
	for i := range o.Addresses {
		o.Addresses[i] = xr.ReadString()
	}
	_RelaysSize := int(xr.ReadUint32())
	if _RelaysSize < 0 {
		return xdr.ElementSizeExceeded("Relays", _RelaysSize, 16)
	}
	if _RelaysSize > 16 {
		return xdr.ElementSizeExceeded("Relays", _RelaysSize, 16)
	}
	o.Relays = make([]Relay, _RelaysSize)
	for i := range o.Relays {
		(&o.Relays[i]).DecodeXDRFrom(xr)
	}
	return xr.Error()
}
func (o *RequestMessage) decodeXDR(xr *xdr.Reader) error {
	o.Repository = xr.ReadStringMax(64)
	o.Name = xr.ReadStringMax(1024)
	o.Offset = xr.ReadUint64()
	o.Size = xr.ReadUint32()
	return xr.Error()
}
Beispiel #3
0
func (o *ClusterConfigMessage) DecodeXDRFrom(xr *xdr.Reader) error {
	o.ClientName = xr.ReadStringMax(64)
	o.ClientVersion = xr.ReadStringMax(64)
	_FoldersSize := int(xr.ReadUint32())
	if _FoldersSize < 0 {
		return xdr.ElementSizeExceeded("Folders", _FoldersSize, 1000000)
	}
	if _FoldersSize > 1000000 {
		return xdr.ElementSizeExceeded("Folders", _FoldersSize, 1000000)
	}
	o.Folders = make([]Folder, _FoldersSize)
	for i := range o.Folders {
		(&o.Folders[i]).DecodeXDRFrom(xr)
	}
	_OptionsSize := int(xr.ReadUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	if _OptionsSize > 64 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	o.Options = make([]Option, _OptionsSize)
	for i := range o.Options {
		(&o.Options[i]).DecodeXDRFrom(xr)
	}
	return xr.Error()
}
Beispiel #4
0
func (o *RequestMessage) decodeXDR(xr *xdr.Reader) error {
	o.Folder = xr.ReadStringMax(64)
	o.Name = xr.ReadStringMax(8192)
	o.Offset = xr.ReadUint64()
	o.Size = xr.ReadUint32()
	return xr.Error()
}
Beispiel #5
0
func (o *Folder) DecodeXDRFrom(xr *xdr.Reader) error {
	o.ID = xr.ReadStringMax(64)
	_DevicesSize := int(xr.ReadUint32())
	if _DevicesSize < 0 {
		return xdr.ElementSizeExceeded("Devices", _DevicesSize, 1000000)
	}
	if _DevicesSize > 1000000 {
		return xdr.ElementSizeExceeded("Devices", _DevicesSize, 1000000)
	}
	o.Devices = make([]Device, _DevicesSize)
	for i := range o.Devices {
		(&o.Devices[i]).DecodeXDRFrom(xr)
	}
	o.Flags = xr.ReadUint32()
	_OptionsSize := int(xr.ReadUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	if _OptionsSize > 64 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	o.Options = make([]Option, _OptionsSize)
	for i := range o.Options {
		(&o.Options[i]).DecodeXDRFrom(xr)
	}
	return xr.Error()
}
Beispiel #6
0
func (o *IndexMessage) DecodeXDRFrom(xr *xdr.Reader) error {
	o.Folder = xr.ReadString()
	_FilesSize := int(xr.ReadUint32())
	if _FilesSize < 0 {
		return xdr.ElementSizeExceeded("Files", _FilesSize, 1000000)
	}
	if _FilesSize > 1000000 {
		return xdr.ElementSizeExceeded("Files", _FilesSize, 1000000)
	}
	o.Files = make([]FileInfo, _FilesSize)
	for i := range o.Files {
		(&o.Files[i]).DecodeXDRFrom(xr)
	}
	o.Flags = xr.ReadUint32()
	_OptionsSize := int(xr.ReadUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	if _OptionsSize > 64 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	o.Options = make([]Option, _OptionsSize)
	for i := range o.Options {
		(&o.Options[i]).DecodeXDRFrom(xr)
	}
	return xr.Error()
}
Beispiel #7
0
func (o *versionList) decodeXDR(xr *xdr.Reader) error {
	_versionsSize := int(xr.ReadUint32())
	o.versions = make([]fileVersion, _versionsSize)
	for i := range o.versions {
		(&o.versions[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #8
0
func (o *addressList) decodeXDR(xr *xdr.Reader) error {
	_addressesSize := int(xr.ReadUint32())
	o.addresses = make([]address, _addressesSize)
	for i := range o.addresses {
		(&o.addresses[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #9
0
func (o *versionList) DecodeXDRFrom(xr *xdr.Reader) error {
	_versionsSize := int(xr.ReadUint32())
	if _versionsSize < 0 {
		return xdr.ElementSizeExceeded("versions", _versionsSize, 0)
	}
	o.versions = make([]fileVersion, _versionsSize)
	for i := range o.versions {
		(&o.versions[i]).DecodeXDRFrom(xr)
	}
	return xr.Error()
}
Beispiel #10
0
func (o *Device) DecodeXDRFrom(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	o.MaxLocalVersion = int64(xr.ReadUint64())
	o.Flags = xr.ReadUint32()
	_OptionsSize := int(xr.ReadUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	if _OptionsSize > 64 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	o.Options = make([]Option, _OptionsSize)
	for i := range o.Options {
		(&o.Options[i]).DecodeXDRFrom(xr)
	}
	return xr.Error()
}
func (o *ClusterConfigMessage) decodeXDR(xr *xdr.Reader) error {
	o.ClientName = xr.ReadStringMax(64)
	o.ClientVersion = xr.ReadStringMax(64)
	_RepositoriesSize := int(xr.ReadUint32())
	if _RepositoriesSize > 64 {
		return xdr.ErrElementSizeExceeded
	}
	o.Repositories = make([]Repository, _RepositoriesSize)
	for i := range o.Repositories {
		(&o.Repositories[i]).decodeXDR(xr)
	}
	_OptionsSize := int(xr.ReadUint32())
	if _OptionsSize > 64 {
		return xdr.ErrElementSizeExceeded
	}
	o.Options = make([]Option, _OptionsSize)
	for i := range o.Options {
		(&o.Options[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #12
0
func (o *IndexMessage) decodeXDR(xr *xdr.Reader) error {
	o.Folder = xr.ReadStringMax(64)
	_FilesSize := int(xr.ReadUint32())
	o.Files = make([]FileInfo, _FilesSize)
	for i := range o.Files {
		(&o.Files[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #13
0
func (o *Folder) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadStringMax(64)
	_DevicesSize := int(xr.ReadUint32())
	o.Devices = make([]Device, _DevicesSize)
	for i := range o.Devices {
		(&o.Devices[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #14
0
func (o *Device) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	_AddressesSize := int(xr.ReadUint32())
	if _AddressesSize > 16 {
		return xdr.ErrElementSizeExceeded
	}
	o.Addresses = make([]Address, _AddressesSize)
	for i := range o.Addresses {
		(&o.Addresses[i]).decodeXDR(xr)
	}
	return xr.Error()
}
func (o *Repository) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadStringMax(64)
	_NodesSize := int(xr.ReadUint32())
	if _NodesSize > 64 {
		return xdr.ErrElementSizeExceeded
	}
	o.Nodes = make([]Node, _NodesSize)
	for i := range o.Nodes {
		(&o.Nodes[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #16
0
func (o *Announce) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	(&o.This).decodeXDR(xr)
	_ExtraSize := int(xr.ReadUint32())
	if _ExtraSize > 16 {
		return xdr.ErrElementSizeExceeded
	}
	o.Extra = make([]Device, _ExtraSize)
	for i := range o.Extra {
		(&o.Extra[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #17
0
func (o *JoinSessionRequest) DecodeXDRFrom(xr *xdr.Reader) error {
	o.Key = xr.ReadBytesMax(32)
	return xr.Error()
}
Beispiel #18
0
func (o *Device) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	o.Flags = xr.ReadUint32()
	o.MaxLocalVersion = xr.ReadUint64()
	return xr.Error()
}
Beispiel #19
0
func (o *ResponseMessage) decodeXDR(xr *xdr.Reader) error {
	o.Data = xr.ReadBytes()
	return xr.Error()
}
Beispiel #20
0
func (o *BlockInfo) decodeXDR(xr *xdr.Reader) error {
	o.Size = xr.ReadUint32()
	o.Hash = xr.ReadBytesMax(64)
	return xr.Error()
}
Beispiel #21
0
func (o *FileInfoTruncated) decodeXDR(xr *xdr.Reader) error {
	o.Name = xr.ReadStringMax(8192)
	o.Flags = xr.ReadUint32()
	o.Modified = int64(xr.ReadUint64())
	o.Version = xr.ReadUint64()
	o.LocalVersion = xr.ReadUint64()
	o.NumBlocks = xr.ReadUint32()
	return xr.Error()
}
Beispiel #22
0
func (o *FileInfo) decodeXDR(xr *xdr.Reader) error {
	o.Name = xr.ReadStringMax(8192)
	o.Flags = xr.ReadUint32()
	o.Modified = int64(xr.ReadUint64())
	o.Version = xr.ReadUint64()
	o.LocalVersion = xr.ReadUint64()
	_BlocksSize := int(xr.ReadUint32())
	o.Blocks = make([]BlockInfo, _BlocksSize)
	for i := range o.Blocks {
		(&o.Blocks[i]).decodeXDR(xr)
	}
	return xr.Error()
}
Beispiel #23
0
func (o *header) DecodeXDRFrom(xr *xdr.Reader) error {
	o.magic = xr.ReadUint32()
	o.messageType = int32(xr.ReadUint32())
	o.messageLength = int32(xr.ReadUint32())
	return xr.Error()
}
Beispiel #24
0
func (o *SessionInvitation) DecodeXDRFrom(xr *xdr.Reader) error {
	o.From = xr.ReadBytesMax(32)
	o.Key = xr.ReadBytesMax(32)
	o.Address = xr.ReadBytesMax(32)
	o.Port = xr.ReadUint16()
	o.ServerSocket = xr.ReadBool()
	return xr.Error()
}
Beispiel #25
0
func (o *EmptyMessage) decodeXDR(xr *xdr.Reader) error {
	return xr.Error()
}
Beispiel #26
0
func (o *Option) decodeXDR(xr *xdr.Reader) error {
	o.Key = xr.ReadStringMax(64)
	o.Value = xr.ReadStringMax(1024)
	return xr.Error()
}
Beispiel #27
0
func (o *CloseMessage) decodeXDR(xr *xdr.Reader) error {
	o.Reason = xr.ReadStringMax(1024)
	return xr.Error()
}
Beispiel #28
0
func (o *Response) DecodeXDRFrom(xr *xdr.Reader) error {
	o.Code = int32(xr.ReadUint32())
	o.Message = xr.ReadString()
	return xr.Error()
}
Beispiel #29
0
func (h *header) decodeXDR(xr *xdr.Reader) error {
	u := xr.ReadUint32()
	*h = decodeHeader(u)
	return xr.Error()
}
Beispiel #30
0
func (o *ConnectRequest) DecodeXDRFrom(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	return xr.Error()
}