| 1 | /*- |
| 2 | * Copyright (c) 2003, 2005 Lev Walkin <[email protected]>. All rights reserved. |
| 3 | * Redistribution and modifications are permitted subject to BSD license. |
| 4 | */ |
| 5 | #include <asn_internal.h>cxx . . $ `<file>/lib/s1ap/asn1c/asn_internal.h`/ |
| 6 | #include <asn_codecs_prim.h>cxx . . $ `<file>/lib/s1ap/asn1c/asn_codecs_prim.h`/ |
| 7 | #include <NULL.h>cxx . . $ `<file>/lib/s1ap/asn1c/NULL.h`/ |
| 8 | #include <BOOLEAN.h>cxx . . $ `<file>/lib/s1ap/asn1c/BOOLEAN.h`/ /* Implemented in terms of BOOLEAN type */ |
| 9 | |
| 10 | /* |
| 11 | * NULL basic type description. |
| 12 | */ |
| 13 | static const ber_tlv_tag_tcxx . . $ ber_tlv_tag_t# asn_DEF_NULL_tagscxx . . $ asn_DEF_NULL_tags.[] = { |
| 14 | (ASN_TAG_CLASS_UNIVERSALcxx . . $ ASN_TAG_CLASS_UNIVERSAL. | (5 << 2)) |
| 15 | }; |
| 16 | asn_TYPE_operation_tcxx . . $ asn_TYPE_operation_t# asn_OP_NULLcxx . . $ asn_OP_NULL. = { |
| 17 | BOOLEAN_freecxx . . $ BOOLEAN_free(d934c6f1aa2db56)., |
| 18 | NULL_printcxx . . $ NULL_print(f90cfeb3746557fe)., |
| 19 | NULL_comparecxx . . $ NULL_compare(bd6c17b928321db4)., |
| 20 | BOOLEAN_decode_bercxx . . $ BOOLEAN_decode_ber(96f9c71a4eda4f59)., /* Implemented in terms of BOOLEAN */ |
| 21 | NULL_encode_dercxx . . $ NULL_encode_der(fa2fb5a8fffd167c)., /* Special handling of DER encoding */ |
| 22 | NULL_decode_xercxx . . $ NULL_decode_xer(95123bf157631071)., |
| 23 | NULL_encode_xercxx . . $ NULL_encode_xer(c4fdd6fdb096b316)., |
| 24 | #ifdef ASN_DISABLE_OER_SUPPORT |
| 25 | 0, |
| 26 | 0, |
| 27 | #else |
| 28 | NULL_decode_oercxx . . $ NULL_decode_oer(7e0840003868e3f)., |
| 29 | NULL_encode_oercxx . . $ NULL_encode_oer(f4853efe7f383924)., |
| 30 | #endif /* ASN_DISABLE_OER_SUPPORT */ |
| 31 | #ifdef ASN_DISABLE_PER_SUPPORT |
| 32 | 0, |
| 33 | 0, |
| 34 | 0, |
| 35 | 0, |
| 36 | #else |
| 37 | NULL_decode_upercxx . . $ NULL_decode_uper(e6a06374f784e2a6)., /* Unaligned PER decoder */ |
| 38 | NULL_encode_upercxx . . $ NULL_encode_uper(1e553b888c3dcd43)., /* Unaligned PER encoder */ |
| 39 | NULL_decode_apercxx . . $ NULL_decode_aper(e6a06374f784e2a6)., /* Aligned PER decoder */ |
| 40 | NULL_encode_apercxx . . $ NULL_encode_aper(1e553b888c3dcd43)., /* Aligned PER encoder */ |
| 41 | #endif /* ASN_DISABLE_PER_SUPPORT */ |
| 42 | NULL_random_fillcxx . . $ NULL_random_fill(a4913c4af30a153b)., |
| 43 | 0 /* Use generic outmost tag fetcher */ |
| 44 | }; |
| 45 | asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# asn_DEF_NULLcxx . . $ asn_DEF_NULL. = { |
| 46 | "NULL", |
| 47 | "NULL", |
| 48 | &asn_OP_NULLcxx . . $ asn_OP_NULL., |
| 49 | asn_DEF_NULL_tagscxx . . $ asn_DEF_NULL_tags., |
| 50 | sizeof(asn_DEF_NULL_tagscxx . . $ asn_DEF_NULL_tags.) / sizeof(asn_DEF_NULL_tagscxx . . $ asn_DEF_NULL_tags.[0]), |
| 51 | asn_DEF_NULL_tagscxx . . $ asn_DEF_NULL_tags., /* Same as above */ |
| 52 | sizeof(asn_DEF_NULL_tagscxx . . $ asn_DEF_NULL_tags.) / sizeof(asn_DEF_NULL_tagscxx . . $ asn_DEF_NULL_tags.[0]), |
| 53 | { 0, 0, asn_generic_no_constraintcxx . . $ asn_generic_no_constraint(f655700a27bffd74). }, |
| 54 | 0, 0, /* No members */ |
| 55 | 0 /* No specifics */ |
| 56 | }; |
| 57 | |
| 58 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# |
| 59 | NULL_encode_dercxx . . $ NULL_encode_der(fa2fb5a8fffd167c).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *ptr, int tag_mode, |
| 60 | ber_tlv_tag_tcxx . . $ ber_tlv_tag_t# tag, asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *cb, void *app_key) { |
| 61 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# erval; |
| 62 | |
| 63 | erval.encodedcxx . . $ asn_enc_rval_s#encoded. = der_write_tagscxx . . $ der_write_tags(7a366124af9c6c29).(td, 0, tag_mode, 0, tag, cb, app_key); |
| 64 | if(erval.encodedcxx . . $ asn_enc_rval_s#encoded. == -1) { |
| 65 | erval.failed_typecxx . . $ asn_enc_rval_s#failed_type. = td; |
| 66 | erval.structure_ptrcxx . . $ asn_enc_rval_s#structure_ptr. = ptr; |
| 67 | } |
| 68 | |
| 69 | ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(erval); |
| 70 | } |
| 71 | |
| 72 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# |
| 73 | NULL_encode_xercxx . . $ NULL_encode_xer(c4fdd6fdb096b316).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *sptr, int ilevel, |
| 74 | enum xer_encoder_flags_ecxx . . $ xer_encoder_flags_e# flags, asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *cb, |
| 75 | void *app_key) { |
| 76 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# er; |
| 77 | |
| 78 | (void)td; |
| 79 | (void)sptr; |
| 80 | (void)ilevel; |
| 81 | (void)flags; |
| 82 | (void)cb; |
| 83 | (void)app_key; |
| 84 | |
| 85 | /* XMLNullValue is empty */ |
| 86 | er.encodedcxx . . $ asn_enc_rval_s#encoded. = 0; |
| 87 | ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(er); |
| 88 | } |
| 89 | |
| 90 | |
| 91 | static enum xer_pbd_rvalcxx . . $ xer_pbd_rval# |
| 92 | NULL__xer_body_decodecxx . . $ NULL__xer_body_decode(e12551757fd1b610).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, void *sptr, |
| 93 | const void *chunk_buf, size_t chunk_size) { |
| 94 | (void)td; |
| 95 | (void)sptr; |
| 96 | (void)chunk_buf; /* Going to be empty according to the rules below. */ |
| 97 | |
| 98 | /* |
| 99 | * There must be no content in self-terminating <NULL/> tag. |
| 100 | */ |
| 101 | if(chunk_size) |
| 102 | return XPBD_BROKEN_ENCODINGcxx . . $ XPBD_BROKEN_ENCODING.; |
| 103 | else |
| 104 | return XPBD_BODY_CONSUMEDcxx . . $ XPBD_BODY_CONSUMED.; |
| 105 | } |
| 106 | |
| 107 | asn_dec_rval_tcxx . . $ asn_dec_rval_t# |
| 108 | NULL_decode_xercxx . . $ NULL_decode_xer(95123bf157631071).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx, |
| 109 | const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, void **sptr, |
| 110 | const char *opt_mname, const void *buf_ptr, size_t size) { |
| 111 | return xer_decode_primitivecxx . . $ xer_decode_primitive(6952a33320d45860).(opt_codec_ctx, td, |
| 112 | sptr, sizeof(NULL_tcxx . . $ NULL_t#), opt_mname, buf_ptr, size, |
| 113 | NULL__xer_body_decodecxx . . $ NULL__xer_body_decode(e12551757fd1b610).); |
| 114 | } |
| 115 | |
| 116 | int |
| 117 | NULL_comparecxx . . $ NULL_compare(bd6c17b928321db4).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *a, const void *b) { |
| 118 | (void)td; |
| 119 | (void)a; |
| 120 | (void)b; |
| 121 | return 0; |
| 122 | } |
| 123 | |
| 124 | int |
| 125 | NULL_printcxx . . $ NULL_print(f90cfeb3746557fe).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, const void *sptr, int ilevel, |
| 126 | asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *cb, void *app_key) { |
| 127 | (void)td; /* Unused argument */ |
| 128 | (void)ilevel; /* Unused argument */ |
| 129 | |
| 130 | if(sptr) { |
| 131 | return (cb("<present>", 9, app_key) < 0) ? -1 : 0; |
| 132 | } else { |
| 133 | return (cb("<absent>", 8, app_key) < 0) ? -1 : 0; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | #ifndef ASN_DISABLE_OER_SUPPORT |
| 138 | |
| 139 | asn_dec_rval_tcxx . . $ asn_dec_rval_t# |
| 140 | NULL_decode_oercxx . . $ NULL_decode_oer(7e0840003868e3f).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx, |
| 141 | const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, |
| 142 | const asn_oer_constraints_tcxx . . $ asn_oer_constraints_t# *constraints, void **sptr, |
| 143 | const void *ptr, size_t size) { |
| 144 | asn_dec_rval_tcxx . . $ asn_dec_rval_t# rv = {RC_OKcxx . . $ RC_OK., 0}; |
| 145 | (void)opt_codec_ctx; |
| 146 | (void)td; |
| 147 | (void)constraints; |
| 148 | (void)ptr; |
| 149 | (void)size; |
| 150 | |
| 151 | if(!*sptr) { |
| 152 | *sptr = MALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:34:9`!(sizeof(NULL_t)); |
| 153 | if(*sptr) { |
| 154 | *(NULL_tcxx . . $ NULL_t# *)*sptr = 0; |
| 155 | } else { |
| 156 | ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!; |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | return rv; |
| 161 | } |
| 162 | |
| 163 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# |
| 164 | NULL_encode_oercxx . . $ NULL_encode_oer(f4853efe7f383924).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, |
| 165 | const asn_oer_constraints_tcxx . . $ asn_oer_constraints_t# *constraints, const void *sptr, |
| 166 | asn_app_consume_bytes_fcxx . . $ asn_app_consume_bytes_f# *cb, void *app_key) { |
| 167 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# er; |
| 168 | |
| 169 | (void)td; |
| 170 | (void)sptr; |
| 171 | (void)constraints; |
| 172 | (void)cb; |
| 173 | (void)app_key; |
| 174 | |
| 175 | er.encodedcxx . . $ asn_enc_rval_s#encoded. = 0; /* Encoding in 0 bytes. */ |
| 176 | |
| 177 | ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(er); |
| 178 | } |
| 179 | |
| 180 | #endif /* ASN_DISABLE_OER_SUPPORT */ |
| 181 | |
| 182 | #ifndef ASN_DISABLE_PER_SUPPORT |
| 183 | |
| 184 | asn_dec_rval_tcxx . . $ asn_dec_rval_t# |
| 185 | NULL_decode_upercxx . . $ NULL_decode_uper(e6a06374f784e2a6).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx, |
| 186 | const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, |
| 187 | const asn_per_constraints_tcxx . . $ asn_per_constraints_t# *constraints, void **sptr, |
| 188 | asn_per_data_tcxx . . $ asn_per_data_t# *pd) { |
| 189 | asn_dec_rval_tcxx . . $ asn_dec_rval_t# rv; |
| 190 | |
| 191 | (void)opt_codec_ctx; |
| 192 | (void)td; |
| 193 | (void)constraints; |
| 194 | (void)pd; |
| 195 | |
| 196 | if(!*sptr) { |
| 197 | *sptr = MALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:34:9`!(sizeof(NULL_t)); |
| 198 | if(*sptr) { |
| 199 | *(NULL_tcxx . . $ NULL_t# *)*sptr = 0; |
| 200 | } else { |
| 201 | ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!; |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | /* |
| 206 | * NULL type does not have content octets. |
| 207 | */ |
| 208 | |
| 209 | rv.codecxx . . $ asn_dec_rval_s#code. = RC_OKcxx . . $ RC_OK.; |
| 210 | rv.consumedcxx . . $ asn_dec_rval_s#consumed. = 0; |
| 211 | return rv; |
| 212 | } |
| 213 | |
| 214 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# |
| 215 | NULL_encode_upercxx . . $ NULL_encode_uper(1e553b888c3dcd43).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, |
| 216 | const asn_per_constraints_tcxx . . $ asn_per_constraints_t# *constraints, const void *sptr, |
| 217 | asn_per_outp_tcxx . . $ asn_per_outp_t# *po) { |
| 218 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# er; |
| 219 | |
| 220 | (void)td; |
| 221 | (void)constraints; |
| 222 | (void)sptr; |
| 223 | (void)po; |
| 224 | |
| 225 | er.encodedcxx . . $ asn_enc_rval_s#encoded. = 0; |
| 226 | ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(er); |
| 227 | } |
| 228 | |
| 229 | asn_dec_rval_tcxx . . $ asn_dec_rval_t# |
| 230 | NULL_decode_apercxx . . $ NULL_decode_aper(e6a06374f784e2a6).(const asn_codec_ctx_tcxx . . $ asn_codec_ctx_t# *opt_codec_ctx, |
| 231 | const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, |
| 232 | const asn_per_constraints_tcxx . . $ asn_per_constraints_t# *constraints, void **sptr, asn_per_data_tcxx . . $ asn_per_data_t# *pd) { |
| 233 | asn_dec_rval_tcxx . . $ asn_dec_rval_t# rv; |
| 234 | |
| 235 | (void)opt_codec_ctx; |
| 236 | (void)td; |
| 237 | (void)constraints; |
| 238 | (void)pd; |
| 239 | |
| 240 | if(!*sptr) { |
| 241 | *sptr = MALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:34:9`!(sizeof(NULL_t)); |
| 242 | if(*sptr) { |
| 243 | *(NULL_tcxx . . $ NULL_t# *)*sptr = 0; |
| 244 | } else { |
| 245 | ASN__DECODE_FAILEDcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:90:9`!; |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | /* |
| 250 | * NULL type does not have content octets. |
| 251 | */ |
| 252 | |
| 253 | rv.codecxx . . $ asn_dec_rval_s#code. = RC_OKcxx . . $ RC_OK.; |
| 254 | rv.consumedcxx . . $ asn_dec_rval_s#consumed. = 0; |
| 255 | return rv; |
| 256 | } |
| 257 | |
| 258 | |
| 259 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# |
| 260 | NULL_encode_apercxx . . $ NULL_encode_aper(1e553b888c3dcd43).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, |
| 261 | const asn_per_constraints_tcxx . . $ asn_per_constraints_t# *constraints, |
| 262 | const void *sptr, asn_per_outp_tcxx . . $ asn_per_outp_t# *po) { |
| 263 | asn_enc_rval_tcxx . . $ asn_enc_rval_t# er; |
| 264 | |
| 265 | (void)td; |
| 266 | (void)constraints; |
| 267 | (void)sptr; |
| 268 | (void)po; |
| 269 | |
| 270 | er.encodedcxx . . $ asn_enc_rval_s#encoded. = 0; |
| 271 | ASN__ENCODED_OKcxx . . $ `lib/s1ap/asn1c/asn_codecs.h:67:9`!(er); |
| 272 | } |
| 273 | |
| 274 | #endif /* ASN_DISABLE_PER_SUPPORT */ |
| 275 | |
| 276 | asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# |
| 277 | NULL_random_fillcxx . . $ NULL_random_fill(a4913c4af30a153b).(const asn_TYPE_descriptor_tcxx . . $ asn_TYPE_descriptor_t# *td, void **sptr, |
| 278 | const asn_encoding_constraints_tcxx . . $ asn_encoding_constraints_t# *constr, |
| 279 | size_t max_length) { |
| 280 | asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# result_ok = {ARFILL_OKcxx . . $ asn_random_fill_result_s#ARFILL_OK., 1}; |
| 281 | asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# result_failed = {ARFILL_FAILEDcxx . . $ asn_random_fill_result_s#ARFILL_FAILED., 0}; |
| 282 | asn_random_fill_result_tcxx . . $ asn_random_fill_result_t# result_skipped = {ARFILL_SKIPPEDcxx . . $ asn_random_fill_result_s#ARFILL_SKIPPED., 0}; |
| 283 | NULL_tcxx . . $ NULL_t# *st = *sptr; |
| 284 | |
| 285 | (void)td; |
| 286 | (void)constr; |
| 287 | |
| 288 | if(max_length == 0) return result_skipped; |
| 289 | |
| 290 | if(st == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 291 | st = (NULL_tcxx . . $ NULL_t# *)(*sptr = CALLOCcxx . . $ `lib/s1ap/asn1c/asn_internal.h:33:9`!(1, sizeof(*st))); |
| 292 | if(st == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) { |
| 293 | return result_failed; |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | return result_ok; |
| 298 | } |
| 299 |