Commit d5fb4ac4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 2ad63c2c
......@@ -10,7 +10,7 @@
//
// See COPYING file for full licensing terms.
// NEO | Work with bigendian data
// NEO | Bigendian/native conversion
package neo
......@@ -23,6 +23,8 @@ type be16 uint16
type be32 uint32
type be64 uint64
// XXX naming ntoh{s,l,q} ?
func ntoh16(v be16) uint16 {
b := (*[2]byte)(unsafe.Pointer(&v))
return binary.BigEndian.Uint16(b[:])
......
......@@ -127,9 +127,9 @@ type RowInfo struct {
// XXX link request <-> answer ?
// TODO ensure len(encoded packet header) == 10
type PktHead struct {
Id uint32 // XXX -> MsgId and same vvv ?
Code uint16 // XXX we don't need this as field - this is already encoded in type
Len uint32 // XXX we don't need this as field - only on the wire
MsgId be32
MsgCode be16
Len be32 // whole packet length (including header)
}
// TODO generate .Encode() / .Decode()
......
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