blob: c63bdd956be64bb2b7d01b43e22f4876e8f4b9ae [file] [log] [blame]
Harald Weltee844bf72019-05-06 15:25:10 +02001/*
2 * Generated by asn1c-0.9.28 (http://lionet.info/asn1c)
3 * From ASN.1 module "SABP-CommonDataTypes"
4 * found in "../../asn1/sabp/SABP-CommonDataTypes.asn"
5 */
6
7#include <osmocom/sabp/SABP_Presence.h>
8
9int
10SABP_Presence_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
22SABP_Presence_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
42SABP_Presence_free(asn_TYPE_descriptor_t *td,
43 void *struct_ptr, int contents_only) {
44 SABP_Presence_1_inherit_TYPE_descriptor(td);
45 td->free_struct(td, struct_ptr, contents_only);
46}
47
48int
49SABP_Presence_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
50 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
51 SABP_Presence_1_inherit_TYPE_descriptor(td);
52 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
53}
54
55asn_dec_rval_t
56SABP_Presence_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 SABP_Presence_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
63SABP_Presence_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 SABP_Presence_1_inherit_TYPE_descriptor(td);
67 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
68}
69
70asn_dec_rval_t
71SABP_Presence_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 SABP_Presence_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
78SABP_Presence_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 SABP_Presence_1_inherit_TYPE_descriptor(td);
82 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
83}
84
85asn_dec_rval_t
86SABP_Presence_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
87 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
88 SABP_Presence_1_inherit_TYPE_descriptor(td);
89 return td->uper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
90}
91
92asn_enc_rval_t
93SABP_Presence_encode_uper(asn_TYPE_descriptor_t *td,
94 asn_per_constraints_t *constraints,
95 void *structure, asn_per_outp_t *per_out) {
96 SABP_Presence_1_inherit_TYPE_descriptor(td);
97 return td->uper_encoder(td, constraints, structure, per_out);
98}
99
100asn_enc_rval_t
101SABP_Presence_encode_aper(asn_TYPE_descriptor_t *td,
102 asn_per_constraints_t *constraints,
103 void *structure, asn_per_outp_t *per_out) {
104 SABP_Presence_1_inherit_TYPE_descriptor(td);
105 return td->aper_encoder(td, constraints, structure, per_out);
106}
107
108asn_dec_rval_t
109SABP_Presence_decode_aper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
110 asn_per_constraints_t *constraints, void **structure, asn_per_data_t *per_data) {
111 SABP_Presence_1_inherit_TYPE_descriptor(td);
112 return td->aper_decoder(opt_codec_ctx, td, constraints, structure, per_data);
113}
114
115static asn_per_constraints_t asn_PER_type_SABP_Presence_constr_1 GCC_NOTUSED = {
116 { APC_CONSTRAINED, 2, 2, 0l, 2l } /* (0..2) */,
117 { APC_UNCONSTRAINED, -1, -1, 0, 0 },
118 0, 0 /* No PER value map */
119};
120static const asn_INTEGER_enum_map_t asn_MAP_SABP_Presence_value2enum_1[] = {
121 { 0, 8, "optional" },
122 { 1, 11, "conditional" },
123 { 2, 9, "mandatory" }
124};
125static const unsigned int asn_MAP_SABP_Presence_enum2value_1[] = {
126 1, /* conditional(1) */
127 2, /* mandatory(2) */
128 0 /* optional(0) */
129};
130static const asn_INTEGER_specifics_t asn_SPC_SABP_Presence_specs_1 = {
131 asn_MAP_SABP_Presence_value2enum_1, /* "tag" => N; sorted by tag */
132 asn_MAP_SABP_Presence_enum2value_1, /* N => "tag"; sorted by N */
133 3, /* Number of elements in the maps */
134 0, /* Enumeration is not extensible */
135 1, /* Strict enumeration */
136 0, /* Native long size */
137 0
138};
139static const ber_tlv_tag_t asn_DEF_SABP_Presence_tags_1[] = {
140 (ASN_TAG_CLASS_UNIVERSAL | (10 << 2))
141};
142asn_TYPE_descriptor_t asn_DEF_SABP_Presence = {
143 "SABP_Presence",
144 "SABP_Presence",
145 SABP_Presence_free,
146 SABP_Presence_print,
147 SABP_Presence_constraint,
148 SABP_Presence_decode_ber,
149 SABP_Presence_encode_der,
150 SABP_Presence_decode_xer,
151 SABP_Presence_encode_xer,
152 SABP_Presence_decode_uper,
153 SABP_Presence_encode_uper,
154 SABP_Presence_decode_aper,
155 SABP_Presence_encode_aper,
156 0, /* Use generic outmost tag fetcher */
157 asn_DEF_SABP_Presence_tags_1,
158 sizeof(asn_DEF_SABP_Presence_tags_1)
159 /sizeof(asn_DEF_SABP_Presence_tags_1[0]), /* 1 */
160 asn_DEF_SABP_Presence_tags_1, /* Same as above */
161 sizeof(asn_DEF_SABP_Presence_tags_1)
162 /sizeof(asn_DEF_SABP_Presence_tags_1[0]), /* 1 */
163 &asn_PER_type_SABP_Presence_constr_1,
164 0, 0, /* Defined elsewhere */
165 &asn_SPC_SABP_Presence_specs_1 /* Additional specs */
166};
167