Harald Welte | 019830c | 2015-09-10 10:20:56 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) |
| 3 | * From ASN.1 module "RUA-CommonDataTypes" |
| 4 | * found in "../../asn1/rua/RUA-CommonDataTypes.asn" |
| 5 | */ |
| 6 | |
| 7 | #include "RUA_PrivateIE-ID.h" |
| 8 | |
| 9 | static int |
| 10 | memb_local_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 >= 0l && value <= 65535l)) { |
| 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 | |
| 34 | static asn_per_constraints_t asn_PER_memb_local_constr_2 GCC_NOTUSED = { |
| 35 | { APC_CONSTRAINED, 16, 16, 0l, 65535l } /* (0..65535) */, |
| 36 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 37 | 0, 0 /* No PER value map */ |
| 38 | }; |
| 39 | static asn_per_constraints_t asn_PER_type_RUA_PrivateIE_ID_constr_1 GCC_NOTUSED = { |
| 40 | { APC_CONSTRAINED, 1, 1, 0l, 1l } /* (0..1) */, |
| 41 | { APC_UNCONSTRAINED, -1, -1, 0, 0 }, |
| 42 | 0, 0 /* No PER value map */ |
| 43 | }; |
| 44 | static asn_TYPE_member_t asn_MBR_RUA_PrivateIE_ID_1[] = { |
| 45 | { ATF_NOFLAGS, 0, offsetof(struct RUA_PrivateIE_ID, choice.local), |
| 46 | (ASN_TAG_CLASS_CONTEXT | (0 << 2)), |
| 47 | -1, /* IMPLICIT tag at current level */ |
| 48 | &asn_DEF_NativeInteger, |
| 49 | memb_local_constraint_1, |
| 50 | &asn_PER_memb_local_constr_2, |
| 51 | 0, |
| 52 | "local" |
| 53 | }, |
| 54 | { ATF_NOFLAGS, 0, offsetof(struct RUA_PrivateIE_ID, choice.global), |
| 55 | (ASN_TAG_CLASS_CONTEXT | (1 << 2)), |
| 56 | -1, /* IMPLICIT tag at current level */ |
| 57 | &asn_DEF_OBJECT_IDENTIFIER, |
| 58 | 0, /* Defer constraints checking to the member type */ |
| 59 | 0, /* No PER visible constraints */ |
| 60 | 0, |
| 61 | "global" |
| 62 | }, |
| 63 | }; |
| 64 | static const asn_TYPE_tag2member_t asn_MAP_RUA_PrivateIE_ID_tag2el_1[] = { |
| 65 | { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* local */ |
| 66 | { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 } /* global */ |
| 67 | }; |
| 68 | static asn_CHOICE_specifics_t asn_SPC_RUA_PrivateIE_ID_specs_1 = { |
| 69 | sizeof(struct RUA_PrivateIE_ID), |
| 70 | offsetof(struct RUA_PrivateIE_ID, _asn_ctx), |
| 71 | offsetof(struct RUA_PrivateIE_ID, present), |
| 72 | sizeof(((struct RUA_PrivateIE_ID *)0)->present), |
| 73 | asn_MAP_RUA_PrivateIE_ID_tag2el_1, |
| 74 | 2, /* Count of tags in the map */ |
| 75 | 0, |
| 76 | -1 /* Extensions start */ |
| 77 | }; |
| 78 | asn_TYPE_descriptor_t asn_DEF_RUA_PrivateIE_ID = { |
| 79 | "RUA_PrivateIE-ID", |
| 80 | "RUA_PrivateIE-ID", |
| 81 | CHOICE_free, |
| 82 | CHOICE_print, |
| 83 | CHOICE_constraint, |
| 84 | CHOICE_decode_ber, |
| 85 | CHOICE_encode_der, |
| 86 | CHOICE_decode_xer, |
| 87 | CHOICE_encode_xer, |
| 88 | CHOICE_decode_uper, |
| 89 | CHOICE_encode_uper, |
| 90 | CHOICE_decode_aper, |
| 91 | CHOICE_encode_aper, |
| 92 | CHOICE_outmost_tag, |
| 93 | 0, /* No effective tags (pointer) */ |
| 94 | 0, /* No effective tags (count) */ |
| 95 | 0, /* No tags (pointer) */ |
| 96 | 0, /* No tags (count) */ |
| 97 | &asn_PER_type_RUA_PrivateIE_ID_constr_1, |
| 98 | asn_MBR_RUA_PrivateIE_ID_1, |
| 99 | 2, /* Elements count */ |
| 100 | &asn_SPC_RUA_PrivateIE_ID_specs_1 /* Additional specs */ |
| 101 | }; |
| 102 | |