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

📄 50-constraint-ok.asn1.-p

📁 RSA加密/解密算法源码 asn1c-0.9.12
💻 -P
📖 第 1 页 / 共 5 页
字号:
	Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);	return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);}asn_enc_rval_tNot_PER_Visible_1_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) {	Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);}asn_dec_rval_tNot_PER_Visible_1_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) {	Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);	return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);}asn_enc_rval_tNot_PER_Visible_1_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) {	Not_PER_Visible_1_1_inherit_TYPE_descriptor(td);	return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);}/*** <<< STAT-DEFS [Not-PER-Visible-1] >>> ***/static ber_tlv_tag_t asn_DEF_Not_PER_Visible_1_1_tags[] = {	(ASN_TAG_CLASS_UNIVERSAL | (22 << 2))};asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_1 = {	"Not-PER-Visible-1",	"Not-PER-Visible-1",	Not_PER_Visible_1_free,	Not_PER_Visible_1_print,	Not_PER_Visible_1_constraint,	Not_PER_Visible_1_decode_ber,	Not_PER_Visible_1_encode_der,	Not_PER_Visible_1_decode_xer,	Not_PER_Visible_1_encode_xer,	0,	/* Use generic outmost tag fetcher */	asn_DEF_Not_PER_Visible_1_1_tags,	sizeof(asn_DEF_Not_PER_Visible_1_1_tags)		/sizeof(asn_DEF_Not_PER_Visible_1_1_tags[0]), /* 1 */	asn_DEF_Not_PER_Visible_1_1_tags,	/* Same as above */	sizeof(asn_DEF_Not_PER_Visible_1_1_tags)		/sizeof(asn_DEF_Not_PER_Visible_1_1_tags[0]), /* 1 */	0, 0,	/* No members */	0	/* No specifics */};/*** <<< INCLUDES [Not-PER-Visible-2] >>> ***/#include <PER-Visible.h>/*** <<< TYPE-DECLS [Not-PER-Visible-2] >>> ***/typedef PER_Visible_t	 Not_PER_Visible_2_t;/*** <<< FUNC-DECLS [Not-PER-Visible-2] >>> ***/extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2;asn_struct_free_f Not_PER_Visible_2_free;asn_struct_print_f Not_PER_Visible_2_print;asn_constr_check_f Not_PER_Visible_2_constraint;ber_type_decoder_f Not_PER_Visible_2_decode_ber;der_type_encoder_f Not_PER_Visible_2_encode_der;xer_type_decoder_f Not_PER_Visible_2_decode_xer;xer_type_encoder_f Not_PER_Visible_2_encode_xer;/*** <<< CTABLES [Not-PER-Visible-2] >>> ***/static int check_permitted_alphabet_1(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 <= 66)) return -1;	}	return 0;}/*** <<< CODE [Not-PER-Visible-2] >>> ***/intNot_PER_Visible_2_constraint(asn_TYPE_descriptor_t *td, const void *sptr,			asn_app_consume_bytes_f *app_errlog, void *app_key) {	const PER_Visible_t *st = (const PER_Visible_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_1(st)) {		/* Constraint check succeeded */		return 0;	} else {		_ASN_ERRLOG(app_errlog, app_key,			"%s: constraint failed (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}}/* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */static voidNot_PER_Visible_2_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {	td->free_struct    = asn_DEF_PER_Visible.free_struct;	td->print_struct   = asn_DEF_PER_Visible.print_struct;	td->ber_decoder    = asn_DEF_PER_Visible.ber_decoder;	td->der_encoder    = asn_DEF_PER_Visible.der_encoder;	td->xer_decoder    = asn_DEF_PER_Visible.xer_decoder;	td->xer_encoder    = asn_DEF_PER_Visible.xer_encoder;	td->elements       = asn_DEF_PER_Visible.elements;	td->elements_count = asn_DEF_PER_Visible.elements_count;	td->specifics      = asn_DEF_PER_Visible.specifics;}voidNot_PER_Visible_2_free(asn_TYPE_descriptor_t *td,		void *struct_ptr, int contents_only) {	Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);	td->free_struct(td, struct_ptr, contents_only);}intNot_PER_Visible_2_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {	Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);}asn_dec_rval_tNot_PER_Visible_2_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,		void **structure, void *bufptr, size_t size, int tag_mode) {	Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);	return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);}asn_enc_rval_tNot_PER_Visible_2_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) {	Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);}asn_dec_rval_tNot_PER_Visible_2_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) {	Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);	return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);}asn_enc_rval_tNot_PER_Visible_2_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) {	Not_PER_Visible_2_1_inherit_TYPE_descriptor(td);	return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);}/*** <<< STAT-DEFS [Not-PER-Visible-2] >>> ***/static ber_tlv_tag_t asn_DEF_Not_PER_Visible_2_1_tags[] = {	(ASN_TAG_CLASS_UNIVERSAL | (22 << 2))};asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_2 = {	"Not-PER-Visible-2",	"Not-PER-Visible-2",	Not_PER_Visible_2_free,	Not_PER_Visible_2_print,	Not_PER_Visible_2_constraint,	Not_PER_Visible_2_decode_ber,	Not_PER_Visible_2_encode_der,	Not_PER_Visible_2_decode_xer,	Not_PER_Visible_2_encode_xer,	0,	/* Use generic outmost tag fetcher */	asn_DEF_Not_PER_Visible_2_1_tags,	sizeof(asn_DEF_Not_PER_Visible_2_1_tags)		/sizeof(asn_DEF_Not_PER_Visible_2_1_tags[0]), /* 1 */	asn_DEF_Not_PER_Visible_2_1_tags,	/* Same as above */	sizeof(asn_DEF_Not_PER_Visible_2_1_tags)		/sizeof(asn_DEF_Not_PER_Visible_2_1_tags[0]), /* 1 */	0, 0,	/* No members */	0	/* No specifics */};/*** <<< INCLUDES [Not-PER-Visible-3] >>> ***/#include <PER-Visible.h>/*** <<< TYPE-DECLS [Not-PER-Visible-3] >>> ***/typedef PER_Visible_t	 Not_PER_Visible_3_t;/*** <<< FUNC-DECLS [Not-PER-Visible-3] >>> ***/extern asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3;asn_struct_free_f Not_PER_Visible_3_free;asn_struct_print_f Not_PER_Visible_3_print;asn_constr_check_f Not_PER_Visible_3_constraint;ber_type_decoder_f Not_PER_Visible_3_decode_ber;der_type_encoder_f Not_PER_Visible_3_encode_der;xer_type_decoder_f Not_PER_Visible_3_decode_xer;xer_type_encoder_f Not_PER_Visible_3_encode_xer;/*** <<< CTABLES [Not-PER-Visible-3] >>> ***/static int check_permitted_alphabet_1(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 <= 66)) return -1;	}	return 0;}/*** <<< CODE [Not-PER-Visible-3] >>> ***/intNot_PER_Visible_3_constraint(asn_TYPE_descriptor_t *td, const void *sptr,			asn_app_consume_bytes_f *app_errlog, void *app_key) {	const PER_Visible_t *st = (const PER_Visible_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_1(st)) {		/* Constraint check succeeded */		return 0;	} else {		_ASN_ERRLOG(app_errlog, app_key,			"%s: constraint failed (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}}/* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */static voidNot_PER_Visible_3_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {	td->free_struct    = asn_DEF_PER_Visible.free_struct;	td->print_struct   = asn_DEF_PER_Visible.print_struct;	td->ber_decoder    = asn_DEF_PER_Visible.ber_decoder;	td->der_encoder    = asn_DEF_PER_Visible.der_encoder;	td->xer_decoder    = asn_DEF_PER_Visible.xer_decoder;	td->xer_encoder    = asn_DEF_PER_Visible.xer_encoder;	td->elements       = asn_DEF_PER_Visible.elements;	td->elements_count = asn_DEF_PER_Visible.elements_count;	td->specifics      = asn_DEF_PER_Visible.specifics;}voidNot_PER_Visible_3_free(asn_TYPE_descriptor_t *td,		void *struct_ptr, int contents_only) {	Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);	td->free_struct(td, struct_ptr, contents_only);}intNot_PER_Visible_3_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {	Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);}asn_dec_rval_tNot_PER_Visible_3_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,		void **structure, void *bufptr, size_t size, int tag_mode) {	Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);	return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);}asn_enc_rval_tNot_PER_Visible_3_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) {	Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);}asn_dec_rval_tNot_PER_Visible_3_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) {	Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);	return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);}asn_enc_rval_tNot_PER_Visible_3_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) {	Not_PER_Visible_3_1_inherit_TYPE_descriptor(td);	return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);}/*** <<< STAT-DEFS [Not-PER-Visible-3] >>> ***/static ber_tlv_tag_t asn_DEF_Not_PER_Visible_3_1_tags[] = {	(ASN_TAG_CLASS_UNIVERSAL | (22 << 2))};asn_TYPE_descriptor_t asn_DEF_Not_PER_Visible_3 = {	"Not-PER-Visible-3",	"Not-PER-Visible-3",	Not_PER_Visible_3_free,	Not_PER_Visible_3_print,	Not_PER_Visible_3_constraint,	Not_PER_Visible_3_decode_ber,	Not_PER_Visible_3_encode_der,	Not_PER_Visible_3_decode_xer,	Not_PER_Visible_3_encode_xer,	0,	/* Use generic outmost tag fetcher */	asn_DEF_Not_PER_Visible_3_1_tags,	sizeof(asn_DEF_Not_PER_Visible_3_1_tags)		/sizeof(asn_DEF_Not_PER_Visible_3_1_tags[0]), /* 1 */	asn_DEF_Not_PER_Visible_3_1_tags,	/* Same as above */	sizeof(asn_DEF_Not_PER_Visible_3_1_tags)		/sizeof(asn_DEF_Not_PER_Visible_3_1_tags[0]), /* 1 */	0, 0,	/* No members */	0	/* No specifics */};/*** <<< INCLUDES [SIZE-but-not-FROM] >>> ***/#include <PER-Visible.h>/*** <<< TYPE-DECLS [SIZE-but-not-FROM] >>> ***/typedef PER_Visible_t	 SIZE_but_not_FROM_t;/*** <<< FUNC-DECLS [SIZE-but-not-FROM] >>> ***/extern asn_TYPE_descriptor_t asn_DEF_SIZE_but_not_FROM;asn_struct_free_f SIZE_but_not_FROM_free;asn_struct_print_f SIZE_but_not_FROM_print;asn_constr_check_f SIZE_but_not_FROM_constraint;ber_type_decoder_f SIZE_but_not_FROM_decode_ber;der_type_encoder_f SIZE_but_not_FROM_encode_der;xer_type_decoder_f SIZE_but_not_FROM_decode_xer;xer_type_encoder_f SIZE_but_not_FROM_encode_xer;/*** <<< CTABLES [SIZE-but-not-FROM] >>> ***/static int check_permitted_alphabet_1(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 <= 68)) return -1;	}	return 0;}/*** <<< CODE [SIZE-but-not-FROM] >>> ***/intSIZE_but_not_FROM_constraint(asn_TYPE_descriptor_t *td, const void *sptr,			asn_app_consume_bytes_f *app_errlog, void *app_key) {	const PER_Visible_t *st = (const PER_Visible_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 >= 1 && size <= 4)		 && !check_permitted_alphabet_1(st)) {		/* Constraint check succeeded */		return 0;	} else {		_ASN_ERRLOG(app_errlog, app_key,			"%s: constraint failed (%s:%d)",			td->name, __FILE__, __LINE__);		return -1;	}}/* * This type is implemented using PER_Visible, * so here we adjust the DEF accordingly. */static voidSIZE_but_not_FROM_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {	td->free_struct    = asn_DEF_PER_Visible.free_struct;	td->print_struct   = asn_DEF_PER_Visible.print_struct;	td->ber_decoder    = asn_DEF_PER_Visible.ber_decoder;	td->der_encoder    = asn_DEF_PER_Visible.der_encoder;	td->xer_decoder    = asn_DEF_PER_Visible.xer_decoder;	td->xer_encoder    = asn_DEF_PER_Visible.xer_encoder;	td->elements       = asn_DEF_PER_Visible.elements;	td->elements_count = asn_DEF_PER_Visible.elements_count;	td->specifics      = asn_DEF_PER_Visible.specifics;}voidSIZE_but_not_FROM_free(asn_TYPE_descriptor_t *td,		void *struct_ptr, int contents_only) {	SIZE_but_not_FROM_1_inherit_TYPE_descriptor(td);	td->free_struct(td, struct_ptr, contents_only);}intSIZE_but_not_FROM_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,		int ilevel, asn_app_consume_bytes_f *cb, vo

⌨️ 快捷键说明

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