Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
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 @@
//
// 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
[
:
])
...
...
t/neo/pkt.go
View file @
d5fb4ac4
...
...
@@ -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()
...
...
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