blob: 76ca2fae4ff75329e072ade660280b9497e51969 [file] [log] [blame]
Harald Welte3aa901d2018-08-13 18:32:36 +02001/*
2 * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
3 * From ASN.1 module "RSPRO"
4 * found in "../../asn1/RSPRO.asn"
5 */
6
7#include <osmocom/rspro/ResultCode.h>
8
9int
10ResultCode_constraint(asn_TYPE_descriptor_t *td, const void *sptr,
11 asn_app_constraint_failed_f *ctfailcb, void *app_key) {
12 /* Replace with underlying type checker */
13 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
14 return td->check_constraints(td, sptr, ctfailcb, app_key);
15}
16
17/*
18 * This type is implemented using NativeEnumerated,
19 * so here we adjust the DEF accordingly.
20 */
21static void
22ResultCode_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
23 td->free_struct = asn_DEF_NativeEnumerated.free_struct;
24 td->print_struct = asn_DEF_NativeEnumerated.print_struct;
25 td->check_constraints = asn_DEF_NativeEnumerated.check_constraints;
26 td->ber_decoder = asn_DEF_NativeEnumerated.ber_decoder;
27 td->der_encoder = asn_DEF_NativeEnumerated.der_encoder;
28 td->xer_decoder = asn_DEF_NativeEnumerated.xer_decoder;
29 td->xer_encoder = asn_DEF_NativeEnumerated.xer_encoder;
30 td->uper_decoder = asn_DEF_NativeEnumerated.uper_decoder;
31 td->uper_encoder = asn_DEF_NativeEnumerated.uper_encoder;
32 td->aper_decoder = asn_DEF_NativeEnumerated.aper_decoder;
33 td->aper_encoder = asn_DEF_NativeEnumerated.aper_encoder;
34 if(!td->per_constraints)
35 td->per_constraints = asn_DEF_NativeEnumerated.per_constraints;
36 td->elements = asn_DEF_NativeEnumerated.elements;
37 td->elements_count = asn_DEF_NativeEnumerated.elements_count;
38 /* td->specifics = asn_DEF_NativeEnumerated.specifics; // Defined explicitly */
39}
40
41void
42ResultCode_free(asn_TYPE_descriptor_t *td,
43 void *struct_ptr, int contents_only) {
44 ResultCode_1_inherit_TYPE_descriptor(td);
45 td->free_struct(td, struct_ptr, contents_only);
46}
47
48int
49ResultCode_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
50 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
51 ResultCode_1_inherit_TYPE_descriptor(td);
52 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
53}
54
55asn_dec_rval_t
56ResultCode_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
57 void **structure, const void *bufptr, size_t size, int tag_mode) {
58 ResultCode_1_inherit_TYPE_descriptor(td);
59 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
60}
61
62asn_enc_rval_t
63ResultCode_encode_der(asn_TYPE_descriptor_t *td,
64 void *structure, int tag_mode, ber_tlv_tag_t tag,
65 asn_app_consume_bytes_f *cb, void *app_key) {
66 ResultCode_1_inherit_TYPE_descriptor(td);
67 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
68}
69
70asn_dec_rval_t
71ResultCode_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
72 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
73 ResultCode_1_inherit_TYPE_descriptor(td);
74 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
75}
76
77asn_enc_rval_t
78ResultCode_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
79 int ilevel, enum xer_encoder_flags_e flags,
80 asn_app_consume_bytes_f *cb, void *app_key) {
81 ResultCode_1_inherit_TYPE_descriptor(td);
82 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
83}
84
85static const asn_INTEGER_enum_map_t asn_MAP_ResultCode_value2enum_1[] = {
86 { 0, 2, "ok" },
87 { 1, 15, "illegalClientId" },
88 { 2, 13, "illegalBankId" },
89 { 3, 13, "illegalSlotId" },
Harald Welte71752dd2019-03-09 15:07:01 +010090 { 4, 26, "unsupportedProtocolVersion" },
91 { 5, 14, "unknownSlotmap" },
Harald Welte65006582022-05-03 16:22:37 +020092 { 6, 13, "identityInUse" },
Harald Welte3aa901d2018-08-13 18:32:36 +020093 { 100, 14, "cardNotPresent" },
94 { 101, 16, "cardUnresponsive" },
95 { 102, 21, "cardTransmissionError" }
96 /* This list is extensible */
97};
98static const unsigned int asn_MAP_ResultCode_enum2value_1[] = {
Harald Welte65006582022-05-03 16:22:37 +020099 7, /* cardNotPresent(100) */
100 9, /* cardTransmissionError(102) */
101 8, /* cardUnresponsive(101) */
102 6, /* identityInUse(6) */
Harald Welte3aa901d2018-08-13 18:32:36 +0200103 2, /* illegalBankId(2) */
104 1, /* illegalClientId(1) */
105 3, /* illegalSlotId(3) */
Harald Welte71752dd2019-03-09 15:07:01 +0100106 0, /* ok(0) */
107 5, /* unknownSlotmap(5) */
108 4 /* unsupportedProtocolVersion(4) */
Harald Welte3aa901d2018-08-13 18:32:36 +0200109 /* This list is extensible */
110};
111static const asn_INTEGER_specifics_t asn_SPC_ResultCode_specs_1 = {
112 asn_MAP_ResultCode_value2enum_1, /* "tag" => N; sorted by tag */
113 asn_MAP_ResultCode_enum2value_1, /* N => "tag"; sorted by N */
Harald Welte65006582022-05-03 16:22:37 +0200114 10, /* Number of elements in the maps */
115 11, /* Extensions before this member */
Harald Welte3aa901d2018-08-13 18:32:36 +0200116 1, /* Strict enumeration */
117 0, /* Native long size */
118 0
119};
120static const ber_tlv_tag_t asn_DEF_ResultCode_tags_1[] = {
121 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
122};
123asn_TYPE_descriptor_t asn_DEF_ResultCode = {
124 "ResultCode",
125 "ResultCode",
126 ResultCode_free,
127 ResultCode_print,
128 ResultCode_constraint,
129 ResultCode_decode_ber,
130 ResultCode_encode_der,
131 ResultCode_decode_xer,
132 ResultCode_encode_xer,
133 0, 0, /* No UPER support, use "-gen-PER" to enable */
134 0, 0, /* No APER support, use "-gen-PER" to enable */
135 0, /* Use generic outmost tag fetcher */
136 asn_DEF_ResultCode_tags_1,
137 sizeof(asn_DEF_ResultCode_tags_1)
138 /sizeof(asn_DEF_ResultCode_tags_1[0]), /* 1 */
139 asn_DEF_ResultCode_tags_1, /* Same as above */
140 sizeof(asn_DEF_ResultCode_tags_1)
141 /sizeof(asn_DEF_ResultCode_tags_1[0]), /* 1 */
142 0, /* No PER visible constraints */
143 0, 0, /* Defined elsewhere */
144 &asn_SPC_ResultCode_specs_1 /* Additional specs */
145};
146