aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-10-06 19:45:38 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-10-06 19:45:38 +0200
commit1091a4fd67111771d70983b7f9d79c043cb328c0 (patch)
tree293db36f540e844cd725c50456b04f70697774cd
parent8c8da68b8dd2e616ab5b0a2949c938c3eb9cd1ef (diff)
Add ber dump
-rw-r--r--misc/main.go11
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]