Harald Welte | ee09189 | 2015-09-10 10:22:03 +0200 | [diff] [blame] | 1 | /* |
| 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 Hofmeyr | f1f2d7c | 2016-01-05 12:00:06 +0100 | [diff] [blame] | 7 | #include <osmocom/ranap/RANAP_BroadcastAssistanceDataDecipheringKeys.h> |
Harald Welte | ee09189 | 2015-09-10 10:22:03 +0200 | [diff] [blame] | 8 | |
| 9 | static int |
| 10 | memb_cipheringKeyFlag_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 11 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 12 | const BIT_STRING_t *st = (const BIT_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 | if(st->size > 0) { |
| 23 | /* Size in bits */ |
| 24 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 25 | } else { |
| 26 | size = 0; |
| 27 | } |
| 28 | |
| 29 | if((size == 1l)) { |
| 30 | /* Constraint check succeeded */ |
| 31 | return 0; |
| 32 | } else { |
| 33 | _ASN_CTFAIL(app_key, td, sptr, |
| 34 | "%s: constraint failed (%s:%d)", |
| 35 | td->name, __FILE__, __LINE__); |
| 36 | return -1; |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | static int |
| 41 | memb_currentDecipheringKey_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 42 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 43 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 44 | size_t size; |
| 45 | |
| 46 | if(!sptr) { |
| 47 | _ASN_CTFAIL(app_key, td, sptr, |
| 48 | "%s: value not given (%s:%d)", |
| 49 | td->name, __FILE__, __LINE__); |
| 50 | return -1; |
| 51 | } |
| 52 | |
| 53 | if(st->size > 0) { |
| 54 | /* Size in bits */ |
| 55 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 56 | } else { |
| 57 | size = 0; |
| 58 | } |
| 59 | |
| 60 | if((size == 56l)) { |
| 61 | /* Constraint check succeeded */ |
| 62 | return 0; |
| 63 | } else { |
| 64 | _ASN_CTFAIL(app_key, td, sptr, |
| 65 | "%s: constraint failed (%s:%d)", |
| 66 | td->name, __FILE__, __LINE__); |
| 67 | return -1; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | static int |
| 72 | memb_nextDecipheringKey_constraint_1(asn_TYPE_descriptor_t *td, const void *sptr, |
| 73 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
| 74 | const BIT_STRING_t *st = (const BIT_STRING_t *)sptr; |
| 75 | size_t size; |
| 76 | |
| 77 | if(!sptr) { |
| 78 | _ASN_CTFAIL(app_key, td, sptr, |
| 79 | "%s: value not given (%s:%d)", |
| 80 | td->name, __FILE__, __LINE__); |
| 81 | return -1; |
| 82 | } |
| 83 | |
| 84 | if(st->size > 0) { |
| 85 | /* Size in bits */ |
| 86 | size = 8 * st->size - (st->bits_unused & 0x07); |
| 87 | } else { |
| 88 | size = 0; |
| 89 | } |
| 90 | |
| 91 | if((size == 56l)) { |
| 92 | /* Constraint check succeeded */ |
| 93 | return 0; |
| 94 | } else { |
| 95 | _ASN_CTFAIL(app_key, td, sptr, |
| 96 | "%s: constraint failed (%s:%d)", |
| 97 | td->name, __FILE__, __LINE__); |
| 98 | return -1; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | static asn_per_constraints_t asn_PER_memb_cipheringKeyFlag_constr_2 GCC_NOTUSED = { |
| 103 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 104 | { APC_CONSTRAINED, 0, 0, 1l, 1l } /* (SIZE(1..1)) */, |
| 105 | 0, 0 /* No PER value map */ |
| 106 | }; |
| 107 | static asn_per_constraints_t asn_PER_memb_currentDecipheringKey_constr_3 GCC_NOTUSED = { |
| 108 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 109 | { APC_CONSTRAINED, 0, 0, 56l, 56l } /* (SIZE(56..56)) */, |
| 110 | 0, 0 /* No PER value map */ |
| 111 | }; |
| 112 | static asn_per_constraints_t asn_PER_memb_nextDecipheringKey_constr_4 GCC_NOTUSED = { |
| 113 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 114 | { APC_CONSTRAINED, 0, 0, 56l, 56l } /* (SIZE(56..56)) */, |
| 115 | 0, 0 /* No PER value map */ |
| 116 | }; |
| 117 | static asn_TYPE_member_t asn_MBR_RANAP_BroadcastAssistanceDataDecipheringKeys_1[] = { |
| 118 | { ATF_NOFLAGS, 0, offsetof(struct RANAP_BroadcastAssistanceDataDecipheringKeys, cipheringKeyFlag), |
| 119 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 120 | -1, /* IMPLICIT tag at current level */ |
| 121 | &asn_DEF_BIT_STRING, |
| 122 | memb_cipheringKeyFlag_constraint_1, |
| 123 | &asn_PER_memb_cipheringKeyFlag_constr_2, |
| 124 | 0, |
| 125 | "cipheringKeyFlag" |
| 126 | }, |
| 127 | { ATF_NOFLAGS, 0, offsetof(struct RANAP_BroadcastAssistanceDataDecipheringKeys, currentDecipheringKey), |
| 128 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 129 | -1, /* IMPLICIT tag at current level */ |
| 130 | &asn_DEF_BIT_STRING, |
| 131 | memb_currentDecipheringKey_constraint_1, |
| 132 | &asn_PER_memb_currentDecipheringKey_constr_3, |
| 133 | 0, |
| 134 | "currentDecipheringKey" |
| 135 | }, |
| 136 | { ATF_NOFLAGS, 0, offsetof(struct RANAP_BroadcastAssistanceDataDecipheringKeys, nextDecipheringKey), |
| 137 | (ASN_TAG_CLASS_CONTEXT | (2 << 2)), |
| 138 | -1, /* IMPLICIT tag at current level */ |
| 139 | &asn_DEF_BIT_STRING, |
| 140 | memb_nextDecipheringKey_constraint_1, |
| 141 | &asn_PER_memb_nextDecipheringKey_constr_4, |
| 142 | 0, |
| 143 | "nextDecipheringKey" |
| 144 | }, |
| 145 | }; |
| 146 | static const ber_tlv_tag_t asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys_tags_1[] = { |
| 147 | (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) |
| 148 | }; |
| 149 | static const asn_TYPE_tag2member_t asn_MAP_RANAP_BroadcastAssistanceDataDecipheringKeys_tag2el_1[] = { |
| 150 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* cipheringKeyFlag */ |
| 151 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* currentDecipheringKey */ |
| 152 | { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 } /* nextDecipheringKey */ |
| 153 | }; |
| 154 | static asn_SEQUENCE_specifics_t asn_SPC_RANAP_BroadcastAssistanceDataDecipheringKeys_specs_1 = { |
| 155 | sizeof(struct RANAP_BroadcastAssistanceDataDecipheringKeys), |
| 156 | offsetof(struct RANAP_BroadcastAssistanceDataDecipheringKeys, _asn_ctx), |
| 157 | asn_MAP_RANAP_BroadcastAssistanceDataDecipheringKeys_tag2el_1, |
| 158 | 3, /* Count of tags in the map */ |
| 159 | 0, 0, 0, /* Optional elements (not needed) */ |
| 160 | 2, /* Start extensions */ |
| 161 | 4 /* Stop extensions */ |
| 162 | }; |
| 163 | asn_TYPE_descriptor_t asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys = { |
| 164 | "RANAP_BroadcastAssistanceDataDecipheringKeys", |
| 165 | "RANAP_BroadcastAssistanceDataDecipheringKeys", |
| 166 | SEQUENCE_free, |
| 167 | SEQUENCE_print, |
| 168 | SEQUENCE_constraint, |
| 169 | SEQUENCE_decode_ber, |
| 170 | SEQUENCE_encode_der, |
| 171 | SEQUENCE_decode_xer, |
| 172 | SEQUENCE_encode_xer, |
| 173 | SEQUENCE_decode_uper, |
| 174 | SEQUENCE_encode_uper, |
| 175 | SEQUENCE_decode_aper, |
| 176 | SEQUENCE_encode_aper, |
| 177 | 0, /* Use generic outmost tag fetcher */ |
| 178 | asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys_tags_1, |
| 179 | sizeof(asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys_tags_1) |
| 180 | /sizeof(asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys_tags_1[0]), /* 1 */ |
| 181 | asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys_tags_1, /* Same as above */ |
| 182 | sizeof(asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys_tags_1) |
| 183 | /sizeof(asn_DEF_RANAP_BroadcastAssistanceDataDecipheringKeys_tags_1[0]), /* 1 */ |
| 184 | 0, /* No PER visible constraints */ |
| 185 | asn_MBR_RANAP_BroadcastAssistanceDataDecipheringKeys_1, |
| 186 | 3, /* Elements count */ |
| 187 | &asn_SPC_RANAP_BroadcastAssistanceDataDecipheringKeys_specs_1 /* Additional specs */ |
| 188 | }; |
| 189 | |