blob: 4286b221e6c5ee49850f7e7e17cbbc01141ea326 [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/OperationTag.h>
8
9int
10OperationTag_constraint(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 <= 2147483647l)) {
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/*
35 * This type is implemented using NativeInteger,
36 * so here we adjust the DEF accordingly.
37 */
38static void
39OperationTag_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) {
40 td->free_struct = asn_DEF_NativeInteger.free_struct;
41 td->print_struct = asn_DEF_NativeInteger.print_struct;
42 td->check_constraints = asn_DEF_NativeInteger.check_constraints;
43 td->ber_decoder = asn_DEF_NativeInteger.ber_decoder;
44 td->der_encoder = asn_DEF_NativeInteger.der_encoder;
45 td->xer_decoder = asn_DEF_NativeInteger.xer_decoder;
46 td->xer_encoder = asn_DEF_NativeInteger.xer_encoder;
47 td->uper_decoder = asn_DEF_NativeInteger.uper_decoder;
48 td->uper_encoder = asn_DEF_NativeInteger.uper_encoder;
49 td->aper_decoder = asn_DEF_NativeInteger.aper_decoder;
50 td->aper_encoder = asn_DEF_NativeInteger.aper_encoder;
51 if(!td->per_constraints)
52 td->per_constraints = asn_DEF_NativeInteger.per_constraints;
53 td->elements = asn_DEF_NativeInteger.elements;
54 td->elements_count = asn_DEF_NativeInteger.elements_count;
55 td->specifics = asn_DEF_NativeInteger.specifics;
56}
57
58void
59OperationTag_free(asn_TYPE_descriptor_t *td,
60 void *struct_ptr, int contents_only) {
61 OperationTag_1_inherit_TYPE_descriptor(td);
62 td->free_struct(td, struct_ptr, contents_only);
63}
64
65int
66OperationTag_print(asn_TYPE_descriptor_t *td, const void *struct_ptr,
67 int ilevel, asn_app_consume_bytes_f *cb, void *app_key) {
68 OperationTag_1_inherit_TYPE_descriptor(td);
69 return td->print_struct(td, struct_ptr, ilevel, cb, app_key);
70}
71
72asn_dec_rval_t
73OperationTag_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
74 void **structure, const void *bufptr, size_t size, int tag_mode) {
75 OperationTag_1_inherit_TYPE_descriptor(td);
76 return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode);
77}
78
79asn_enc_rval_t
80OperationTag_encode_der(asn_TYPE_descriptor_t *td,
81 void *structure, int tag_mode, ber_tlv_tag_t tag,
82 asn_app_consume_bytes_f *cb, void *app_key) {
83 OperationTag_1_inherit_TYPE_descriptor(td);
84 return td->der_encoder(td, structure, tag_mode, tag, cb, app_key);
85}
86
87asn_dec_rval_t
88OperationTag_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
89 void **structure, const char *opt_mname, const void *bufptr, size_t size) {
90 OperationTag_1_inherit_TYPE_descriptor(td);
91 return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size);
92}
93
94asn_enc_rval_t
95OperationTag_encode_xer(asn_TYPE_descriptor_t *td, void *structure,
96 int ilevel, enum xer_encoder_flags_e flags,
97 asn_app_consume_bytes_f *cb, void *app_key) {
98 OperationTag_1_inherit_TYPE_descriptor(td);
99 return td->xer_encoder(td, structure, ilevel, flags, cb, app_key);
100}
101
102static const ber_tlv_tag_t asn_DEF_OperationTag_tags_1[] = {
103 (ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
104};
105asn_TYPE_descriptor_t asn_DEF_OperationTag = {
106 "OperationTag",
107 "OperationTag",
108 OperationTag_free,
109 OperationTag_print,
110 OperationTag_constraint,
111 OperationTag_decode_ber,
112 OperationTag_encode_der,
113 OperationTag_decode_xer,
114 OperationTag_encode_xer,
115 0, 0, /* No UPER support, use "-gen-PER" to enable */
116 0, 0, /* No APER support, use "-gen-PER" to enable */
117 0, /* Use generic outmost tag fetcher */
118 asn_DEF_OperationTag_tags_1,
119 sizeof(asn_DEF_OperationTag_tags_1)
120 /sizeof(asn_DEF_OperationTag_tags_1[0]), /* 1 */
121 asn_DEF_OperationTag_tags_1, /* Same as above */
122 sizeof(asn_DEF_OperationTag_tags_1)
123 /sizeof(asn_DEF_OperationTag_tags_1[0]), /* 1 */
124 0, /* No PER visible constraints */
125 0, 0, /* No members */
126 0 /* No specifics */
127};
128