timenotation.c
来自「H.248协议编解码协议栈」· C语言 代码 · 共 144 行
C
144 行
/* * 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 "TimeNotation.h"static int check_permitted_alphabet_2(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv <= 127)) return -1; } return 0;}static int check_permitted_alphabet_3(const void *sptr) { /* The underlying type is IA5String */ const IA5String_t *st = (const IA5String_t *)sptr; const uint8_t *ch = st->buf; const uint8_t *end = ch + st->size; for(; ch < end; ch++) { uint8_t cv = *ch; if(!(cv <= 127)) return -1; } return 0;}static intmemb_date_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_consume_bytes_f *app_errlog, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; size_t size; if(!sptr) { _ASN_ERRLOG(app_errlog, app_key, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size == 8) && !check_permitted_alphabet_2(st)) { /* Constraint check succeeded */ return 0; } else { _ASN_ERRLOG(app_errlog, app_key, "%s: constraint failed (%s:%d)", td->name, __FILE__, __LINE__); return -1; }}static intmemb_time_1_constraint(asn_TYPE_descriptor_t *td, const void *sptr, asn_app_consume_bytes_f *app_errlog, void *app_key) { const IA5String_t *st = (const IA5String_t *)sptr; size_t size; if(!sptr) { _ASN_ERRLOG(app_errlog, app_key, "%s: value not given (%s:%d)", td->name, __FILE__, __LINE__); return -1; } size = st->size; if((size == 8) && !check_permitted_alphabet_3(st)) { /* 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_TimeNotation_1[] = { { ATF_NOFLAGS, 0, offsetof(struct TimeNotation, date), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ (void *)&asn_DEF_IA5String, memb_date_1_constraint, "date" }, { ATF_NOFLAGS, 0, offsetof(struct TimeNotation, time), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ (void *)&asn_DEF_IA5String, memb_time_1_constraint, "time" },};static ber_tlv_tag_t asn_DEF_TimeNotation_1_tags[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))};static asn_TYPE_tag2member_t asn_MAP_TimeNotation_1_tag2el[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* date at 956 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* time at 957 */};static asn_SEQUENCE_specifics_t asn_SPC_TimeNotation_1_specs = { sizeof(struct TimeNotation), offsetof(struct TimeNotation, _asn_ctx), asn_MAP_TimeNotation_1_tag2el, 2, /* Count of tags in the map */ -1, /* Start extensions */ -1 /* Stop extensions */};asn_TYPE_descriptor_t asn_DEF_TimeNotation = { "TimeNotation", "TimeNotation", 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_TimeNotation_1_tags, sizeof(asn_DEF_TimeNotation_1_tags) /sizeof(asn_DEF_TimeNotation_1_tags[0]), /* 1 */ asn_DEF_TimeNotation_1_tags, /* Same as above */ sizeof(asn_DEF_TimeNotation_1_tags) /sizeof(asn_DEF_TimeNotation_1_tags[0]), /* 1 */ asn_MBR_TimeNotation_1, 2, /* Elements count */ &asn_SPC_TimeNotation_1_specs /* Additional specs */};
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?