Rate This Document
Findability
Accuracy
Completeness
Readability

Data Structures

AsnDesc

ASN.1 data descriptor.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
struct AsnDescriptor {
    uint16_t id;             /* Unique index of the descriptor */
    uint16_t attrs;          /* Type attribute (bitmap format). See #AsnDescAttr. */
    uint32_t limit;          /* Size limit of a member array or character array */
    uint32_t nmem;           /* Total number of members */
    AsnDescInfo i;           /* Type description */
    uint8_t extNum;          /* Number of extension members */
    uint8_t reserved;        /* Reserved field */
    size_t size;             /* Size of members of this type */
    AsnDescMember m;         /* Member list */
    AsnConstraint cstr;      /* Constraint */
    AsnLocalTag localTag;    /* Local tag information */
    AsnBuiltinType asn1Type; /* ASN.1 built-in type */

    /* Type name in the ASN.1 notation (use the member name for an anonymous type). Note that the name is not unique. */
    AsnNameValue name;
    AsnDescNameValue nameValues;

    ASN_ENC_FUNC enc; /* Encoding function */
    ASN_DEC_FUNC dec; /* Decoding function */

    uintptr_t reservedArr[4];
};

typedef struct AsnDescriptor AsnDesc;

AsnBuf

Encoding and decoding buffer structure.

1
2
3
4
5
6
7
8
typedef struct {
    uint8_t *buf;    /* Start address of the buffer */
    uint32_t bufLen; /* Buffer length in bytes */
    union {
        uint32_t bitIdx;  /* Current bit index of the buffer, used in BER/DER/PER */
        uint32_t byteIdx; /* Current byte index of the buffer, used only in XER */
    };
} AsnBuf;

AsnCtx

ASN.1 context structure.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
typedef struct {
    AsnBuf *buf;             /* Encoding buffer structure */
    uint32_t ret;            /* Error code #AsnErrors */
    uint8_t method;          /* ASN.1 encoding and decoding method #AsnCodecMethod */
    uint8_t level;           /* Member level, which assists in formatting */
    bool isDynamicArray;     /* Whether to define the array as a dynamic array */
    bool memPoolInitialized; /* Whether the memory pool has been initialized */
    AsnLocalTag *localTag;   /* Local tag information */
    uint32_t openTypeKey;    /* OpenType key */
    uint32_t reserved1;
    AsnMemPool *memPool;     /* Memory pool */
    uintptr_t reserved[2];
} AsnCtx;