⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 73-circular-ok.asn1.-p

📁 RSA加密/解密算法源码 asn1c-0.9.12
💻 -P
📖 第 1 页 / 共 2 页
字号:
/*** <<< DEPS [Ypet] >>> ***//* * Method of determining the components presence */typedef enum Ypet_PR {	Ypet_PR_epyt,	/* Member epyt is present */	Ypet_PR_plain,	/* Member plain is present */	Ypet_PR_senums,	/* Member senums is present */	Ypet_PR_patest1,	/* Member patest1 is present */	Ypet_PR_patest2,	/* Member patest2 is present */} Ypet_PR;/*** <<< TYPE-DECLS [Ypet] >>> ***/typedef struct Ypet {	Epyt_t	 epyt;	INTEGER_t	*plain	/* DEFAULT 7 */;	struct senums {		A_SET_OF(EnumType_t) list;				/* Context for parsing across buffer boundaries */		asn_struct_ctx_t _asn_ctx;	} senums;	IA5String_t	 patest1;	IA5String_t	 patest2;		/* Presence bitmask: ASN_SET_ISPRESENT(pYpet, Ypet_PR_x) */	unsigned int _presence_map		[((5+(8*sizeof(unsigned int))-1)/(8*sizeof(unsigned int)))];		/* Context for parsing across buffer boundaries */	asn_struct_ctx_t _asn_ctx;} Ypet_t;/*** <<< FUNC-DECLS [Ypet] >>> ***/extern asn_TYPE_descriptor_t asn_DEF_Ypet;/*** <<< CTABLES [Ypet] >>> ***/static int check_permitted_alphabet_6(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 >= 65 && cv <= 90)) return -1;	}	return 0;}static int check_permitted_alphabet_7(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 >= 97 && cv <= 122)) return -1;	}	return 0;}/*** <<< CODE [Ypet] >>> ***/static intmemb_patest1_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;		if(!sptr) {		_ASN_ERRLOG(app_errlog, app_key,			"%s: value not given (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}			if(!check_permitted_alphabet_6(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_patest2_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;		if(!sptr) {		_ASN_ERRLOG(app_errlog, app_key,			"%s: value not given (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}			if(!check_permitted_alphabet_7(st)) {		/* Constraint check succeeded */		return 0;	} else {		_ASN_ERRLOG(app_errlog, app_key,			"%s: constraint failed (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}}/*** <<< STAT-DEFS [Ypet] >>> ***/static asn_TYPE_member_t asn_MBR_senums_4[] = {	{ ATF_NOFLAGS, 0, 0,		.tag = (ASN_TAG_CLASS_UNIVERSAL | (10 << 2)),		.tag_mode = 0,		.type = (void *)&asn_DEF_EnumType,		.memb_constraints = 0,	/* Defer constraints checking to the member type */		.name = ""		},};static ber_tlv_tag_t asn_DEF_senums_4_tags[] = {	(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))};static asn_SET_OF_specifics_t asn_SPC_senums_4_specs = {	sizeof(struct senums),	offsetof(struct senums, _asn_ctx),	1,	/* XER encoding is XMLValueList */};static /* Use -fall-defs-global to expose */asn_TYPE_descriptor_t asn_DEF_senums_4 = {	"senums",	"senums",	SET_OF_free,	SET_OF_print,	SET_OF_constraint,	SET_OF_decode_ber,	SET_OF_encode_der,	SET_OF_decode_xer,	SET_OF_encode_xer,	0,	/* Use generic outmost tag fetcher */	asn_DEF_senums_4_tags,	sizeof(asn_DEF_senums_4_tags)		/sizeof(asn_DEF_senums_4_tags[0]), /* 1 */	asn_DEF_senums_4_tags,	/* Same as above */	sizeof(asn_DEF_senums_4_tags)		/sizeof(asn_DEF_senums_4_tags[0]), /* 1 */	asn_MBR_senums_4,	1,	/* Single element */	&asn_SPC_senums_4_specs	/* Additional specs */};static asn_TYPE_member_t asn_MBR_Ypet_1[] = {	{ ATF_NOFLAGS, 0, offsetof(struct Ypet, epyt),		.tag = (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)),		.tag_mode = 0,		.type = (void *)&asn_DEF_Epyt,		.memb_constraints = 0,	/* Defer constraints checking to the member type */		.name = "epyt"		},	{ ATF_POINTER, 1, offsetof(struct Ypet, plain),		.tag = (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)),		.tag_mode = 0,		.type = (void *)&asn_DEF_INTEGER,		.memb_constraints = 0,	/* Defer constraints checking to the member type */		.name = "plain"		},	{ ATF_NOFLAGS, 0, offsetof(struct Ypet, senums),		.tag = (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)),		.tag_mode = 0,		.type = (void *)&asn_DEF_senums_4,		.memb_constraints = 0,	/* Defer constraints checking to the member type */		.name = "senums"		},	{ ATF_NOFLAGS, 0, offsetof(struct Ypet, patest1),		.tag = (ASN_TAG_CLASS_CONTEXT | (1 << 2)),		.tag_mode = +1,	/* EXPLICIT tag at current level */		.type = (void *)&asn_DEF_IA5String,		.memb_constraints = memb_patest1_1_constraint,		.name = "patest1"		},	{ ATF_NOFLAGS, 0, offsetof(struct Ypet, patest2),		.tag = (ASN_TAG_CLASS_CONTEXT | (2 << 2)),		.tag_mode = +1,	/* EXPLICIT tag at current level */		.type = (void *)&asn_DEF_IA5String,		.memb_constraints = memb_patest2_1_constraint,		.name = "patest2"		},};static ber_tlv_tag_t asn_DEF_Ypet_1_tags[] = {	(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))};static asn_TYPE_tag2member_t asn_MAP_Ypet_1_tag2el[] = {    { (ASN_TAG_CLASS_UNIVERSAL | (2 << 2)), 1, 0, 0 }, /* plain at 28 */    { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)), 0, 0, 0 }, /* epyt at 27 */    { (ASN_TAG_CLASS_UNIVERSAL | (17 << 2)), 2, 0, 0 }, /* senums at 29 */    { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 3, 0, 0 }, /* patest1 at 30 */    { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 4, 0, 0 } /* patest2 at 31 */};static uint8_t asn_MAP_Ypet_1_mmap[(5 + (8 * sizeof(unsigned int)) - 1) / 8] = {	(1 << 7) | (0 << 6) | (1 << 5) | (1 << 4) | (1 << 3)};static asn_SET_specifics_t asn_SPC_Ypet_1_specs = {	sizeof(struct Ypet),	offsetof(struct Ypet, _asn_ctx),	offsetof(struct Ypet, _presence_map),	asn_MAP_Ypet_1_tag2el,	5,	/* Count of tags in the map */	asn_MAP_Ypet_1_tag2el,	/* Same as above */	5,	/* Count of tags in the CXER map */	0,	/* Whether extensible */	(unsigned int *)asn_MAP_Ypet_1_mmap	/* Mandatory elements map */};asn_TYPE_descriptor_t asn_DEF_Ypet = {	"Ypet",	"Ypet",	SET_free,	SET_print,	SET_constraint,	SET_decode_ber,	SET_encode_der,	SET_decode_xer,	SET_encode_xer,	0,	/* Use generic outmost tag fetcher */	asn_DEF_Ypet_1_tags,	sizeof(asn_DEF_Ypet_1_tags)		/sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */	asn_DEF_Ypet_1_tags,	/* Same as above */	sizeof(asn_DEF_Ypet_1_tags)		/sizeof(asn_DEF_Ypet_1_tags[0]), /* 1 */	asn_MBR_Ypet_1,	5,	/* Elements count */	&asn_SPC_Ypet_1_specs	/* Additional specs */};/*** <<< INCLUDES [EnumType] >>> ***/#include <ENUMERATED.h>/*** <<< DEPS [EnumType] >>> ***/typedef enum EnumType {	EnumType_one	= 0,	EnumType_two	= 1} EnumType_e;/*** <<< TYPE-DECLS [EnumType] >>> ***/typedef ENUMERATED_t	 EnumType_t;/*** <<< FUNC-DECLS [EnumType] >>> ***/extern asn_TYPE_descriptor_t asn_DEF_EnumType;asn_struct_free_f EnumType_free;asn_struct_print_f EnumType_print;asn_constr_check_f EnumType_constraint;ber_type_decoder_f EnumType_decode_ber;der_type_encoder_f EnumType_encode_der;xer_type_decoder_f EnumType_decode_xer;xer_type_encoder_f EnumType_encode_xer;/*** <<< CODE [EnumType] >>> ***/intEnumType_constraint(asn_TYPE_descriptor_t *td, const void *sptr,			asn_app_consume_bytes_f *app_errlog, void *app_key) {	/* Replace with underlying type checker */	td->check_constraints = asn_DEF_ENUMERATED.check_constraints;	return td->check_constraints(td, sptr, app_errlog, app_key);}/* * This type is implemented using ENUMERATED, * so here we adjust the DEF accordingly. */static voidEnumType_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {	td->free_struct    = asn_DEF_ENUMERATED.free_struct;	td->print_struct   = asn_DEF_ENUMERATED.print_struct;	td->ber_decoder    = asn_DEF_ENUMERATED.ber_decoder;	td->der_encoder    = asn_DEF_ENUMERATED.der_encoder;	td->xer_decoder    = asn_DEF_ENUMERATED.xer_decoder;	td->xer_encoder    = asn_DEF_ENUMERATED.xer_encoder;	td->elements       = asn_DEF_ENUMERATED.elements;	td->elements_count = asn_DEF_ENUMERATED.elements_count;    /* td->specifics      = asn_DEF_ENUMERATED.specifics;	// Defined explicitly */}voidEnumType_free(asn_TYPE_descriptor_t *td,		void *struct_ptr, int contents_only) {	EnumType_1_inherit_TYPE_descriptor(td);	td->free_struct(td, struct_ptr, contents_only);}intEnumType_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {	EnumType_1_inherit_TYPE_descriptor(td);	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);}asn_dec_rval_tEnumType_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,		void **structure, void *bufptr, size_t size, int tag_mode) {	EnumType_1_inherit_TYPE_descriptor(td);	return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);}asn_enc_rval_tEnumType_encode_der(asn_TYPE_descriptor_t *td,		void *structure, int tag_mode, ber_tlv_tag_t tag,		asn_app_consume_bytes_f *cb, void *app_key) {	EnumType_1_inherit_TYPE_descriptor(td);	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);}asn_dec_rval_tEnumType_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,		void **structure, const char *opt_mname, void *bufptr, size_t size) {	EnumType_1_inherit_TYPE_descriptor(td);	return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);}asn_enc_rval_tEnumType_encode_xer(asn_TYPE_descriptor_t *td, void *structure,		int ilevel, enum xer_encoder_flags_e flags,		asn_app_consume_bytes_f *cb, void *app_key) {	EnumType_1_inherit_TYPE_descriptor(td);	return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);}/*** <<< STAT-DEFS [EnumType] >>> ***/static asn_INTEGER_enum_map_t asn_MAP_EnumType_1_value2enum[] = {	{ 0,	3,	"one" },	{ 1,	3,	"two" }};static unsigned int asn_MAP_EnumType_1_enum2value[] = {	0,	/* one(0) */	1	/* two(1) */};static asn_INTEGER_specifics_t asn_SPC_EnumType_1_specs = {	asn_MAP_EnumType_1_value2enum,	/* "tag" => N; sorted by tag */	asn_MAP_EnumType_1_enum2value,	/* N => "tag"; sorted by N */	2,	/* Number of elements in the maps */	0,	/* Enumeration is not extensible */	1	/* Strict enumeration */};static ber_tlv_tag_t asn_DEF_EnumType_1_tags[] = {	(ASN_TAG_CLASS_UNIVERSAL | (10 << 2))};asn_TYPE_descriptor_t asn_DEF_EnumType = {	"EnumType",	"EnumType",	EnumType_free,	EnumType_print,	EnumType_constraint,	EnumType_decode_ber,	EnumType_encode_der,	EnumType_decode_xer,	EnumType_encode_xer,	0,	/* Use generic outmost tag fetcher */	asn_DEF_EnumType_1_tags,	sizeof(asn_DEF_EnumType_1_tags)		/sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */	asn_DEF_EnumType_1_tags,	/* Same as above */	sizeof(asn_DEF_EnumType_1_tags)		/sizeof(asn_DEF_EnumType_1_tags[0]), /* 1 */	0, 0,	/* Defined elsewhere */	&asn_SPC_EnumType_1_specs	/* Additional specs */};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -