(* $Workfile:   x400com.tpl  $ $Revision:   1.2  $ *)
(* X400COM.TPL *)
(*****************************************************************************)
(* ASN.1 X.400 COMMON DATA-TYPE TEMPLATE                                     *)
(*                                                                           *)
(* Known simplifications:                                                    *)
(*   - refinement for Token                                                  *)
(*   - refinement for Certificate  (note some tags there to allow a decode)  *)
(*   - refinement for Algorithm Identifier                                   *)
(*                       - coded for xapia compliance for now                *)
(*   - adding of extension attributes for ORAddress                          *)
(*   - setting of 'S' for potential constructor octet primitives             *)
(*   - NOTE !!  - many extensions defined with type ANY on a temporary basis *)
(*                These are mainly security features which refer to X.517    *)
(*                for their definitions. X.517 is not yet available          *)
(*     The only ones left are: tokens certificates.                          *)
(*                                                                           *)
(*****************************************************************************)

Content                    LABEL     = Mcont
                           STRUCTURE = OCTETSTRING

MTSIdentifier              LABEL     = Mmtid
                           STRUCTURE = SEQUENCE
                           TAG       = (A 4 C)
                           CHILDREN  = { <Mgbid, A  3 C,M,0> D,
                                         <Mlcid, U 22 P,M,32>  }

LocalIdentifier            LABEL     = Mlcid
                           STRUCTURE = IA5 STRING

OriginatorName             LABEL     = Morig
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>,
                                         <Dxatl, U 17 C,O,0>D,
                                         <Ddirn, C  0 C,O,0> }

ContentType                LABEL     = Mcntt
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Mictp, A  6 P,O,32767>,
                                         <Mxctp, U  6 P,O,0>     }

ContentType in Report Xfr  LABEL     = Mrcnt
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Mictp, A  6 P,O,1024>D,
                                         <Mxctp, U  6 P,O,0>   D }

DeliverContentType         LABEL     = Mdcnt
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Mictp, C  0 P,O,1024>,
                                         <Mxctp, U  6 P,O,0>   }

BuiltInContentType         LABEL     = Mictp
                           STRUCTURE = INTEGER

ExternalContentType        LABEL     = Mxctp
                           STRUCTURE = OBJECT IDENTIFIER

ContentIdentifier          LABEL     = Mcnti
                           STRUCTURE = PRINTABLE STRING

ContentLength              LABEL     = Mcntl
                           STRUCTURE = INTEGER

Priority                   LABEL     = Mprio
                           STRUCTURE = INTEGER

PerMessageIndicators       LABEL     = Mpmsg
                           STRUCTURE = BITSTRING

DeferredDeliveryTime       LABEL     = Mddlv
                           STRUCTURE = UTC TIME

RecipientName              LABEL     = Mrcpn
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>,
                                         <Dxatl, U 17 C,O,0>D,
                                         <Ddirn, C  0 C,O,0> }

OriginatorReportRequest    LABEL     = Morrq
                           STRUCTURE = BITSTRING

ExplicitConversion         LABEL     = Mexcv
                           STRUCTURE = INTEGER

ActualRecipientName        LABEL     = Macnm
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>E,
                                         <Dddal, U 16 C,O,0>,
                                         <Dxatl, U 17 C,O,0>,
                                         <Ddirn, C  0 C,O,0> }

Report                     LABEL     = Mrept
                           STRUCTURE = CHOICE
                           TAG       = (C 1 C)
                           CHILDREN  = { <Mdrpt, C  0 C,O,0> ,
                                         <Mndrp, C  1 C,O,0> }

DeliveryReport             LABEL     = Mdrpt
                           STRUCTURE = SET
                           CHILDREN  = { <Cutct, C  0 P,M,0>,
                                         <Mustp, C  1 P,D,0> }

TypeofMTSUser              LABEL     = Mustp
                           STRUCTURE = INTEGER

NonDeliveryReport          LABEL     = Mndrp
                           STRUCTURE = SET
                           CHILDREN  = { <Mndrn, C  0 P,M,0>,
                                         <Mnddg, C  1 P,O,0> }

