Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.29 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "X2AP-IEs" |
| 4 | * found in "Spec/e2ap-v031ex.asn" |
| 5 | * `asn1c -fcompound-names -fno-include-deps -findirect-choice -gen-PER` |
| 6 | */ |
| 7 | |
| 8 | #include "E-RABUsageReport-Item.h" |
| 9 | |
| 10 | #include "ProtocolExtensionContainer.h" |
| 11 | static int |
| 12 | memb_startTimeStamp_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 13 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 14 | const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; |
| 15 | size_t size; |
| 16 | |
| 17 | if(!sptr) { |
| 18 | ASN__CTFAIL(app_key, td, sptr, |
| 19 | "%s: value not given (%s:%d)", |
| 20 | td->name, __FILE__, __LINE__); |
| 21 | return -1; |
| 22 | } |
| 23 | |
| 24 | size = st->size; |
| 25 | |
| 26 | if((size == 4)) { |
| 27 | /* Constraint check succeeded */ |
| 28 | return 0; |
| 29 | } else { |
| 30 | ASN__CTFAIL(app_key, td, sptr, |
| 31 | "%s: constraint failed (%s:%d)", |
| 32 | td->name, __FILE__, __LINE__); |
| 33 | return -1; |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | static int |
| 38 | memb_endTimeStamp_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 39 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 40 | const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; |
| 41 | size_t size; |
| 42 | |
| 43 | if(!sptr) { |
| 44 | ASN__CTFAIL(app_key, td, sptr, |
| 45 | "%s: value not given (%s:%d)", |
| 46 | td->name, __FILE__, __LINE__); |
| 47 | return -1; |
| 48 | } |
| 49 | |
| 50 | size = st->size; |
| 51 | |
| 52 | if((size == 4)) { |
| 53 | /* Constraint check succeeded */ |
| 54 | return 0; |
| 55 | } else { |
| 56 | ASN__CTFAIL(app_key, td, sptr, |
| 57 | "%s: constraint failed (%s:%d)", |
| 58 | td->name, __FILE__, __LINE__); |
| 59 | return -1; |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | static int |
| 64 | memb_usageCountUL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 65 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 66 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 67 | long value; |
| 68 | |
| 69 | if(!sptr) { |
| 70 | ASN__CTFAIL(app_key, td, sptr, |
| 71 | "%s: value not given (%s:%d)", |
| 72 | td->name, __FILE__, __LINE__); |
| 73 | return -1; |
| 74 | } |
| 75 | |
| 76 | if(asn_INTEGER2long(st, &value)) { |
| 77 | ASN__CTFAIL(app_key, td, sptr, |
| 78 | "%s: value too large (%s:%d)", |
| 79 | td->name, __FILE__, __LINE__); |
| 80 | return -1; |
| 81 | } |
| 82 | |
| 83 | if((value >= 0 && value <= 18446744073709551615)) { |
| 84 | /* Constraint check succeeded */ |
| 85 | return 0; |
| 86 | } else { |
| 87 | ASN__CTFAIL(app_key, td, sptr, |
| 88 | "%s: constraint failed (%s:%d)", |
| 89 | td->name, __FILE__, __LINE__); |
| 90 | return -1; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | static int |
| 95 | memb_usageCountDL_constraint_1(const asn_TYPE_descriptor_t *td, const void *sptr, |
| 96 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 97 | const INTEGER_t *st = (const INTEGER_t *)sptr; |
| 98 | long value; |
| 99 | |
| 100 | if(!sptr) { |
| 101 | ASN__CTFAIL(app_key, td, sptr, |
| 102 | "%s: value not given (%s:%d)", |
| 103 | td->name, __FILE__, __LINE__); |
| 104 | return -1; |
| 105 | } |
| 106 | |
| 107 | if(asn_INTEGER2long(st, &value)) { |
| 108 | ASN__CTFAIL(app_key, td, sptr, |
| 109 | "%s: value too large (%s:%d)", |
| 110 | td->name, __FILE__, __LINE__); |
| 111 | return -1; |
| 112 | } |
| 113 | |
| 114 | if((value >= 0 && value <= 18446744073709551615)) { |
| 115 | /* Constraint check succeeded */ |
| 116 | return 0; |
| 117 | } else { |
| 118 | ASN__CTFAIL(app_key, td, sptr, |
| 119 | "%s: constraint failed (%s:%d)", |
| 120 | td->name, __FILE__, __LINE__); |
| 121 | return -1; |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | static asn_oer_constraints_t asn_OER_memb_startTimeStamp_constr_2 CC_NOTUSED = { |
| 126 | { 0, 0 }, |
| 127 | 4 /* (SIZE(4..4)) */}; |
| 128 | static asn_per_constraints_t asn_PER_memb_startTimeStamp_constr_2 CC_NOTUSED = { |
| 129 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 130 | { APC_CONSTRAINED, 0, 0, 4, 4 } /* (SIZE(4..4)) */, |
| 131 | 0, 0 /* No PER value map */ |
| 132 | }; |
| 133 | static asn_oer_constraints_t asn_OER_memb_endTimeStamp_constr_3 CC_NOTUSED = { |
| 134 | { 0, 0 }, |
| 135 | 4 /* (SIZE(4..4)) */}; |
| 136 | static asn_per_constraints_t asn_PER_memb_endTimeStamp_constr_3 CC_NOTUSED = { |
| 137 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 138 | { APC_CONSTRAINED, 0, 0, 4, 4 } /* (SIZE(4..4)) */, |
| 139 | 0, 0 /* No PER value map */ |
| 140 | }; |
| 141 | static asn_oer_constraints_t asn_OER_memb_usageCountUL_constr_4 CC_NOTUSED = { |
| 142 | { 8, 1 } /* (0..18446744073709551615) */, |
| 143 | -1}; |
| 144 | static asn_per_constraints_t asn_PER_memb_usageCountUL_constr_4 CC_NOTUSED = { |
| 145 | { APC_CONSTRAINED, 64, -1, 0, 18446744073709551615 } /* (0..18446744073709551615) */, |
| 146 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 147 | 0, 0 /* No PER value map */ |
| 148 | }; |
| 149 | static asn_oer_constraints_t asn_OER_memb_usageCountDL_constr_5 CC_NOTUSED = { |
| 150 | { 8, 1 } /* (0..18446744073709551615) */, |
| 151 | -1}; |
| 152 | static asn_per_constraints_t asn_PER_memb_usageCountDL_constr_5 CC_NOTUSED = { |
| 153 | { APC_CONSTRAINED, 64, -1, 0, 18446744073709551615 } /* (0..18446744073709551615) */, |
| 154 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 155 | 0, 0 /* No PER value map */ |
| 156 | }; |
| 157 | static asn_TYPE_member_t asn_MBR_E_RABUsageReport_Item_1[] = { |
| 158 | { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, startTimeStamp), |
| 159 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 160 | -1, /* IMPLICIT tag at current level */ |
| 161 | &asn_DEF_OCTET_STRING, |
| 162 | 0, |
| 163 | { &asn_OER_memb_startTimeStamp_constr_2, &asn_PER_memb_startTimeStamp_constr_2, memb_startTimeStamp_constraint_1 }, |
| 164 | 0, 0, /* No default value */ |
| 165 | "startTimeStamp" |
| 166 | }, |
| 167 | { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, endTimeStamp), |
| 168 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 169 | -1, /* IMPLICIT tag at current level */ |
| 170 | &asn_DEF_OCTET_STRING, |
| 171 | 0, |
| 172 | { &asn_OER_memb_endTimeStamp_constr_3, &asn_PER_memb_endTimeStamp_constr_3, memb_endTimeStamp_constraint_1 }, |
| 173 | 0, 0, /* No default value */ |
| 174 | "endTimeStamp" |
| 175 | }, |
| 176 | { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, usageCountUL), |
| 177 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 178 | -1, /* IMPLICIT tag at current level */ |
| 179 | &asn_DEF_INTEGER, |
| 180 | 0, |
| 181 | { &asn_OER_memb_usageCountUL_constr_4, &asn_PER_memb_usageCountUL_constr_4, memb_usageCountUL_constraint_1 }, |
| 182 | 0, 0, /* No default value */ |
| 183 | "usageCountUL" |
| 184 | }, |
| 185 | { ATF_NOFLAGS, 0, offsetof(struct E_RABUsageReport_Item, usageCountDL), |
| 186 | (ASN_TAG_CLASS_CONTEXT | (3 << 2)), |
| 187 | -1, /* IMPLICIT tag at current level */ |
| 188 | &asn_DEF_INTEGER, |
| 189 | 0, |
| 190 | { &asn_OER_memb_usageCountDL_constr_5, &asn_PER_memb_usageCountDL_constr_5, memb_usageCountDL_constraint_1 }, |
| 191 | 0, 0, /* No default value */ |
| 192 | "usageCountDL" |
| 193 | }, |
| 194 | { ATF_POINTER, 1, offsetof(struct E_RABUsageReport_Item, iE_Extensions), |
| 195 | (ASN_TAG_CLASS_CONTEXT | (4 << 2)), |
| 196 | -1, /* IMPLICIT tag at current level */ |
| 197 | &asn_DEF_ProtocolExtensionContainer_9566P141, |
| 198 | 0, |
| 199 | { 0, 0, 0 }, |
| 200 | 0, 0, /* No default value */ |
| 201 | "iE-Extensions" |
| 202 | }, |
| 203 | }; |
| 204 | static const int asn_MAP_E_RABUsageReport_Item_oms_1[] = { 4 }; |
| 205 | static const ber_tlv_tag_t asn_DEF_E_RABUsageReport_Item_tags_1[] = { |
| 206 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 207 | }; |
| 208 | static const asn_TYPE_tag2member_t asn_MAP_E_RABUsageReport_Item_tag2el_1[] = { |
| 209 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* startTimeStamp */ |
| 210 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* endTimeStamp */ |
| 211 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* usageCountUL */ |
| 212 | { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* usageCountDL */ |
| 213 | { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 } /* iE-Extensions */ |
| 214 | }; |
| 215 | static asn_SEQUENCE_specifics_t asn_SPC_E_RABUsageReport_Item_specs_1 = { |
| 216 | sizeof(struct E_RABUsageReport_Item), |
| 217 | offsetof(struct E_RABUsageReport_Item, _asn_ctx), |
| 218 | asn_MAP_E_RABUsageReport_Item_tag2el_1, |
| 219 | 5, /* Count of tags in the map */ |
| 220 | asn_MAP_E_RABUsageReport_Item_oms_1, /* Optional members */ |
| 221 | 1, 0, /* Root/Additions */ |
| 222 | 5, /* First extension addition */ |
| 223 | }; |
| 224 | asn_TYPE_descriptor_t asn_DEF_E_RABUsageReport_Item = { |
| 225 | "E-RABUsageReport-Item", |
| 226 | "E-RABUsageReport-Item", |
| 227 | &asn_OP_SEQUENCE, |
| 228 | asn_DEF_E_RABUsageReport_Item_tags_1, |
| 229 | sizeof(asn_DEF_E_RABUsageReport_Item_tags_1) |
| 230 | /sizeof(asn_DEF_E_RABUsageReport_Item_tags_1[0]), /* 1 */ |
| 231 | asn_DEF_E_RABUsageReport_Item_tags_1, /* Same as above */ |
| 232 | sizeof(asn_DEF_E_RABUsageReport_Item_tags_1) |
| 233 | /sizeof(asn_DEF_E_RABUsageReport_Item_tags_1[0]), /* 1 */ |
| 234 | { 0, 0, SEQUENCE_constraint }, |
| 235 | asn_MBR_E_RABUsageReport_Item_1, |
| 236 | 5, /* Elements count */ |
| 237 | &asn_SPC_E_RABUsageReport_Item_specs_1 /* Additional specs */ |
| 238 | }; |
| 239 | |