2 * Copyright (c) 2017-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
5 #ifndef ASN_OPEN_TYPE_H
6 #define ASN_OPEN_TYPE_H
8 #include <asn_application.h>
9 ///////////#include <per_support.h>
16 * Decode an Open Type which is potentially constraiend
17 * by the other members of the parent structure.
21 #define ADVANCE(num_bytes) \
23 size_t num = num_bytes; \
24 ptr = ((const char *)ptr) + num; \
26 consumed_myself += num; \
29 #define OPEN_TYPE_free CHOICE_free
31 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
32 #define OPEN_TYPE_print CHOICE_print
33 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
35 #define OPEN_TYPE_compare CHOICE_compare
37 #define OPEN_TYPE_constraint CHOICE_constraint
39 #if !defined(ASN_DISABLE_BER_SUPPORT)
40 asn_dec_rval_t OPEN_TYPE_ber_get(
41 const asn_codec_ctx_t *opt_codec_ctx,
42 const asn_TYPE_descriptor_t *parent_type,
43 void *parent_structure,
44 const asn_TYPE_member_t *element,
45 const void *ptr, size_t size);
46 #define OPEN_TYPE_decode_ber NULL
47 #define OPEN_TYPE_encode_der CHOICE_encode_der
48 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
50 #if !defined(ASN_DISABLE_XER_SUPPORT)
51 asn_dec_rval_t OPEN_TYPE_xer_get(
52 const asn_codec_ctx_t *opt_codec_ctx,
53 const asn_TYPE_descriptor_t *parent_type,
54 void *parent_structure,
55 const asn_TYPE_member_t *element,
56 const void *ptr, size_t size);
57 #define OPEN_TYPE_decode_xer NULL
58 #define OPEN_TYPE_encode_xer CHOICE_encode_xer
59 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
61 #if !defined(ASN_DISABLE_JER_SUPPORT)
62 #define OPEN_TYPE_encode_jer CHOICE_encode_jer
63 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
65 #if !defined(ASN_DISABLE_OER_SUPPORT)
66 asn_dec_rval_t OPEN_TYPE_oer_get(
67 const asn_codec_ctx_t *opt_codec_ctx,
68 const asn_TYPE_descriptor_t *parent_type,
69 void *parent_structure,
70 asn_TYPE_member_t *element, const void *ptr,
72 #define OPEN_TYPE_decode_oer NULL
73 #define OPEN_TYPE_encode_oer CHOICE_encode_oer
74 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
76 #if !defined(ASN_DISABLE_UPER_SUPPORT)
77 asn_dec_rval_t OPEN_TYPE_uper_get(
78 const asn_codec_ctx_t *opt_codec_ctx,
79 const asn_TYPE_descriptor_t *parent_type,
80 void *parent_structure,
81 const asn_TYPE_member_t *element,
83 #define OPEN_TYPE_decode_uper NULL
84 asn_enc_rval_t OPEN_TYPE_encode_uper(
85 const asn_TYPE_descriptor_t *type_descriptor,
86 const asn_per_constraints_t *constraints, const void *struct_ptr,
87 asn_per_outp_t *per_output);
88 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
89 #if !defined(ASN_DISABLE_APER_SUPPORT)
90 asn_dec_rval_t OPEN_TYPE_aper_get(
91 const asn_codec_ctx_t *opt_codec_ctx,
92 const asn_TYPE_descriptor_t *parent_type,
93 void *parent_structure,
94 const asn_TYPE_member_t *element,
96 #define OPEN_TYPE_decode_aper NULL
97 asn_enc_rval_t OPEN_TYPE_encode_aper(
98 const asn_TYPE_descriptor_t *type_descriptor,
99 const asn_per_constraints_t *constraints, const void *struct_ptr,
100 asn_per_outp_t *per_output);
102 int OPEN_TYPE_aper_is_unknown_type(
103 const asn_TYPE_descriptor_t *td,
105 const asn_TYPE_member_t *elm);
107 asn_dec_rval_t OPEN_TYPE_aper_unknown_type_discard_bytes(
109 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
111 extern asn_TYPE_operation_t asn_OP_OPEN_TYPE;
117 #endif /* ASN_OPEN_TYPE_H */