BER Runtime Library Functions.
Detailed Description
The ASN.1 Basic Encoding Rules (BER) Runtime Library contains the low-level constants, types, and functions that are assembled by the compiler to encode/decode more complex structures.
|
Modules |
| | BER/DER C Decode Functions. |
| | BER/DER C File Functions. |
| | BER/DER C Encode Functions. |
| | BER/PER C Utility Functions |
| | Streaming BER Runtime Library Functions. |
Classes |
| struct | _Asn1BufLocDescr |
Defines |
|
#define | ASN_K_INDEFLEN -9999 |
|
#define | XU_DUMP(msg) xu_dump(msg,0,0) |
|
#define | xd_resetp(pctxt) rtxResetContext(pctxt) |
|
#define | ASN1TAG2BYTE(tag) ((OSOCTET)(((tag)&TM_B_IDCODE)|((tag)>>ASN1TAG_LSHIFT))) |
| #define | XD_MEMCPY1(pctxt, object_p) |
|
#define | XD_FETCH1(pctxt) ((pctxt)->buffer.data[(pctxt)->buffer.byteIndex++]) |
|
#define | XD_PEEKTAG(pctxt, tag) (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] & (~0x20)) == (tag & (~0x20))) |
|
#define | XD_PEEKPC(pctxt) (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] & 0x20) == 0x20) |
| #define | XD_MATCHEOC(pctxt) |
|
#define | XD_MATCHBYTES1(pctxt, b1) ((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] == b1) |
| #define | XD_MATCHBYTES2(pctxt, b1, b2) |
| #define | XD_MATCHBYTES3(pctxt, b1, b2, b3) |
| #define | XD_MATCHBYTES4(pctxt, b1, b2, b3, b4) |
| #define | XD_MATCHBYTES5(pctxt, b1, b2, b3, b4, b5) |
|
#define | XD_BUMPIDX(pctxt, nbytes) ((pctxt)->buffer.byteIndex += nbytes) |
| #define | XD_CHKBUFEND(pctxt) |
| #define | XD_CHKDEFLEN(pctxt, len) |
| #define | XD_CHKEOB(pctxt) |
| #define | XD_CHKEND(pctxt, ccb_p) |
| #define | XE_CHKBUF(pctxt, len) |
|
#define | XE_PUT1(pctxt, ch) (pctxt)->buffer.data[--(pctxt)->buffer.byteIndex] = ch; |
| #define | XE_PUT2(pctxt, ch1, ch2) |
|
#define | XE_SAFEPUT1(pctxt, ch) XE_CHKBUF(pctxt,1); (pctxt)->buffer.data[--(pctxt)->buffer.byteIndex] = ch; |
Typedefs |
| typedef _Asn1BufLocDescr | Asn1BufLocDescr |
Define Documentation
| #define XD_CHKBUFEND |
( |
pctxt |
|
) |
|
|
|
|
Value: (((ASN1BUF_INDEFLEN(pctxt)) || \
((pctxt)->buffer.byteIndex <= (pctxt)->buffer.size)) ? 0 : RTERR_ENDOFBUF)
|
| #define XD_CHKDEFLEN |
( |
pctxt, |
|
|
len |
|
) |
|
|
|
|
Value: (((ASN1BUF_INDEFLEN(pctxt)) || \
(((pctxt)->buffer.byteIndex + len) <= (pctxt)->buffer.size)) ? \
0 : RTERR_ENDOFBUF)
|
| #define XD_CHKEND |
( |
pctxt, |
|
|
ccb_p |
|
) |
|
|
|
|
Value: (((ccb_p)->len == ASN_K_INDEFLEN) ? XD_CHKEOB(pctxt) : \
((OSRTBUFPTR(pctxt) - (ccb_p)->ptr >= (ccb_p)->len) || \
((pctxt)->buffer.byteIndex >= (pctxt)->buffer.size)))
|
| #define XD_CHKEOB |
( |
pctxt |
|
) |
|
|
|
|
Value: (((pctxt)->buffer.byteIndex + 2 > (pctxt)->buffer.size) ? TRUE : \
(((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] == 0 && \
(pctxt)->buffer.data[(pctxt)->buffer.byteIndex + 1] == 0 ) ? \
TRUE : FALSE))
|
| #define XD_MATCHBYTES2 |
( |
pctxt, |
|
|
b1, |
|
|
b2 |
|
) |
|
|
|
|
Value: (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] == b1) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+1] == b2))
|
| #define XD_MATCHBYTES3 |
( |
pctxt, |
|
|
b1, |
|
|
b2, |
|
|
b3 |
|
) |
|
|
|
|
Value: (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] == b1) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+1] == b2) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+2] == b3))
|
| #define XD_MATCHBYTES4 |
( |
pctxt, |
|
|
b1, |
|
|
b2, |
|
|
b3, |
|
|
b4 |
|
) |
|
|
|
|
Value: (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] == b1) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+1] == b2) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+2] == b3) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+3] == b4))
|
| #define XD_MATCHBYTES5 |
( |
pctxt, |
|
|
b1, |
|
|
b2, |
|
|
b3, |
|
|
b4, |
|
|
b5 |
|
) |
|
|
|
|
Value: (((pctxt)->buffer.data[(pctxt)->buffer.byteIndex] == b1) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+1] == b2) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+2] == b3) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+3] == b4) && \
((pctxt)->buffer.data[(pctxt)->buffer.byteIndex+4] == b5))
|
| #define XD_MATCHEOC |
( |
pctxt |
|
) |
|
|
|
|
Value: ( ( (pctxt)->buffer.byteIndex + 2 <= (pctxt)->buffer.size ) && \
( (pctxt)->buffer.data[(pctxt)->buffer.byteIndex] == 0 ) && \
( (pctxt)->buffer.data[(pctxt)->buffer.byteIndex + 1] == 0 ) )
|
| #define XD_MEMCPY1 |
( |
pctxt, |
|
|
object_p |
|
) |
|
|
|
|
Value: ((ASN1BUF_INDEFLEN(pctxt) || \
((pctxt)->buffer.byteIndex < (pctxt)->buffer.size)) ? \
(*object_p = *OSRTBUFPTR(pctxt), (pctxt)->buffer.byteIndex ++, 0) : \
RTERR_ENDOFBUF)
|
| #define XE_CHKBUF |
( |
pctxt, |
|
|
len |
|
) |
|
|
|
|
Value: if (len > (pctxt)->buffer.byteIndex) { \
int stat = xe_expandBuffer (pctxt, len); \
if (stat != 0) return stat; }
|
| #define XE_PUT2 |
( |
pctxt, |
|
|
ch1, |
|
|
ch2 |
|
) |
|
|
|
|
Value: (pctxt)->buffer.byteIndex -= 2; \
(pctxt)->buffer.data[(pctxt)->buffer.byteIndex] = ch1; \
(pctxt)->buffer.data[(pctxt)->buffer.byteIndex+1] = ch2;
|
Typedef Documentation
|
|
Buffer location descriptor |