InterledgerPacket
DEFINITIONS
AUTOMATIC TAGS ::=
BEGIN

IMPORTS
    UInt8,
    VarBytes
    FROM GenericTypes

    InterledgerPrepare,
    InterledgerFulfill,
    InterledgerReject
    FROM InterledgerProtocol
;

PACKET ::= CLASS {
    &typeId UInt8 UNIQUE,
    &Type
} WITH SYNTAX {&typeId &Type}

PacketSet PACKET ::= {
    {12 InterledgerPrepare} |
    {13 InterledgerFulfill} |
    {14 InterledgerReject}
}

InterledgerPacket ::= SEQUENCE {
    -- One byte type ID
    type PACKET.&typeId ({PacketSet}),
    -- Length-prefixed header
    data PACKET.&Type ({PacketSet}{@type})
}

END