示例#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
}
示例#2
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
}
示例#3
0
func (o *XDRBenchStruct) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.I1 = u.UnmarshalUint64()
	o.I2 = u.UnmarshalUint32()
	o.I3 = u.UnmarshalUint16()
	o.I4 = u.UnmarshalUint8()
	o.Bs0 = u.UnmarshalBytesMax(128)
	o.Bs1 = u.UnmarshalBytes()
	_Is0Size := int(u.UnmarshalUint32())
	if _Is0Size < 0 {
		return xdr.ElementSizeExceeded("Is0", _Is0Size, 0)
	} else if _Is0Size == 0 {
		o.Is0 = nil
	} else {
		if _Is0Size <= len(o.Is0) {
			o.Is0 = o.Is0[:_Is0Size]
		} else {
			o.Is0 = make([]int32, _Is0Size)
		}
		for i := range o.Is0 {
			o.Is0[i] = int32(u.UnmarshalUint32())
		}
	}
	o.S0 = u.UnmarshalStringMax(128)
	o.S1 = u.UnmarshalString()
	return u.Error
}
示例#4
0
func (o *TestStruct) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.B = u.UnmarshalBool()
	o.I = int(u.UnmarshalUint64())
	o.I8 = int8(u.UnmarshalUint8())
	o.UI8 = u.UnmarshalUint8()
	o.I16 = int16(u.UnmarshalUint16())
	o.UI16 = u.UnmarshalUint16()
	o.I32 = int32(u.UnmarshalUint32())
	o.UI32 = u.UnmarshalUint32()
	o.I64 = int64(u.UnmarshalUint64())
	o.UI64 = u.UnmarshalUint64()
	o.BS = u.UnmarshalBytesMax(1024)
	o.S = u.UnmarshalStringMax(1024)
	(&o.C).UnmarshalXDRFrom(u)
	_SSSize := int(u.UnmarshalUint32())
	if _SSSize < 0 {
		return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
	} else if _SSSize == 0 {
		o.SS = nil
	} else {
		if _SSSize > 1024 {
			return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
		}
		if _SSSize <= len(o.SS) {
			for i := _SSSize; i < len(o.SS); i++ {
				o.SS[i] = ""
			}
			o.SS = o.SS[:_SSSize]
		} else {
			o.SS = make([]string, _SSSize)
		}
		for i := range o.SS {
			o.SS[i] = u.UnmarshalString()
		}
	}
	(&o.ES).UnmarshalXDRFrom(u)
	(&o.OS).UnmarshalXDRFrom(u)
	_OSsSize := int(u.UnmarshalUint32())
	if _OSsSize < 0 {
		return xdr.ElementSizeExceeded("OSs", _OSsSize, 0)
	} else if _OSsSize == 0 {
		o.OSs = nil
	} else {
		if _OSsSize <= len(o.OSs) {
			o.OSs = o.OSs[:_OSsSize]
		} else {
			o.OSs = make([]OtherStruct, _OSsSize)
		}
		for i := range o.OSs {
			(&o.OSs[i]).UnmarshalXDRFrom(u)
		}
	}
	return u.Error
}
示例#5
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
}
示例#6
0
func (o *ClusterConfigMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.DeviceName = u.UnmarshalStringMax(64)
	o.ClientName = u.UnmarshalStringMax(64)
	o.ClientVersion = u.UnmarshalStringMax(64)
	_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
}
示例#7
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
}
示例#8
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
}
示例#9
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
}
示例#10
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
}
示例#11
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
}
示例#12
0
func (o *CloseMessage) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Reason = u.UnmarshalStringMax(1024)
	o.Code = int32(u.UnmarshalUint32())
	return u.Error
}
示例#13
0
func (o *Option) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.Key = u.UnmarshalStringMax(64)
	o.Value = u.UnmarshalStringMax(1024)
	return u.Error
}
示例#14
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
}
示例#15
0
func (o *Relay) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.URL = u.UnmarshalStringMax(2083)
	o.Latency = int32(u.UnmarshalUint32())
	return u.Error
}
示例#16
0
func (o *Address) UnmarshalXDRFrom(u *xdr.Unmarshaller) error {
	o.URL = u.UnmarshalStringMax(2083)
	return u.Error
}