我要评分
获取效率
正确性
完整性
易理解

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
typedef struct AsnDesc { 
    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];
} AsnDescriptor; 

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
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 */
    uint16_t reserved;     /* Reserved field */
    AsnLocalTag *localTag; /* Local tag information */
    uintptr_t reservedArr[4];
} AsnCtx;