Esempio n. 1
0
func (o *FileInfo) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Name = u.UnmarshalStringMax(8192)
	o.Flags = u.UnmarshalUint32()
	o.Modified = int64(u.UnmarshalUint64())
	(&o.Version).UnmarshalXDRFrom(u)
	o.LocalVersion = int64(u.UnmarshalUint64())
	_BlocksSize := int(u.UnmarshalUint32())
	if _BlocksSize < 0 {
		return xdr.ElementSizeExceeded("Blocks", _BlocksSize, 10000000)
	} else if _BlocksSize == 0 {
		o.Blocks = nil
	} else {
		if _BlocksSize > 10000000 {
			return xdr.ElementSizeExceeded("Blocks", _BlocksSize, 10000000)
		}
		if _BlocksSize <= len(o.Blocks) {
			o.Blocks = o.Blocks[:_BlocksSize]
		} else {
			o.Blocks = make([]BlockInfo, _BlocksSize)
		}
		for i := range o.Blocks {
			(&o.Blocks[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 2
0
func (o *SessionInvitation) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.From = u.UnmarshalBytesMax(32)
	o.Key = u.UnmarshalBytesMax(32)
	o.Address = u.UnmarshalBytesMax(32)
	o.Port = u.UnmarshalUint16()
	o.ServerSocket = u.UnmarshalBool()
	return u.Error
}
Esempio n. 3
0
func (o *VersionList) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	_versionsSize := int(u.UnmarshalUint32())
	if _versionsSize < 0 {
		return xdr.ElementSizeExceeded("versions", _versionsSize, 0)
	} else if _versionsSize == 0 {
		o.versions = nil
	} else {
		if _versionsSize <= len(o.versions) {
			o.versions = o.versions[:_versionsSize]
		} else {
			o.versions = make([]fileVersion, _versionsSize)
		}
		for i := range o.versions {
			(&o.versions[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 4
0
func (o *Folder) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.ID = u.UnmarshalStringMax(256)
	o.Label = u.UnmarshalStringMax(256)
	_DevicesSize := int(u.UnmarshalUint32())
	if _DevicesSize < 0 {
		return xdr.ElementSizeExceeded("Devices", _DevicesSize, 1000000)
	} else if _DevicesSize == 0 {
		o.Devices = nil
	} else {
		if _DevicesSize > 1000000 {
			return xdr.ElementSizeExceeded("Devices", _DevicesSize, 1000000)
		}
		if _DevicesSize <= len(o.Devices) {
			o.Devices = o.Devices[:_DevicesSize]
		} else {
			o.Devices = make([]Device, _DevicesSize)
		}
		for i := range o.Devices {
			(&o.Devices[i]).UnmarshalXDRFrom(u)
		}
	}
	o.Flags = u.UnmarshalUint32()
	_OptionsSize := int(u.UnmarshalUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	} else if _OptionsSize == 0 {
		o.Options = nil
	} else {
		if _OptionsSize > 64 {
			return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
		}
		if _OptionsSize <= len(o.Options) {
			o.Options = o.Options[:_OptionsSize]
		} else {
			o.Options = make([]Option, _OptionsSize)
		}
		for i := range o.Options {
			(&o.Options[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 5
0
func (o *Device) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.ID = u.UnmarshalBytesMax(32)
	_AddressesSize := int(u.UnmarshalUint32())
	if _AddressesSize < 0 {
		return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 16)
	} else if _AddressesSize == 0 {
		o.Addresses = nil
	} else {
		if _AddressesSize > 16 {
			return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 16)
		}
		if _AddressesSize <= len(o.Addresses) {
			o.Addresses = o.Addresses[:_AddressesSize]
		} else {
			o.Addresses = make([]Address, _AddressesSize)
		}
		for i := range o.Addresses {
			(&o.Addresses[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 6
0
func (o *ClusterConfigMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	_FoldersSize := int(u.UnmarshalUint32())
	if _FoldersSize < 0 {
		return xdr.ElementSizeExceeded("Folders", _FoldersSize, 1000000)
	} else if _FoldersSize == 0 {
		o.Folders = nil
	} else {
		if _FoldersSize > 1000000 {
			return xdr.ElementSizeExceeded("Folders", _FoldersSize, 1000000)
		}
		if _FoldersSize <= len(o.Folders) {
			o.Folders = o.Folders[:_FoldersSize]
		} else {
			o.Folders = make([]Folder, _FoldersSize)
		}
		for i := range o.Folders {
			(&o.Folders[i]).UnmarshalXDRFrom(u)
		}
	}
	_OptionsSize := int(u.UnmarshalUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	} else if _OptionsSize == 0 {
		o.Options = nil
	} else {
		if _OptionsSize > 64 {
			return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
		}
		if _OptionsSize <= len(o.Options) {
			o.Options = o.Options[:_OptionsSize]
		} else {
			o.Options = make([]Option, _OptionsSize)
		}
		for i := range o.Options {
			(&o.Options[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 7
0
func (o *Announce) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Magic = u.UnmarshalUint32()
	(&o.This).UnmarshalXDRFrom(u)
	_ExtraSize := int(u.UnmarshalUint32())
	if _ExtraSize < 0 {
		return xdr.ElementSizeExceeded("Extra", _ExtraSize, 16)
	} else if _ExtraSize == 0 {
		o.Extra = nil
	} else {
		if _ExtraSize > 16 {
			return xdr.ElementSizeExceeded("Extra", _ExtraSize, 16)
		}
		if _ExtraSize <= len(o.Extra) {
			o.Extra = o.Extra[:_ExtraSize]
		} else {
			o.Extra = make([]Device, _ExtraSize)
		}
		for i := range o.Extra {
			(&o.Extra[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 8
0
func (v *Vector) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	l := int(u.UnmarshalUint32())
	if l > 1e6 {
		return xdr.ElementSizeExceeded("number of counters", l, 1e6)
	}
	n := make(Vector, l)
	for i := range n {
		n[i].ID = ShortID(u.UnmarshalUint64())
		n[i].Value = u.UnmarshalUint64()
	}
	*v = n
	return u.Error
}
Esempio n. 9
0
func (o *IndexMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Folder = u.UnmarshalStringMax(256)
	_FilesSize := int(u.UnmarshalUint32())
	if _FilesSize < 0 {
		return xdr.ElementSizeExceeded("Files", _FilesSize, 1000000)
	} else if _FilesSize == 0 {
		o.Files = nil
	} else {
		if _FilesSize > 1000000 {
			return xdr.ElementSizeExceeded("Files", _FilesSize, 1000000)
		}
		if _FilesSize <= len(o.Files) {
			o.Files = o.Files[:_FilesSize]
		} else {
			o.Files = make([]FileInfo, _FilesSize)
		}
		for i := range o.Files {
			(&o.Files[i]).UnmarshalXDRFrom(u)
		}
	}
	o.Flags = u.UnmarshalUint32()
	_OptionsSize := int(u.UnmarshalUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	} else if _OptionsSize == 0 {
		o.Options = nil
	} else {
		if _OptionsSize > 64 {
			return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
		}
		if _OptionsSize <= len(o.Options) {
			o.Options = o.Options[:_OptionsSize]
		} else {
			o.Options = make([]Option, _OptionsSize)
		}
		for i := range o.Options {
			(&o.Options[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 10
0
func (o *DownloadProgressMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Folder = u.UnmarshalStringMax(64)
	_UpdatesSize := int(u.UnmarshalUint32())
	if _UpdatesSize < 0 {
		return xdr.ElementSizeExceeded("Updates", _UpdatesSize, 1000000)
	} else if _UpdatesSize == 0 {
		o.Updates = nil
	} else {
		if _UpdatesSize > 1000000 {
			return xdr.ElementSizeExceeded("Updates", _UpdatesSize, 1000000)
		}
		if _UpdatesSize <= len(o.Updates) {
			o.Updates = o.Updates[:_UpdatesSize]
		} else {
			o.Updates = make([]FileDownloadProgressUpdate, _UpdatesSize)
		}
		for i := range o.Updates {
			(&o.Updates[i]).UnmarshalXDRFrom(u)
		}
	}
	o.Flags = u.UnmarshalUint32()
	_OptionsSize := int(u.UnmarshalUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	} else if _OptionsSize == 0 {
		o.Options = nil
	} else {
		if _OptionsSize > 64 {
			return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
		}
		if _OptionsSize <= len(o.Options) {
			o.Options = o.Options[:_OptionsSize]
		} else {
			o.Options = make([]Option, _OptionsSize)
		}
		for i := range o.Options {
			(&o.Options[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 11
0
func (o *FileDownloadProgressUpdate) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.UpdateType = u.UnmarshalUint32()
	o.Name = u.UnmarshalStringMax(8192)
	(&o.Version).UnmarshalXDRFrom(u)
	_BlockIndexesSize := int(u.UnmarshalUint32())
	if _BlockIndexesSize < 0 {
		return xdr.ElementSizeExceeded("BlockIndexes", _BlockIndexesSize, 1000000)
	} else if _BlockIndexesSize == 0 {
		o.BlockIndexes = nil
	} else {
		if _BlockIndexesSize > 1000000 {
			return xdr.ElementSizeExceeded("BlockIndexes", _BlockIndexesSize, 1000000)
		}
		if _BlockIndexesSize <= len(o.BlockIndexes) {
			o.BlockIndexes = o.BlockIndexes[:_BlockIndexesSize]
		} else {
			o.BlockIndexes = make([]int32, _BlockIndexesSize)
		}
		for i := range o.BlockIndexes {
			o.BlockIndexes[i] = int32(u.UnmarshalUint32())
		}
	}
	return u.Error
}
Esempio n. 12
0
func (o *RequestMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Folder = u.UnmarshalStringMax(256)
	o.Name = u.UnmarshalStringMax(8192)
	o.Offset = int64(u.UnmarshalUint64())
	o.Size = int32(u.UnmarshalUint32())
	o.Hash = u.UnmarshalBytesMax(64)
	o.Flags = u.UnmarshalUint32()
	_OptionsSize := int(u.UnmarshalUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	} else if _OptionsSize == 0 {
		o.Options = nil
	} else {
		if _OptionsSize > 64 {
			return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
		}
		if _OptionsSize <= len(o.Options) {
			o.Options = o.Options[:_OptionsSize]
		} else {
			o.Options = make([]Option, _OptionsSize)
		}
		for i := range o.Options {
			(&o.Options[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 13
0
func (o *BlockInfo) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Size = int32(u.UnmarshalUint32())
	o.Hash = u.UnmarshalBytesMax(64)
	return u.Error
}
Esempio n. 14
0
func (o *JoinSessionRequest) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Key = u.UnmarshalBytesMax(32)
	return u.Error
}
Esempio n. 15
0
func (o *CloseMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Reason = u.UnmarshalStringMax(1024)
	o.Code = int32(u.UnmarshalUint32())
	return u.Error
}
Esempio n. 16
0
func (o *Option) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Key = u.UnmarshalStringMax(64)
	o.Value = u.UnmarshalStringMax(1024)
	return u.Error
}
Esempio n. 17
0
func (o *Device) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.ID = u.UnmarshalBytesMax(32)
	o.Name = u.UnmarshalStringMax(64)
	_AddressesSize := int(u.UnmarshalUint32())
	if _AddressesSize < 0 {
		return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 64)
	} else if _AddressesSize == 0 {
		o.Addresses = nil
	} else {
		if _AddressesSize > 64 {
			return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 64)
		}
		if _AddressesSize <= len(o.Addresses) {
			for i := _AddressesSize; i < len(o.Addresses); i++ {
				o.Addresses[i] = ""
			}
			o.Addresses = o.Addresses[:_AddressesSize]
		} else {
			o.Addresses = make([]string, _AddressesSize)
		}
		for i := range o.Addresses {
			o.Addresses[i] = u.UnmarshalStringMax(2083)
		}
	}
	o.Compression = u.UnmarshalUint32()
	o.CertName = u.UnmarshalStringMax(64)
	o.MaxLocalVersion = int64(u.UnmarshalUint64())
	o.Flags = u.UnmarshalUint32()
	_OptionsSize := int(u.UnmarshalUint32())
	if _OptionsSize < 0 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	} else if _OptionsSize == 0 {
		o.Options = nil
	} else {
		if _OptionsSize > 64 {
			return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
		}
		if _OptionsSize <= len(o.Options) {
			o.Options = o.Options[:_OptionsSize]
		} else {
			o.Options = make([]Option, _OptionsSize)
		}
		for i := range o.Options {
			(&o.Options[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
Esempio n. 18
0
func (o *Response) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Code = int32(u.UnmarshalUint32())
	o.Message = u.UnmarshalString()
	return u.Error
}
Esempio n. 19
0
func (o *ResponseMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Data = u.UnmarshalBytes()
	o.Code = int32(u.UnmarshalUint32())
	return u.Error
}
func (o *XDRA) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Name = u.UnmarshalString()
	o.BirthDay = int64(u.UnmarshalUint64())
	o.Phone = u.UnmarshalString()
	o.Siblings = int32(u.UnmarshalUint32())
	o.Spouse = u.UnmarshalBool()
	o.Money = u.UnmarshalUint64()
	return u.Error
}
Esempio n. 21
0
func (o *header) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.magic = u.UnmarshalUint32()
	o.messageType = int32(u.UnmarshalUint32())
	o.messageLength = int32(u.UnmarshalUint32())
	return u.Error
}
Esempio n. 22
0
func (o *FileInfoTruncated) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Name = u.UnmarshalStringMax(8192)
	o.Flags = u.UnmarshalUint32()
	o.Modified = int64(u.UnmarshalUint64())
	(&o.Version).UnmarshalXDRFrom(u)
	o.LocalVersion = int64(u.UnmarshalUint64())
	_BlocksSize := int(u.UnmarshalUint32())
	if _BlocksSize < 0 {
		return xdr.ElementSizeExceeded("Blocks", _BlocksSize, 1000000)
	} else if _BlocksSize == 0 {
		o.Blocks = nil
	} else {
		if _BlocksSize > 1000000 {
			return xdr.ElementSizeExceeded("Blocks", _BlocksSize, 1000000)
		}
		for i := 0; i < _BlocksSize; i++ {
			size := int64(u.UnmarshalUint32())
			o.CachedSize += size
			u.UnmarshalBytes()
		}
	}

	return u.Error
}
Esempio n. 23
0
func (o *Relay) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.URL = u.UnmarshalStringMax(2083)
	o.Latency = int32(u.UnmarshalUint32())
	return u.Error
}
Esempio n. 24
0
func (o *Address) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.URL = u.UnmarshalStringMax(2083)
	return u.Error
}
Esempio n. 25
0
func (h *header) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	v := u.UnmarshalUint32()
	*h = decodeHeader(v)
	return u.Error
}
Esempio n. 26
0
func (o *fileVersion) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	(&o.version).UnmarshalXDRFrom(u)
	o.device = u.UnmarshalBytes()
	return u.Error
}
Esempio n. 27
0
func (o *Version13HelloMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.DeviceName = u.UnmarshalStringMax(64)
	o.ClientName = u.UnmarshalStringMax(64)
	o.ClientVersion = u.UnmarshalStringMax(64)
	return u.Error
}
Esempio n. 28
0
func (o *ConnectRequest) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.ID = u.UnmarshalBytesMax(32)
	return u.Error
}
Esempio n. 29
0
func (o *Opaque) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	copy((*o)[:], u.UnmarshalRaw(32))
	return u.Error
}
Esempio n. 30
0
func (o *OtherStruct) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.F1 = u.UnmarshalUint32()
	o.F2 = u.UnmarshalString()
	return u.Error
}