diff --git a/libasn1compiler/asn1c_C.c b/libasn1compiler/asn1c_C.c index 3bac8683e..d578b86f5 100644 --- a/libasn1compiler/asn1c_C.c +++ b/libasn1compiler/asn1c_C.c @@ -13,6 +13,7 @@ #include /* constraint groker from libasn1fix */ #include /* other exportables from libasn1fix */ #include +#include typedef struct tag2el_s { struct asn1p_type_tag_s el_tag; @@ -75,6 +76,24 @@ enum etd_spec { }; static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_count, int all_tags_count, int elements_count, enum etd_spec); +static int is_bner_pdu_regex_init = 0; +static regex_t bner_pdu_regex; + +static int init_bner(void) { + int ret = 0; + + if(!is_bner_pdu_regex_init) { + ret = regcomp(&bner_pdu_regex, "BACnet.*PDU", 0); + if(ret == 0) is_bner_pdu_regex_init = 1; + } + + return ret; +} +static int is_bner_fixed_pdu(const char *pdu_type_name) { + init_bner(); + return (regexec(&bner_pdu_regex, pdu_type_name, 0, NULL, 0) == 0); +} + #define C99_MODE (!(arg->flags & A1C_NO_C99)) #define UNNAMED_UNIONS (arg->flags & A1C_UNNAMED_UNIONS) #define HIDE_INNER_DEFS (arg->embed && !(arg->flags & A1C_ALL_DEFS_GLOBAL)) @@ -2980,7 +2999,12 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_ if (!p2) p2 = strdup(p); - OUT("&asn_OP_%s,\n", p2); + if(arg->flags & A1C_GEN_BNER + && is_bner_fixed_pdu(expr->Identifier)) { + OUT("&asn_OP_%s,\n", expr_id); + } else { + OUT("&asn_OP_%s,\n", p2); + } if(tags_count) { OUT("asn_DEF_%s_tags_%d,\n", diff --git a/skeletons/Makefile.am b/skeletons/Makefile.am index 4fd9cdb15..aa6e8eb9e 100644 --- a/skeletons/Makefile.am +++ b/skeletons/Makefile.am @@ -100,20 +100,21 @@ check_PROGRAMS = \ check-converter_c89_example # BNER Support -libasn1cskeletons_la_SOURCES += \ - bner_decoder.c bner_decoder.h \ - bner_encoder.c bner_encoder.h \ - bner_support.c bner_support.h \ - constr_CHOICE_bner.c \ - constr_SEQUENCE_bner.c \ - constr_SEQUENCE_OF_bner.c \ - ANY_bner.c \ - BOOLEAN_bner.c \ - INTEGER_bner.c \ - NativeInteger_bner.c \ - NativeReal_bner.c \ - NULL_bner.c \ - OCTET_STRING_bner.c \ +libasn1cskeletons_la_SOURCES += \ + bner_decoder.c bner_decoder.h \ + bner_encoder.c bner_encoder.h \ + bner_fixed_stubs.c bner_fixed_stubs.h \ + bner_support.c bner_support.h \ + constr_CHOICE_bner.c \ + constr_SEQUENCE_bner.c \ + constr_SEQUENCE_OF_bner.c \ + ANY_bner.c \ + BOOLEAN_bner.c \ + INTEGER_bner.c \ + NativeInteger_bner.c \ + NativeReal_bner.c \ + NULL_bner.c \ + OCTET_STRING_bner.c \ REAL_bner.c LDADD = -lm diff --git a/skeletons/bner_fixed_stubs.c b/skeletons/bner_fixed_stubs.c new file mode 100644 index 000000000..e53166431 --- /dev/null +++ b/skeletons/bner_fixed_stubs.c @@ -0,0 +1,623 @@ +/* + * Copyright (c) 2003-2017 Lev Walkin and contributors. + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#include +#include +#include +#include + +/* + * BACnet defines two different encodings: + * 1) Fixed encoding (Clause 20.1) + * The fixed encoding is used on the following PDUs: + * BACnetPDU + * BACnet-Confirmed-Request-PDU + * BACnet-Unconfirmed-Request-PDU + * BACnet-SimpleACK-PDU + * BACnet-ComplexACK-PDU + * BACnet-SegmentACK-PDU + * BACnet-Error-PDU + * BACnet-Reject-PDU + * BACnet-Abort-PDU + * These PDUs can be matched with the regular expression: "BACnet.*PDU" + * The fixed encoding is outside the scope of the asn1 compiler, and + * only a weak function that fails encoding/decoding these PDUs is provided here + * + * 2) Variable encoding (Clause 20.2) + * All other BACnet rules are encoded with the BNER variable encoding. + * This encoding is provided for in the asn1 compiler + */ + +asn_TYPE_operation_t asn_OP_BACnetPDU = { + CHOICE_free, + CHOICE_print, + CHOICE_compare, + CHOICE_decode_ber, + CHOICE_encode_der, + CHOICE_decode_xer, + CHOICE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + CHOICE_decode_oer, + CHOICE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + CHOICE_decode_uper, + CHOICE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + CHOICE_decode_BACnetPDU, + CHOICE_encode_BACnetPDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + CHOICE_random_fill, + CHOICE_outmost_tag +}; + +__attribute__((weak)) asn_dec_rval_t +CHOICE_decode_BACnetPDU(const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, + void **struct_ptr, const void *buffer, size_t size, + ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +CHOICE_encode_BACnetPDU(const struct asn_TYPE_descriptor_s *td, + const void *sptr, int tag_mode, ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_Confirmed_Request_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_Confirmed_Request_PDU, + SEQUENCE_encode_BACnet_Confirmed_Request_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_Confirmed_Request_PDU( + const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, void **struct_ptr, + const void *buffer, size_t size, ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_Confirmed_Request_PDU( + const struct asn_TYPE_descriptor_s *td, const void *sptr, int tag_mode, + ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_Unconfirmed_Request_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_Unconfirmed_Request_PDU, + SEQUENCE_encode_BACnet_Unconfirmed_Request_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_Unconfirmed_Request_PDU( + const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, void **struct_ptr, + const void *buffer, size_t size, ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_Unconfirmed_Request_PDU( + const struct asn_TYPE_descriptor_s *td, const void *sptr, int tag_mode, + ber_tlv_tag_t tag, asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_SimpleACK_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_SimpleACK_PDU, + SEQUENCE_encode_BACnet_SimpleACK_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_SimpleACK_PDU( + const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, void **struct_ptr, + const void *buffer, size_t size, ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_SimpleACK_PDU(const struct asn_TYPE_descriptor_s *td, + const void *sptr, int tag_mode, + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_ComplexACK_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_ComplexACK_PDU, + SEQUENCE_encode_BACnet_ComplexACK_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_ComplexACK_PDU( + const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, void **struct_ptr, + const void *buffer, size_t size, ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_ComplexACK_PDU(const struct asn_TYPE_descriptor_s *td, + const void *sptr, int tag_mode, + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_SegmentACK_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_SegmentACK_PDU, + SEQUENCE_encode_BACnet_SegmentACK_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_SegmentACK_PDU( + const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, void **struct_ptr, + const void *buffer, size_t size, ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_SegmentACK_PDU(const struct asn_TYPE_descriptor_s *td, + const void *sptr, int tag_mode, + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_Error_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_Error_PDU, + SEQUENCE_encode_BACnet_Error_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_Error_PDU(const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, + void **struct_ptr, const void *buffer, + size_t size, ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_Error_PDU(const struct asn_TYPE_descriptor_s *td, + const void *sptr, int tag_mode, + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_Reject_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_Reject_PDU, + SEQUENCE_encode_BACnet_Reject_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_Reject_PDU(const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, + void **struct_ptr, const void *buffer, + size_t size, ber_tlv_tag_t tag, + int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_Reject_PDU(const struct asn_TYPE_descriptor_s *td, + const void *sptr, int tag_mode, + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} + +asn_TYPE_operation_t asn_OP_BACnet_Abort_PDU = { + SEQUENCE_free, + SEQUENCE_print, + SEQUENCE_compare, + SEQUENCE_decode_ber, + SEQUENCE_encode_der, + SEQUENCE_decode_xer, + SEQUENCE_encode_xer, +#ifdef ASN_DISABLE_OER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_oer, + SEQUENCE_encode_oer, +#endif /* ASN_DISABLE_OER_SUPPORT */ +#ifdef ASN_DISABLE_PER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_uper, + SEQUENCE_encode_uper, +#endif /* ASN_DISABLE_PER_SUPPORT */ +#ifdef ASN_DISABLE_BNER_SUPPORT + 0, + 0, +#else + SEQUENCE_decode_BACnet_Abort_PDU, + SEQUENCE_encode_BACnet_Abort_PDU, +#endif /* ASN_DISABLE_BNER_SUPPORT */ + SEQUENCE_random_fill, + 0 /* Use generic outmost tag fetcher */ +}; + +__attribute__((weak)) asn_dec_rval_t +SEQUENCE_decode_BACnet_Abort_PDU(const struct asn_codec_ctx_s *opt_codec_ctx, + const struct asn_TYPE_descriptor_s *td, + void **struct_ptr, const void *buffer, + size_t size, ber_tlv_tag_t tag, int tag_mode) { + (void)opt_codec_ctx; + (void)td; + (void)struct_ptr; + (void)buffer; + (void)size; + (void)tag; + (void)tag_mode; + asn_dec_rval_t tmp_error = {RC_FAIL, 0}; + ASN_DEBUG("Missing %s", __func__); + return tmp_error; +} + +__attribute__((weak)) asn_enc_rval_t +SEQUENCE_encode_BACnet_Abort_PDU(const struct asn_TYPE_descriptor_s *td, + const void *sptr, int tag_mode, + ber_tlv_tag_t tag, + asn_app_consume_bytes_f *consume_bytes_cb, + void *app_key) { + (void)td; + (void)sptr; + (void)tag_mode; + (void)tag; + (void)consume_bytes_cb; + (void)app_key; + ASN_DEBUG("Missing %s", __func__); + ASN__ENCODE_FAILED; +} diff --git a/skeletons/bner_fixed_stubs.h b/skeletons/bner_fixed_stubs.h new file mode 100644 index 000000000..920579358 --- /dev/null +++ b/skeletons/bner_fixed_stubs.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2003-2017 Lev Walkin and contributors. + * All rights reserved. + * Redistribution and modifications are permitted subject to BSD license. + */ +#ifndef BNER_FIXED_STUBS_H +#define BNER_FIXED_STUBS_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +extern asn_TYPE_operation_t asn_OP_BACnetPDU; +extern asn_TYPE_operation_t asn_OP_BACnet_Confirmed_Request_PDU; +extern asn_TYPE_operation_t asn_OP_BACnet_Unconfirmed_Request_PDU; +extern asn_TYPE_operation_t asn_OP_BACnet_SimpleACK_PDU; +extern asn_TYPE_operation_t asn_OP_BACnet_ComplexACK_PDU; +extern asn_TYPE_operation_t asn_OP_BACnet_SegmentACK_PDU; +extern asn_TYPE_operation_t asn_OP_BACnet_Error_PDU; +extern asn_TYPE_operation_t asn_OP_BACnet_Reject_PDU; +extern asn_TYPE_operation_t asn_OP_BACnet_Abort_PDU; + +bner_type_decoder_f CHOICE_decode_BACnetPDU; +bner_type_encoder_f CHOICE_encode_BACnetPDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_Confirmed_Request_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_Confirmed_Request_PDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_Unconfirmed_Request_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_Unconfirmed_Request_PDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_SimpleACK_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_SimpleACK_PDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_ComplexACK_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_ComplexACK_PDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_SegmentACK_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_SegmentACK_PDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_Error_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_Error_PDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_Reject_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_Reject_PDU; +bner_type_decoder_f SEQUENCE_decode_BACnet_Abort_PDU; +bner_type_encoder_f SEQUENCE_encode_BACnet_Abort_PDU; + +#ifdef __cplusplus +} +#endif + +#endif /* BNER_FIXED_STUBS_H */ diff --git a/skeletons/constr_TYPE.h b/skeletons/constr_TYPE.h index 41f5c262f..9f914cf41 100644 --- a/skeletons/constr_TYPE.h +++ b/skeletons/constr_TYPE.h @@ -262,4 +262,6 @@ int asn_fprint(FILE *stream, /* Destination stream descriptor */ } #endif +#include + #endif /* _CONSTR_TYPE_H_ */ diff --git a/skeletons/file-dependencies b/skeletons/file-dependencies index f10c38a16..a67ead15e 100644 --- a/skeletons/file-dependencies +++ b/skeletons/file-dependencies @@ -68,6 +68,7 @@ per_opentype.h per_opentype.c # PER "open type" handling bner_support.h bner_support.c # BNER tag support bner_decoder.h bner_decoder.c # BNER decoding support bner_encoder.h bner_encoder.c # BNER encoding support +bner_fixed_stubs.h bner_fixed_stubs.c # BNER fixed encoding rules stubs CONVERTER: # THIS IS A SPECIAL SECTION converter-example.c # A default name for the example transcoder