2 * Generated by asn1c-0.9.23 (http://lionet.info/asn1c)
3 * From ASN.1 module "MAP-LCS-DataTypes"
4 * found in "../asn1src/MAP-LCS-DataTypes.asn"
5 * `asn1c -gen-PER -fskeletons-copy -fnative-types`
8 #include "IntervalTime.h"
11 IntervalTime_constraint(asn_TYPE_descriptor_t
*td
, const void *sptr
,
12 asn_app_constraint_failed_f
*ctfailcb
, void *app_key
) {
16 _ASN_CTFAIL(app_key
, td
, sptr
,
17 "%s: value not given (%s:%d)",
18 td
->name
, __FILE__
, __LINE__
);
22 value
= *(const long *)sptr
;
24 if((value
>= 1 && value
<= 32767)) {
25 /* Constraint check succeeded */
28 _ASN_CTFAIL(app_key
, td
, sptr
,
29 "%s: constraint failed (%s:%d)",
30 td
->name
, __FILE__
, __LINE__
);
36 * This type is implemented using NativeInteger,
37 * so here we adjust the DEF accordingly.
40 IntervalTime_1_inherit_TYPE_descriptor(asn_TYPE_descriptor_t
*td
) {
41 td
->free_struct
= asn_DEF_NativeInteger
.free_struct
;
42 td
->print_struct
= asn_DEF_NativeInteger
.print_struct
;
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 if(!td
->per_constraints
)
50 td
->per_constraints
= asn_DEF_NativeInteger
.per_constraints
;
51 td
->elements
= asn_DEF_NativeInteger
.elements
;
52 td
->elements_count
= asn_DEF_NativeInteger
.elements_count
;
53 td
->specifics
= asn_DEF_NativeInteger
.specifics
;
57 IntervalTime_free(asn_TYPE_descriptor_t
*td
,
58 void *struct_ptr
, int contents_only
) {
59 IntervalTime_1_inherit_TYPE_descriptor(td
);
60 td
->free_struct(td
, struct_ptr
, contents_only
);
64 IntervalTime_print(asn_TYPE_descriptor_t
*td
, const void *struct_ptr
,
65 int ilevel
, asn_app_consume_bytes_f
*cb
, void *app_key
) {
66 IntervalTime_1_inherit_TYPE_descriptor(td
);
67 return td
->print_struct(td
, struct_ptr
, ilevel
, cb
, app_key
);
71 IntervalTime_decode_ber(asn_codec_ctx_t
*opt_codec_ctx
, asn_TYPE_descriptor_t
*td
,
72 void **structure
, const void *bufptr
, size_t size
, int tag_mode
) {
73 IntervalTime_1_inherit_TYPE_descriptor(td
);
74 return td
->ber_decoder(opt_codec_ctx
, td
, structure
, bufptr
, size
, tag_mode
);
78 IntervalTime_encode_der(asn_TYPE_descriptor_t
*td
,
79 void *structure
, int tag_mode
, ber_tlv_tag_t tag
,
80 asn_app_consume_bytes_f
*cb
, void *app_key
) {
81 IntervalTime_1_inherit_TYPE_descriptor(td
);
82 return td
->der_encoder(td
, structure
, tag_mode
, tag
, cb
, app_key
);
86 IntervalTime_decode_xer(asn_codec_ctx_t
*opt_codec_ctx
, asn_TYPE_descriptor_t
*td
,
87 void **structure
, const char *opt_mname
, const void *bufptr
, size_t size
) {
88 IntervalTime_1_inherit_TYPE_descriptor(td
);
89 return td
->xer_decoder(opt_codec_ctx
, td
, structure
, opt_mname
, bufptr
, size
);
93 IntervalTime_encode_xer(asn_TYPE_descriptor_t
*td
, void *structure
,
94 int ilevel
, enum xer_encoder_flags_e flags
,
95 asn_app_consume_bytes_f
*cb
, void *app_key
) {
96 IntervalTime_1_inherit_TYPE_descriptor(td
);
97 return td
->xer_encoder(td
, structure
, ilevel
, flags
, cb
, app_key
);
101 IntervalTime_decode_uper(asn_codec_ctx_t
*opt_codec_ctx
, asn_TYPE_descriptor_t
*td
,
102 asn_per_constraints_t
*constraints
, void **structure
, asn_per_data_t
*per_data
) {
103 IntervalTime_1_inherit_TYPE_descriptor(td
);
104 return td
->uper_decoder(opt_codec_ctx
, td
, constraints
, structure
, per_data
);
108 IntervalTime_encode_uper(asn_TYPE_descriptor_t
*td
,
109 asn_per_constraints_t
*constraints
,
110 void *structure
, asn_per_outp_t
*per_out
) {
111 IntervalTime_1_inherit_TYPE_descriptor(td
);
112 return td
->uper_encoder(td
, constraints
, structure
, per_out
);
115 static asn_per_constraints_t asn_PER_type_IntervalTime_constr_1
= {
116 { APC_CONSTRAINED
, 15, 15, 1, 32767 } /* (1..32767) */,
117 { APC_UNCONSTRAINED
, -1, -1, 0, 0 },
118 0, 0 /* No PER value map */
120 static ber_tlv_tag_t asn_DEF_IntervalTime_tags_1
[] = {
121 (ASN_TAG_CLASS_UNIVERSAL
| (2 << 2))
123 asn_TYPE_descriptor_t asn_DEF_IntervalTime
= {
128 IntervalTime_constraint
,
129 IntervalTime_decode_ber
,
130 IntervalTime_encode_der
,
131 IntervalTime_decode_xer
,
132 IntervalTime_encode_xer
,
133 IntervalTime_decode_uper
,
134 IntervalTime_encode_uper
,
135 0, /* Use generic outmost tag fetcher */
136 asn_DEF_IntervalTime_tags_1
,
137 sizeof(asn_DEF_IntervalTime_tags_1
)
138 /sizeof(asn_DEF_IntervalTime_tags_1
[0]), /* 1 */
139 asn_DEF_IntervalTime_tags_1
, /* Same as above */
140 sizeof(asn_DEF_IntervalTime_tags_1
)
141 /sizeof(asn_DEF_IntervalTime_tags_1
[0]), /* 1 */
142 &asn_PER_type_IntervalTime_constr_1
,
143 0, 0, /* No members */