示例#1
0
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()
}
示例#2
0
func (o *AnnounceV1) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.Port = xr.ReadUint16()
	o.NodeID = xr.ReadStringMax(64)
	o.IP = xr.ReadBytesMax(16)
	return xr.Error()
}
示例#3
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()
}
示例#4
0
func (o *OptionsMessage) decodeXDR(xr *xdr.Reader) error {
	_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()
}
示例#5
0
func (o *AnnounceV2) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.NodeID = xr.ReadStringMax(64)
	_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()
}
示例#6
0
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()
}
示例#7
0
func (o *IndexMessage) decodeXDR(xr *xdr.Reader) error {
	o.Repository = 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()
}
示例#8
0
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()
}
示例#9
0
func (o *Node) 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()
}
示例#10
0
func (o *AnnounceV2) 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([]Node, _ExtraSize)
	for i := range o.Extra {
		(&o.Extra[i]).decodeXDR(xr)
	}
	return xr.Error()
}
示例#11
0
func (o *Address) decodeXDR(xr *xdr.Reader) error {
	o.IP = xr.ReadBytesMax(16)
	o.Port = xr.ReadUint16()
	return xr.Error()
}
示例#12
0
func (o *BlockInfo) decodeXDR(xr *xdr.Reader) error {
	o.Size = xr.ReadUint32()
	o.Hash = xr.ReadBytesMax(64)
	return xr.Error()
}
示例#13
0
func (o *Block) decodeXDR(xr *xdr.Reader) error {
	o.Offset = int64(xr.ReadUint64())
	o.Size = xr.ReadUint32()
	o.Hash = xr.ReadBytes()
	return xr.Error()
}
示例#14
0
func (o *EmptyMessage) decodeXDR(xr *xdr.Reader) error {
	return xr.Error()
}
示例#15
0
func (o *FileInfo) decodeXDR(xr *xdr.Reader) error {
	o.Name = xr.ReadStringMax(1024)
	o.Flags = xr.ReadUint32()
	o.Modified = int64(xr.ReadUint64())
	o.Version = xr.ReadUint64()
	_BlocksSize := int(xr.ReadUint32())
	if _BlocksSize > 1000000 {
		return xdr.ErrElementSizeExceeded
	}
	o.Blocks = make([]BlockInfo, _BlocksSize)
	for i := range o.Blocks {
		(&o.Blocks[i]).decodeXDR(xr)
	}
	return xr.Error()
}
示例#16
0
func (o *repeatReader) decodeXDR(xr *xdr.Reader) error {
	o.data = xr.ReadBytes()
	return xr.Error()
}
示例#17
0
func (o *Node) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadStringMax(64)
	o.Flags = xr.ReadUint32()
	return xr.Error()
}
示例#18
0
func (o *File) decodeXDR(xr *xdr.Reader) error {
	o.Name = xr.ReadString()
	o.Flags = xr.ReadUint32()
	o.Modified = int64(xr.ReadUint64())
	o.Version = xr.ReadUint64()
	o.Size = int64(xr.ReadUint64())
	_BlocksSize := int(xr.ReadUint32())
	o.Blocks = make([]Block, _BlocksSize)
	for i := range o.Blocks {
		(&o.Blocks[i]).decodeXDR(xr)
	}
	o.Suppressed = xr.ReadBool()
	return xr.Error()
}
示例#19
0
func (o *QueryV2) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.NodeID = xr.ReadBytesMax(32)
	return xr.Error()
}
示例#20
0
func (o *Node) decodeXDR(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	o.Flags = xr.ReadUint32()
	o.MaxVersion = xr.ReadUint64()
	return xr.Error()
}
示例#21
0
func (o *fileVersion) decodeXDR(xr *xdr.Reader) error {
	o.version = xr.ReadUint64()
	o.node = xr.ReadBytes()
	return xr.Error()
}
示例#22
0
func (o *TestStruct) decodeXDR(xr *xdr.Reader) error {
	o.I = int(xr.ReadUint64())
	o.I16 = int16(xr.ReadUint16())
	o.UI16 = xr.ReadUint16()
	o.I32 = int32(xr.ReadUint32())
	o.UI32 = xr.ReadUint32()
	o.I64 = int64(xr.ReadUint64())
	o.UI64 = xr.ReadUint64()
	o.BS = xr.ReadBytes()
	o.S = xr.ReadString()
	return xr.Error()
}
示例#23
0
func (o *Option) decodeXDR(xr *xdr.Reader) error {
	o.Key = xr.ReadStringMax(64)
	o.Value = xr.ReadStringMax(1024)
	return xr.Error()
}
示例#24
0
func (o *ResponseMessage) decodeXDR(xr *xdr.Reader) error {
	o.Data = xr.ReadBytes()
	return xr.Error()
}
示例#25
0
func (o *QueryV2) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.NodeID = xr.ReadStringMax(64)
	return xr.Error()
}
示例#26
0
func (o *CloseMessage) decodeXDR(xr *xdr.Reader) error {
	o.Reason = xr.ReadStringMax(1024)
	return xr.Error()
}
示例#27
0
func (h *header) decodeXDR(xr *xdr.Reader) error {
	u := xr.ReadUint32()
	*h = decodeHeader(u)
	return xr.Error()
}
示例#28
0
func (o *XDRBenchStruct) decodeXDR(xr *xdr.Reader) error {
	o.I1 = xr.ReadUint64()
	o.I2 = xr.ReadUint32()
	o.I3 = xr.ReadUint16()
	o.Bs0 = xr.ReadBytesMax(128)
	o.Bs1 = xr.ReadBytes()
	o.S0 = xr.ReadStringMax(128)
	o.S1 = xr.ReadString()
	return xr.Error()
}