diff options
Diffstat (limited to 'acse')
-rw-r--r-- | acse/acse.go | 63 |
1 files changed, 24 insertions, 39 deletions
diff --git a/acse/acse.go b/acse/acse.go index 8429b83..adbb17a 100644 --- a/acse/acse.go +++ b/acse/acse.go @@ -1,65 +1,50 @@ package acse -// 2.2.0.0.1 +import "github.com/dim13/asn1" -type ObjectIdentifier []int // asn1.ObjectIdentifier +// 2.2.0.0.1 // A-ASSOCIATE Request // Application Constructed implicit 0 type AARQ struct { - ProtocolVersion Version // 0 implicit BitString - ApplicationContextName ObjectIdentifier // 1 - UserInformation interface{} // 30 implicit + asn1.Tag `asn1:"application,tag:0"` + ProtocolVersion asn1.BitString `asn1:"tag:0"` // 0 implicit BitString + ApplicationContextName asn1.ObjectIdentifier `asn1:"tag:1,explicit"` // 1 + UserInformation struct{ asn1.RawContent } `asn1:"tag:30,optional"` // 30 implicit } -type Version byte - -const ( - Version1 Version = iota -) - // A-ASSOCIATE Result (Result == 0) // A-REJECT (Result == 1) // Application Constructed implicit 1 type AARE struct { - ProtocolVersion Version // 0 implicit BitString - ApplicationContextName ObjectIdentifier // 1 - Result Result // 2 - ResultSourceDiagnostic AcseServiceUser // 3 - UserInformation interface{} // 30 implicit + asn1.Tag `asn1:"application,tag:1"` + ProtocolVersion asn1.BitString `asn1:"tag:0"` // 0 implicit BitString + ApplicationContextName asn1.ObjectIdentifier `asn1:"tag:1,explicit"` // 1 + Result int `asn1:"tag:2,explicit"` // 2 + ResultSourceDiagnostic AcseServiceUser `asn1:"tag:3"` // 3 + UserInformation struct{ asn1.RawContent } `asn1:"tag:30,optional"` // 30 implicit } -type Result int - -const ( - Accepted Result = iota - RejectedPermanent -) - -type AcseServiceUser int - -const ( - Null AcseServiceUser = iota - NoReasonGiven -) +type AcseServiceUser struct { + User int `asn1:"tag:0,optional"` + Provider int `asn1:"tag:0,optional"` +} // A-RELEASE Request // Application Constructed implicit 2 -type RLRQ struct{} +type RLRQ struct { + asn1.Tag `asn1:"application,tag:2"` +} // A-RELEASE Result // Application Constructed implicit 3 -type RLRE struct{} +type RLRE struct { + asn1.Tag `asn1:"application,tag:3"` +} // A-ABORT // Application Constructed implicit 4 type ABRT struct { - AbortSource AbortSource // 0 implicit + asn1.Tag `asn1:"application,tag:4"` + AbortSource int `asn1:"tag:0"` // 0 implicit } - -type AbortSource int - -const ( - ServiceUser AbortSource = iota - ServiceProvider -) |