Commit 39545b9c authored by Kirill Smelkov's avatar Kirill Smelkov

go/neo/proto: Unexport Msg.NEOMsg{Encode,Decode}

And provide only single top-level entry-points to encode/decode
messages. As of now the entry points are just plain forwarding, but with
introducing of msgpack and encodings, they will take into account
through which encoding a message has to be encoded/decoded.
parent aa16f0f2
...@@ -1321,7 +1321,7 @@ func (c *Conn) err(op string, e error) error { ...@@ -1321,7 +1321,7 @@ func (c *Conn) err(op string, e error) error {
// pktEncode allocates pktBuf and encodes msg into it. // pktEncode allocates pktBuf and encodes msg into it.
func pktEncode(connId uint32, msg proto.Msg) *pktBuf { func pktEncode(connId uint32, msg proto.Msg) *pktBuf {
l := msg.NEOMsgEncodedLen() l := proto.MsgEncodedLen(msg)
buf := pktAlloc(proto.PktHeaderLen + l) buf := pktAlloc(proto.PktHeaderLen + l)
h := buf.Header() h := buf.Header()
...@@ -1329,7 +1329,7 @@ func pktEncode(connId uint32, msg proto.Msg) *pktBuf { ...@@ -1329,7 +1329,7 @@ func pktEncode(connId uint32, msg proto.Msg) *pktBuf {
h.MsgCode = packed.Hton16(proto.MsgCode(msg)) h.MsgCode = packed.Hton16(proto.MsgCode(msg))
h.MsgLen = packed.Hton32(uint32(l)) // XXX casting: think again h.MsgLen = packed.Hton32(uint32(l)) // XXX casting: think again
msg.NEOMsgEncode(buf.Payload()) proto.MsgEncode(msg, buf.Payload())
return buf return buf
} }
...@@ -1376,7 +1376,7 @@ func (c *Conn) Recv() (proto.Msg, error) { ...@@ -1376,7 +1376,7 @@ func (c *Conn) Recv() (proto.Msg, error) {
// msg := reflect.NewAt(msgType, bufAlloc(msgType.Size()) // msg := reflect.NewAt(msgType, bufAlloc(msgType.Size())
_, err = msg.NEOMsgDecode(payload) _, err = proto.MsgDecode(msg, payload)
if err != nil { if err != nil {
return nil, c.err("decode", err) // XXX "decode:" is already in ErrDecodeOverflow return nil, c.err("decode", err) // XXX "decode:" is already in ErrDecodeOverflow
} }
...@@ -1428,7 +1428,7 @@ func (c *Conn) Expect(msgv ...proto.Msg) (which int, err error) { ...@@ -1428,7 +1428,7 @@ func (c *Conn) Expect(msgv ...proto.Msg) (which int, err error) {
for i, msg := range msgv { for i, msg := range msgv {
if proto.MsgCode(msg) == msgCode { if proto.MsgCode(msg) == msgCode {
_, err := msg.NEOMsgDecode(payload) _, err := proto.MsgDecode(msg, payload)
if err != nil { if err != nil {
return -1, c.err("decode", err) return -1, c.err("decode", err)
} }
......
...@@ -157,8 +157,8 @@ func (t *T) xverifyPkt(pkt *pktBuf, connid uint32, msgcode uint16, payload []byt ...@@ -157,8 +157,8 @@ func (t *T) xverifyPkt(pkt *pktBuf, connid uint32, msgcode uint16, payload []byt
// Verify pktBuf to match expected message. // Verify pktBuf to match expected message.
func (t *T) xverifyPktMsg(pkt *pktBuf, connid uint32, msg proto.Msg) { func (t *T) xverifyPktMsg(pkt *pktBuf, connid uint32, msg proto.Msg) {
data := make([]byte, msg.NEOMsgEncodedLen()) data := make([]byte, proto.MsgEncodedLen(msg))
msg.NEOMsgEncode(data) proto.MsgEncode(msg, data)
t.xverifyPkt(pkt, connid, proto.MsgCode(msg), data) t.xverifyPkt(pkt, connid, proto.MsgCode(msg), data)
} }
......
...@@ -95,7 +95,7 @@ func (pkt *pktBuf) String() string { ...@@ -95,7 +95,7 @@ func (pkt *pktBuf) String() string {
// XXX dup wrt Conn.Recv // XXX dup wrt Conn.Recv
msg := reflect.New(msgType).Interface().(proto.Msg) msg := reflect.New(msgType).Interface().(proto.Msg)
n, err := msg.NEOMsgDecode(payload) n, err := proto.MsgDecode(msg, payload)
if err != nil { if err != nil {
s += fmt.Sprintf(" (%s) %v; [%d]: % x", msgType.Name(), err, len(payload), payload) s += fmt.Sprintf(" (%s) %v; [%d]: % x", msgType.Name(), err, len(payload), payload)
} else { } else {
......
...@@ -114,18 +114,36 @@ type Msg interface { ...@@ -114,18 +114,36 @@ type Msg interface {
// on the wire. // on the wire.
neoMsgCode() uint16 neoMsgCode() uint16
// NEOMsgEncodedLen returns how much space is needed to encode current message payload. // neoMsgEncodedLen returns how much space is needed to encode current message payload.
NEOMsgEncodedLen() int neoMsgEncodedLen() int
// NEOMsgEncode encodes current message state into buf. // neoMsgEncode encodes current message state into buf.
// //
// len(buf) must be >= neoMsgEncodedLen(). // len(buf) must be >= neoMsgEncodedLen().
NEOMsgEncode(buf []byte) neoMsgEncode(buf []byte)
// NEOMsgDecode decodes data into message in-place. // neoMsgDecode decodes data into message in-place.
NEOMsgDecode(data []byte) (nread int, err error) neoMsgDecode(data []byte) (nread int, err error)
} }
// MsgEncodedLen returns how much space is needed to encode msg payload.
func MsgEncodedLen(msg Msg) int {
return msg.neoMsgEncodedLen()
}
// MsgEncode encodes msg state into buf.
//
// len(buf) must be >= MsgEncodedLen(m).
func MsgEncode(msg Msg, buf []byte) {
msg.neoMsgEncode(buf)
}
// MsgDecode decodes data into msg in-place.
func MsgDecode(msg Msg, data []byte) (nread int, err error) {
return msg.neoMsgDecode(data)
}
// ErrDecodeOverflow is the error returned by neoMsgDecode when decoding hits buffer overflow // ErrDecodeOverflow is the error returned by neoMsgDecode when decoding hits buffer overflow
var ErrDecodeOverflow = errors.New("decode: buffer overflow") var ErrDecodeOverflow = errors.New("decode: buffer overflow")
......
...@@ -91,7 +91,7 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) { ...@@ -91,7 +91,7 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) {
// msg.encode() == expected // msg.encode() == expected
msgCode := msg.neoMsgCode() msgCode := msg.neoMsgCode()
n := msg.NEOMsgEncodedLen() n := MsgEncodedLen(msg)
msgType := MsgType(msgCode) msgType := MsgType(msgCode)
if msgType != typ { if msgType != typ {
t.Errorf("%v: msgCode = %v which corresponds to %v", typ, msgCode, msgType) t.Errorf("%v: msgCode = %v which corresponds to %v", typ, msgCode, msgType)
...@@ -101,7 +101,7 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) { ...@@ -101,7 +101,7 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) {
} }
buf := make([]byte, n) buf := make([]byte, n)
msg.NEOMsgEncode(buf) MsgEncode(msg, buf)
if string(buf) != encoded { if string(buf) != encoded {
t.Errorf("%v: encode result unexpected:", typ) t.Errorf("%v: encode result unexpected:", typ)
t.Errorf("\thave: %s", hexpkg.EncodeToString(buf)) t.Errorf("\thave: %s", hexpkg.EncodeToString(buf))
...@@ -131,13 +131,13 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) { ...@@ -131,13 +131,13 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) {
} }
}() }()
msg.NEOMsgEncode(buf[:l]) MsgEncode(msg, buf[:l])
}() }()
} }
// msg.decode() == expected // msg.decode() == expected
data := []byte(encoded + "noise") data := []byte(encoded + "noise")
n, err := msg2.NEOMsgDecode(data) n, err := MsgDecode(msg2, data)
if err != nil { if err != nil {
t.Errorf("%v: decode error %v", typ, err) t.Errorf("%v: decode error %v", typ, err)
} }
...@@ -151,7 +151,7 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) { ...@@ -151,7 +151,7 @@ func testMsgMarshal(t *testing.T, msg Msg, encoded string) {
// decode must detect buffer overflow // decode must detect buffer overflow
for l := len(encoded) - 1; l >= 0; l-- { for l := len(encoded) - 1; l >= 0; l-- {
n, err = msg2.NEOMsgDecode(data[:l]) n, err = MsgDecode(msg2, data[:l])
if !(n == 0 && err == ErrDecodeOverflow) { if !(n == 0 && err == ErrDecodeOverflow) {
t.Errorf("%v: decode overflow not detected on [:%v]", typ, l) t.Errorf("%v: decode overflow not detected on [:%v]", typ, l)
} }
...@@ -290,11 +290,11 @@ func TestMsgMarshalAllOverflowLightly(t *testing.T) { ...@@ -290,11 +290,11 @@ func TestMsgMarshalAllOverflowLightly(t *testing.T) {
for _, typ := range msgTypeRegistry { for _, typ := range msgTypeRegistry {
// zero-value for a type // zero-value for a type
msg := reflect.New(typ).Interface().(Msg) msg := reflect.New(typ).Interface().(Msg)
l := msg.NEOMsgEncodedLen() l := MsgEncodedLen(msg)
zerol := make([]byte, l) zerol := make([]byte, l)
// decoding will turn nil slice & map into empty allocated ones. // decoding will turn nil slice & map into empty allocated ones.
// we need it so that reflect.DeepEqual works for msg encode/decode comparison // we need it so that reflect.DeepEqual works for msg encode/decode comparison
n, err := msg.NEOMsgDecode(zerol) n, err := MsgDecode(msg, zerol)
if !(n == l && err == nil) { if !(n == l && err == nil) {
t.Errorf("%v: zero-decode unexpected: %v, %v ; want %v, nil", typ, n, err, l) t.Errorf("%v: zero-decode unexpected: %v, %v ; want %v, nil", typ, n, err, l)
} }
...@@ -325,7 +325,7 @@ func TestMsgDecodeLenOverflow(t *testing.T) { ...@@ -325,7 +325,7 @@ func TestMsgDecodeLenOverflow(t *testing.T) {
} }
}() }()
n, err := tt.msg.NEOMsgDecode(data) n, err := MsgDecode(tt.msg, data)
if !(n == 0 && err == ErrDecodeOverflow) { if !(n == 0 && err == ErrDecodeOverflow) {
t.Errorf("%T: decode %x\nhave: %d, %v\nwant: %d, %v", tt.msg, data, t.Errorf("%T: decode %x\nhave: %d, %v\nwant: %d, %v", tt.msg, data,
n, err, 0, ErrDecodeOverflow) n, err, 0, ErrDecodeOverflow)
......
...@@ -26,9 +26,9 @@ This program generates marshalling code for message types defined in proto.go . ...@@ -26,9 +26,9 @@ This program generates marshalling code for message types defined in proto.go .
For every type 4 methods are generated in accordance with neo.Msg interface: For every type 4 methods are generated in accordance with neo.Msg interface:
neoMsgCode() uint16 neoMsgCode() uint16
NEOMsgEncodedLen() int neoMsgEncodedLen() int
NEOMsgEncode(buf []byte) neoMsgEncode(buf []byte)
NEOMsgDecode(data []byte) (nread int, err error) neoMsgDecode(data []byte) (nread int, err error)
List of message types is obtained via searching through proto.go AST - looking List of message types is obtained via searching through proto.go AST - looking
for appropriate struct declarations there. for appropriate struct declarations there.
...@@ -606,7 +606,7 @@ type sizer struct { ...@@ -606,7 +606,7 @@ type sizer struct {
// //
// when type is recursively walked, for every case code to update `data[n:]` is generated. // when type is recursively walked, for every case code to update `data[n:]` is generated.
// no overflow checks are generated as by neo.Msg interface provided data // no overflow checks are generated as by neo.Msg interface provided data
// buffer should have at least payloadLen length returned by NEOMsgEncodedLen() // buffer should have at least payloadLen length returned by neoMsgEncodedLen()
// (the size computed by sizer). // (the size computed by sizer).
// //
// the code emitted looks like: // the code emitted looks like:
...@@ -615,7 +615,7 @@ type sizer struct { ...@@ -615,7 +615,7 @@ type sizer struct {
// encode<typ2>(data[n2:], path2) // encode<typ2>(data[n2:], path2)
// ... // ...
// //
// TODO encode have to care in NEOMsgEncode to emit preamble such that bound // TODO encode have to care in neoMsgEncode to emit preamble such that bound
// checking is performed only once (currently compiler emits many of them) // checking is performed only once (currently compiler emits many of them)
type encoder struct { type encoder struct {
commonCodeGen commonCodeGen
...@@ -663,7 +663,7 @@ var _ CodeGenerator = (*decoder)(nil) ...@@ -663,7 +663,7 @@ var _ CodeGenerator = (*decoder)(nil)
func (s *sizer) generatedCode() string { func (s *sizer) generatedCode() string {
code := Buffer{} code := Buffer{}
// prologue // prologue
code.emit("func (%s *%s) NEOMsgEncodedLen() int {", s.recvName, s.typeName) code.emit("func (%s *%s) neoMsgEncodedLen() int {", s.recvName, s.typeName)
if s.varUsed["size"] { if s.varUsed["size"] {
code.emit("var %s int", s.var_("size")) code.emit("var %s int", s.var_("size"))
} }
...@@ -684,7 +684,7 @@ func (s *sizer) generatedCode() string { ...@@ -684,7 +684,7 @@ func (s *sizer) generatedCode() string {
func (e *encoder) generatedCode() string { func (e *encoder) generatedCode() string {
code := Buffer{} code := Buffer{}
// prologue // prologue
code.emit("func (%s *%s) NEOMsgEncode(data []byte) {", e.recvName, e.typeName) code.emit("func (%s *%s) neoMsgEncode(data []byte) {", e.recvName, e.typeName)
code.Write(e.buf.Bytes()) code.Write(e.buf.Bytes())
...@@ -796,7 +796,7 @@ func (d *decoder) generatedCode() string { ...@@ -796,7 +796,7 @@ func (d *decoder) generatedCode() string {
code := Buffer{} code := Buffer{}
// prologue // prologue
code.emit("func (%s *%s) NEOMsgDecode(data []byte) (int, error) {", d.recvName, d.typeName) code.emit("func (%s *%s) neoMsgDecode(data []byte) (int, error) {", d.recvName, d.typeName)
if d.varUsed["nread"] { if d.varUsed["nread"] {
code.emit("var %v uint64", d.var_("nread")) code.emit("var %v uint64", d.var_("nread"))
} }
......
...@@ -21,11 +21,11 @@ func (*Error) neoMsgCode() uint16 { ...@@ -21,11 +21,11 @@ func (*Error) neoMsgCode() uint16 {
return 0 | answerBit return 0 | answerBit
} }
func (p *Error) NEOMsgEncodedLen() int { func (p *Error) neoMsgEncodedLen() int {
return 8 + len(p.Message) return 8 + len(p.Message)
} }
func (p *Error) NEOMsgEncode(data []byte) { func (p *Error) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], uint32(p.Code)) binary.BigEndian.PutUint32(data[0:], uint32(p.Code))
{ {
l := uint32(len(p.Message)) l := uint32(len(p.Message))
...@@ -36,7 +36,7 @@ func (p *Error) NEOMsgEncode(data []byte) { ...@@ -36,7 +36,7 @@ func (p *Error) NEOMsgEncode(data []byte) {
} }
} }
func (p *Error) NEOMsgDecode(data []byte) (int, error) { func (p *Error) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
...@@ -64,7 +64,7 @@ func (*RequestIdentification) neoMsgCode() uint16 { ...@@ -64,7 +64,7 @@ func (*RequestIdentification) neoMsgCode() uint16 {
return 1 return 1
} }
func (p *RequestIdentification) NEOMsgEncodedLen() int { func (p *RequestIdentification) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.DevPath); i++ { for i := 0; i < len(p.DevPath); i++ {
a := &p.DevPath[i] a := &p.DevPath[i]
...@@ -73,7 +73,7 @@ func (p *RequestIdentification) NEOMsgEncodedLen() int { ...@@ -73,7 +73,7 @@ func (p *RequestIdentification) NEOMsgEncodedLen() int {
return 17 + p.Address.neoEncodedLen() + len(p.ClusterName) + p.IdTime.neoEncodedLen() + len(p.DevPath)*4 + len(p.NewNID)*4 + size return 17 + p.Address.neoEncodedLen() + len(p.ClusterName) + p.IdTime.neoEncodedLen() + len(p.DevPath)*4 + len(p.NewNID)*4 + size
} }
func (p *RequestIdentification) NEOMsgEncode(data []byte) { func (p *RequestIdentification) neoMsgEncode(data []byte) {
(data[0:])[0] = uint8(int8(p.NodeType)) (data[0:])[0] = uint8(int8(p.NodeType))
binary.BigEndian.PutUint32(data[1:], uint32(int32(p.UUID))) binary.BigEndian.PutUint32(data[1:], uint32(int32(p.UUID)))
{ {
...@@ -119,7 +119,7 @@ func (p *RequestIdentification) NEOMsgEncode(data []byte) { ...@@ -119,7 +119,7 @@ func (p *RequestIdentification) NEOMsgEncode(data []byte) {
} }
} }
func (p *RequestIdentification) NEOMsgDecode(data []byte) (int, error) { func (p *RequestIdentification) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 5 { if len(data) < 5 {
goto overflow goto overflow
...@@ -210,17 +210,17 @@ func (*AcceptIdentification) neoMsgCode() uint16 { ...@@ -210,17 +210,17 @@ func (*AcceptIdentification) neoMsgCode() uint16 {
return 1 | answerBit return 1 | answerBit
} }
func (p *AcceptIdentification) NEOMsgEncodedLen() int { func (p *AcceptIdentification) neoMsgEncodedLen() int {
return 9 return 9
} }
func (p *AcceptIdentification) NEOMsgEncode(data []byte) { func (p *AcceptIdentification) neoMsgEncode(data []byte) {
(data[0:])[0] = uint8(int8(p.NodeType)) (data[0:])[0] = uint8(int8(p.NodeType))
binary.BigEndian.PutUint32(data[1:], uint32(int32(p.MyUUID))) binary.BigEndian.PutUint32(data[1:], uint32(int32(p.MyUUID)))
binary.BigEndian.PutUint32(data[5:], uint32(int32(p.YourUUID))) binary.BigEndian.PutUint32(data[5:], uint32(int32(p.YourUUID)))
} }
func (p *AcceptIdentification) NEOMsgDecode(data []byte) (int, error) { func (p *AcceptIdentification) neoMsgDecode(data []byte) (int, error) {
if len(data) < 9 { if len(data) < 9 {
goto overflow goto overflow
} }
...@@ -239,14 +239,14 @@ func (*Ping) neoMsgCode() uint16 { ...@@ -239,14 +239,14 @@ func (*Ping) neoMsgCode() uint16 {
return 2 return 2
} }
func (p *Ping) NEOMsgEncodedLen() int { func (p *Ping) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *Ping) NEOMsgEncode(data []byte) { func (p *Ping) neoMsgEncode(data []byte) {
} }
func (p *Ping) NEOMsgDecode(data []byte) (int, error) { func (p *Ping) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -256,14 +256,14 @@ func (*Pong) neoMsgCode() uint16 { ...@@ -256,14 +256,14 @@ func (*Pong) neoMsgCode() uint16 {
return 2 | answerBit return 2 | answerBit
} }
func (p *Pong) NEOMsgEncodedLen() int { func (p *Pong) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *Pong) NEOMsgEncode(data []byte) { func (p *Pong) neoMsgEncode(data []byte) {
} }
func (p *Pong) NEOMsgDecode(data []byte) (int, error) { func (p *Pong) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -273,14 +273,14 @@ func (*CloseClient) neoMsgCode() uint16 { ...@@ -273,14 +273,14 @@ func (*CloseClient) neoMsgCode() uint16 {
return 3 return 3
} }
func (p *CloseClient) NEOMsgEncodedLen() int { func (p *CloseClient) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *CloseClient) NEOMsgEncode(data []byte) { func (p *CloseClient) neoMsgEncode(data []byte) {
} }
func (p *CloseClient) NEOMsgDecode(data []byte) (int, error) { func (p *CloseClient) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -290,14 +290,14 @@ func (*PrimaryMaster) neoMsgCode() uint16 { ...@@ -290,14 +290,14 @@ func (*PrimaryMaster) neoMsgCode() uint16 {
return 4 return 4
} }
func (p *PrimaryMaster) NEOMsgEncodedLen() int { func (p *PrimaryMaster) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *PrimaryMaster) NEOMsgEncode(data []byte) { func (p *PrimaryMaster) neoMsgEncode(data []byte) {
} }
func (p *PrimaryMaster) NEOMsgDecode(data []byte) (int, error) { func (p *PrimaryMaster) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -307,15 +307,15 @@ func (*AnswerPrimary) neoMsgCode() uint16 { ...@@ -307,15 +307,15 @@ func (*AnswerPrimary) neoMsgCode() uint16 {
return 4 | answerBit return 4 | answerBit
} }
func (p *AnswerPrimary) NEOMsgEncodedLen() int { func (p *AnswerPrimary) neoMsgEncodedLen() int {
return 4 return 4
} }
func (p *AnswerPrimary) NEOMsgEncode(data []byte) { func (p *AnswerPrimary) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], uint32(int32(p.PrimaryNodeUUID))) binary.BigEndian.PutUint32(data[0:], uint32(int32(p.PrimaryNodeUUID)))
} }
func (p *AnswerPrimary) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerPrimary) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
...@@ -332,7 +332,7 @@ func (*NotPrimaryMaster) neoMsgCode() uint16 { ...@@ -332,7 +332,7 @@ func (*NotPrimaryMaster) neoMsgCode() uint16 {
return 5 return 5
} }
func (p *NotPrimaryMaster) NEOMsgEncodedLen() int { func (p *NotPrimaryMaster) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.KnownMasterList); i++ { for i := 0; i < len(p.KnownMasterList); i++ {
a := &p.KnownMasterList[i] a := &p.KnownMasterList[i]
...@@ -341,7 +341,7 @@ func (p *NotPrimaryMaster) NEOMsgEncodedLen() int { ...@@ -341,7 +341,7 @@ func (p *NotPrimaryMaster) NEOMsgEncodedLen() int {
return 8 + size return 8 + size
} }
func (p *NotPrimaryMaster) NEOMsgEncode(data []byte) { func (p *NotPrimaryMaster) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], uint32(int32(p.Primary))) binary.BigEndian.PutUint32(data[0:], uint32(int32(p.Primary)))
{ {
l := uint32(len(p.KnownMasterList)) l := uint32(len(p.KnownMasterList))
...@@ -358,7 +358,7 @@ func (p *NotPrimaryMaster) NEOMsgEncode(data []byte) { ...@@ -358,7 +358,7 @@ func (p *NotPrimaryMaster) NEOMsgEncode(data []byte) {
} }
} }
func (p *NotPrimaryMaster) NEOMsgDecode(data []byte) (int, error) { func (p *NotPrimaryMaster) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
...@@ -392,7 +392,7 @@ func (*NotifyNodeInformation) neoMsgCode() uint16 { ...@@ -392,7 +392,7 @@ func (*NotifyNodeInformation) neoMsgCode() uint16 {
return 6 return 6
} }
func (p *NotifyNodeInformation) NEOMsgEncodedLen() int { func (p *NotifyNodeInformation) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.NodeList); i++ { for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
...@@ -401,7 +401,7 @@ func (p *NotifyNodeInformation) NEOMsgEncodedLen() int { ...@@ -401,7 +401,7 @@ func (p *NotifyNodeInformation) NEOMsgEncodedLen() int {
return 4 + p.IdTime.neoEncodedLen() + len(p.NodeList)*6 + size return 4 + p.IdTime.neoEncodedLen() + len(p.NodeList)*6 + size
} }
func (p *NotifyNodeInformation) NEOMsgEncode(data []byte) { func (p *NotifyNodeInformation) neoMsgEncode(data []byte) {
{ {
n := p.IdTime.neoEncode(data[0:]) n := p.IdTime.neoEncode(data[0:])
data = data[0+n:] data = data[0+n:]
...@@ -428,7 +428,7 @@ func (p *NotifyNodeInformation) NEOMsgEncode(data []byte) { ...@@ -428,7 +428,7 @@ func (p *NotifyNodeInformation) NEOMsgEncode(data []byte) {
} }
} }
func (p *NotifyNodeInformation) NEOMsgDecode(data []byte) (int, error) { func (p *NotifyNodeInformation) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
{ {
n, ok := p.IdTime.neoDecode(data) n, ok := p.IdTime.neoDecode(data)
...@@ -489,14 +489,14 @@ func (*Recovery) neoMsgCode() uint16 { ...@@ -489,14 +489,14 @@ func (*Recovery) neoMsgCode() uint16 {
return 7 return 7
} }
func (p *Recovery) NEOMsgEncodedLen() int { func (p *Recovery) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *Recovery) NEOMsgEncode(data []byte) { func (p *Recovery) neoMsgEncode(data []byte) {
} }
func (p *Recovery) NEOMsgDecode(data []byte) (int, error) { func (p *Recovery) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -506,17 +506,17 @@ func (*AnswerRecovery) neoMsgCode() uint16 { ...@@ -506,17 +506,17 @@ func (*AnswerRecovery) neoMsgCode() uint16 {
return 7 | answerBit return 7 | answerBit
} }
func (p *AnswerRecovery) NEOMsgEncodedLen() int { func (p *AnswerRecovery) neoMsgEncodedLen() int {
return 24 return 24
} }
func (p *AnswerRecovery) NEOMsgEncode(data []byte) { func (p *AnswerRecovery) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.PTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.PTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.BackupTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.BackupTid))
binary.BigEndian.PutUint64(data[16:], uint64(p.TruncateTid)) binary.BigEndian.PutUint64(data[16:], uint64(p.TruncateTid))
} }
func (p *AnswerRecovery) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerRecovery) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
...@@ -535,14 +535,14 @@ func (*LastIDs) neoMsgCode() uint16 { ...@@ -535,14 +535,14 @@ func (*LastIDs) neoMsgCode() uint16 {
return 8 return 8
} }
func (p *LastIDs) NEOMsgEncodedLen() int { func (p *LastIDs) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *LastIDs) NEOMsgEncode(data []byte) { func (p *LastIDs) neoMsgEncode(data []byte) {
} }
func (p *LastIDs) NEOMsgDecode(data []byte) (int, error) { func (p *LastIDs) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -552,16 +552,16 @@ func (*AnswerLastIDs) neoMsgCode() uint16 { ...@@ -552,16 +552,16 @@ func (*AnswerLastIDs) neoMsgCode() uint16 {
return 8 | answerBit return 8 | answerBit
} }
func (p *AnswerLastIDs) NEOMsgEncodedLen() int { func (p *AnswerLastIDs) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *AnswerLastIDs) NEOMsgEncode(data []byte) { func (p *AnswerLastIDs) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.LastOid)) binary.BigEndian.PutUint64(data[0:], uint64(p.LastOid))
binary.BigEndian.PutUint64(data[8:], uint64(p.LastTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.LastTid))
} }
func (p *AnswerLastIDs) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerLastIDs) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -579,14 +579,14 @@ func (*AskPartitionTable) neoMsgCode() uint16 { ...@@ -579,14 +579,14 @@ func (*AskPartitionTable) neoMsgCode() uint16 {
return 9 return 9
} }
func (p *AskPartitionTable) NEOMsgEncodedLen() int { func (p *AskPartitionTable) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *AskPartitionTable) NEOMsgEncode(data []byte) { func (p *AskPartitionTable) neoMsgEncode(data []byte) {
} }
func (p *AskPartitionTable) NEOMsgDecode(data []byte) (int, error) { func (p *AskPartitionTable) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -596,7 +596,7 @@ func (*AnswerPartitionTable) neoMsgCode() uint16 { ...@@ -596,7 +596,7 @@ func (*AnswerPartitionTable) neoMsgCode() uint16 {
return 9 | answerBit return 9 | answerBit
} }
func (p *AnswerPartitionTable) NEOMsgEncodedLen() int { func (p *AnswerPartitionTable) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.RowList); i++ { for i := 0; i < len(p.RowList); i++ {
a := &p.RowList[i] a := &p.RowList[i]
...@@ -605,7 +605,7 @@ func (p *AnswerPartitionTable) NEOMsgEncodedLen() int { ...@@ -605,7 +605,7 @@ func (p *AnswerPartitionTable) NEOMsgEncodedLen() int {
return 16 + len(p.RowList)*4 + size return 16 + len(p.RowList)*4 + size
} }
func (p *AnswerPartitionTable) NEOMsgEncode(data []byte) { func (p *AnswerPartitionTable) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.PTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.PTid))
binary.BigEndian.PutUint32(data[8:], p.NumReplicas) binary.BigEndian.PutUint32(data[8:], p.NumReplicas)
{ {
...@@ -630,7 +630,7 @@ func (p *AnswerPartitionTable) NEOMsgEncode(data []byte) { ...@@ -630,7 +630,7 @@ func (p *AnswerPartitionTable) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerPartitionTable) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerPartitionTable) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
...@@ -676,7 +676,7 @@ func (*SendPartitionTable) neoMsgCode() uint16 { ...@@ -676,7 +676,7 @@ func (*SendPartitionTable) neoMsgCode() uint16 {
return 10 return 10
} }
func (p *SendPartitionTable) NEOMsgEncodedLen() int { func (p *SendPartitionTable) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.RowList); i++ { for i := 0; i < len(p.RowList); i++ {
a := &p.RowList[i] a := &p.RowList[i]
...@@ -685,7 +685,7 @@ func (p *SendPartitionTable) NEOMsgEncodedLen() int { ...@@ -685,7 +685,7 @@ func (p *SendPartitionTable) NEOMsgEncodedLen() int {
return 16 + len(p.RowList)*4 + size return 16 + len(p.RowList)*4 + size
} }
func (p *SendPartitionTable) NEOMsgEncode(data []byte) { func (p *SendPartitionTable) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.PTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.PTid))
binary.BigEndian.PutUint32(data[8:], p.NumReplicas) binary.BigEndian.PutUint32(data[8:], p.NumReplicas)
{ {
...@@ -710,7 +710,7 @@ func (p *SendPartitionTable) NEOMsgEncode(data []byte) { ...@@ -710,7 +710,7 @@ func (p *SendPartitionTable) NEOMsgEncode(data []byte) {
} }
} }
func (p *SendPartitionTable) NEOMsgDecode(data []byte) (int, error) { func (p *SendPartitionTable) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
...@@ -756,11 +756,11 @@ func (*NotifyPartitionChanges) neoMsgCode() uint16 { ...@@ -756,11 +756,11 @@ func (*NotifyPartitionChanges) neoMsgCode() uint16 {
return 11 return 11
} }
func (p *NotifyPartitionChanges) NEOMsgEncodedLen() int { func (p *NotifyPartitionChanges) neoMsgEncodedLen() int {
return 16 + len(p.CellList)*9 return 16 + len(p.CellList)*9
} }
func (p *NotifyPartitionChanges) NEOMsgEncode(data []byte) { func (p *NotifyPartitionChanges) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.PTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.PTid))
binary.BigEndian.PutUint32(data[8:], p.NumReplicas) binary.BigEndian.PutUint32(data[8:], p.NumReplicas)
{ {
...@@ -777,7 +777,7 @@ func (p *NotifyPartitionChanges) NEOMsgEncode(data []byte) { ...@@ -777,7 +777,7 @@ func (p *NotifyPartitionChanges) NEOMsgEncode(data []byte) {
} }
} }
func (p *NotifyPartitionChanges) NEOMsgDecode(data []byte) (int, error) { func (p *NotifyPartitionChanges) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
...@@ -815,15 +815,15 @@ func (*StartOperation) neoMsgCode() uint16 { ...@@ -815,15 +815,15 @@ func (*StartOperation) neoMsgCode() uint16 {
return 12 return 12
} }
func (p *StartOperation) NEOMsgEncodedLen() int { func (p *StartOperation) neoMsgEncodedLen() int {
return 1 return 1
} }
func (p *StartOperation) NEOMsgEncode(data []byte) { func (p *StartOperation) neoMsgEncode(data []byte) {
(data[0:])[0] = bool2byte(p.Backup) (data[0:])[0] = bool2byte(p.Backup)
} }
func (p *StartOperation) NEOMsgDecode(data []byte) (int, error) { func (p *StartOperation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
...@@ -840,14 +840,14 @@ func (*StopOperation) neoMsgCode() uint16 { ...@@ -840,14 +840,14 @@ func (*StopOperation) neoMsgCode() uint16 {
return 13 return 13
} }
func (p *StopOperation) NEOMsgEncodedLen() int { func (p *StopOperation) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *StopOperation) NEOMsgEncode(data []byte) { func (p *StopOperation) neoMsgEncode(data []byte) {
} }
func (p *StopOperation) NEOMsgDecode(data []byte) (int, error) { func (p *StopOperation) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -857,11 +857,11 @@ func (*UnfinishedTransactions) neoMsgCode() uint16 { ...@@ -857,11 +857,11 @@ func (*UnfinishedTransactions) neoMsgCode() uint16 {
return 14 return 14
} }
func (p *UnfinishedTransactions) NEOMsgEncodedLen() int { func (p *UnfinishedTransactions) neoMsgEncodedLen() int {
return 4 + len(p.RowList)*4 return 4 + len(p.RowList)*4
} }
func (p *UnfinishedTransactions) NEOMsgEncode(data []byte) { func (p *UnfinishedTransactions) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.RowList)) l := uint32(len(p.RowList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -874,7 +874,7 @@ func (p *UnfinishedTransactions) NEOMsgEncode(data []byte) { ...@@ -874,7 +874,7 @@ func (p *UnfinishedTransactions) NEOMsgEncode(data []byte) {
} }
} }
func (p *UnfinishedTransactions) NEOMsgDecode(data []byte) (int, error) { func (p *UnfinishedTransactions) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -905,11 +905,11 @@ func (*AnswerUnfinishedTransactions) neoMsgCode() uint16 { ...@@ -905,11 +905,11 @@ func (*AnswerUnfinishedTransactions) neoMsgCode() uint16 {
return 14 | answerBit return 14 | answerBit
} }
func (p *AnswerUnfinishedTransactions) NEOMsgEncodedLen() int { func (p *AnswerUnfinishedTransactions) neoMsgEncodedLen() int {
return 12 + len(p.TidList)*8 return 12 + len(p.TidList)*8
} }
func (p *AnswerUnfinishedTransactions) NEOMsgEncode(data []byte) { func (p *AnswerUnfinishedTransactions) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.MaxTID))
{ {
l := uint32(len(p.TidList)) l := uint32(len(p.TidList))
...@@ -923,7 +923,7 @@ func (p *AnswerUnfinishedTransactions) NEOMsgEncode(data []byte) { ...@@ -923,7 +923,7 @@ func (p *AnswerUnfinishedTransactions) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerUnfinishedTransactions) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerUnfinishedTransactions) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -955,14 +955,14 @@ func (*LockedTransactions) neoMsgCode() uint16 { ...@@ -955,14 +955,14 @@ func (*LockedTransactions) neoMsgCode() uint16 {
return 15 return 15
} }
func (p *LockedTransactions) NEOMsgEncodedLen() int { func (p *LockedTransactions) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *LockedTransactions) NEOMsgEncode(data []byte) { func (p *LockedTransactions) neoMsgEncode(data []byte) {
} }
func (p *LockedTransactions) NEOMsgDecode(data []byte) (int, error) { func (p *LockedTransactions) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -972,11 +972,11 @@ func (*AnswerLockedTransactions) neoMsgCode() uint16 { ...@@ -972,11 +972,11 @@ func (*AnswerLockedTransactions) neoMsgCode() uint16 {
return 15 | answerBit return 15 | answerBit
} }
func (p *AnswerLockedTransactions) NEOMsgEncodedLen() int { func (p *AnswerLockedTransactions) neoMsgEncodedLen() int {
return 4 + len(p.TidDict)*16 return 4 + len(p.TidDict)*16
} }
func (p *AnswerLockedTransactions) NEOMsgEncode(data []byte) { func (p *AnswerLockedTransactions) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.TidDict)) l := uint32(len(p.TidDict))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -994,7 +994,7 @@ func (p *AnswerLockedTransactions) NEOMsgEncode(data []byte) { ...@@ -994,7 +994,7 @@ func (p *AnswerLockedTransactions) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerLockedTransactions) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerLockedTransactions) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -1026,15 +1026,15 @@ func (*FinalTID) neoMsgCode() uint16 { ...@@ -1026,15 +1026,15 @@ func (*FinalTID) neoMsgCode() uint16 {
return 16 return 16
} }
func (p *FinalTID) NEOMsgEncodedLen() int { func (p *FinalTID) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *FinalTID) NEOMsgEncode(data []byte) { func (p *FinalTID) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTID))
} }
func (p *FinalTID) NEOMsgDecode(data []byte) (int, error) { func (p *FinalTID) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1051,15 +1051,15 @@ func (*AnswerFinalTID) neoMsgCode() uint16 { ...@@ -1051,15 +1051,15 @@ func (*AnswerFinalTID) neoMsgCode() uint16 {
return 16 | answerBit return 16 | answerBit
} }
func (p *AnswerFinalTID) NEOMsgEncodedLen() int { func (p *AnswerFinalTID) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *AnswerFinalTID) NEOMsgEncode(data []byte) { func (p *AnswerFinalTID) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *AnswerFinalTID) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerFinalTID) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1076,16 +1076,16 @@ func (*ValidateTransaction) neoMsgCode() uint16 { ...@@ -1076,16 +1076,16 @@ func (*ValidateTransaction) neoMsgCode() uint16 {
return 17 return 17
} }
func (p *ValidateTransaction) NEOMsgEncodedLen() int { func (p *ValidateTransaction) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *ValidateTransaction) NEOMsgEncode(data []byte) { func (p *ValidateTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTID))
binary.BigEndian.PutUint64(data[8:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[8:], uint64(p.Tid))
} }
func (p *ValidateTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *ValidateTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -1103,15 +1103,15 @@ func (*BeginTransaction) neoMsgCode() uint16 { ...@@ -1103,15 +1103,15 @@ func (*BeginTransaction) neoMsgCode() uint16 {
return 18 return 18
} }
func (p *BeginTransaction) NEOMsgEncodedLen() int { func (p *BeginTransaction) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *BeginTransaction) NEOMsgEncode(data []byte) { func (p *BeginTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *BeginTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *BeginTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1128,15 +1128,15 @@ func (*AnswerBeginTransaction) neoMsgCode() uint16 { ...@@ -1128,15 +1128,15 @@ func (*AnswerBeginTransaction) neoMsgCode() uint16 {
return 18 | answerBit return 18 | answerBit
} }
func (p *AnswerBeginTransaction) NEOMsgEncodedLen() int { func (p *AnswerBeginTransaction) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *AnswerBeginTransaction) NEOMsgEncode(data []byte) { func (p *AnswerBeginTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *AnswerBeginTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerBeginTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1153,11 +1153,11 @@ func (*FailedVote) neoMsgCode() uint16 { ...@@ -1153,11 +1153,11 @@ func (*FailedVote) neoMsgCode() uint16 {
return 19 return 19
} }
func (p *FailedVote) NEOMsgEncodedLen() int { func (p *FailedVote) neoMsgEncodedLen() int {
return 12 + len(p.NodeList)*4 return 12 + len(p.NodeList)*4
} }
func (p *FailedVote) NEOMsgEncode(data []byte) { func (p *FailedVote) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.NodeList)) l := uint32(len(p.NodeList))
...@@ -1171,7 +1171,7 @@ func (p *FailedVote) NEOMsgEncode(data []byte) { ...@@ -1171,7 +1171,7 @@ func (p *FailedVote) NEOMsgEncode(data []byte) {
} }
} }
func (p *FailedVote) NEOMsgDecode(data []byte) (int, error) { func (p *FailedVote) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -1203,11 +1203,11 @@ func (*FinishTransaction) neoMsgCode() uint16 { ...@@ -1203,11 +1203,11 @@ func (*FinishTransaction) neoMsgCode() uint16 {
return 20 return 20
} }
func (p *FinishTransaction) NEOMsgEncodedLen() int { func (p *FinishTransaction) neoMsgEncodedLen() int {
return 16 + len(p.OIDList)*8 + len(p.CheckedList)*8 return 16 + len(p.OIDList)*8 + len(p.CheckedList)*8
} }
func (p *FinishTransaction) NEOMsgEncode(data []byte) { func (p *FinishTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.OIDList)) l := uint32(len(p.OIDList))
...@@ -1231,7 +1231,7 @@ func (p *FinishTransaction) NEOMsgEncode(data []byte) { ...@@ -1231,7 +1231,7 @@ func (p *FinishTransaction) NEOMsgEncode(data []byte) {
} }
} }
func (p *FinishTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *FinishTransaction) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -1277,16 +1277,16 @@ func (*AnswerTransactionFinished) neoMsgCode() uint16 { ...@@ -1277,16 +1277,16 @@ func (*AnswerTransactionFinished) neoMsgCode() uint16 {
return 20 | answerBit return 20 | answerBit
} }
func (p *AnswerTransactionFinished) NEOMsgEncodedLen() int { func (p *AnswerTransactionFinished) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *AnswerTransactionFinished) NEOMsgEncode(data []byte) { func (p *AnswerTransactionFinished) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[8:], uint64(p.Tid))
} }
func (p *AnswerTransactionFinished) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerTransactionFinished) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -1304,16 +1304,16 @@ func (*LockInformation) neoMsgCode() uint16 { ...@@ -1304,16 +1304,16 @@ func (*LockInformation) neoMsgCode() uint16 {
return 21 return 21
} }
func (p *LockInformation) NEOMsgEncodedLen() int { func (p *LockInformation) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *LockInformation) NEOMsgEncode(data []byte) { func (p *LockInformation) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Ttid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Ttid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[8:], uint64(p.Tid))
} }
func (p *LockInformation) NEOMsgDecode(data []byte) (int, error) { func (p *LockInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -1331,15 +1331,15 @@ func (*AnswerInformationLocked) neoMsgCode() uint16 { ...@@ -1331,15 +1331,15 @@ func (*AnswerInformationLocked) neoMsgCode() uint16 {
return 21 | answerBit return 21 | answerBit
} }
func (p *AnswerInformationLocked) NEOMsgEncodedLen() int { func (p *AnswerInformationLocked) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *AnswerInformationLocked) NEOMsgEncode(data []byte) { func (p *AnswerInformationLocked) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Ttid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Ttid))
} }
func (p *AnswerInformationLocked) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerInformationLocked) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1356,11 +1356,11 @@ func (*InvalidateObjects) neoMsgCode() uint16 { ...@@ -1356,11 +1356,11 @@ func (*InvalidateObjects) neoMsgCode() uint16 {
return 22 return 22
} }
func (p *InvalidateObjects) NEOMsgEncodedLen() int { func (p *InvalidateObjects) neoMsgEncodedLen() int {
return 12 + len(p.OidList)*8 return 12 + len(p.OidList)*8
} }
func (p *InvalidateObjects) NEOMsgEncode(data []byte) { func (p *InvalidateObjects) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.OidList)) l := uint32(len(p.OidList))
...@@ -1374,7 +1374,7 @@ func (p *InvalidateObjects) NEOMsgEncode(data []byte) { ...@@ -1374,7 +1374,7 @@ func (p *InvalidateObjects) NEOMsgEncode(data []byte) {
} }
} }
func (p *InvalidateObjects) NEOMsgDecode(data []byte) (int, error) { func (p *InvalidateObjects) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -1406,15 +1406,15 @@ func (*NotifyUnlockInformation) neoMsgCode() uint16 { ...@@ -1406,15 +1406,15 @@ func (*NotifyUnlockInformation) neoMsgCode() uint16 {
return 23 return 23
} }
func (p *NotifyUnlockInformation) NEOMsgEncodedLen() int { func (p *NotifyUnlockInformation) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *NotifyUnlockInformation) NEOMsgEncode(data []byte) { func (p *NotifyUnlockInformation) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTID))
} }
func (p *NotifyUnlockInformation) NEOMsgDecode(data []byte) (int, error) { func (p *NotifyUnlockInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1431,15 +1431,15 @@ func (*AskNewOIDs) neoMsgCode() uint16 { ...@@ -1431,15 +1431,15 @@ func (*AskNewOIDs) neoMsgCode() uint16 {
return 24 return 24
} }
func (p *AskNewOIDs) NEOMsgEncodedLen() int { func (p *AskNewOIDs) neoMsgEncodedLen() int {
return 4 return 4
} }
func (p *AskNewOIDs) NEOMsgEncode(data []byte) { func (p *AskNewOIDs) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.NumOIDs) binary.BigEndian.PutUint32(data[0:], p.NumOIDs)
} }
func (p *AskNewOIDs) NEOMsgDecode(data []byte) (int, error) { func (p *AskNewOIDs) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
...@@ -1456,11 +1456,11 @@ func (*AnswerNewOIDs) neoMsgCode() uint16 { ...@@ -1456,11 +1456,11 @@ func (*AnswerNewOIDs) neoMsgCode() uint16 {
return 24 | answerBit return 24 | answerBit
} }
func (p *AnswerNewOIDs) NEOMsgEncodedLen() int { func (p *AnswerNewOIDs) neoMsgEncodedLen() int {
return 4 + len(p.OidList)*8 return 4 + len(p.OidList)*8
} }
func (p *AnswerNewOIDs) NEOMsgEncode(data []byte) { func (p *AnswerNewOIDs) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.OidList)) l := uint32(len(p.OidList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -1473,7 +1473,7 @@ func (p *AnswerNewOIDs) NEOMsgEncode(data []byte) { ...@@ -1473,7 +1473,7 @@ func (p *AnswerNewOIDs) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerNewOIDs) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerNewOIDs) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -1504,16 +1504,16 @@ func (*NotifyDeadlock) neoMsgCode() uint16 { ...@@ -1504,16 +1504,16 @@ func (*NotifyDeadlock) neoMsgCode() uint16 {
return 25 return 25
} }
func (p *NotifyDeadlock) NEOMsgEncodedLen() int { func (p *NotifyDeadlock) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *NotifyDeadlock) NEOMsgEncode(data []byte) { func (p *NotifyDeadlock) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.LockingTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.LockingTid))
} }
func (p *NotifyDeadlock) NEOMsgDecode(data []byte) (int, error) { func (p *NotifyDeadlock) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -1531,16 +1531,16 @@ func (*RebaseTransaction) neoMsgCode() uint16 { ...@@ -1531,16 +1531,16 @@ func (*RebaseTransaction) neoMsgCode() uint16 {
return 26 return 26
} }
func (p *RebaseTransaction) NEOMsgEncodedLen() int { func (p *RebaseTransaction) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *RebaseTransaction) NEOMsgEncode(data []byte) { func (p *RebaseTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.LockingTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.LockingTid))
} }
func (p *RebaseTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *RebaseTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -1558,11 +1558,11 @@ func (*AnswerRebaseTransaction) neoMsgCode() uint16 { ...@@ -1558,11 +1558,11 @@ func (*AnswerRebaseTransaction) neoMsgCode() uint16 {
return 26 | answerBit return 26 | answerBit
} }
func (p *AnswerRebaseTransaction) NEOMsgEncodedLen() int { func (p *AnswerRebaseTransaction) neoMsgEncodedLen() int {
return 4 + len(p.OidList)*8 return 4 + len(p.OidList)*8
} }
func (p *AnswerRebaseTransaction) NEOMsgEncode(data []byte) { func (p *AnswerRebaseTransaction) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.OidList)) l := uint32(len(p.OidList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -1575,7 +1575,7 @@ func (p *AnswerRebaseTransaction) NEOMsgEncode(data []byte) { ...@@ -1575,7 +1575,7 @@ func (p *AnswerRebaseTransaction) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerRebaseTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerRebaseTransaction) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -1606,16 +1606,16 @@ func (*RebaseObject) neoMsgCode() uint16 { ...@@ -1606,16 +1606,16 @@ func (*RebaseObject) neoMsgCode() uint16 {
return 27 return 27
} }
func (p *RebaseObject) NEOMsgEncodedLen() int { func (p *RebaseObject) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *RebaseObject) NEOMsgEncode(data []byte) { func (p *RebaseObject) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[8:], uint64(p.Oid))
} }
func (p *RebaseObject) NEOMsgDecode(data []byte) (int, error) { func (p *RebaseObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -1633,11 +1633,11 @@ func (*AnswerRebaseObject) neoMsgCode() uint16 { ...@@ -1633,11 +1633,11 @@ func (*AnswerRebaseObject) neoMsgCode() uint16 {
return 27 | answerBit return 27 | answerBit
} }
func (p *AnswerRebaseObject) NEOMsgEncodedLen() int { func (p *AnswerRebaseObject) neoMsgEncodedLen() int {
return 41 + len(p.Data.XData()) return 41 + len(p.Data.XData())
} }
func (p *AnswerRebaseObject) NEOMsgEncode(data []byte) { func (p *AnswerRebaseObject) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Serial)) binary.BigEndian.PutUint64(data[0:], uint64(p.Serial))
binary.BigEndian.PutUint64(data[8:], uint64(p.ConflictSerial)) binary.BigEndian.PutUint64(data[8:], uint64(p.ConflictSerial))
(data[16:])[0] = bool2byte(p.Compression) (data[16:])[0] = bool2byte(p.Compression)
...@@ -1651,7 +1651,7 @@ func (p *AnswerRebaseObject) NEOMsgEncode(data []byte) { ...@@ -1651,7 +1651,7 @@ func (p *AnswerRebaseObject) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerRebaseObject) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerRebaseObject) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 41 { if len(data) < 41 {
goto overflow goto overflow
...@@ -1683,11 +1683,11 @@ func (*StoreObject) neoMsgCode() uint16 { ...@@ -1683,11 +1683,11 @@ func (*StoreObject) neoMsgCode() uint16 {
return 28 return 28
} }
func (p *StoreObject) NEOMsgEncodedLen() int { func (p *StoreObject) neoMsgEncodedLen() int {
return 57 + len(p.Data) return 57 + len(p.Data)
} }
func (p *StoreObject) NEOMsgEncode(data []byte) { func (p *StoreObject) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Oid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Serial)) binary.BigEndian.PutUint64(data[8:], uint64(p.Serial))
(data[16:])[0] = bool2byte(p.Compression) (data[16:])[0] = bool2byte(p.Compression)
...@@ -1703,7 +1703,7 @@ func (p *StoreObject) NEOMsgEncode(data []byte) { ...@@ -1703,7 +1703,7 @@ func (p *StoreObject) NEOMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[8:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[8:], uint64(p.Tid))
} }
func (p *StoreObject) NEOMsgDecode(data []byte) (int, error) { func (p *StoreObject) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 41 { if len(data) < 41 {
goto overflow goto overflow
...@@ -1737,15 +1737,15 @@ func (*AnswerStoreObject) neoMsgCode() uint16 { ...@@ -1737,15 +1737,15 @@ func (*AnswerStoreObject) neoMsgCode() uint16 {
return 28 | answerBit return 28 | answerBit
} }
func (p *AnswerStoreObject) NEOMsgEncodedLen() int { func (p *AnswerStoreObject) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *AnswerStoreObject) NEOMsgEncode(data []byte) { func (p *AnswerStoreObject) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Conflict)) binary.BigEndian.PutUint64(data[0:], uint64(p.Conflict))
} }
func (p *AnswerStoreObject) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerStoreObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1762,11 +1762,11 @@ func (*AbortTransaction) neoMsgCode() uint16 { ...@@ -1762,11 +1762,11 @@ func (*AbortTransaction) neoMsgCode() uint16 {
return 29 return 29
} }
func (p *AbortTransaction) NEOMsgEncodedLen() int { func (p *AbortTransaction) neoMsgEncodedLen() int {
return 12 + len(p.NodeList)*4 return 12 + len(p.NodeList)*4
} }
func (p *AbortTransaction) NEOMsgEncode(data []byte) { func (p *AbortTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.NodeList)) l := uint32(len(p.NodeList))
...@@ -1780,7 +1780,7 @@ func (p *AbortTransaction) NEOMsgEncode(data []byte) { ...@@ -1780,7 +1780,7 @@ func (p *AbortTransaction) NEOMsgEncode(data []byte) {
} }
} }
func (p *AbortTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *AbortTransaction) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -1812,11 +1812,11 @@ func (*StoreTransaction) neoMsgCode() uint16 { ...@@ -1812,11 +1812,11 @@ func (*StoreTransaction) neoMsgCode() uint16 {
return 30 return 30
} }
func (p *StoreTransaction) NEOMsgEncodedLen() int { func (p *StoreTransaction) neoMsgEncodedLen() int {
return 24 + len(p.User) + len(p.Description) + len(p.Extension) + len(p.OidList)*8 return 24 + len(p.User) + len(p.Description) + len(p.Extension) + len(p.OidList)*8
} }
func (p *StoreTransaction) NEOMsgEncode(data []byte) { func (p *StoreTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.User)) l := uint32(len(p.User))
...@@ -1851,7 +1851,7 @@ func (p *StoreTransaction) NEOMsgEncode(data []byte) { ...@@ -1851,7 +1851,7 @@ func (p *StoreTransaction) NEOMsgEncode(data []byte) {
} }
} }
func (p *StoreTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *StoreTransaction) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -1913,14 +1913,14 @@ func (*AnswerStoreTransaction) neoMsgCode() uint16 { ...@@ -1913,14 +1913,14 @@ func (*AnswerStoreTransaction) neoMsgCode() uint16 {
return 30 | answerBit return 30 | answerBit
} }
func (p *AnswerStoreTransaction) NEOMsgEncodedLen() int { func (p *AnswerStoreTransaction) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *AnswerStoreTransaction) NEOMsgEncode(data []byte) { func (p *AnswerStoreTransaction) neoMsgEncode(data []byte) {
} }
func (p *AnswerStoreTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerStoreTransaction) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -1930,15 +1930,15 @@ func (*VoteTransaction) neoMsgCode() uint16 { ...@@ -1930,15 +1930,15 @@ func (*VoteTransaction) neoMsgCode() uint16 {
return 31 return 31
} }
func (p *VoteTransaction) NEOMsgEncodedLen() int { func (p *VoteTransaction) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *VoteTransaction) NEOMsgEncode(data []byte) { func (p *VoteTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *VoteTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *VoteTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -1955,14 +1955,14 @@ func (*AnswerVoteTransaction) neoMsgCode() uint16 { ...@@ -1955,14 +1955,14 @@ func (*AnswerVoteTransaction) neoMsgCode() uint16 {
return 31 | answerBit return 31 | answerBit
} }
func (p *AnswerVoteTransaction) NEOMsgEncodedLen() int { func (p *AnswerVoteTransaction) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *AnswerVoteTransaction) NEOMsgEncode(data []byte) { func (p *AnswerVoteTransaction) neoMsgEncode(data []byte) {
} }
func (p *AnswerVoteTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerVoteTransaction) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -1972,17 +1972,17 @@ func (*GetObject) neoMsgCode() uint16 { ...@@ -1972,17 +1972,17 @@ func (*GetObject) neoMsgCode() uint16 {
return 32 return 32
} }
func (p *GetObject) NEOMsgEncodedLen() int { func (p *GetObject) neoMsgEncodedLen() int {
return 24 return 24
} }
func (p *GetObject) NEOMsgEncode(data []byte) { func (p *GetObject) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Oid))
binary.BigEndian.PutUint64(data[8:], uint64(p.At)) binary.BigEndian.PutUint64(data[8:], uint64(p.At))
binary.BigEndian.PutUint64(data[16:], uint64(p.Before)) binary.BigEndian.PutUint64(data[16:], uint64(p.Before))
} }
func (p *GetObject) NEOMsgDecode(data []byte) (int, error) { func (p *GetObject) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
...@@ -2001,11 +2001,11 @@ func (*AnswerObject) neoMsgCode() uint16 { ...@@ -2001,11 +2001,11 @@ func (*AnswerObject) neoMsgCode() uint16 {
return 32 | answerBit return 32 | answerBit
} }
func (p *AnswerObject) NEOMsgEncodedLen() int { func (p *AnswerObject) neoMsgEncodedLen() int {
return 57 + len(p.Data.XData()) return 57 + len(p.Data.XData())
} }
func (p *AnswerObject) NEOMsgEncode(data []byte) { func (p *AnswerObject) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Oid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Serial)) binary.BigEndian.PutUint64(data[8:], uint64(p.Serial))
binary.BigEndian.PutUint64(data[16:], uint64(p.NextSerial)) binary.BigEndian.PutUint64(data[16:], uint64(p.NextSerial))
...@@ -2021,7 +2021,7 @@ func (p *AnswerObject) NEOMsgEncode(data []byte) { ...@@ -2021,7 +2021,7 @@ func (p *AnswerObject) NEOMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.DataSerial)) binary.BigEndian.PutUint64(data[0:], uint64(p.DataSerial))
} }
func (p *AnswerObject) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerObject) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 49 { if len(data) < 49 {
goto overflow goto overflow
...@@ -2055,17 +2055,17 @@ func (*AskTIDs) neoMsgCode() uint16 { ...@@ -2055,17 +2055,17 @@ func (*AskTIDs) neoMsgCode() uint16 {
return 33 return 33
} }
func (p *AskTIDs) NEOMsgEncodedLen() int { func (p *AskTIDs) neoMsgEncodedLen() int {
return 20 return 20
} }
func (p *AskTIDs) NEOMsgEncode(data []byte) { func (p *AskTIDs) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], p.First) binary.BigEndian.PutUint64(data[0:], p.First)
binary.BigEndian.PutUint64(data[8:], p.Last) binary.BigEndian.PutUint64(data[8:], p.Last)
binary.BigEndian.PutUint32(data[16:], p.Partition) binary.BigEndian.PutUint32(data[16:], p.Partition)
} }
func (p *AskTIDs) NEOMsgDecode(data []byte) (int, error) { func (p *AskTIDs) neoMsgDecode(data []byte) (int, error) {
if len(data) < 20 { if len(data) < 20 {
goto overflow goto overflow
} }
...@@ -2084,11 +2084,11 @@ func (*AnswerTIDs) neoMsgCode() uint16 { ...@@ -2084,11 +2084,11 @@ func (*AnswerTIDs) neoMsgCode() uint16 {
return 33 | answerBit return 33 | answerBit
} }
func (p *AnswerTIDs) NEOMsgEncodedLen() int { func (p *AnswerTIDs) neoMsgEncodedLen() int {
return 4 + len(p.TIDList)*8 return 4 + len(p.TIDList)*8
} }
func (p *AnswerTIDs) NEOMsgEncode(data []byte) { func (p *AnswerTIDs) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.TIDList)) l := uint32(len(p.TIDList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -2101,7 +2101,7 @@ func (p *AnswerTIDs) NEOMsgEncode(data []byte) { ...@@ -2101,7 +2101,7 @@ func (p *AnswerTIDs) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerTIDs) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerTIDs) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -2132,15 +2132,15 @@ func (*TransactionInformation) neoMsgCode() uint16 { ...@@ -2132,15 +2132,15 @@ func (*TransactionInformation) neoMsgCode() uint16 {
return 34 return 34
} }
func (p *TransactionInformation) NEOMsgEncodedLen() int { func (p *TransactionInformation) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *TransactionInformation) NEOMsgEncode(data []byte) { func (p *TransactionInformation) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *TransactionInformation) NEOMsgDecode(data []byte) (int, error) { func (p *TransactionInformation) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -2157,11 +2157,11 @@ func (*AnswerTransactionInformation) neoMsgCode() uint16 { ...@@ -2157,11 +2157,11 @@ func (*AnswerTransactionInformation) neoMsgCode() uint16 {
return 34 | answerBit return 34 | answerBit
} }
func (p *AnswerTransactionInformation) NEOMsgEncodedLen() int { func (p *AnswerTransactionInformation) neoMsgEncodedLen() int {
return 25 + len(p.User) + len(p.Description) + len(p.Extension) + len(p.OidList)*8 return 25 + len(p.User) + len(p.Description) + len(p.Extension) + len(p.OidList)*8
} }
func (p *AnswerTransactionInformation) NEOMsgEncode(data []byte) { func (p *AnswerTransactionInformation) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.User)) l := uint32(len(p.User))
...@@ -2197,7 +2197,7 @@ func (p *AnswerTransactionInformation) NEOMsgEncode(data []byte) { ...@@ -2197,7 +2197,7 @@ func (p *AnswerTransactionInformation) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerTransactionInformation) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerTransactionInformation) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -2260,17 +2260,17 @@ func (*ObjectHistory) neoMsgCode() uint16 { ...@@ -2260,17 +2260,17 @@ func (*ObjectHistory) neoMsgCode() uint16 {
return 35 return 35
} }
func (p *ObjectHistory) NEOMsgEncodedLen() int { func (p *ObjectHistory) neoMsgEncodedLen() int {
return 24 return 24
} }
func (p *ObjectHistory) NEOMsgEncode(data []byte) { func (p *ObjectHistory) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Oid))
binary.BigEndian.PutUint64(data[8:], p.First) binary.BigEndian.PutUint64(data[8:], p.First)
binary.BigEndian.PutUint64(data[16:], p.Last) binary.BigEndian.PutUint64(data[16:], p.Last)
} }
func (p *ObjectHistory) NEOMsgDecode(data []byte) (int, error) { func (p *ObjectHistory) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
...@@ -2289,11 +2289,11 @@ func (*AnswerObjectHistory) neoMsgCode() uint16 { ...@@ -2289,11 +2289,11 @@ func (*AnswerObjectHistory) neoMsgCode() uint16 {
return 35 | answerBit return 35 | answerBit
} }
func (p *AnswerObjectHistory) NEOMsgEncodedLen() int { func (p *AnswerObjectHistory) neoMsgEncodedLen() int {
return 12 + len(p.HistoryList)*12 return 12 + len(p.HistoryList)*12
} }
func (p *AnswerObjectHistory) NEOMsgEncode(data []byte) { func (p *AnswerObjectHistory) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Oid))
{ {
l := uint32(len(p.HistoryList)) l := uint32(len(p.HistoryList))
...@@ -2308,7 +2308,7 @@ func (p *AnswerObjectHistory) NEOMsgEncode(data []byte) { ...@@ -2308,7 +2308,7 @@ func (p *AnswerObjectHistory) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerObjectHistory) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerObjectHistory) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -2344,17 +2344,17 @@ func (*PartitionList) neoMsgCode() uint16 { ...@@ -2344,17 +2344,17 @@ func (*PartitionList) neoMsgCode() uint16 {
return 36 return 36
} }
func (p *PartitionList) NEOMsgEncodedLen() int { func (p *PartitionList) neoMsgEncodedLen() int {
return 12 return 12
} }
func (p *PartitionList) NEOMsgEncode(data []byte) { func (p *PartitionList) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.MinOffset) binary.BigEndian.PutUint32(data[0:], p.MinOffset)
binary.BigEndian.PutUint32(data[4:], p.MaxOffset) binary.BigEndian.PutUint32(data[4:], p.MaxOffset)
binary.BigEndian.PutUint32(data[8:], uint32(int32(p.NodeUUID))) binary.BigEndian.PutUint32(data[8:], uint32(int32(p.NodeUUID)))
} }
func (p *PartitionList) NEOMsgDecode(data []byte) (int, error) { func (p *PartitionList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
...@@ -2373,7 +2373,7 @@ func (*AnswerPartitionList) neoMsgCode() uint16 { ...@@ -2373,7 +2373,7 @@ func (*AnswerPartitionList) neoMsgCode() uint16 {
return 36 | answerBit return 36 | answerBit
} }
func (p *AnswerPartitionList) NEOMsgEncodedLen() int { func (p *AnswerPartitionList) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.RowList); i++ { for i := 0; i < len(p.RowList); i++ {
a := &p.RowList[i] a := &p.RowList[i]
...@@ -2382,7 +2382,7 @@ func (p *AnswerPartitionList) NEOMsgEncodedLen() int { ...@@ -2382,7 +2382,7 @@ func (p *AnswerPartitionList) NEOMsgEncodedLen() int {
return 16 + len(p.RowList)*4 + size return 16 + len(p.RowList)*4 + size
} }
func (p *AnswerPartitionList) NEOMsgEncode(data []byte) { func (p *AnswerPartitionList) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.PTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.PTid))
binary.BigEndian.PutUint32(data[8:], p.NumReplicas) binary.BigEndian.PutUint32(data[8:], p.NumReplicas)
{ {
...@@ -2407,7 +2407,7 @@ func (p *AnswerPartitionList) NEOMsgEncode(data []byte) { ...@@ -2407,7 +2407,7 @@ func (p *AnswerPartitionList) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerPartitionList) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerPartitionList) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
...@@ -2453,15 +2453,15 @@ func (*NodeList) neoMsgCode() uint16 { ...@@ -2453,15 +2453,15 @@ func (*NodeList) neoMsgCode() uint16 {
return 37 return 37
} }
func (p *NodeList) NEOMsgEncodedLen() int { func (p *NodeList) neoMsgEncodedLen() int {
return 1 return 1
} }
func (p *NodeList) NEOMsgEncode(data []byte) { func (p *NodeList) neoMsgEncode(data []byte) {
(data[0:])[0] = uint8(int8(p.NodeType)) (data[0:])[0] = uint8(int8(p.NodeType))
} }
func (p *NodeList) NEOMsgDecode(data []byte) (int, error) { func (p *NodeList) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
...@@ -2478,7 +2478,7 @@ func (*AnswerNodeList) neoMsgCode() uint16 { ...@@ -2478,7 +2478,7 @@ func (*AnswerNodeList) neoMsgCode() uint16 {
return 37 | answerBit return 37 | answerBit
} }
func (p *AnswerNodeList) NEOMsgEncodedLen() int { func (p *AnswerNodeList) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.NodeList); i++ { for i := 0; i < len(p.NodeList); i++ {
a := &p.NodeList[i] a := &p.NodeList[i]
...@@ -2487,7 +2487,7 @@ func (p *AnswerNodeList) NEOMsgEncodedLen() int { ...@@ -2487,7 +2487,7 @@ func (p *AnswerNodeList) NEOMsgEncodedLen() int {
return 4 + len(p.NodeList)*6 + size return 4 + len(p.NodeList)*6 + size
} }
func (p *AnswerNodeList) NEOMsgEncode(data []byte) { func (p *AnswerNodeList) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.NodeList)) l := uint32(len(p.NodeList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -2510,7 +2510,7 @@ func (p *AnswerNodeList) NEOMsgEncode(data []byte) { ...@@ -2510,7 +2510,7 @@ func (p *AnswerNodeList) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerNodeList) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerNodeList) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -2563,16 +2563,16 @@ func (*SetNodeState) neoMsgCode() uint16 { ...@@ -2563,16 +2563,16 @@ func (*SetNodeState) neoMsgCode() uint16 {
return 38 return 38
} }
func (p *SetNodeState) NEOMsgEncodedLen() int { func (p *SetNodeState) neoMsgEncodedLen() int {
return 5 return 5
} }
func (p *SetNodeState) NEOMsgEncode(data []byte) { func (p *SetNodeState) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], uint32(int32(p.NodeUUID))) binary.BigEndian.PutUint32(data[0:], uint32(int32(p.NodeUUID)))
(data[4:])[0] = uint8(int8(p.NodeState)) (data[4:])[0] = uint8(int8(p.NodeState))
} }
func (p *SetNodeState) NEOMsgDecode(data []byte) (int, error) { func (p *SetNodeState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 5 { if len(data) < 5 {
goto overflow goto overflow
} }
...@@ -2590,11 +2590,11 @@ func (*AddPendingNodes) neoMsgCode() uint16 { ...@@ -2590,11 +2590,11 @@ func (*AddPendingNodes) neoMsgCode() uint16 {
return 39 return 39
} }
func (p *AddPendingNodes) NEOMsgEncodedLen() int { func (p *AddPendingNodes) neoMsgEncodedLen() int {
return 4 + len(p.NodeList)*4 return 4 + len(p.NodeList)*4
} }
func (p *AddPendingNodes) NEOMsgEncode(data []byte) { func (p *AddPendingNodes) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.NodeList)) l := uint32(len(p.NodeList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -2607,7 +2607,7 @@ func (p *AddPendingNodes) NEOMsgEncode(data []byte) { ...@@ -2607,7 +2607,7 @@ func (p *AddPendingNodes) NEOMsgEncode(data []byte) {
} }
} }
func (p *AddPendingNodes) NEOMsgDecode(data []byte) (int, error) { func (p *AddPendingNodes) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -2638,11 +2638,11 @@ func (*TweakPartitionTable) neoMsgCode() uint16 { ...@@ -2638,11 +2638,11 @@ func (*TweakPartitionTable) neoMsgCode() uint16 {
return 40 return 40
} }
func (p *TweakPartitionTable) NEOMsgEncodedLen() int { func (p *TweakPartitionTable) neoMsgEncodedLen() int {
return 5 + len(p.NodeList)*4 return 5 + len(p.NodeList)*4
} }
func (p *TweakPartitionTable) NEOMsgEncode(data []byte) { func (p *TweakPartitionTable) neoMsgEncode(data []byte) {
(data[0:])[0] = bool2byte(p.DryRun) (data[0:])[0] = bool2byte(p.DryRun)
{ {
l := uint32(len(p.NodeList)) l := uint32(len(p.NodeList))
...@@ -2656,7 +2656,7 @@ func (p *TweakPartitionTable) NEOMsgEncode(data []byte) { ...@@ -2656,7 +2656,7 @@ func (p *TweakPartitionTable) NEOMsgEncode(data []byte) {
} }
} }
func (p *TweakPartitionTable) NEOMsgDecode(data []byte) (int, error) { func (p *TweakPartitionTable) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 5 { if len(data) < 5 {
goto overflow goto overflow
...@@ -2688,7 +2688,7 @@ func (*AnswerTweakPartitionTable) neoMsgCode() uint16 { ...@@ -2688,7 +2688,7 @@ func (*AnswerTweakPartitionTable) neoMsgCode() uint16 {
return 40 | answerBit return 40 | answerBit
} }
func (p *AnswerTweakPartitionTable) NEOMsgEncodedLen() int { func (p *AnswerTweakPartitionTable) neoMsgEncodedLen() int {
var size int var size int
for i := 0; i < len(p.RowList); i++ { for i := 0; i < len(p.RowList); i++ {
a := &p.RowList[i] a := &p.RowList[i]
...@@ -2697,7 +2697,7 @@ func (p *AnswerTweakPartitionTable) NEOMsgEncodedLen() int { ...@@ -2697,7 +2697,7 @@ func (p *AnswerTweakPartitionTable) NEOMsgEncodedLen() int {
return 5 + len(p.RowList)*4 + size return 5 + len(p.RowList)*4 + size
} }
func (p *AnswerTweakPartitionTable) NEOMsgEncode(data []byte) { func (p *AnswerTweakPartitionTable) neoMsgEncode(data []byte) {
(data[0:])[0] = bool2byte(p.Changed) (data[0:])[0] = bool2byte(p.Changed)
{ {
l := uint32(len(p.RowList)) l := uint32(len(p.RowList))
...@@ -2721,7 +2721,7 @@ func (p *AnswerTweakPartitionTable) NEOMsgEncode(data []byte) { ...@@ -2721,7 +2721,7 @@ func (p *AnswerTweakPartitionTable) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerTweakPartitionTable) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerTweakPartitionTable) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 5 { if len(data) < 5 {
goto overflow goto overflow
...@@ -2766,15 +2766,15 @@ func (*SetNumReplicas) neoMsgCode() uint16 { ...@@ -2766,15 +2766,15 @@ func (*SetNumReplicas) neoMsgCode() uint16 {
return 41 return 41
} }
func (p *SetNumReplicas) NEOMsgEncodedLen() int { func (p *SetNumReplicas) neoMsgEncodedLen() int {
return 4 return 4
} }
func (p *SetNumReplicas) NEOMsgEncode(data []byte) { func (p *SetNumReplicas) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.NumReplicas) binary.BigEndian.PutUint32(data[0:], p.NumReplicas)
} }
func (p *SetNumReplicas) NEOMsgDecode(data []byte) (int, error) { func (p *SetNumReplicas) neoMsgDecode(data []byte) (int, error) {
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
} }
...@@ -2791,15 +2791,15 @@ func (*SetClusterState) neoMsgCode() uint16 { ...@@ -2791,15 +2791,15 @@ func (*SetClusterState) neoMsgCode() uint16 {
return 42 return 42
} }
func (p *SetClusterState) NEOMsgEncodedLen() int { func (p *SetClusterState) neoMsgEncodedLen() int {
return 1 return 1
} }
func (p *SetClusterState) NEOMsgEncode(data []byte) { func (p *SetClusterState) neoMsgEncode(data []byte) {
(data[0:])[0] = uint8(int8(p.State)) (data[0:])[0] = uint8(int8(p.State))
} }
func (p *SetClusterState) NEOMsgDecode(data []byte) (int, error) { func (p *SetClusterState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
...@@ -2816,11 +2816,11 @@ func (*Repair) neoMsgCode() uint16 { ...@@ -2816,11 +2816,11 @@ func (*Repair) neoMsgCode() uint16 {
return 43 return 43
} }
func (p *Repair) NEOMsgEncodedLen() int { func (p *Repair) neoMsgEncodedLen() int {
return 5 + len(p.NodeList)*4 return 5 + len(p.NodeList)*4
} }
func (p *Repair) NEOMsgEncode(data []byte) { func (p *Repair) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.NodeList)) l := uint32(len(p.NodeList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -2834,7 +2834,7 @@ func (p *Repair) NEOMsgEncode(data []byte) { ...@@ -2834,7 +2834,7 @@ func (p *Repair) NEOMsgEncode(data []byte) {
(data[0:])[0] = bool2byte(p.repairFlags.DryRun) (data[0:])[0] = bool2byte(p.repairFlags.DryRun)
} }
func (p *Repair) NEOMsgDecode(data []byte) (int, error) { func (p *Repair) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -2866,15 +2866,15 @@ func (*RepairOne) neoMsgCode() uint16 { ...@@ -2866,15 +2866,15 @@ func (*RepairOne) neoMsgCode() uint16 {
return 44 return 44
} }
func (p *RepairOne) NEOMsgEncodedLen() int { func (p *RepairOne) neoMsgEncodedLen() int {
return 1 return 1
} }
func (p *RepairOne) NEOMsgEncode(data []byte) { func (p *RepairOne) neoMsgEncode(data []byte) {
(data[0:])[0] = bool2byte(p.repairFlags.DryRun) (data[0:])[0] = bool2byte(p.repairFlags.DryRun)
} }
func (p *RepairOne) NEOMsgDecode(data []byte) (int, error) { func (p *RepairOne) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
...@@ -2891,15 +2891,15 @@ func (*NotifyClusterState) neoMsgCode() uint16 { ...@@ -2891,15 +2891,15 @@ func (*NotifyClusterState) neoMsgCode() uint16 {
return 45 return 45
} }
func (p *NotifyClusterState) NEOMsgEncodedLen() int { func (p *NotifyClusterState) neoMsgEncodedLen() int {
return 1 return 1
} }
func (p *NotifyClusterState) NEOMsgEncode(data []byte) { func (p *NotifyClusterState) neoMsgEncode(data []byte) {
(data[0:])[0] = uint8(int8(p.State)) (data[0:])[0] = uint8(int8(p.State))
} }
func (p *NotifyClusterState) NEOMsgDecode(data []byte) (int, error) { func (p *NotifyClusterState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
...@@ -2916,14 +2916,14 @@ func (*AskClusterState) neoMsgCode() uint16 { ...@@ -2916,14 +2916,14 @@ func (*AskClusterState) neoMsgCode() uint16 {
return 46 return 46
} }
func (p *AskClusterState) NEOMsgEncodedLen() int { func (p *AskClusterState) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *AskClusterState) NEOMsgEncode(data []byte) { func (p *AskClusterState) neoMsgEncode(data []byte) {
} }
func (p *AskClusterState) NEOMsgDecode(data []byte) (int, error) { func (p *AskClusterState) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -2933,15 +2933,15 @@ func (*AnswerClusterState) neoMsgCode() uint16 { ...@@ -2933,15 +2933,15 @@ func (*AnswerClusterState) neoMsgCode() uint16 {
return 46 | answerBit return 46 | answerBit
} }
func (p *AnswerClusterState) NEOMsgEncodedLen() int { func (p *AnswerClusterState) neoMsgEncodedLen() int {
return 1 return 1
} }
func (p *AnswerClusterState) NEOMsgEncode(data []byte) { func (p *AnswerClusterState) neoMsgEncode(data []byte) {
(data[0:])[0] = uint8(int8(p.State)) (data[0:])[0] = uint8(int8(p.State))
} }
func (p *AnswerClusterState) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerClusterState) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
...@@ -2958,11 +2958,11 @@ func (*ObjectUndoSerial) neoMsgCode() uint16 { ...@@ -2958,11 +2958,11 @@ func (*ObjectUndoSerial) neoMsgCode() uint16 {
return 47 return 47
} }
func (p *ObjectUndoSerial) NEOMsgEncodedLen() int { func (p *ObjectUndoSerial) neoMsgEncodedLen() int {
return 28 + len(p.OidList)*8 return 28 + len(p.OidList)*8
} }
func (p *ObjectUndoSerial) NEOMsgEncode(data []byte) { func (p *ObjectUndoSerial) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
binary.BigEndian.PutUint64(data[8:], uint64(p.LTID)) binary.BigEndian.PutUint64(data[8:], uint64(p.LTID))
binary.BigEndian.PutUint64(data[16:], uint64(p.UndoneTID)) binary.BigEndian.PutUint64(data[16:], uint64(p.UndoneTID))
...@@ -2978,7 +2978,7 @@ func (p *ObjectUndoSerial) NEOMsgEncode(data []byte) { ...@@ -2978,7 +2978,7 @@ func (p *ObjectUndoSerial) NEOMsgEncode(data []byte) {
} }
} }
func (p *ObjectUndoSerial) NEOMsgDecode(data []byte) (int, error) { func (p *ObjectUndoSerial) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 28 { if len(data) < 28 {
goto overflow goto overflow
...@@ -3012,11 +3012,11 @@ func (*AnswerObjectUndoSerial) neoMsgCode() uint16 { ...@@ -3012,11 +3012,11 @@ func (*AnswerObjectUndoSerial) neoMsgCode() uint16 {
return 47 | answerBit return 47 | answerBit
} }
func (p *AnswerObjectUndoSerial) NEOMsgEncodedLen() int { func (p *AnswerObjectUndoSerial) neoMsgEncodedLen() int {
return 4 + len(p.ObjectTIDDict)*25 return 4 + len(p.ObjectTIDDict)*25
} }
func (p *AnswerObjectUndoSerial) NEOMsgEncode(data []byte) { func (p *AnswerObjectUndoSerial) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.ObjectTIDDict)) l := uint32(len(p.ObjectTIDDict))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -3036,7 +3036,7 @@ func (p *AnswerObjectUndoSerial) NEOMsgEncode(data []byte) { ...@@ -3036,7 +3036,7 @@ func (p *AnswerObjectUndoSerial) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerObjectUndoSerial) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerObjectUndoSerial) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -3080,18 +3080,18 @@ func (*AskTIDsFrom) neoMsgCode() uint16 { ...@@ -3080,18 +3080,18 @@ func (*AskTIDsFrom) neoMsgCode() uint16 {
return 48 return 48
} }
func (p *AskTIDsFrom) NEOMsgEncodedLen() int { func (p *AskTIDsFrom) neoMsgEncodedLen() int {
return 24 return 24
} }
func (p *AskTIDsFrom) NEOMsgEncode(data []byte) { func (p *AskTIDsFrom) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.MinTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.MinTID))
binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID))
binary.BigEndian.PutUint32(data[16:], p.Length) binary.BigEndian.PutUint32(data[16:], p.Length)
binary.BigEndian.PutUint32(data[20:], p.Partition) binary.BigEndian.PutUint32(data[20:], p.Partition)
} }
func (p *AskTIDsFrom) NEOMsgDecode(data []byte) (int, error) { func (p *AskTIDsFrom) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
...@@ -3111,11 +3111,11 @@ func (*AnswerTIDsFrom) neoMsgCode() uint16 { ...@@ -3111,11 +3111,11 @@ func (*AnswerTIDsFrom) neoMsgCode() uint16 {
return 48 | answerBit return 48 | answerBit
} }
func (p *AnswerTIDsFrom) NEOMsgEncodedLen() int { func (p *AnswerTIDsFrom) neoMsgEncodedLen() int {
return 4 + len(p.TidList)*8 return 4 + len(p.TidList)*8
} }
func (p *AnswerTIDsFrom) NEOMsgEncode(data []byte) { func (p *AnswerTIDsFrom) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.TidList)) l := uint32(len(p.TidList))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -3128,7 +3128,7 @@ func (p *AnswerTIDsFrom) NEOMsgEncode(data []byte) { ...@@ -3128,7 +3128,7 @@ func (p *AnswerTIDsFrom) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerTIDsFrom) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerTIDsFrom) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -3159,15 +3159,15 @@ func (*Pack) neoMsgCode() uint16 { ...@@ -3159,15 +3159,15 @@ func (*Pack) neoMsgCode() uint16 {
return 49 return 49
} }
func (p *Pack) NEOMsgEncodedLen() int { func (p *Pack) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *Pack) NEOMsgEncode(data []byte) { func (p *Pack) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *Pack) NEOMsgDecode(data []byte) (int, error) { func (p *Pack) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -3184,15 +3184,15 @@ func (*AnswerPack) neoMsgCode() uint16 { ...@@ -3184,15 +3184,15 @@ func (*AnswerPack) neoMsgCode() uint16 {
return 49 | answerBit return 49 | answerBit
} }
func (p *AnswerPack) NEOMsgEncodedLen() int { func (p *AnswerPack) neoMsgEncodedLen() int {
return 1 return 1
} }
func (p *AnswerPack) NEOMsgEncode(data []byte) { func (p *AnswerPack) neoMsgEncode(data []byte) {
(data[0:])[0] = bool2byte(p.Status) (data[0:])[0] = bool2byte(p.Status)
} }
func (p *AnswerPack) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerPack) neoMsgDecode(data []byte) (int, error) {
if len(data) < 1 { if len(data) < 1 {
goto overflow goto overflow
} }
...@@ -3209,11 +3209,11 @@ func (*CheckReplicas) neoMsgCode() uint16 { ...@@ -3209,11 +3209,11 @@ func (*CheckReplicas) neoMsgCode() uint16 {
return 50 return 50
} }
func (p *CheckReplicas) NEOMsgEncodedLen() int { func (p *CheckReplicas) neoMsgEncodedLen() int {
return 20 + len(p.PartitionDict)*8 return 20 + len(p.PartitionDict)*8
} }
func (p *CheckReplicas) NEOMsgEncode(data []byte) { func (p *CheckReplicas) neoMsgEncode(data []byte) {
{ {
l := uint32(len(p.PartitionDict)) l := uint32(len(p.PartitionDict))
binary.BigEndian.PutUint32(data[0:], l) binary.BigEndian.PutUint32(data[0:], l)
...@@ -3233,7 +3233,7 @@ func (p *CheckReplicas) NEOMsgEncode(data []byte) { ...@@ -3233,7 +3233,7 @@ func (p *CheckReplicas) NEOMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID))
} }
func (p *CheckReplicas) NEOMsgDecode(data []byte) (int, error) { func (p *CheckReplicas) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 4 { if len(data) < 4 {
goto overflow goto overflow
...@@ -3267,11 +3267,11 @@ func (*CheckPartition) neoMsgCode() uint16 { ...@@ -3267,11 +3267,11 @@ func (*CheckPartition) neoMsgCode() uint16 {
return 51 return 51
} }
func (p *CheckPartition) NEOMsgEncodedLen() int { func (p *CheckPartition) neoMsgEncodedLen() int {
return 24 + len(p.Source.UpstreamName) + p.Source.Address.neoEncodedLen() return 24 + len(p.Source.UpstreamName) + p.Source.Address.neoEncodedLen()
} }
func (p *CheckPartition) NEOMsgEncode(data []byte) { func (p *CheckPartition) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Partition) binary.BigEndian.PutUint32(data[0:], p.Partition)
{ {
l := uint32(len(p.Source.UpstreamName)) l := uint32(len(p.Source.UpstreamName))
...@@ -3288,7 +3288,7 @@ func (p *CheckPartition) NEOMsgEncode(data []byte) { ...@@ -3288,7 +3288,7 @@ func (p *CheckPartition) NEOMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID))
} }
func (p *CheckPartition) NEOMsgDecode(data []byte) (int, error) { func (p *CheckPartition) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
...@@ -3329,18 +3329,18 @@ func (*CheckTIDRange) neoMsgCode() uint16 { ...@@ -3329,18 +3329,18 @@ func (*CheckTIDRange) neoMsgCode() uint16 {
return 52 return 52
} }
func (p *CheckTIDRange) NEOMsgEncodedLen() int { func (p *CheckTIDRange) neoMsgEncodedLen() int {
return 24 return 24
} }
func (p *CheckTIDRange) NEOMsgEncode(data []byte) { func (p *CheckTIDRange) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Partition) binary.BigEndian.PutUint32(data[0:], p.Partition)
binary.BigEndian.PutUint32(data[4:], p.Length) binary.BigEndian.PutUint32(data[4:], p.Length)
binary.BigEndian.PutUint64(data[8:], uint64(p.MinTID)) binary.BigEndian.PutUint64(data[8:], uint64(p.MinTID))
binary.BigEndian.PutUint64(data[16:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[16:], uint64(p.MaxTID))
} }
func (p *CheckTIDRange) NEOMsgDecode(data []byte) (int, error) { func (p *CheckTIDRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
...@@ -3360,17 +3360,17 @@ func (*AnswerCheckTIDRange) neoMsgCode() uint16 { ...@@ -3360,17 +3360,17 @@ func (*AnswerCheckTIDRange) neoMsgCode() uint16 {
return 52 | answerBit return 52 | answerBit
} }
func (p *AnswerCheckTIDRange) NEOMsgEncodedLen() int { func (p *AnswerCheckTIDRange) neoMsgEncodedLen() int {
return 32 return 32
} }
func (p *AnswerCheckTIDRange) NEOMsgEncode(data []byte) { func (p *AnswerCheckTIDRange) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Count) binary.BigEndian.PutUint32(data[0:], p.Count)
copy(data[4:], p.Checksum[:]) copy(data[4:], p.Checksum[:])
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID))
} }
func (p *AnswerCheckTIDRange) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerCheckTIDRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 32 { if len(data) < 32 {
goto overflow goto overflow
} }
...@@ -3389,11 +3389,11 @@ func (*CheckSerialRange) neoMsgCode() uint16 { ...@@ -3389,11 +3389,11 @@ func (*CheckSerialRange) neoMsgCode() uint16 {
return 53 return 53
} }
func (p *CheckSerialRange) NEOMsgEncodedLen() int { func (p *CheckSerialRange) neoMsgEncodedLen() int {
return 32 return 32
} }
func (p *CheckSerialRange) NEOMsgEncode(data []byte) { func (p *CheckSerialRange) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Partition) binary.BigEndian.PutUint32(data[0:], p.Partition)
binary.BigEndian.PutUint32(data[4:], p.Length) binary.BigEndian.PutUint32(data[4:], p.Length)
binary.BigEndian.PutUint64(data[8:], uint64(p.MinTID)) binary.BigEndian.PutUint64(data[8:], uint64(p.MinTID))
...@@ -3401,7 +3401,7 @@ func (p *CheckSerialRange) NEOMsgEncode(data []byte) { ...@@ -3401,7 +3401,7 @@ func (p *CheckSerialRange) NEOMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[24:], uint64(p.MinOID)) binary.BigEndian.PutUint64(data[24:], uint64(p.MinOID))
} }
func (p *CheckSerialRange) NEOMsgDecode(data []byte) (int, error) { func (p *CheckSerialRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 32 { if len(data) < 32 {
goto overflow goto overflow
} }
...@@ -3422,11 +3422,11 @@ func (*AnswerCheckSerialRange) neoMsgCode() uint16 { ...@@ -3422,11 +3422,11 @@ func (*AnswerCheckSerialRange) neoMsgCode() uint16 {
return 53 | answerBit return 53 | answerBit
} }
func (p *AnswerCheckSerialRange) NEOMsgEncodedLen() int { func (p *AnswerCheckSerialRange) neoMsgEncodedLen() int {
return 60 return 60
} }
func (p *AnswerCheckSerialRange) NEOMsgEncode(data []byte) { func (p *AnswerCheckSerialRange) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Count) binary.BigEndian.PutUint32(data[0:], p.Count)
copy(data[4:], p.TidChecksum[:]) copy(data[4:], p.TidChecksum[:])
binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[24:], uint64(p.MaxTID))
...@@ -3434,7 +3434,7 @@ func (p *AnswerCheckSerialRange) NEOMsgEncode(data []byte) { ...@@ -3434,7 +3434,7 @@ func (p *AnswerCheckSerialRange) NEOMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[52:], uint64(p.MaxOID)) binary.BigEndian.PutUint64(data[52:], uint64(p.MaxOID))
} }
func (p *AnswerCheckSerialRange) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerCheckSerialRange) neoMsgDecode(data []byte) (int, error) {
if len(data) < 60 { if len(data) < 60 {
goto overflow goto overflow
} }
...@@ -3455,11 +3455,11 @@ func (*PartitionCorrupted) neoMsgCode() uint16 { ...@@ -3455,11 +3455,11 @@ func (*PartitionCorrupted) neoMsgCode() uint16 {
return 54 return 54
} }
func (p *PartitionCorrupted) NEOMsgEncodedLen() int { func (p *PartitionCorrupted) neoMsgEncodedLen() int {
return 8 + len(p.CellList)*4 return 8 + len(p.CellList)*4
} }
func (p *PartitionCorrupted) NEOMsgEncode(data []byte) { func (p *PartitionCorrupted) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Partition) binary.BigEndian.PutUint32(data[0:], p.Partition)
{ {
l := uint32(len(p.CellList)) l := uint32(len(p.CellList))
...@@ -3473,7 +3473,7 @@ func (p *PartitionCorrupted) NEOMsgEncode(data []byte) { ...@@ -3473,7 +3473,7 @@ func (p *PartitionCorrupted) NEOMsgEncode(data []byte) {
} }
} }
func (p *PartitionCorrupted) NEOMsgDecode(data []byte) (int, error) { func (p *PartitionCorrupted) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
...@@ -3505,14 +3505,14 @@ func (*NotifyReady) neoMsgCode() uint16 { ...@@ -3505,14 +3505,14 @@ func (*NotifyReady) neoMsgCode() uint16 {
return 55 return 55
} }
func (p *NotifyReady) NEOMsgEncodedLen() int { func (p *NotifyReady) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *NotifyReady) NEOMsgEncode(data []byte) { func (p *NotifyReady) neoMsgEncode(data []byte) {
} }
func (p *NotifyReady) NEOMsgDecode(data []byte) (int, error) { func (p *NotifyReady) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -3522,14 +3522,14 @@ func (*LastTransaction) neoMsgCode() uint16 { ...@@ -3522,14 +3522,14 @@ func (*LastTransaction) neoMsgCode() uint16 {
return 56 return 56
} }
func (p *LastTransaction) NEOMsgEncodedLen() int { func (p *LastTransaction) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *LastTransaction) NEOMsgEncode(data []byte) { func (p *LastTransaction) neoMsgEncode(data []byte) {
} }
func (p *LastTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *LastTransaction) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
...@@ -3539,15 +3539,15 @@ func (*AnswerLastTransaction) neoMsgCode() uint16 { ...@@ -3539,15 +3539,15 @@ func (*AnswerLastTransaction) neoMsgCode() uint16 {
return 56 | answerBit return 56 | answerBit
} }
func (p *AnswerLastTransaction) NEOMsgEncodedLen() int { func (p *AnswerLastTransaction) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *AnswerLastTransaction) NEOMsgEncode(data []byte) { func (p *AnswerLastTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *AnswerLastTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerLastTransaction) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -3564,17 +3564,17 @@ func (*CheckCurrentSerial) neoMsgCode() uint16 { ...@@ -3564,17 +3564,17 @@ func (*CheckCurrentSerial) neoMsgCode() uint16 {
return 57 return 57
} }
func (p *CheckCurrentSerial) NEOMsgEncodedLen() int { func (p *CheckCurrentSerial) neoMsgEncodedLen() int {
return 24 return 24
} }
func (p *CheckCurrentSerial) NEOMsgEncode(data []byte) { func (p *CheckCurrentSerial) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[8:], uint64(p.Oid))
binary.BigEndian.PutUint64(data[16:], uint64(p.Serial)) binary.BigEndian.PutUint64(data[16:], uint64(p.Serial))
} }
func (p *CheckCurrentSerial) NEOMsgDecode(data []byte) (int, error) { func (p *CheckCurrentSerial) neoMsgDecode(data []byte) (int, error) {
if len(data) < 24 { if len(data) < 24 {
goto overflow goto overflow
} }
...@@ -3593,15 +3593,15 @@ func (*AnswerCheckCurrentSerial) neoMsgCode() uint16 { ...@@ -3593,15 +3593,15 @@ func (*AnswerCheckCurrentSerial) neoMsgCode() uint16 {
return 57 | answerBit return 57 | answerBit
} }
func (p *AnswerCheckCurrentSerial) NEOMsgEncodedLen() int { func (p *AnswerCheckCurrentSerial) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *AnswerCheckCurrentSerial) NEOMsgEncode(data []byte) { func (p *AnswerCheckCurrentSerial) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.AnswerStoreObject.Conflict)) binary.BigEndian.PutUint64(data[0:], uint64(p.AnswerStoreObject.Conflict))
} }
func (p *AnswerCheckCurrentSerial) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerCheckCurrentSerial) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -3618,16 +3618,16 @@ func (*NotifyTransactionFinished) neoMsgCode() uint16 { ...@@ -3618,16 +3618,16 @@ func (*NotifyTransactionFinished) neoMsgCode() uint16 {
return 58 return 58
} }
func (p *NotifyTransactionFinished) NEOMsgEncodedLen() int { func (p *NotifyTransactionFinished) neoMsgEncodedLen() int {
return 16 return 16
} }
func (p *NotifyTransactionFinished) NEOMsgEncode(data []byte) { func (p *NotifyTransactionFinished) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.TTID)) binary.BigEndian.PutUint64(data[0:], uint64(p.TTID))
binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID)) binary.BigEndian.PutUint64(data[8:], uint64(p.MaxTID))
} }
func (p *NotifyTransactionFinished) NEOMsgDecode(data []byte) (int, error) { func (p *NotifyTransactionFinished) neoMsgDecode(data []byte) (int, error) {
if len(data) < 16 { if len(data) < 16 {
goto overflow goto overflow
} }
...@@ -3645,7 +3645,7 @@ func (*Replicate) neoMsgCode() uint16 { ...@@ -3645,7 +3645,7 @@ func (*Replicate) neoMsgCode() uint16 {
return 59 return 59
} }
func (p *Replicate) NEOMsgEncodedLen() int { func (p *Replicate) neoMsgEncodedLen() int {
var size int var size int
for key := range p.SourceDict { for key := range p.SourceDict {
size += len(p.SourceDict[key]) size += len(p.SourceDict[key])
...@@ -3653,7 +3653,7 @@ func (p *Replicate) NEOMsgEncodedLen() int { ...@@ -3653,7 +3653,7 @@ func (p *Replicate) NEOMsgEncodedLen() int {
return 16 + len(p.UpstreamName) + len(p.SourceDict)*8 + size return 16 + len(p.UpstreamName) + len(p.SourceDict)*8 + size
} }
func (p *Replicate) NEOMsgEncode(data []byte) { func (p *Replicate) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.UpstreamName)) l := uint32(len(p.UpstreamName))
...@@ -3685,7 +3685,7 @@ func (p *Replicate) NEOMsgEncode(data []byte) { ...@@ -3685,7 +3685,7 @@ func (p *Replicate) NEOMsgEncode(data []byte) {
} }
} }
func (p *Replicate) NEOMsgDecode(data []byte) (int, error) { func (p *Replicate) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -3736,16 +3736,16 @@ func (*ReplicationDone) neoMsgCode() uint16 { ...@@ -3736,16 +3736,16 @@ func (*ReplicationDone) neoMsgCode() uint16 {
return 60 return 60
} }
func (p *ReplicationDone) NEOMsgEncodedLen() int { func (p *ReplicationDone) neoMsgEncodedLen() int {
return 12 return 12
} }
func (p *ReplicationDone) NEOMsgEncode(data []byte) { func (p *ReplicationDone) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Offset) binary.BigEndian.PutUint32(data[0:], p.Offset)
binary.BigEndian.PutUint64(data[4:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[4:], uint64(p.Tid))
} }
func (p *ReplicationDone) NEOMsgDecode(data []byte) (int, error) { func (p *ReplicationDone) neoMsgDecode(data []byte) (int, error) {
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
} }
...@@ -3763,11 +3763,11 @@ func (*FetchTransactions) neoMsgCode() uint16 { ...@@ -3763,11 +3763,11 @@ func (*FetchTransactions) neoMsgCode() uint16 {
return 61 return 61
} }
func (p *FetchTransactions) NEOMsgEncodedLen() int { func (p *FetchTransactions) neoMsgEncodedLen() int {
return 28 + len(p.TxnKnownList)*8 return 28 + len(p.TxnKnownList)*8
} }
func (p *FetchTransactions) NEOMsgEncode(data []byte) { func (p *FetchTransactions) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Partition) binary.BigEndian.PutUint32(data[0:], p.Partition)
binary.BigEndian.PutUint32(data[4:], p.Length) binary.BigEndian.PutUint32(data[4:], p.Length)
binary.BigEndian.PutUint64(data[8:], uint64(p.MinTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.MinTid))
...@@ -3784,7 +3784,7 @@ func (p *FetchTransactions) NEOMsgEncode(data []byte) { ...@@ -3784,7 +3784,7 @@ func (p *FetchTransactions) NEOMsgEncode(data []byte) {
} }
} }
func (p *FetchTransactions) NEOMsgDecode(data []byte) (int, error) { func (p *FetchTransactions) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 28 { if len(data) < 28 {
goto overflow goto overflow
...@@ -3819,11 +3819,11 @@ func (*AnswerFetchTransactions) neoMsgCode() uint16 { ...@@ -3819,11 +3819,11 @@ func (*AnswerFetchTransactions) neoMsgCode() uint16 {
return 61 | answerBit return 61 | answerBit
} }
func (p *AnswerFetchTransactions) NEOMsgEncodedLen() int { func (p *AnswerFetchTransactions) neoMsgEncodedLen() int {
return 20 + len(p.TxnDeleteList)*8 return 20 + len(p.TxnDeleteList)*8
} }
func (p *AnswerFetchTransactions) NEOMsgEncode(data []byte) { func (p *AnswerFetchTransactions) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.PackTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.PackTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.NextTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.NextTid))
{ {
...@@ -3838,7 +3838,7 @@ func (p *AnswerFetchTransactions) NEOMsgEncode(data []byte) { ...@@ -3838,7 +3838,7 @@ func (p *AnswerFetchTransactions) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerFetchTransactions) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerFetchTransactions) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 20 { if len(data) < 20 {
goto overflow goto overflow
...@@ -3871,7 +3871,7 @@ func (*FetchObjects) neoMsgCode() uint16 { ...@@ -3871,7 +3871,7 @@ func (*FetchObjects) neoMsgCode() uint16 {
return 62 return 62
} }
func (p *FetchObjects) NEOMsgEncodedLen() int { func (p *FetchObjects) neoMsgEncodedLen() int {
var size int var size int
for key := range p.ObjKnownDict { for key := range p.ObjKnownDict {
size += len(p.ObjKnownDict[key]) * 8 size += len(p.ObjKnownDict[key]) * 8
...@@ -3879,7 +3879,7 @@ func (p *FetchObjects) NEOMsgEncodedLen() int { ...@@ -3879,7 +3879,7 @@ func (p *FetchObjects) NEOMsgEncodedLen() int {
return 36 + len(p.ObjKnownDict)*12 + size return 36 + len(p.ObjKnownDict)*12 + size
} }
func (p *FetchObjects) NEOMsgEncode(data []byte) { func (p *FetchObjects) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint32(data[0:], p.Partition) binary.BigEndian.PutUint32(data[0:], p.Partition)
binary.BigEndian.PutUint32(data[4:], p.Length) binary.BigEndian.PutUint32(data[4:], p.Length)
binary.BigEndian.PutUint64(data[8:], uint64(p.MinTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.MinTid))
...@@ -3911,7 +3911,7 @@ func (p *FetchObjects) NEOMsgEncode(data []byte) { ...@@ -3911,7 +3911,7 @@ func (p *FetchObjects) NEOMsgEncode(data []byte) {
} }
} }
func (p *FetchObjects) NEOMsgDecode(data []byte) (int, error) { func (p *FetchObjects) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 36 { if len(data) < 36 {
goto overflow goto overflow
...@@ -3962,7 +3962,7 @@ func (*AnswerFetchObjects) neoMsgCode() uint16 { ...@@ -3962,7 +3962,7 @@ func (*AnswerFetchObjects) neoMsgCode() uint16 {
return 62 | answerBit return 62 | answerBit
} }
func (p *AnswerFetchObjects) NEOMsgEncodedLen() int { func (p *AnswerFetchObjects) neoMsgEncodedLen() int {
var size int var size int
for key := range p.ObjDeleteDict { for key := range p.ObjDeleteDict {
size += len(p.ObjDeleteDict[key]) * 8 size += len(p.ObjDeleteDict[key]) * 8
...@@ -3970,7 +3970,7 @@ func (p *AnswerFetchObjects) NEOMsgEncodedLen() int { ...@@ -3970,7 +3970,7 @@ func (p *AnswerFetchObjects) NEOMsgEncodedLen() int {
return 28 + len(p.ObjDeleteDict)*12 + size return 28 + len(p.ObjDeleteDict)*12 + size
} }
func (p *AnswerFetchObjects) NEOMsgEncode(data []byte) { func (p *AnswerFetchObjects) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.PackTid)) binary.BigEndian.PutUint64(data[0:], uint64(p.PackTid))
binary.BigEndian.PutUint64(data[8:], uint64(p.NextTid)) binary.BigEndian.PutUint64(data[8:], uint64(p.NextTid))
binary.BigEndian.PutUint64(data[16:], uint64(p.NextOid)) binary.BigEndian.PutUint64(data[16:], uint64(p.NextOid))
...@@ -4000,7 +4000,7 @@ func (p *AnswerFetchObjects) NEOMsgEncode(data []byte) { ...@@ -4000,7 +4000,7 @@ func (p *AnswerFetchObjects) NEOMsgEncode(data []byte) {
} }
} }
func (p *AnswerFetchObjects) NEOMsgDecode(data []byte) (int, error) { func (p *AnswerFetchObjects) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 28 { if len(data) < 28 {
goto overflow goto overflow
...@@ -4049,11 +4049,11 @@ func (*AddTransaction) neoMsgCode() uint16 { ...@@ -4049,11 +4049,11 @@ func (*AddTransaction) neoMsgCode() uint16 {
return 63 return 63
} }
func (p *AddTransaction) NEOMsgEncodedLen() int { func (p *AddTransaction) neoMsgEncodedLen() int {
return 33 + len(p.User) + len(p.Description) + len(p.Extension) + len(p.OidList)*8 return 33 + len(p.User) + len(p.Description) + len(p.Extension) + len(p.OidList)*8
} }
func (p *AddTransaction) NEOMsgEncode(data []byte) { func (p *AddTransaction) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
{ {
l := uint32(len(p.User)) l := uint32(len(p.User))
...@@ -4090,7 +4090,7 @@ func (p *AddTransaction) NEOMsgEncode(data []byte) { ...@@ -4090,7 +4090,7 @@ func (p *AddTransaction) NEOMsgEncode(data []byte) {
} }
} }
func (p *AddTransaction) NEOMsgDecode(data []byte) (int, error) { func (p *AddTransaction) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 12 { if len(data) < 12 {
goto overflow goto overflow
...@@ -4154,11 +4154,11 @@ func (*AddObject) neoMsgCode() uint16 { ...@@ -4154,11 +4154,11 @@ func (*AddObject) neoMsgCode() uint16 {
return 64 return 64
} }
func (p *AddObject) NEOMsgEncodedLen() int { func (p *AddObject) neoMsgEncodedLen() int {
return 49 + len(p.Data.XData()) return 49 + len(p.Data.XData())
} }
func (p *AddObject) NEOMsgEncode(data []byte) { func (p *AddObject) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Oid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Oid))
binary.BigEndian.PutUint64(data[8:], uint64(p.Serial)) binary.BigEndian.PutUint64(data[8:], uint64(p.Serial))
(data[16:])[0] = bool2byte(p.Compression) (data[16:])[0] = bool2byte(p.Compression)
...@@ -4173,7 +4173,7 @@ func (p *AddObject) NEOMsgEncode(data []byte) { ...@@ -4173,7 +4173,7 @@ func (p *AddObject) NEOMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.DataSerial)) binary.BigEndian.PutUint64(data[0:], uint64(p.DataSerial))
} }
func (p *AddObject) NEOMsgDecode(data []byte) (int, error) { func (p *AddObject) neoMsgDecode(data []byte) (int, error) {
var nread uint64 var nread uint64
if len(data) < 41 { if len(data) < 41 {
goto overflow goto overflow
...@@ -4206,15 +4206,15 @@ func (*Truncate) neoMsgCode() uint16 { ...@@ -4206,15 +4206,15 @@ func (*Truncate) neoMsgCode() uint16 {
return 65 return 65
} }
func (p *Truncate) NEOMsgEncodedLen() int { func (p *Truncate) neoMsgEncodedLen() int {
return 8 return 8
} }
func (p *Truncate) NEOMsgEncode(data []byte) { func (p *Truncate) neoMsgEncode(data []byte) {
binary.BigEndian.PutUint64(data[0:], uint64(p.Tid)) binary.BigEndian.PutUint64(data[0:], uint64(p.Tid))
} }
func (p *Truncate) NEOMsgDecode(data []byte) (int, error) { func (p *Truncate) neoMsgDecode(data []byte) (int, error) {
if len(data) < 8 { if len(data) < 8 {
goto overflow goto overflow
} }
...@@ -4231,14 +4231,14 @@ func (*FlushLog) neoMsgCode() uint16 { ...@@ -4231,14 +4231,14 @@ func (*FlushLog) neoMsgCode() uint16 {
return 66 return 66
} }
func (p *FlushLog) NEOMsgEncodedLen() int { func (p *FlushLog) neoMsgEncodedLen() int {
return 0 return 0
} }
func (p *FlushLog) NEOMsgEncode(data []byte) { func (p *FlushLog) neoMsgEncode(data []byte) {
} }
func (p *FlushLog) NEOMsgDecode(data []byte) (int, error) { func (p *FlushLog) neoMsgDecode(data []byte) (int, error) {
return 0, nil return 0, nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment