ooasn1.h
来自「一个非常美妙的proxy。功能强大。基于sip的协议。如果还要的话」· C头文件 代码 · 共 1,600 行 · 第 1/5 页
H
1,600 行
*/EXTERN int decodeDynOctetString (OOCTXT* pctxt, ASN1DynOctStr* pOctStr);/** * This function will decode a length determinant value. * * @param pctxt A pointer to a context structure. This provides a * storage area for the function to store all working * variables that must be maintained between function * calls. * @param pvalue A pointer to an unsigned integer variable to receive the * decoded length value. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int decodeLength (OOCTXT* pctxt, ASN1UINT* pvalue);/** * @param pctxt A pointer to a context structure. This provides a * storage area for the function to store all working * variables that must be maintained between function * calls. * @param bitOffset The bit offset inside the message buffer. */EXTERN int moveBitCursor (OOCTXT* pctxt, int bitOffset);/** * This function decodes a value of the ASN.1 object identifier type. * * @param pctxt Pointer to context block structure. * @param pvalue Pointer to value to receive decoded result. The * ASN1OBJID structure contains an integer to hold the * number of subidentifiers and an array to hold the * subidentifier values. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int decodeObjectIdentifier (OOCTXT* pctxt, ASN1OBJID* pvalue);/** * This function will decode a value of the ASN.1 octet string type whose * maximun size is known in advance. The ASN1C compiler generates a call to * this function to decode octet string productions or elements that contain a * size constraint. * * @param pctxt Pointer to a context structure. This provides a storage * area for the function to store all working variables * that must be maintained between function calls. * @param numocts_p A pointer to an unsigned buffer of bufsiz octets to * receive decoded data. * @param buffer A pointer to a pre-allocated buffer of size octets to * receive the decoded data. * @param bufsiz The size of the buffer to receive the decoded result. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int decodeOctetString (OOCTXT* pctxt, ASN1UINT* numocts_p, ASN1OCTET* buffer, ASN1UINT bufsiz);/** * This function will decode an ASN.1 open type. This used to be the ASN.1 ANY * type, but now is used in a variety of applications requiring an encoding * that can be interpreted by a decoder without prior knowledge of the type * of the variable. * * @param pctxt Pointer to a context structure. This provides a storage * area for the function to store all working variables * that must be maintained between function calls. * @param numocts_p A pointer to an unsigned buffer of bufsiz octets to * receive decoded data. * @param object_p2 A pointer to an open type variable to receive the * decoded data. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int decodeOpenType (OOCTXT* pctxt, const ASN1OCTET** object_p2, ASN1UINT* numocts_p);/** * This function will decode a small non-negative whole number as specified in * Section 10.6 of the X.691 standard. This is a number that is expected to be * small, but whose size is potentially unlimited due to the presence of an * extension maker. * * @param pctxt Pointer to a context structure. This provides a storage * area for the function to store all workings variables * that must be maintained between function calls. * @param pvalue Pointer to an unsigned integer value t receive decoded * results. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int decodeSmallNonNegWholeNumber (OOCTXT* pctxt, ASN1UINT* pvalue);/** * This function will decode a semi-constrained integer. * * @param pctxt Pointer to context block structure. * @param pvalue Pointer to integer variable to receive decoded value. * @param lower Lower range value, represented as signed * integer. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int decodeSemiConsInteger (OOCTXT* pctxt, ASN1INT* pvalue, ASN1INT lower);/** * This function will decode a semi-constrained unsigned integer. * * @param pctxt Pointer to context block structure. * @param pvalue Pointer to unsigned integer variable to receive decoded * value. * @param lower Lower range value, represented as unsigned * integer. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int decodeSemiConsUnsigned (OOCTXT* pctxt, ASN1UINT* pvalue, ASN1UINT lower);/** * This function will decode an unconstrained integer. * * @param pctxt Pointer to context block structure. * @param pvalue Pointer to integer variable to receive decoded value. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */#define decodeUnconsInteger(pctxt,pvalue) \decodeSemiConsInteger(pctxt, pvalue, ASN1INT_MIN)/** * This function will decode an unconstrained unsigned integer. * * @param pctxt Pointer to context block structure. * @param pvalue Pointer to unsigned integer variable to receive decoded * value. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */#define decodeUnconsUnsigned(pctxt,pvalue) \decodeSemiConsUnsigned(pctxt, pvalue, 0U)EXTERN int decodeVarWidthCharString (OOCTXT* pctxt, const char** pvalue);/** * This function will encode a variable of the ASN.1 BOOLEAN type in * a single bit. * * @param pctxt Pointer to a context structure. This provides a storage * area for the function to store all working variables * that must be maintained between function calls. * @param value The BOOLEAN value to be encoded. */EXTERN int encodeBit (OOCTXT* pctxt, ASN1BOOL value);/** * This function encodes multiple bits. * * @param pctxt Pointer to context block structure. * @param value Unsigned integer containing the bits to be encoded. * @param nbits Number of bits in value to encode. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeBits (OOCTXT* pctxt, ASN1UINT value, ASN1UINT nbits);/** * This function will encode a value of the ASN.1 bit string type. * * @param pctxt A pointer to a context structure. This provides a * storage area for the function to store all working * variables that must be maintained between function * calls. * @param numocts The number of bits n the string to be encoded. * @param data Pointer to the bit string data to be encoded. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeBitString (OOCTXT* pctxt, ASN1UINT numocts, const ASN1OCTET* data);/** * This function will encode a variable of the ASN.1 BMP character string. This * differs from the encode routines for the character strings previously * described in that the BMP string type is based on 16-bit characters. A * 16-bit character string is modeled using an array of unsigned short * integers. * * @param pctxt A pointer to a context structure. This provides a * storage area for the function to store all working * variables that must be maintained between function * calls. * @param value Character string to be encoded. This structure includes * a count field containing the number of characters to * encode and an array of unsigned short integers to hold * the 16-bit characters to be encoded. * @param permCharSet Pointer to the constraining character set. This contains * an array containing all valid characters in the set as * well as the aligned and unaligned bit counts required * to encode the characters. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeBMPString (OOCTXT* pctxt, ASN1BMPString value, Asn116BitCharSet* permCharSet);/** * This function will position the encode bit cursor on the next byte boundry. * * @param pctxt A pointer to a context structure. This provides a * storage area for the function to store all working * variables that must be maintained between function * calls. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeByteAlign (OOCTXT* pctxt);/** * This function will determine if the given number of bytes will fit in the * encode buffer. If not, either the buffer is expanded (if it is a dynamic * buffer) or an error is signaled. * * @param pctxt A pointer to a context structure. This provides a * storage area for the function to store all working * variables that must be maintained between function * calls. * @param nbytes Number of bytes of space required to hold the variable * to be encoded. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeCheckBuffer (OOCTXT* pctxt, ASN1UINT nbytes);/** * This function encodes a constrained string value. This version of the * function allows all of the required permitted alphabet constraint parameters * to be passed in as arguments. * * @param pctxt Pointer to context block structure. * @param string Pointer to string to be encoded. * @param charSet String containing permitted alphabet character set. Can * be null if no character set was specified. * @param abits Number of bits in a character set character (aligned). * @param ubits Number of bits in a character set character (unaligned). * @param canSetBits Number of bits in a character from the canonical set * representing this string. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeConstrainedStringEx (OOCTXT* pctxt, const char* string, const char* charSet, ASN1UINT abits, ASN1UINT ubits, ASN1UINT canSetBits);/** * This function encodes an integer constrained either by a value or value * range constraint. * * @param pctxt Pointer to context block structure. * @param value Value to be encoded. * @param lower Lower range value. * @param upper Upper range value. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeConsInteger (OOCTXT* pctxt, ASN1INT value, ASN1INT lower, ASN1INT upper);/** * This function encodes an unsigned integer constrained either by a value or * value range constraint. The constrained unsigned integer option is used if: * * 1. The lower value of the range is >= 0, and 2. The upper value of the range * is >= MAXINT * * @param pctxt Pointer to context block structure. * @param value Value to be encoded. * @param lower Lower range value. * @param upper Upper range value. * @return Completion status of operation: * - 0 (ASN_OK) = success, * - negative return value is error. */EXTERN int encodeConsUnsigned (OOCTXT* pctxt, ASN1UINT value, ASN1UINT lower, ASN1UINT upper);/** * This function encodes a constrained whole number as specified in Section * 10.5 of the X.691 standard. * * @param pctxt Pointer to context block structure. * @param adjusted_value Unsigned adjusted integer value to be encoded. The * adjustment is done by subtracting the lower value * of the range from the value to be encoded. * @param range_value Unsigned integer value specifying the total size of * the range. This is obtained by subtracting the * lower range value from the upper range value. * @
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?