NonDeliveryReasonCode      LABEL     = Mndrn
                           STRUCTURE = INTEGER

NonDeliveryDiagnosticCode  LABEL     = Mnddg
                           STRUCTURE = INTEGER

OrigIntendedRcptNmae       LABEL     = Mircp
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>  ,
                                         <Dxatl, U 17 C,O,0> D,
                                         <Ddirn, C  0 C,O,0>  }

1 RcptReassignProhibited   LABEL     = Xrrpb
                           STRUCTURE = ENUMERATED

2 OrigRequestedAltRcpt     LABEL     = Xoalt
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>  ,
                                         <Dxatl, U 17 C,O,0> D,
                                         <Ddirn, C  0 C,O,0>  }

3 DLExpansionProhibited    LABEL     = Xdlxp
                           STRUCTURE = ENUMERATED

4 ConvWithLossProhibited   LABEL     = Xcwlp
                           STRUCTURE = ENUMERATED

5 LatestDeliveryTime       LABEL     = Xldvt
                           STRUCTURE = UTC TIME

6 RequestedDeliveryMethods LABEL     = Xrdms
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 256
                           CHILDREN  = { <Xrdlm, U  2 P,O,0>  }

RequestedDeliveryMethod    LABEL     = Xrdlm
                           STRUCTURE = INTEGER

7 PhysicalFwdingProhibited LABEL     = Xpfwp
                           STRUCTURE = ENUMERATED

8 PhysicalFwdingAddrReq    LABEL     = Xpfwa
                           STRUCTURE = ENUMERATED

9 PhysicalDeliveryModes    LABEL     = Xpdlm
                           STRUCTURE = BITSTRING

10 RegisterMailTypes       LABEL     = Xrmty
                           STRUCTURE = INTEGER

11 RcptNumberForAdvice     LABEL     = Xrnad
                           STRUCTURE = TELETEX STRING

12 PhysicalRenditionAttr   LABEL     = Xprat
                           STRUCTURE = OBJECT IDENTIFIER

13 OriginatorReturnAddress LABEL     = Xoret
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>  ,
                                         <Dxatl, U 17 C,O,0> D }

14 PhysicalDlvyReportReq   LABEL     = Xpdrr
                           STRUCTURE = INTEGER

15 OriginatorCertificate   LABEL     = Xoctf
                           STRUCTURE = ANY
                           CHILDREN  = {}

16 MessageToken            LABEL     = Xmtok
                           STRUCTURE = ANY
                           CHILDREN  = {}

(*****************************************************************************)
(* Token-Data. This is inside token. Have only done what is needed to get    *)
(* om_create of MT_PUBIC_DATA working and may be completely wrong otherwise. *)
(*****************************************************************************)
TokenSignedData            LABEL     = Xtosd
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Xccal, C  0 C,O,0>,
                                         <Xcick, C  1 C,O,0>,
                                         <Xmslb, C  2 C,O,0>,
                                         <Xpdvr, C  3 P,O,0>,
                                         <Xmsqn, C  4 P,O,0> }

MessageSequenceNumber      LABEL     = Xmsqn
                           STRUCTURE = INTEGER

17 ContentConfAlgothmId    LABEL     = Xccal
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <5algm, U  6 P,M,0>*,
                                         <5prms, U  0 P,O,0> }

18 ContentIntegrityCheck   LABEL     = Xcick
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <5algi, U 16 C,M,0>   ,
                                         <5encr, U  3 P,M,0>    }

19 MsgOrigAuthCheck        LABEL     = Xochk
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <5algi, U 16 C,M,0>   ,
                                         <5encr, U  3 P,M,0>    }

20 MsgSecurityLabel        LABEL     = Xmslb
                           STRUCTURE = SET
                           CHILDREN  = { <Mspid, U  6 P,O,0>   ,
                                         <Mscls, U  2 P,O,0>   ,
                                         <Mpvmk, U 19 P,O,128> ,
                                         <Mscts, U 17 C,O,0>    }

