Harald Welte | e844bf7 | 2019-05-06 15:25:10 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "SABP-IEs" |
| 4 | * found in "../../asn1/sabp/SABP-IEs.asn" |
| 5 | */ |
| 6 | |
| 7 | #include <osmocom/sabp/SABP_Service-Area-Identifier.h> |
| 8 | |
| 9 | static int |
| 10 | memb_pLMNidentity_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 11 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 12 | const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; |
| 13 | size_t size; |
| 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 | size = st->size; |
| 23 | |
| 24 | if((size == 3l)) { |
| 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 | static int |
| 36 | memb_lac_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 37 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 38 | const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; |
| 39 | size_t size; |
| 40 | |
| 41 | if(!sptr) { |
| 42 | _ASN_CTFAIL(app_key, td, sptr, |
| 43 | "%s: value not given (%s:%d)", |
| 44 | td->name, __FILE__, __LINE__); |
| 45 | return -1; |
| 46 | } |
| 47 | |
| 48 | size = st->size; |
| 49 | |
| 50 | if((size == 2l)) { |
| 51 | /* Constraint check succeeded */ |
| 52 | return 0; |
| 53 | } else { |
| 54 | _ASN_CTFAIL(app_key, td, sptr, |
| 55 | "%s: constraint failed (%s:%d)", |
| 56 | td->name, __FILE__, __LINE__); |
| 57 | return -1; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | static int |
| 62 | memb_sac_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 63 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 64 | const OCTET_STRING_t *st = (const OCTET_STRING_t *)sptr; |
| 65 | size_t size; |
| 66 | |
| 67 | if(!sptr) { |
| 68 | _ASN_CTFAIL(app_key, td, sptr, |
| 69 | "%s: value not given (%s:%d)", |
| 70 | td->name, __FILE__, __LINE__); |
| 71 | return -1; |
| 72 | } |
| 73 | |
| 74 | size = st->size; |
| 75 | |
| 76 | if((size == 2l)) { |
| 77 | /* Constraint check succeeded */ |
| 78 | return 0; |
| 79 | } else { |
| 80 | _ASN_CTFAIL(app_key, td, sptr, |
| 81 | "%s: constraint failed (%s:%d)", |
| 82 | td->name, __FILE__, __LINE__); |
| 83 | return -1; |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | static asn_per_constraints_t asn_PER_memb_pLMNidentity_constr_2 GCC_NOTUSED = { |
| 88 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 89 | { APC_CONSTRAINED, 0, 0, 3l, 3l } /* (SIZE(3..3)) */, |
| 90 | 0, 0 /* No PER value map */ |
| 91 | }; |
| 92 | static asn_per_constraints_t asn_PER_memb_lac_constr_3 GCC_NOTUSED = { |
| 93 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 94 | { APC_CONSTRAINED, 0, 0, 2l, 2l } /* (SIZE(2..2)) */, |
| 95 | 0, 0 /* No PER value map */ |
| 96 | }; |
| 97 | static asn_per_constraints_t asn_PER_memb_sac_constr_4 GCC_NOTUSED = { |
| 98 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 99 | { APC_CONSTRAINED, 0, 0, 2l, 2l } /* (SIZE(2..2)) */, |
| 100 | 0, 0 /* No PER value map */ |
| 101 | }; |
| 102 | static asn_TYPE_member_t asn_MBR_SABP_Service_Area_Identifier_1[] = { |
| 103 | { ATF_NOFLAGS, 0, offsetof(struct SABP_Service_Area_Identifier, pLMNidentity), |
| 104 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 105 | -1, /* IMPLICIT tag at current level */ |
| 106 | &asn_DEF_OCTET_STRING, |
| 107 | memb_pLMNidentity_constraint_1, |
| 108 | &asn_PER_memb_pLMNidentity_constr_2, |
| 109 | 0, |
| 110 | "pLMNidentity" |
| 111 | }, |
| 112 | { ATF_NOFLAGS, 0, offsetof(struct SABP_Service_Area_Identifier, lac), |
| 113 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 114 | -1, /* IMPLICIT tag at current level */ |
| 115 | &asn_DEF_OCTET_STRING, |
| 116 | memb_lac_constraint_1, |
| 117 | &asn_PER_memb_lac_constr_3, |
| 118 | 0, |
| 119 | "lac" |
| 120 | }, |
| 121 | { ATF_NOFLAGS, 0, offsetof(struct SABP_Service_Area_Identifier, sac), |
| 122 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 123 | -1, /* IMPLICIT tag at current level */ |
| 124 | &asn_DEF_OCTET_STRING, |
| 125 | memb_sac_constraint_1, |
| 126 | &asn_PER_memb_sac_constr_4, |
| 127 | 0, |
| 128 | "sac" |
| 129 | }, |
| 130 | }; |
| 131 | static const ber_tlv_tag_t asn_DEF_SABP_Service_Area_Identifier_tags_1[] = { |
| 132 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 133 | }; |
| 134 | static const asn_TYPE_tag2member_t asn_MAP_SABP_Service_Area_Identifier_tag2el_1[] = { |
| 135 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* pLMNidentity */ |
| 136 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* lac */ |
| 137 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* sac */ |
| 138 | }; |
| 139 | static asn_SEQUENCE_specifics_t asn_SPC_SABP_Service_Area_Identifier_specs_1 = { |
| 140 | sizeof(struct SABP_Service_Area_Identifier), |
| 141 | offsetof(struct SABP_Service_Area_Identifier, _asn_ctx), |
| 142 | asn_MAP_SABP_Service_Area_Identifier_tag2el_1, |
| 143 | 3, /* Count of tags in the map */ |
| 144 | 0, 0, 0, /* Optional elements (not needed) */ |
| 145 | -1, /* Start extensions */ |
| 146 | -1 /* Stop extensions */ |
| 147 | }; |
| 148 | asn_TYPE_descriptor_t asn_DEF_SABP_Service_Area_Identifier = { |
| 149 | "SABP_Service-Area-Identifier", |
| 150 | "SABP_Service-Area-Identifier", |
| 151 | SEQUENCE_free, |
| 152 | SEQUENCE_print, |
| 153 | SEQUENCE_constraint, |
| 154 | SEQUENCE_decode_ber, |
| 155 | SEQUENCE_encode_der, |
| 156 | SEQUENCE_decode_xer, |
| 157 | SEQUENCE_encode_xer, |
| 158 | SEQUENCE_decode_uper, |
| 159 | SEQUENCE_encode_uper, |
| 160 | SEQUENCE_decode_aper, |
| 161 | SEQUENCE_encode_aper, |
| 162 | 0, /* Use generic outmost tag fetcher */ |
| 163 | asn_DEF_SABP_Service_Area_Identifier_tags_1, |
| 164 | sizeof(asn_DEF_SABP_Service_Area_Identifier_tags_1) |
| 165 | /sizeof(asn_DEF_SABP_Service_Area_Identifier_tags_1[0]), /* 1 */ |
| 166 | asn_DEF_SABP_Service_Area_Identifier_tags_1, /* Same as above */ |
| 167 | sizeof(asn_DEF_SABP_Service_Area_Identifier_tags_1) |
| 168 | /sizeof(asn_DEF_SABP_Service_Area_Identifier_tags_1[0]), /* 1 */ |
| 169 | 0, /* No PER visible constraints */ |
| 170 | asn_MBR_SABP_Service_Area_Identifier_1, |
| 171 | 3, /* Elements count */ |
| 172 | &asn_SPC_SABP_Service_Area_Identifier_specs_1 /* Additional specs */ |
| 173 | }; |
| 174 | |