File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "bytes"
5
+ "fmt"
6
+
7
+ "github.com/mk6i/retro-aim-server/wire"
8
+ )
9
+
10
+ func main () {
11
+
12
+ b := []byte {}
13
+
14
+ flap := wire.FLAPFrame {}
15
+ err := wire .UnmarshalBE (& flap , bytes .NewReader (b ))
16
+ if err != nil {
17
+ err = fmt .Errorf ("unable to unmarshal FLAP frame: %w" , err )
18
+ }
19
+
20
+ rd := bytes .NewBuffer (flap .Payload )
21
+ snac := wire.SNACFrame {}
22
+ wire .UnmarshalBE (& snac , rd )
23
+
24
+ printByteSlice (rd .Bytes ())
25
+ //snacBody := wire.SNAC_0x01_0x0F_OServiceUserInfoUpdate{}
26
+ //wire.UnmarshalBE(&snacBody, rd)
27
+ ////fmt.Println(snacBody)
28
+ //
29
+ //fmt.Println()
30
+ //
31
+ //for _, tlv := range snacBody.TLVList {
32
+ // fmt.Printf("0x%x\t", tlv.Tag)
33
+ // printByteSlice(tlv.Value)
34
+ // fmt.Println()
35
+ //}
36
+ }
37
+
38
+ func printByteSlice (data []byte ) {
39
+ fmt .Print ("[]byte{" )
40
+ for i , b := range data {
41
+ if i > 0 {
42
+ fmt .Print (", " )
43
+ }
44
+ fmt .Printf ("0x%02X" , b )
45
+ }
46
+ fmt .Println ("}" )
47
+ }
You can’t perform that action at this time.
0 commit comments