21 ProofOfSubmissionReq    LABEL     = Xpsbr
                           STRUCTURE = ENUMERATED

22 ProofOfDeliveryRequest  LABEL     = Xpdvr
                           STRUCTURE = ENUMERATED

23 ContentCorrelator       LABEL     = Xcntc
                           STRUCTURE = ANY
                           CHILDREN  = {}

24 ProbeOriginAuthCheck    LABEL     = Xpoac
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <5algi, U 16 C,M,0>   ,
                                         <5encr, U  3 P,M,0>    }


25 RedirectionHistory      LABEL     = Xrhis
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 512
                           CHILDREN  = { <Xrdir, U 16 C,O,0> }

Redirection                LABEL     = Xrdir
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Xirnm, U 16 C,M,0> D,
                                         <Xrrsn, U 10 P,M,0>  }

IntendedRecipientName      LABEL     = Xirnm
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dornm, A  0 C,M,0> ,
                                         <Cutct, U 23 P,M,0>  }

RedirectionReason          LABEL     = Xrrsn
                           STRUCTURE = ENUMERATED

26 DLExpansionHistory      LABEL     = Xdlhs
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 512
                           CHILDREN  = { <Xdlxn, U 16 C,O,0>  }

DLExpansion                LABEL     = Xdlxn
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dornm, A  0 C,M,0>,
                                         <Cutct, U 23 P,M,0>   }

27 PhysicalFwdingAddress   LABEL     = Xpfad
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>  ,
                                         <Dxatl, U 17 C,O,0> D,
                                         <Ddirn, C  0 C,O,0>  }

28 RecipientCertificate    LABEL     = Xrctf
                           STRUCTURE = ANY
                           TAG       = (C 0 C)
                           CHILDREN  = {}

29 ProofOfDelivery         LABEL     = Xpdlv
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <5algi, U 16 C,M,0>   ,
                                         <5encr, U  3 P,M,0>    }

30 OrigAndDLExpansionHis   LABEL     = Xodlh
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 512
                           CHILDREN  = { <Xodlx, U 16 C,O,0>  }

OrigAndDLExpansion         LABEL     = Xodlx
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dornm, A 00 C,M,0>,
                                         <Cutct, U 23 P,M,0>   }


31 ReportingDLName         LABEL     = Xrdln
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>  ,
                                         <Dxatl, U 17 C,O,0> D,
                                         <Ddirn, C  0 C,O,0>  }

32 ReportingMTACertificate LABEL     = Xrmta
                           STRUCTURE = ANY
                           CHILDREN  = {}

33 ReportOriginAuthCheck   LABEL     = Xroac
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <5algi, U 16 C,M,0>   ,
                                         <5encr, U  3 P,M,0>    }


34 OriginatingMTACert      LABEL     = Xomct
                           STRUCTURE = ANY
                           CHILDREN  = {}

35 ProofofSubmission       LABEL     = Xpsub
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <5algi, U 16 C,M,0>   ,
                                         <5encr, U  3 P,M,0>    }

36 ForwardingRequest       LABEL     = Xfwdr
                           STRUCTURE = INTEGER

38 InternalTraceInfo (88)  LABEL     = Xit8c
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 512
                           CHILDREN  = { <Xit8e, U 16 C,O,0>  }

InternalTraceInfoElement88 LABEL     = Xit8e
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Mgbid, A  3 C,M,0> ,
                                         <Xmta5, U 22 P,M,32>,
                                         <Xmt8i, U 17 C,M,0>  }

MTASuppliedInformation 88  LABEL     = Xmt8i
                           STRUCTURE = SET
                           CHILDREN  = { <Marrt, C  0 P,M,0> ,
                                         <Mrtng, C  2 P,M,0> ,
                                         <Xattp, U  0 P,O,0> ,
                                         <Mdeft, C  1 P,O,0> ,
                                         <Mceit, A  5 C,O,0> ,
                                         <Moact, C  3 P,D,16> }

Attempted                  LABEL     = Xattp
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Mamta, U 22 P,O,32>,
                                         <Magbd, A  3 C,O,0>  }

