예제 #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()
}
예제 #2
0
func (o *TestStruct) DecodeXDRFrom(xr *xdr.Reader) error {
	o.I = int(xr.ReadUint64())
	o.I8 = int8(xr.ReadUint8())
	o.UI8 = xr.ReadUint8()
	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.ReadBytesMax(1024)
	o.S = xr.ReadStringMax(1024)
	(&o.C).DecodeXDRFrom(xr)
	_SSSize := int(xr.ReadUint32())
	if _SSSize < 0 {
		return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
	}
	if _SSSize > 1024 {
		return xdr.ElementSizeExceeded("SS", _SSSize, 1024)
	}
	o.SS = make([]string, _SSSize)
	for i := range o.SS {
		o.SS[i] = xr.ReadString()
	}
	return xr.Error()
}
예제 #3
0
func (o *Device) DecodeXDRFrom(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	o.Name = xr.ReadStringMax(64)
	_AddressesSize := int(xr.ReadUint32())
	if _AddressesSize < 0 {
		return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 64)
	}
	if _AddressesSize > 64 {
		return xdr.ElementSizeExceeded("Addresses", _AddressesSize, 64)
	}
	o.Addresses = make([]string, _AddressesSize)
	for i := range o.Addresses {
		o.Addresses[i] = xr.ReadStringMax(2083)
	}
	o.Compression = xr.ReadUint32()
	o.CertName = xr.ReadStringMax(64)
	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()
}
예제 #4
0
func (o *XDRBenchStruct) DecodeXDRFrom(xr *xdr.Reader) error {
	o.I1 = xr.ReadUint64()
	o.I2 = xr.ReadUint32()
	o.I3 = xr.ReadUint16()
	o.I4 = xr.ReadUint8()
	o.Bs0 = xr.ReadBytesMax(128)
	o.Bs1 = xr.ReadBytes()
	o.S0 = xr.ReadStringMax(128)
	o.S1 = xr.ReadString()
	return xr.Error()
}
예제 #5
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()
}
예제 #6
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()
}
예제 #7
0
func (o *RequestMessage) decodeXDR(xr *xdr.Reader) error {
	o.Folder = xr.ReadStringMax(64)
	o.Name = xr.ReadStringMax(8192)
	o.Offset = int64(xr.ReadUint64())
	o.Size = int32(xr.ReadUint32())
	o.Hash = xr.ReadBytesMax(64)
	o.Flags = xr.ReadUint32()
	_OptionsSize := int(xr.ReadUint32())
	if _OptionsSize > 64 {
		return xdr.ElementSizeExceeded("Options", _OptionsSize, 64)
	}
	o.Options = make([]Option, _OptionsSize)
	for i := range o.Options {
		(&o.Options[i]).decodeXDR(xr)
	}
	return xr.Error()
}
예제 #8
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()
}
예제 #9
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()
}
예제 #10
0
func (o *BlockInfo) decodeXDR(xr *xdr.Reader) error {
	o.Size = xr.ReadUint32()
	o.Hash = xr.ReadBytesMax(64)
	return xr.Error()
}
예제 #11
0
func (o *ConnectRequest) DecodeXDRFrom(xr *xdr.Reader) error {
	o.ID = xr.ReadBytesMax(32)
	return xr.Error()
}
예제 #12
0
func (o *JoinSessionRequest) DecodeXDRFrom(xr *xdr.Reader) error {
	o.Key = xr.ReadBytesMax(32)
	return xr.Error()
}
예제 #13
0
func (o *Query) decodeXDR(xr *xdr.Reader) error {
	o.Magic = xr.ReadUint32()
	o.DeviceID = xr.ReadBytesMax(32)
	return xr.Error()
}
예제 #14
0
func (o *Address) decodeXDR(xr *xdr.Reader) error {
	o.IP = xr.ReadBytesMax(16)
	o.Port = xr.ReadUint16()
	return xr.Error()
}