/src/libiec61850/src/mms/iso_mms/asn1c/MMSString.c
Line | Count | Source |
1 | | /* |
2 | | * Generated by asn1c-0.9.21 (http://lionet.info/asn1c) |
3 | | * From ASN.1 module "MMS" |
4 | | * found in "../mms-extended.asn" |
5 | | * `asn1c -fskeletons-copy` |
6 | | */ |
7 | | |
8 | | #include <asn_internal.h> |
9 | | |
10 | | #include "MMSString.h" |
11 | | |
12 | | int |
13 | | MMSString_constraint(asn_TYPE_descriptor_t *td, const void *sptr, |
14 | 0 | asn_app_constraint_failed_f *ctfailcb, void *app_key) { |
15 | | /* Replace with underlying type checker */ |
16 | 0 | td->check_constraints = asn_DEF_UTF8String.check_constraints; |
17 | 0 | return td->check_constraints(td, sptr, ctfailcb, app_key); |
18 | 0 | } |
19 | | |
20 | | /* |
21 | | * This type is implemented using UTF8String, |
22 | | * so here we adjust the DEF accordingly. |
23 | | */ |
24 | | static void |
25 | 0 | MMSString_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t *td) { |
26 | 0 | td->free_struct = asn_DEF_UTF8String.free_struct; |
27 | 0 | td->print_struct = asn_DEF_UTF8String.print_struct; |
28 | 0 | td->ber_decoder = asn_DEF_UTF8String.ber_decoder; |
29 | 0 | td->der_encoder = asn_DEF_UTF8String.der_encoder; |
30 | 0 | td->xer_decoder = asn_DEF_UTF8String.xer_decoder; |
31 | 0 | td->xer_encoder = asn_DEF_UTF8String.xer_encoder; |
32 | 0 | td->uper_decoder = asn_DEF_UTF8String.uper_decoder; |
33 | 0 | td->uper_encoder = asn_DEF_UTF8String.uper_encoder; |
34 | 0 | if(!td->per_constraints) |
35 | 0 | td->per_constraints = asn_DEF_UTF8String.per_constraints; |
36 | 0 | td->elements = asn_DEF_UTF8String.elements; |
37 | 0 | td->elements_count = asn_DEF_UTF8String.elements_count; |
38 | 0 | td->specifics = asn_DEF_UTF8String.specifics; |
39 | 0 | } |
40 | | |
41 | | void |
42 | | MMSString_free(asn_TYPE_descriptor_t *td, |
43 | 0 | void *struct_ptr, int contents_only) { |
44 | 0 | MMSString_1_inherit_TYPE_descriptor(td); |
45 | 0 | td->free_struct(td, struct_ptr, contents_only); |
46 | 0 | } |
47 | | |
48 | | int |
49 | | MMSString_print(asn_TYPE_descriptor_t *td, const void *struct_ptr, |
50 | 0 | int ilevel, asn_app_consume_bytes_f *cb, void *app_key) { |
51 | 0 | MMSString_1_inherit_TYPE_descriptor(td); |
52 | 0 | return td->print_struct(td, struct_ptr, ilevel, cb, app_key); |
53 | 0 | } |
54 | | |
55 | | asn_dec_rval_t |
56 | | MMSString_decode_ber(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
57 | 0 | void **structure, const void *bufptr, size_t size, int tag_mode) { |
58 | 0 | MMSString_1_inherit_TYPE_descriptor(td); |
59 | 0 | return td->ber_decoder(opt_codec_ctx, td, structure, bufptr, size, tag_mode); |
60 | 0 | } |
61 | | |
62 | | asn_enc_rval_t |
63 | | MMSString_encode_der(asn_TYPE_descriptor_t *td, |
64 | | void *structure, int tag_mode, ber_tlv_tag_t tag, |
65 | 0 | asn_app_consume_bytes_f *cb, void *app_key) { |
66 | 0 | MMSString_1_inherit_TYPE_descriptor(td); |
67 | 0 | return td->der_encoder(td, structure, tag_mode, tag, cb, app_key); |
68 | 0 | } |
69 | | |
70 | | asn_dec_rval_t |
71 | | MMSString_decode_xer(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, |
72 | 0 | void **structure, const char *opt_mname, const void *bufptr, size_t size) { |
73 | 0 | MMSString_1_inherit_TYPE_descriptor(td); |
74 | 0 | return td->xer_decoder(opt_codec_ctx, td, structure, opt_mname, bufptr, size); |
75 | 0 | } |
76 | | |
77 | | asn_enc_rval_t |
78 | | MMSString_encode_xer(asn_TYPE_descriptor_t *td, void *structure, |
79 | | int ilevel, enum xer_encoder_flags_e flags, |
80 | 0 | asn_app_consume_bytes_f *cb, void *app_key) { |
81 | 0 | MMSString_1_inherit_TYPE_descriptor(td); |
82 | 0 | return td->xer_encoder(td, structure, ilevel, flags, cb, app_key); |
83 | 0 | } |
84 | | |
85 | | static ber_tlv_tag_t asn_DEF_MMSString_tags_1[] = { |
86 | | (ASN_TAG_CLASS_UNIVERSAL | (12 << 2)) |
87 | | }; |
88 | | asn_TYPE_descriptor_t asn_DEF_MMSString = { |
89 | | "MMSString", |
90 | | "MMSString", |
91 | | MMSString_free, |
92 | | MMSString_print, |
93 | | MMSString_constraint, |
94 | | MMSString_decode_ber, |
95 | | MMSString_encode_der, |
96 | | MMSString_decode_xer, |
97 | | MMSString_encode_xer, |
98 | | 0, 0, /* No PER support, use "-gen-PER" to enable */ |
99 | | 0, /* Use generic outmost tag fetcher */ |
100 | | asn_DEF_MMSString_tags_1, |
101 | | sizeof(asn_DEF_MMSString_tags_1) |
102 | | /sizeof(asn_DEF_MMSString_tags_1[0]), /* 1 */ |
103 | | asn_DEF_MMSString_tags_1, /* Same as above */ |
104 | | sizeof(asn_DEF_MMSString_tags_1) |
105 | | /sizeof(asn_DEF_MMSString_tags_1[0]), /* 1 */ |
106 | | 0, /* No PER visible constraints */ |
107 | | 0, 0, /* No members */ |
108 | | 0 /* No specifics */ |
109 | | }; |
110 | | |