diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2015-10-06 19:45:38 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2015-10-06 19:45:38 +0200 |
commit | 1091a4fd67111771d70983b7f9d79c043cb328c0 (patch) | |
tree | 293db36f540e844cd725c50456b04f70697774cd | |
parent | 8c8da68b8dd2e616ab5b0a2949c938c3eb9cd1ef (diff) |
Add ber dump
-rw-r--r-- | misc/main.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/misc/main.go b/misc/main.go index 1cfb3d8..139b7a2 100644 --- a/misc/main.go +++ b/misc/main.go @@ -4,8 +4,8 @@ import ( "encoding/hex" "flag" "fmt" - "log" + "dim13.org/asn1/ber" "dim13.org/asn1/spdu" ) @@ -207,22 +207,23 @@ var ext = []byte{ func dump(b []byte) { fmt.Println(hex.Dump(b)) + fmt.Println(ber.Dump(b)) } func Ask(c spdu.Conn, out []byte) []byte { - log.Println("Ask") + fmt.Println("Ask") dump(out) c.Write(out) in, _ := spdu.ReadAll(c) - log.Printf("Packet length: 0x%.2X\n", len(in)) + fmt.Printf("Packet length: 0x%.2X\n", len(in)) dump(in) return in } func Status(c spdu.Conn) { - log.Println("Status") + fmt.Println("Status") in, _ := spdu.ReadAll(c) - log.Printf("Packet length: 0x%.2X\n", len(in)) + fmt.Printf("Packet length: 0x%.2X\n", len(in)) dump(in) out := status out[4] = in[4] |