1 /*
2  * Generated by asn1c-0.9.21 (http://lionet.info/asn1c)
3  * From ASN.1 module "FEF-IntermediateDraft"
4  * 	found in "../annexb-snacc-122001.asn1"
5  */
6 
7 #include <asn_internal.h>
8 
9 #include "HealthCareProviderId.h"
10 
11 int
HealthCareProviderId_constraint(asn_TYPE_descriptor_t * td,const void * sptr,asn_app_constraint_failed_f * ctfailcb,void * app_key)12 HealthCareProviderId_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
13 			asn_app_constraint_failed_f *ctfailcb, void *app_key) {
14 	long value;
15 
16 	if(!sptr) {
17 		_ASN_CTFAIL(app_key, td, sptr,
18 			"%s: value not given (%s:%d)",
19 			td->name, __FILE__, __LINE__);
20 		return -1;
21 	}
22 
23 	value = *(const long *)sptr;
24 
25 	if((value >= 0 && value <= 65535)) {
26 		/* Constraint check succeeded */
27 		return 0;
28 	} else {
29 		_ASN_CTFAIL(app_key, td, sptr,
30 			"%s: constraint failed (%s:%d)",
31 			td->name, __FILE__, __LINE__);
32 		return -1;
33 	}
34 }
35 
36 /*
37  * This type is implemented using INT_U16,
38  * so here we adjust the DEF accordingly.
39  */
40 static void
HealthCareProviderId_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t * td)41 HealthCareProviderId_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
42 	td->free_struct    = asn_DEF_INT_U16.free_struct;
43 	td->print_struct   = asn_DEF_INT_U16.print_struct;
44 	td->ber_decoder    = asn_DEF_INT_U16.ber_decoder;
45 	td->der_encoder    = asn_DEF_INT_U16.der_encoder;
46 	td->xer_decoder    = asn_DEF_INT_U16.xer_decoder;
47 	td->xer_encoder    = asn_DEF_INT_U16.xer_encoder;
48 	td->uper_decoder   = asn_DEF_INT_U16.uper_decoder;
49 	td->uper_encoder   = asn_DEF_INT_U16.uper_encoder;
50 	if(!td->per_constraints)
51 		td->per_constraints = asn_DEF_INT_U16.per_constraints;
52 	td->elements       = asn_DEF_INT_U16.elements;
53 	td->elements_count = asn_DEF_INT_U16.elements_count;
54 	td->specifics      = asn_DEF_INT_U16.specifics;
55 }
56 
57 void
HealthCareProviderId_free(asn_TYPE_descriptor_t * td,void * struct_ptr,int contents_only)58 HealthCareProviderId_free(asn_TYPE_descriptor_t *td,
59 		void *struct_ptr, int contents_only) {
60 	HealthCareProviderId_1_inherit_TYPE_descriptor(td);
61 	td->free_struct(td, struct_ptr, contents_only);
62 }
63 
64 int
HealthCareProviderId_print(asn_TYPE_descriptor_t * td,const void * struct_ptr,int ilevel,asn_app_consume_bytes_f * cb,void * app_key)65 HealthCareProviderId_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
66 		int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
67 	HealthCareProviderId_1_inherit_TYPE_descriptor(td);
68 	return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
69 }
70 
71 asn_dec_rval_t
HealthCareProviderId_decode_ber(asn_codec_ctx_t * opt_codec_ctx,asn_TYPE_descriptor_t * td,void ** structure,const void * bufptr,size_t size,int tag_mode)72 HealthCareProviderId_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
73 		void **structure, const void *bufptr, size_t size, int tag_mode) {
74 	HealthCareProviderId_1_inherit_TYPE_descriptor(td);
75 	return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
76 }
77 
78 asn_enc_rval_t
HealthCareProviderId_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)79 HealthCareProviderId_encode_der(asn_TYPE_descriptor_t *td,
80 		void *structure, int tag_mode, ber_tlv_tag_t tag,
81 		asn_app_consume_bytes_f *cb, void *app_key) {
82 	HealthCareProviderId_1_inherit_TYPE_descriptor(td);
83 	return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
84 }
85 
86 asn_dec_rval_t
HealthCareProviderId_decode_xer(asn_codec_ctx_t * opt_codec_ctx,asn_TYPE_descriptor_t * td,void ** structure,const char * opt_mname,const void * bufptr,size_t size)87 HealthCareProviderId_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
88 		void **structure, const char *opt_mname, const void *bufptr, size_t size) {
89 	HealthCareProviderId_1_inherit_TYPE_descriptor(td);
90 	return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
91 }
92 
93 asn_enc_rval_t
HealthCareProviderId_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)94 HealthCareProviderId_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
95 		int ilevel, enum xer_encoder_flags_e flags,
96 		asn_app_consume_bytes_f *cb, void *app_key) {
97 	HealthCareProviderId_1_inherit_TYPE_descriptor(td);
98 	return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
99 }
100 
101 static ber_tlv_tag_t asn_DEF_HealthCareProviderId_tags_1[] = {
102 	(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
103 };
104 asn_TYPE_descriptor_t asn_DEF_HealthCareProviderId = {
105 	"HealthCareProviderId",
106 	"HealthCareProviderId",
107 	HealthCareProviderId_free,
108 	HealthCareProviderId_print,
109 	HealthCareProviderId_constraint,
110 	HealthCareProviderId_decode_ber,
111 	HealthCareProviderId_encode_der,
112 	HealthCareProviderId_decode_xer,
113 	HealthCareProviderId_encode_xer,
114 	0, 0,	/* No PER support, use "-gen-PER" to enable */
115 	0,	/* Use generic outmost tag fetcher */
116 	asn_DEF_HealthCareProviderId_tags_1,
117 	sizeof(asn_DEF_HealthCareProviderId_tags_1)
118 		/sizeof(asn_DEF_HealthCareProviderId_tags_1[0]), /* 1 */
119 	asn_DEF_HealthCareProviderId_tags_1,	/* Same as above */
120 	sizeof(asn_DEF_HealthCareProviderId_tags_1)
121 		/sizeof(asn_DEF_HealthCareProviderId_tags_1[0]), /* 1 */
122 	0,	/* No PER visible constraints */
123 	0, 0,	/* No members */
124 	0	/* No specifics */
125 };
126 
127