RoutingAction              LABEL     = Mrtng
                           STRUCTURE = ENUMERATED

AttemptedMTAName           LABEL     = Mamta
                           STRUCTURE = IA5 STRING

AttemptedDomainID          LABEL     = Magbd
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Mactr, A  1 C,M,0> D,
                                         <Maadm, A  2 C,M,0> D,
                                         <Mapdi, U  0 P,O,0> D }

AttemptedCountryName       LABEL     = Mactr
                           STRUCTURE = CHOICE
                           TAG       = (A 1 C)
                           CHILDREN  = { <Macac, U 19 P,O,3>,
                                         <Ma121, U 18 P,O,2>}

AttCtryNameISO3166Alpha2   LABEL     = Macac
                           STRUCTURE = PRINTABLE STRING

AttCountryNameX121DccCode  LABEL     = Ma121
                           STRUCTURE = NUMERIC STRING

AttemptdAdministrationName LABEL     = Maadm
                           STRUCTURE = CHOICE
                           TAG       = (A 2 C)
                           CHILDREN  = { <Maadn, U 18 S,O,16>,
                                         <Maadp, U 19 S,O,16>}

AttemptdAdminNamePrintable LABEL     = Maadp
                           STRUCTURE = PRINTABLE STRING

AttemptedAdminNameNumeric  LABEL     = Maadn
                           STRUCTURE = NUMERIC STRING

PrivateDomainIdentifier    LABEL     = Mapdi
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Mapdn, U 18 P,O,16> ,
                                         <Mapdp, U 19 P,O,16>  }

AttPrivateDomainIdPrintble LABEL     = Mapdp
                           STRUCTURE = PRINTABLE STRING

AttPrivateDomainIdNumeric  LABEL     = Mapdn
                           STRUCTURE = NUMERIC STRING

InternalTraceInfo (84)     LABEL     = Xitrc
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 512
                           CHILDREN  = { <Xitre, U 16 C,M,0> }

InternalTraceInfoElement84 LABEL     = Xitre
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Xmtan, U  0 P,M,32>D,
                                         <Xmtai, U 17 C,M,0>  }

MTAName 84                 LABEL     = Xmtan
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Xmta5, U 22 P,O,32>,
                                         <Xmtap, U 19 P,O,32> }

MTAName (ia5string)        LABEL     = Xmta5
                           STRUCTURE = IA5 STRING

MTAName (printable)        LABEL     = Xmtap
                           STRUCTURE = PRINTABLE STRING

MTASuppliedInformation 84  LABEL     = Xmtai
                           STRUCTURE = SET
                           CHILDREN  = { <Marrt, C  0 P,M,0>  ,
                                         <Mrtng, C  2 P,M,0>  ,
                                         <Mpvmn, U 19 P,O,32> ,
                                         <Mdeft, C  1 P,O,0>  }

PreviousMTAName            LABEL     = Mpvmn
                           STRUCTURE = PRINTABLE STRING


(* Security Fields                                                           *)

SecurityPolicyIdentifier   LABEL     = Mspid
                           STRUCTURE = OBJECT IDENTIFIER

SecurityClassification     LABEL     = Mscls
                           STRUCTURE = INTEGER

PrivacyMark                LABEL     = Mpvmk
                           STRUCTURE = PRINTABLE STRING

SecurityCategories         LABEL     = Mscts
                           STRUCTURE = SET OF
                           LIMIT     = 64
                           CHILDREN  = { <Mscat, U 16 C,O,0> D }

SecurityCategory           LABEL     = Mscat
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Mstyp, C  0 P,M,0>* ,
                                         <Msctv, C  1 C,M,0>   }

SecurityCategoryType       LABEL     = Mstyp
                           STRUCTURE = OBJECT IDENTIFIER

SecurityCategoryValues     LABEL     = Msctv
                           STRUCTURE = ANY
                           TAG       = (C 1 C)
                           CHILDREN  = { }

(* Generally  common fields                                                  *)

