Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
d5fb4ac4
Commit
d5fb4ac4
authored
Dec 06, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2ad63c2c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
t/neo/byteorder.go
t/neo/byteorder.go
+3
-1
t/neo/pkt.go
t/neo/pkt.go
+3
-3
No files found.
t/neo/byteorder.go
View file @
d5fb4ac4
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
//
//
// See COPYING file for full licensing terms.
// See COPYING file for full licensing terms.
// NEO |
Work with bigendian data
// NEO |
Bigendian/native conversion
package
neo
package
neo
...
@@ -23,6 +23,8 @@ type be16 uint16
...
@@ -23,6 +23,8 @@ type be16 uint16
type
be32
uint32
type
be32
uint32
type
be64
uint64
type
be64
uint64
// XXX naming ntoh{s,l,q} ?
func
ntoh16
(
v
be16
)
uint16
{
func
ntoh16
(
v
be16
)
uint16
{
b
:=
(
*
[
2
]
byte
)(
unsafe
.
Pointer
(
&
v
))
b
:=
(
*
[
2
]
byte
)(
unsafe
.
Pointer
(
&
v
))
return
binary
.
BigEndian
.
Uint16
(
b
[
:
])
return
binary
.
BigEndian
.
Uint16
(
b
[
:
])
...
...
t/neo/pkt.go
View file @
d5fb4ac4
...
@@ -127,9 +127,9 @@ type RowInfo struct {
...
@@ -127,9 +127,9 @@ type RowInfo struct {
// XXX link request <-> answer ?
// XXX link request <-> answer ?
// TODO ensure len(encoded packet header) == 10
// TODO ensure len(encoded packet header) == 10
type
PktHead
struct
{
type
PktHead
struct
{
Id
uint32
// XXX -> MsgId and same vvv ?
MsgId
be32
Code
uint16
// XXX we don't need this as field - this is already encoded in type
MsgCode
be16
Len
uint32
// XXX we don't need this as field - only on the wire
Len
be32
// whole packet length (including header)
}
}
// TODO generate .Encode() / .Decode()
// TODO generate .Encode() / .Decode()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment