SIM-115: update simulator to use latest E2SM KPM version 3
[sim/e2-interface.git] / e2sim / asn1c / constr_SET_OF.h
1 /*-
2  * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
5 #ifndef CONSTR_SET_OF_H
6 #define CONSTR_SET_OF_H
7
8 #include <asn_application.h>
9 #include <asn_SET_OF.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 typedef struct asn_SET_OF_specifics_s {
16     /*
17      * Target structure description.
18      */
19     unsigned struct_size;       /* Size of the target structure. */
20     unsigned ctx_offset;        /* Offset of the asn_struct_ctx_t member */
21
22     /* XER-specific stuff */
23     int as_XMLValueList; /* The member type must be encoded like this */
24 } asn_SET_OF_specifics_t;
25
26 /*
27  * A set specialized functions dealing with the SET OF type.
28  */
29 asn_struct_free_f SET_OF_free;
30
31 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
32 asn_struct_print_f SET_OF_print;
33 #endif  /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
34
35 asn_struct_compare_f SET_OF_compare;
36
37 asn_constr_check_f SET_OF_constraint;
38
39 #if !defined(ASN_DISABLE_BER_SUPPORT)
40 ber_type_decoder_f SET_OF_decode_ber;
41 der_type_encoder_f SET_OF_encode_der;
42 #endif  /* !defined(ASN_DISABLE_BER_SUPPORT) */
43
44 #if !defined(ASN_DISABLE_XER_SUPPORT)
45 xer_type_decoder_f SET_OF_decode_xer;
46 xer_type_encoder_f SET_OF_encode_xer;
47 #endif  /* !defined(ASN_DISABLE_XER_SUPPORT) */
48
49 #if !defined(ASN_DISABLE_JER_SUPPORT)
50 jer_type_encoder_f SET_OF_encode_jer;
51 #endif  /* !defined(ASN_DISABLE_JER_SUPPORT) */
52
53 #if !defined(ASN_DISABLE_OER_SUPPORT)
54 oer_type_decoder_f SET_OF_decode_oer;
55 oer_type_encoder_f SET_OF_encode_oer;
56 #endif  /* !defined(ASN_DISABLE_OER_SUPPORT) */
57
58 #if !defined(ASN_DISABLE_UPER_SUPPORT)
59 per_type_decoder_f SET_OF_decode_uper;
60 per_type_encoder_f SET_OF_encode_uper;
61 #endif  /* !defined(ASN_DISABLE_UPER_SUPPORT) */
62 #if !defined(ASN_DISABLE_APER_SUPPORT)
63 per_type_decoder_f SET_OF_decode_aper;
64 per_type_encoder_f SET_OF_encode_aper;
65 #endif  /* !defined(ASN_DISABLE_APER_SUPPORT) */
66
67 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
68 asn_random_fill_f SET_OF_random_fill;
69 #endif  /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
70
71 extern asn_TYPE_operation_t asn_OP_SET_OF;
72
73 /*
74  * Internally visible buffer holding a single encoded element.
75  */
76 struct _el_buffer {
77     uint8_t *buf;
78     size_t length;
79     size_t allocated_size;
80     unsigned bits_unused;
81 };
82
83 enum SET_OF__encode_method {
84     SOES_DER,   /* Distinguished Encoding Rules */
85     SOES_CUPER,  /* Canonical Unaligned Packed Encoding Rules */
86     SOES_CAPER  /* Canonical Aligned Packed Encoding Rules */
87 };
88
89 struct _el_buffer * SET_OF__encode_sorted(
90         const asn_TYPE_member_t *elm,
91         const asn_anonymous_set_ *list,
92         enum SET_OF__encode_method method);
93
94 void SET_OF__encode_sorted_free(
95         struct _el_buffer *el_buf,
96         size_t count);
97
98 #ifdef __cplusplus
99 }
100 #endif
101
102 #endif  /* CONSTR_SET_OF_H */