SILC_ASN1_CHOICE

SYNOPSIS

    Decoding:
    SILC_ASN1_CHOICE(&chosen)

DESCRIPTION

Macro used to specify choices in decoding. The choice list must be terminated with SILC_ASN1_END. There is no limit how many choices can be specified in the list. The `chosen' is SilcUInt32 and its value tells which of the choice was found. First choice in the list has value 1, second value 2, and so on.

EXAMPLE

    // Decode timeval that is either UTC or generalized time
    silc_asn1_decode(asn1, tree,
                     SILC_ASN1_SEQUENCE,
                       SILC_ASN1_CHOICE(&chosen),
                         SILC_ASN1_UTC_TIME(&timeval),
                         SILC_ASN1_GEN_TIME(&timeval),
                       SILC_ASN1_END,
                     SILC_ASN1_END, SILC_ASN1_END);