blob: 0d58c65a513a64e9728a7ea3bf12a33bc9907495 [file] [log] [blame]
Harald Welted523a692015-08-30 23:11:19 +02001/*
2 * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
3 * From ASN.1 module "HNBAP-IEs"
4 * found in "../../asn1/hnbap/HNBAP-IEs.asn"
Harald Welteff4750f2015-08-31 09:55:28 +02005 * `asn1c -gen-PER`
Harald Welted523a692015-08-30 23:11:19 +02006 */
7
Neels Hofmeyrf1f2d7c2016-01-05 12:00:06 +01008#include <osmocom/hnbap/HNBCapacity.h>
Harald Welted523a692015-08-30 23:11:19 +02009
10int
11HNBCapacity_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
12 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
13 long value;
14
15 if(!sptr) {
16 _ASN_CTFAIL(app_key, td, sptr,
17 "%s: value not given (%s:%d)",
18 td->name, __FILE__, __LINE__);
19 return -1;
20 }
21
22 value = *(const long *)sptr;
23
24 if((value >= 0l && value <= 1000l)) {
25 /* Constraint check succeeded */
26 return 0;
27 } else {
28 _ASN_CTFAIL(app_key, td, sptr,
29 "%s: constraint failed (%s:%d)",
30 td->name, __FILE__, __LINE__);
31 return -1;
32 }
33}
34
35/*
36 * This type is implemented using NativeInteger,
37 * so here we adjust the DEF accordingly.
38 */
39static void
40HNBCapacity_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
41 td->free_struct = asn_DEF_NativeInteger.free_struct;
42 td->print_struct = asn_DEF_NativeInteger.print_struct;
43 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
44 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
45 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
46 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
47 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
48 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
49 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
50 td->aper_decoder = asn_DEF_NativeInteger.aper_decoder;
51 td->aper_encoder = asn_DEF_NativeInteger.aper_encoder;
52 if(!td->per_constraints)
53 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
54 td->elements = asn_DEF_NativeInteger.elements;
55 td->elements_count = asn_DEF_NativeInteger.elements_count;
56 td->specifics = asn_DEF_NativeInteger.specifics;
57}
58
59void
60HNBCapacity_free(asn_TYPE_descriptor_t *td,
61 void *struct_ptr, int contents_only) {
62 HNBCapacity_1_inherit_TYPE_descriptor(td);
63 td->free_struct(td, struct_ptr, contents_only);
64}
65
66int
67HNBCapacity_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
68 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
69 HNBCapacity_1_inherit_TYPE_descriptor(td);
70 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
71}
72
73asn_dec_rval_t
74HNBCapacity_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
75 void **structure, const void *bufptr, size_t size, int tag_mode) {
76 HNBCapacity_1_inherit_TYPE_descriptor(td);
77 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
78}
79
80asn_enc_rval_t
81HNBCapacity_encode_der(asn_TYPE_descriptor_t *td,
82 void *structure, int tag_mode, ber_tlv_tag_t tag,
83 asn_app_consume_bytes_f *cb, void *app_key) {
84 HNBCapacity_1_inherit_TYPE_descriptor(td);
85 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
86}
87
88asn_dec_rval_t
89HNBCapacity_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
90 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
91 HNBCapacity_1_inherit_TYPE_descriptor(td);
92 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
93}
94
95asn_enc_rval_t
96HNBCapacity_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
97 int ilevel, enum xer_encoder_flags_e flags,
98 asn_app_consume_bytes_f *cb, void *app_key) {
99 HNBCapacity_1_inherit_TYPE_descriptor(td);
100 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
101}
102
103asn_dec_rval_t
104HNBCapacity_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
105 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
106 HNBCapacity_1_inherit_TYPE_descriptor(td);
107 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
108}
109
110asn_enc_rval_t
111HNBCapacity_encode_uper(asn_TYPE_descriptor_t *td,
112 asn_per_constraints_t *constraints,
113 void *structure, asn_per_outp_t *per_out) {
114 HNBCapacity_1_inherit_TYPE_descriptor(td);
115 return td->uper_encoder(td, constraints, structure, per_out);
116}
117
118asn_enc_rval_t
119HNBCapacity_encode_aper(asn_TYPE_descriptor_t *td,
120 asn_per_constraints_t *constraints,
121 void *structure, asn_per_outp_t *per_out) {
122 HNBCapacity_1_inherit_TYPE_descriptor(td);
123 return td->aper_encoder(td, constraints, structure, per_out);
124}
125
126asn_dec_rval_t
127HNBCapacity_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
128 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
129 HNBCapacity_1_inherit_TYPE_descriptor(td);
130 return td->aper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
131}
132
133static asn_per_constraints_t asn_PER_type_HNBCapacity_constr_1 GCC_NOTUSED = {
134 { APC_CONSTRAINED, 10, 10, 0l, 1000l } /* (0..1000) */,
135 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
136 0, 0 /* No PER value map */
137};
138static const ber_tlv_tag_t asn_DEF_HNBCapacity_tags_1[] = {
139 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
140};
141asn_TYPE_descriptor_t asn_DEF_HNBCapacity = {
142 "HNBCapacity",
143 "HNBCapacity",
144 HNBCapacity_free,
145 HNBCapacity_print,
146 HNBCapacity_constraint,
147 HNBCapacity_decode_ber,
148 HNBCapacity_encode_der,
149 HNBCapacity_decode_xer,
150 HNBCapacity_encode_xer,
151 HNBCapacity_decode_uper,
152 HNBCapacity_encode_uper,
153 HNBCapacity_decode_aper,
154 HNBCapacity_encode_aper,
155 0, /* Use generic outmost tag fetcher */
156 asn_DEF_HNBCapacity_tags_1,
157 sizeof(asn_DEF_HNBCapacity_tags_1)
158 /sizeof(asn_DEF_HNBCapacity_tags_1[0]), /* 1 */
159 asn_DEF_HNBCapacity_tags_1, /* Same as above */
160 sizeof(asn_DEF_HNBCapacity_tags_1)
161 /sizeof(asn_DEF_HNBCapacity_tags_1[0]), /* 1 */
162 &asn_PER_type_HNBCapacity_constr_1,
163 0, 0, /* No members */
164 0 /* No specifics */
165};
166