From cd42ef6603dc8b6703ff261e628b31ee07ef0165 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 8 Oct 2015 18:49:29 +0200 Subject: work in progress --- parse/parse.go | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 2 deletions(-) (limited to 'parse') diff --git a/parse/parse.go b/parse/parse.go index a5ca546..8f53c06 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -3,7 +3,12 @@ package main import ( "fmt" - "dim13.org/asn1/ber" + //"dim13.org/asn1/ber" + "dim13.org/asn1/acse" + "dim13.org/asn1/csta" + "dim13.org/asn1/rose" + + "github.com/dim13/asn1" ) var t = map[byte]string{ @@ -19,6 +24,58 @@ var t = map[byte]string{ func main() { for n, s := range session { fmt.Println(">>> packet", n, t[s[0]]) - fmt.Println(ber.Dump(s)) + //fmt.Println(ber.Dump(s)) + switch s[0] { + case 0xa1: + v := rose.Invoke{} + _, err := asn1.Unmarshal(s, &v) + if err != nil { + fmt.Println(err) + } + fmt.Println(v, csta.Modules[v.Opcode]) + case 0xa2: + v := rose.ReturnResult{} + _, err := asn1.Unmarshal(s, &v) + if err != nil { + fmt.Println(err) + } + fmt.Println(v, csta.Modules[v.Result.Opcode]) + case 0x60: + v := acse.AARQ{} + _, err := asn1.Unmarshal(s, &v) + if err != nil { + fmt.Println(err) + } + fmt.Println(v) + case 0x61: + v := acse.AARE{} + _, err := asn1.Unmarshal(s, &v) + if err != nil { + fmt.Println(err) + } + fmt.Println(v) + case 0x62: + v := acse.RLRQ{} + _, err := asn1.Unmarshal(s, &v) + if err != nil { + fmt.Println(err) + } + fmt.Println(v) + case 0x63: + v := acse.RLRE{} + _, err := asn1.Unmarshal(s, &v) + if err != nil { + fmt.Println(err) + } + fmt.Println(v) + case 0x64: + v := acse.ABRT{} + _, err := asn1.Unmarshal(s, &v) + if err != nil { + fmt.Println(err) + } + fmt.Println(v) + + } } } -- cgit v1.2.3