message.c
来自「H.248协议编解码协议栈」· C语言 代码 · 共 194 行
C
194 行
/* * Generated by asn1c-0.9.16 (http://lionet.info/asn1c) * From ASN.1 module "MEDIA-GATEWAY-CONTROL" * found in "h248_2.asn" */#include <asn_internal.h>#include "Message.h"static intmemb_version_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_consume_bytes_f *app_errlog, void *app_key) { const INTEGER_t *st = (const INTEGER_t *)sptr; long value; if(!sptr) { _ASN_ERRLOG(app_errlog, app_key, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if(asn_INTEGER2long(st, &value)) { _ASN_ERRLOG(app_errlog, app_key, "%s: value too large (%s:%d)", td->name, __FILE__, __LINE__); return -1; } if((value >= 0 && value <= 99)) { /* Constraint check succeeded */ return 0; } else { _ASN_ERRLOG(app_errlog, app_key, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; }}static asn_TYPE_member_t asn_MBR_transactions_6[] = { { ATF_NOFLAGS, 0, 0, -1 /* Ambiguous tag (CHOICE?) */, 0, (void *)&asn_DEF_Transaction, 0, /* Defer constraints checking to the member type */ "" },};static ber_tlv_tag_t asn_DEF_transactions_6_tags[] = { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};static asn_SET_OF_specifics_t asn_SPC_transactions_6_specs = { sizeof(struct transactions), offsetof(struct transactions, _asn_ctx), 0, /* XER encoding is XMLDelimitedItemList */};static /* Use -fall-defs-global to expose */asn_TYPE_descriptor_t asn_DEF_transactions_6 = { "transactions", "transactions", SEQUENCE_OF_free, SEQUENCE_OF_print, SEQUENCE_OF_constraint, SEQUENCE_OF_decode_ber, SEQUENCE_OF_encode_der, SEQUENCE_OF_decode_xer, SEQUENCE_OF_encode_xer, 0, /* Use generic outmost tag fetcher */ asn_DEF_transactions_6_tags, sizeof(asn_DEF_transactions_6_tags) /sizeof(asn_DEF_transactions_6_tags[0]) - 1, /* 1 */ asn_DEF_transactions_6_tags, /* Same as above */ sizeof(asn_DEF_transactions_6_tags) /sizeof(asn_DEF_transactions_6_tags[0]), /* 2 */ asn_MBR_transactions_6, 1, /* Single element */ &asn_SPC_transactions_6_specs /* Additional specs */};static asn_TYPE_member_t asn_MBR_messageBody_4[] = { { ATF_NOFLAGS, 0, offsetof(struct messageBody, choice.messageError), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ (void *)&asn_DEF_ErrorDescriptor, 0, /* Defer constraints checking to the member type */ "messageError" }, { ATF_NOFLAGS, 0, offsetof(struct messageBody, choice.transactions), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ (void *)&asn_DEF_transactions_6, 0, /* Defer constraints checking to the member type */ "transactions" },};static asn_TYPE_tag2member_t asn_MAP_messageBody_4_tag2el[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* messageError at 29 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* transactions at 31 */};static asn_CHOICE_specifics_t asn_SPC_messageBody_4_specs = { sizeof(struct messageBody), offsetof(struct messageBody, _asn_ctx), offsetof(struct messageBody, present), sizeof(((struct messageBody *)0)->present), asn_MAP_messageBody_4_tag2el, 2, /* Count of tags in the map */ 0 /* Whether extensible */};static /* Use -fall-defs-global to expose */asn_TYPE_descriptor_t asn_DEF_messageBody_4 = { "messageBody", "messageBody", CHOICE_free, CHOICE_print, CHOICE_constraint, CHOICE_decode_ber, CHOICE_encode_der, CHOICE_decode_xer, CHOICE_encode_xer, CHOICE_outmost_tag, 0, /* No effective tags (pointer) */ 0, /* No effective tags (count) */ 0, /* No tags (pointer) */ 0, /* No tags (count) */ asn_MBR_messageBody_4, 2, /* Elements count */ &asn_SPC_messageBody_4_specs /* Additional specs */};static asn_TYPE_member_t asn_MBR_Message_1[] = { { ATF_NOFLAGS, 0, offsetof(struct Message, version), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ (void *)&asn_DEF_INTEGER, memb_version_1_constraint, "version" }, { ATF_NOFLAGS, 0, offsetof(struct Message, mId), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), +1, /* EXPLICIT tag at current level */ (void *)&asn_DEF_MId, 0, /* Defer constraints checking to the member type */ "mId" }, { ATF_NOFLAGS, 0, offsetof(struct Message, messageBody), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), +1, /* EXPLICIT tag at current level */ (void *)&asn_DEF_messageBody_4, 0, /* Defer constraints checking to the member type */ "messageBody" },};static ber_tlv_tag_t asn_DEF_Message_1_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};static asn_TYPE_tag2member_t asn_MAP_Message_1_tag2el[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* version at 24 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* mId at 26 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* messageBody at 29 */};static asn_SEQUENCE_specifics_t asn_SPC_Message_1_specs = { sizeof(struct Message), offsetof(struct Message, _asn_ctx), asn_MAP_Message_1_tag2el, 3, /* Count of tags in the map */ 2, /* Start extensions */ 4 /* Stop extensions */};asn_TYPE_descriptor_t asn_DEF_Message = { "Message", "Message", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, 0, /* Use generic outmost tag fetcher */ asn_DEF_Message_1_tags, sizeof(asn_DEF_Message_1_tags) /sizeof(asn_DEF_Message_1_tags[0]), /* 1 */ asn_DEF_Message_1_tags, /* Same as above */ sizeof(asn_DEF_Message_1_tags) /sizeof(asn_DEF_Message_1_tags[0]), /* 1 */ asn_MBR_Message_1, 3, /* Elements count */ &asn_SPC_Message_1_specs /* Additional specs */};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?