blob: ae010abecce1d34743cec7b25abc568f9106959c [file] [log] [blame]
Harald Welteee091892015-09-10 10:22:03 +02001/*
2 * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
3 * From ASN.1 module "RANAP-IEs"
4 * found in "../../asn1/ranap/RANAP-IEs.asn"
5 */
6
Neels Hofmeyrf1f2d7c2016-01-05 12:00:06 +01007#include <osmocom/ranap/RANAP_ResidualBitErrorRatio.h>
Harald Welteee091892015-09-10 10:22:03 +02008
9static int
10memb_mantissa_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
11 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
12 long value;
13
14 if(!sptr) {
15 _ASN_CTFAIL(app_key, td, sptr,
16 "%s: value not given (%s:%d)",
17 td->name, __FILE__, __LINE__);
18 return -1;
19 }
20
21 value = *(const long *)sptr;
22
23 if((value >= 1l && value <= 9l)) {
24 /* Constraint check succeeded */
25 return 0;
26 } else {
27 _ASN_CTFAIL(app_key, td, sptr,
28 "%s: constraint failed (%s:%d)",
29 td->name, __FILE__, __LINE__);
30 return -1;
31 }
32}
33
34static int
35memb_exponent_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr,
36 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
37 long value;
38
39 if(!sptr) {
40 _ASN_CTFAIL(app_key, td, sptr,
41 "%s: value not given (%s:%d)",
42 td->name, __FILE__, __LINE__);
43 return -1;
44 }
45
46 value = *(const long *)sptr;
47
48 if((value >= 1l && value <= 8l)) {
49 /* Constraint check succeeded */
50 return 0;
51 } else {
52 _ASN_CTFAIL(app_key, td, sptr,
53 "%s: constraint failed (%s:%d)",
54 td->name, __FILE__, __LINE__);
55 return -1;
56 }
57}
58
59static asn_per_constraints_t asn_PER_memb_mantissa_constr_2 GCC_NOTUSED = {
60 { APC_CONSTRAINED, 4, 4, 1l, 9l } /* (1..9) */,
61 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
62 0, 0 /* No PER value map */
63};
64static asn_per_constraints_t asn_PER_memb_exponent_constr_3 GCC_NOTUSED = {
65 { APC_CONSTRAINED, 3, 3, 1l, 8l } /* (1..8) */,
66 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
67 0, 0 /* No PER value map */
68};
69static asn_TYPE_member_t asn_MBR_RANAP_ResidualBitErrorRatio_1[] = {
70 { ATF_NOFLAGS, 0, offsetof(struct RANAP_ResidualBitErrorRatio, mantissa),
71 (ASN_TAG_CLASS_CONTEXT | (0 << 2)),
72 -1, /* IMPLICIT tag at current level */
73 &asn_DEF_NativeInteger,
74 memb_mantissa_constraint_1,
75 &asn_PER_memb_mantissa_constr_2,
76 0,
77 "mantissa"
78 },
79 { ATF_NOFLAGS, 0, offsetof(struct RANAP_ResidualBitErrorRatio, exponent),
80 (ASN_TAG_CLASS_CONTEXT | (1 << 2)),
81 -1, /* IMPLICIT tag at current level */
82 &asn_DEF_NativeInteger,
83 memb_exponent_constraint_1,
84 &asn_PER_memb_exponent_constr_3,
85 0,
86 "exponent"
87 },
88 { ATF_POINTER, 1, offsetof(struct RANAP_ResidualBitErrorRatio, iE_Extensions),
89 (ASN_TAG_CLASS_CONTEXT | (2 << 2)),
90 -1, /* IMPLICIT tag at current level */
91 &asn_DEF_RANAP_IE_Extensions,
92 0, /* Defer constraints checking to the member type */
93 0, /* No PER visible constraints */
94 0,
95 "iE-Extensions"
96 },
97};
98static const int asn_MAP_RANAP_ResidualBitErrorRatio_oms_1[] = { 2 };
99static const ber_tlv_tag_t asn_DEF_RANAP_ResidualBitErrorRatio_tags_1[] = {
100 (ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
101};
102static const asn_TYPE_tag2member_t asn_MAP_RANAP_ResidualBitErrorRatio_tag2el_1[] = {
103 { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* mantissa */
104 { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* exponent */
105 { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* iE-Extensions */
106};
107static asn_SEQUENCE_specifics_t asn_SPC_RANAP_ResidualBitErrorRatio_specs_1 = {
108 sizeof(struct RANAP_ResidualBitErrorRatio),
109 offsetof(struct RANAP_ResidualBitErrorRatio, _asn_ctx),
110 asn_MAP_RANAP_ResidualBitErrorRatio_tag2el_1,
111 3, /* Count of tags in the map */
112 asn_MAP_RANAP_ResidualBitErrorRatio_oms_1, /* Optional members */
113 1, 0, /* Root/Additions */
114 -1, /* Start extensions */
115 -1 /* Stop extensions */
116};
117asn_TYPE_descriptor_t asn_DEF_RANAP_ResidualBitErrorRatio = {
118 "RANAP_ResidualBitErrorRatio",
119 "RANAP_ResidualBitErrorRatio",
120 SEQUENCE_free,
121 SEQUENCE_print,
122 SEQUENCE_constraint,
123 SEQUENCE_decode_ber,
124 SEQUENCE_encode_der,
125 SEQUENCE_decode_xer,
126 SEQUENCE_encode_xer,
127 SEQUENCE_decode_uper,
128 SEQUENCE_encode_uper,
129 SEQUENCE_decode_aper,
130 SEQUENCE_encode_aper,
131 0, /* Use generic outmost tag fetcher */
132 asn_DEF_RANAP_ResidualBitErrorRatio_tags_1,
133 sizeof(asn_DEF_RANAP_ResidualBitErrorRatio_tags_1)
134 /sizeof(asn_DEF_RANAP_ResidualBitErrorRatio_tags_1[0]), /* 1 */
135 asn_DEF_RANAP_ResidualBitErrorRatio_tags_1, /* Same as above */
136 sizeof(asn_DEF_RANAP_ResidualBitErrorRatio_tags_1)
137 /sizeof(asn_DEF_RANAP_ResidualBitErrorRatio_tags_1[0]), /* 1 */
138 0, /* No PER visible constraints */
139 asn_MBR_RANAP_ResidualBitErrorRatio_1,
140 3, /* Elements count */
141 &asn_SPC_RANAP_ResidualBitErrorRatio_specs_1 /* Additional specs */
142};
143