ORAddress                  LABEL     = Morad
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dsatt, U 16 C,M,0>DE,
                                         <Dddal, U 16 C,O,0>  ,
                                         <Dxatl, U 17 C,O,0>D }

GlobalDomainId             LABEL     = Mgbid
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Dctry, A  1 C,M,0> ,
                                         <Dadmd, A  2 C,M,0>E,
                                         <Mpdid, U  0 P,O,0> }

PrivateDomainIdentifier    LABEL     = Mpdid
                           STRUCTURE = CHOICE
                           CHILDREN  = { <Cnumc, U 18 P,O,16> ,
                                         <Cptbl, U 19 P,O,16>  }

TraceInformation           LABEL     = Mtrac
                           STRUCTURE = SEQUENCE OF
                           LIMIT     = 512
                           CHILDREN  = { <Mtrce, U 16 C,M,0> }

TraceInformationElement    LABEL     = Mtrce
                           STRUCTURE = SEQUENCE
                           CHILDREN  = { <Mgbid, A  3 C,M,0> ,
                                         <Mdsif, U 17 C,M,0>  }

DomainSuppliedInformation  LABEL     = Mdsif
                           STRUCTURE = SET
                           CHILDREN  = { <Marrt, C  0 P,M,0> ,
                                         <Mrtng, C  2 P,M,0> ,
                                         <Magbd, A  3 C,O,0> ,
                                         <Mdeft, C  1 P,O,0> ,
                                         <Mceit, A  5 C,O,0> ,
                                         <Moact, C  3 P,D,16>  }

Other Actions              LABEL     = Moact
                           STRUCTURE = BITSTRING

ArrivalTime                LABEL     = Marrt
                           STRUCTURE = UTC TIME

DeferredTime               LABEL     = Mdeft
                           STRUCTURE = UTC TIME

ConvertedEITs              LABEL     = Mceit
                           STRUCTURE = SET
                           CHILDREN  = { <Mbeit, C  0 P,M,32> ,
                                         <Mg3nb, C  1 P,D,0>  ,
                                         <Mtetx, C  2 C,D,0>  ,
                                         <Mg4c1, C  3 C,O,0>  ,
                                         <Meeit, C  4 C,O,0>  }

EncodedInformationTypes    LABEL     = Meits
                           STRUCTURE = SET
                           CHILDREN  = { <Mbeit, C  0 P,M,32> ,
                                         <Mg3nb, C  1 P,D,0>  ,
                                         <Mtetx, C  2 C,D,0>  ,
                                         <Mg4c1, C  3 C,O,0>  ,
                                         <Meeit, C  4 C,O,0>  }

BuiltInEITs                LABEL     = Mbeit
                           STRUCTURE = BITSTRING

G3NonBasicParams           LABEL     = Mg3nb
                           STRUCTURE = BITSTRING

TeletexNonBasicParams      LABEL     = Mtetx
                           STRUCTURE = SET
                           CHILDREN  = { <Mghcs, C  0 P,O,32>,
                                         <Mclcs, C  1 P,O,0> ,
                                         <Mpgfm, C  2 P,O,0> ,
                                         <Mmtmc, C  3 P,O,0> ,
                                         <Mpriu, C  4 P,O,0>  }

GraphicCharacterSets       LABEL     = Mghcs
                           STRUCTURE = TELETEX STRING

ControlCharacterSets       LABEL     = Mclcs
                           STRUCTURE = TELETEX STRING

PageFormats                LABEL     = Mpgfm
                           STRUCTURE = OCTETSTRING

MiscellaneousTerminalCap   LABEL     = Mmtmc
                           STRUCTURE = TELETEX STRING

PrivateUse                 LABEL     = Mpriu
                           STRUCTURE = OCTETSTRING

G4Class1AndMixedModeNonBas LABEL     = Mg4c1
                           STRUCTURE = ANY
                           TAG       = (C 3 C)
                           CHILDREN  = {}

SET OF ExternalEITs        LABEL     = Meeit
                           STRUCTURE = SET OF
                           LIMIT     = 1024
                           CHILDREN  = { <Cobid, U 6 P,M,0> }
!
