diff options
-rw-r--r-- | Makefile.am | 5 | ||||
-rw-r--r-- | TODO-RELEASE | 9 | ||||
-rw-r--r-- | binaries/Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 38 | ||||
-rwxr-xr-x | contrib/jenkins.sh | 11 | ||||
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/control | 6 | ||||
-rw-r--r-- | debian/libsmpp34-1.docs (renamed from debian/libsmpp34-0.docs) | 0 | ||||
-rw-r--r-- | debian/libsmpp34-1.install (renamed from debian/libsmpp34-0.install) | 0 | ||||
-rw-r--r-- | debian/libsmpp34-1.symbols (renamed from debian/libsmpp34-0.symbols) | 2 | ||||
-rwxr-xr-x | debian/rules | 7 | ||||
-rw-r--r-- | def_frame/deliver_sm.frame | 2 | ||||
-rw-r--r-- | def_frame/replace_sm.frame | 2 | ||||
-rw-r--r-- | def_frame/submit_multi.frame | 2 | ||||
-rw-r--r-- | def_frame/submit_sm.frame | 2 | ||||
-rw-r--r-- | src/Makefile.am | 7 | ||||
-rw-r--r-- | src/smpp34_dumpBuf.c | 2 | ||||
-rw-r--r-- | src/smpp34_dumpPdu.c | 3 | ||||
-rw-r--r-- | src/smpp34_pack.c | 3 | ||||
-rw-r--r-- | src/smpp34_structs.h | 82 | ||||
-rw-r--r-- | src/smpp34_unpack.c | 5 | ||||
-rw-r--r-- | test_pdu/bind_receiver_resp_test.c | 2 |
22 files changed, 126 insertions, 72 deletions
diff --git a/Makefile.am b/Makefile.am index b274f45..3e44376 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,7 +17,10 @@ EXTRA_DIST = src/Makefile.am\ test_apps/esme.xml\ test_apps/sendwp.xml\ test_apps/recv_and_unpack.inc \ - README.md + README.md \ + .version + +@RELMAKE@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libsmpp34.pc diff --git a/TODO-RELEASE b/TODO-RELEASE new file mode 100644 index 0000000..d0852fc --- /dev/null +++ b/TODO-RELEASE @@ -0,0 +1,9 @@ +# When cleaning up this file: bump API version in corresponding Makefile.am and rename corresponding debian/lib*.install +# according to https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info +# In short: +# LIBVERSION=c:r:a +# If the library source code has changed at all since the last update, then increment revision: c:r + 1:a. +# If any interfaces have been added, removed, or changed since the last update: c + 1:0:0. +# If any interfaces have been added since the last public release: c:r:a + 1. +# If any interfaces have been removed or changed since the last public release: c:r:0. +#library what description / commit summary line diff --git a/binaries/Makefile.am b/binaries/Makefile.am index ff7ddae..9fd565e 100644 --- a/binaries/Makefile.am +++ b/binaries/Makefile.am @@ -9,7 +9,7 @@ include $(top_srcdir)/test_pdu/Makefile.am include $(top_srcdir)/test_apps/Makefile.am include $(top_srcdir)/src/Makefile.am -LDADD = $(top_builddir)/binaries/libsmpp34.la +LDADD = libsmpp34.la AM_CPPFLAGS = -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS AM_CFLAGS = @CFLAGS@ -Wall -fPIC # -static INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir) diff --git a/configure.ac b/configure.ac index 0354ab9..8ecbb77 100644 --- a/configure.ac +++ b/configure.ac @@ -8,6 +8,10 @@ AC_CONFIG_AUX_DIR(aux_config) AM_INIT_AUTOMAKE([foreign]) AM_CONFIG_HEADER([aux_config/config.h]) +dnl include release helper +RELMAKE='-include osmo-release.mk' +AC_SUBST([RELMAKE]) + # Checks for programs. AC_PROG_CC AM_PROG_CC_C_O @@ -36,6 +40,40 @@ AM_CONDITIONAL(HAVE_LIBXML2, test "$found_libxml2" = yes) # Checks for library functions. AC_FUNC_MALLOC AC_CHECK_FUNCS([memset]) + +AC_ARG_ENABLE(sanitize, + [AS_HELP_STRING( + [--enable-sanitize], + [Compile with address sanitizer enabled], + )], + [sanitize=$enableval], [sanitize="no"]) +if test x"$sanitize" = x"yes" +then + CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" + CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" +fi + +AC_ARG_ENABLE(werror, + [AS_HELP_STRING( + [--enable-werror], + [Turn all compiler warnings into errors, with exceptions: + a) deprecation (allow upstream to mark deprecation without breaking builds); + b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) + ] + )], + [werror=$enableval], [werror="no"]) +if test x"$werror" = x"yes" +then + WERROR_FLAGS="-Werror" + WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" + WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" + CFLAGS="$CFLAGS $WERROR_FLAGS" + CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" +fi + +AC_MSG_RESULT([CFLAGS="$CFLAGS"]) +AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) + AC_OUTPUT([Makefile def_frame/Makefile def_list/Makefile diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 7a388c2..8680cde 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,9 +1,14 @@ #!/usr/bin/env bash +export PATH="$PATH:$HOME/osmo-ci/scripts" set -ex +osmo-clean-workspace.sh + autoreconf --install --force -./configure +./configure --enable-sanitize --enable-werror $MAKE -# currently broken $MAKE $PARALLEL_MAKE -# currently broken $MAKE distcheck +$MAKE $PARALLEL_MAKE +$MAKE distcheck || cat-testlogs.sh + +osmo-clean-workspace.sh diff --git a/debian/changelog b/debian/changelog index 1c3f4ec..02583fa 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +libsmpp34 (1.13.0-1) experimental; urgency=medium + + * New upstream release and SONAME bump + + -- Thorsten Alteholz <debian@alteholz.de> Tue, 15 May 2018 23:03:33 +0200 + libsmpp34 (1.12.0-2) unstable; urgency=medium * move to unstable diff --git a/debian/control b/debian/control index 525ec35..ce9680c 100644 --- a/debian/control +++ b/debian/control @@ -8,11 +8,11 @@ Build-Depends: debhelper (>= 11), , libxml2-dev , pkg-config Standards-Version: 4.1.4 -Vcs-Browser: https://salsa.debian.org/debian-mobcom-team/libsmpp34.git +Vcs-Browser: https://salsa.debian.org/debian-mobcom-team/libsmpp34 Vcs-Git: https://salsa.debian.org/debian-mobcom-team/libsmpp34.git Homepage: http://c-open-smpp-34.sourceforge.net/ -Package: libsmpp34-0 +Package: libsmpp34-1 Architecture: any Multi-Arch: same Depends: ${shlibs:Depends}, @@ -29,7 +29,7 @@ Package: libsmpp34-dev Architecture: any Multi-Arch: same Section: libdevel -Depends: libsmpp34-0 (= ${binary:Version}), +Depends: libsmpp34-1 (= ${binary:Version}), ${misc:Depends} Description: Development files for libsmpp34 This library is an implementation for providing the PDU handling of the diff --git a/debian/libsmpp34-0.docs b/debian/libsmpp34-1.docs index e69de29..e69de29 100644 --- a/debian/libsmpp34-0.docs +++ b/debian/libsmpp34-1.docs diff --git a/debian/libsmpp34-0.install b/debian/libsmpp34-1.install index 3ddde58..3ddde58 100644 --- a/debian/libsmpp34-0.install +++ b/debian/libsmpp34-1.install diff --git a/debian/libsmpp34-0.symbols b/debian/libsmpp34-1.symbols index f52b4fd..e150344 100644 --- a/debian/libsmpp34-0.symbols +++ b/debian/libsmpp34-1.symbols @@ -1,4 +1,4 @@ -libsmpp34.so.0 libsmpp34-0 #MINVER# +libsmpp34.so.1 libsmpp34-1 #MINVER# build_dad@Base 1.10 build_tlv@Base 1.10 build_udad@Base 1.10 diff --git a/debian/rules b/debian/rules index 8d66af4..fcf8621 100755 --- a/debian/rules +++ b/debian/rules @@ -38,7 +38,6 @@ override_dh_clean: rm -f debian/libsmpp34.pc -get-orig-source: $(info I: $(PKG)_$(VER)) - @echo "# Downloading..." - uscan --noconf --verbose --rename --destdir=$(CURDIR) --force-download --download-version $(VER) $(PKD) - +#get-orig-source: $(info I: $(PKG)_$(VER)) +# @echo "# Downloading..." +# uscan --noconf --verbose --rename --destdir=$(CURDIR) --force-download --download-version $(VER) $(PKD) diff --git a/def_frame/deliver_sm.frame b/def_frame/deliver_sm.frame index 2306f19..6cbd90d 100644 --- a/def_frame/deliver_sm.frame +++ b/def_frame/deliver_sm.frame @@ -15,5 +15,5 @@ C_OCTET( instancia, validity_period, 1 ); U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_deliver_sm ); diff --git a/def_frame/replace_sm.frame b/def_frame/replace_sm.frame index a35187d..641207e 100644 --- a/def_frame/replace_sm.frame +++ b/def_frame/replace_sm.frame @@ -7,4 +7,4 @@ C_OCTET( instancia, validity_period, 17 ); U08( instancia, registered_delivery, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); diff --git a/def_frame/submit_multi.frame b/def_frame/submit_multi.frame index 0c5fb31..e58fd36 100644 --- a/def_frame/submit_multi.frame +++ b/def_frame/submit_multi.frame @@ -14,5 +14,5 @@ C_OCTET( instancia, validity_period, 17 ); U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_submit_multi ); diff --git a/def_frame/submit_sm.frame b/def_frame/submit_sm.frame index 0a54421..bf8e560 100644 --- a/def_frame/submit_sm.frame +++ b/def_frame/submit_sm.frame @@ -15,5 +15,5 @@ C_OCTET( instancia, validity_period, 17 ); U08( instancia, data_coding, valueDec_08 ); U08( instancia, sm_default_msg_id, valueDec_08 ); U08( instancia, sm_length, valueDec_08 ); - OCTET8( instancia, short_message, 254 ); + OCTET8( instancia, short_message, 254, instancia sm_length ); TLV( instancia, tlv, do_tlv_submit_sm ); diff --git a/src/Makefile.am b/src/Makefile.am index 940fd0a..67550f3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,6 @@ +# This is _NOT_ the library release version, it's an API version. +# Please read Chapter 6 "Library interface versions" of the libtool documentation before making any modification +LIBVERSION=1:0:0 # src/Makefile.am # lib_LTLIBRARIES = libsmpp34.la @@ -22,7 +25,5 @@ include_HEADERS = \ libsmpp34_la_CFLAGS = @CFLAGS@ -Wall libsmpp34_la_CFLAGS += -D_REENTRANT -DBSD_COMP -D_POSIX_PTHREAD_SEMANTICS libsmpp34_la_INCLUDES = -I. -I.. -libsmpp34_la_LDFLAGS = @LDFLAGS@ -version-info 0:1:0 +libsmpp34_la_LDFLAGS = @LDFLAGS@ -version-info $(LIBVERSION) -no-undefined libsmpp34_la_LDFLAGS += -lrt -lpthread - - diff --git a/src/smpp34_dumpBuf.c b/src/smpp34_dumpBuf.c index 77dfdba..dd0bad4 100644 --- a/src/smpp34_dumpBuf.c +++ b/src/smpp34_dumpBuf.c @@ -49,14 +49,12 @@ smpp34_dumpBuf(uint8_t *dest, int destL, uint8_t *src, int srcL) int size; uint8_t ind = 3; uint8_t *buffer = NULL; - int lefterror = 0; size = srcL; buffer = src; memset(smpp34_strerror, 0, sizeof(smpp34_strerror)); ptrerror = smpp34_strerror; - lefterror = sizeof(smpp34_strerror); /* dump buffer character by character until size is reached */ for(i = 0; i < size; i++){ diff --git a/src/smpp34_dumpPdu.c b/src/smpp34_dumpPdu.c index 89d6e53..688f4ea 100644 --- a/src/smpp34_dumpPdu.c +++ b/src/smpp34_dumpPdu.c @@ -136,11 +136,10 @@ smpp34_dumpPdu(uint32_t type, uint8_t *dest, int size_dest, void* tt) _op(inst, par, size )\ } -#define OCTET8( inst, par, size ){\ +#define OCTET8( inst, par, size, lenval ){\ int i = 0;\ uint8_t *p = l_dest;\ int dummy = 0;\ - lenval = *((inst par) - 1);\ if( (lenval + 33) >= left ){\ PUTLOG("[%s:%s(%s)]", par, inst par, \ "Value length exceed buffer length");\ diff --git a/src/smpp34_pack.c b/src/smpp34_pack.c index b36e7a4..ef1c599 100644 --- a/src/smpp34_pack.c +++ b/src/smpp34_pack.c @@ -139,8 +139,7 @@ smpp34_pack(uint32_t type, uint8_t *ptrBuf, int ptrSize, int *ptrLen, void* tt) }\ }; -#define OCTET8( inst, par, sizeval ){\ - lenval = *((inst par) - 1);\ +#define OCTET8( inst, par, sizeval, lenval ){\ if( lenval >= left ){\ PUTLOG("[leng %s:%d(%s)]", par, lenval,\ "Value length exceed buffer length");\ diff --git a/src/smpp34_structs.h b/src/smpp34_structs.h index 025109d..7c83df8 100644 --- a/src/smpp34_structs.h +++ b/src/smpp34_structs.h @@ -5,25 +5,25 @@ * * This file is part of libsmpp34 (c-open-smpp3.4 library). * - * The libsmpp34 library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of the + * The libsmpp34 library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the * License, or (at your option) any later version. * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public * License for more details. * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _STB_H_ #define _STB_H_ -#define SMALL_BUFF 30 +#define SMALL_BUFF 34 /* Identify PDUs ident ********************************************************/ #define MAX_TLV_SIZE 1024 #define MAX_DAD_SIZE 21 @@ -37,35 +37,35 @@ extern int smpp34_errno; extern char smpp34_strerror[2048]; /* Define structures **********************************************************/ -typedef struct tlv_t tlv_t; -typedef struct dad_t dad_t; -typedef struct udad_t udad_t; -typedef struct bind_transmitter_t bind_transmitter_t; -typedef struct bind_transmitter_resp_t bind_transmitter_resp_t; -typedef struct bind_receiver_t bind_receiver_t; -typedef struct bind_receiver_resp_t bind_receiver_resp_t; -typedef struct bind_transceiver_t bind_transceiver_t; -typedef struct bind_transceiver_resp_t bind_transceiver_resp_t; -typedef struct outbind_t outbind_t; -typedef struct unbind_t unbind_t; -typedef struct unbind_resp_t unbind_resp_t; -typedef struct generic_nack_t generic_nack_t; -typedef struct submit_sm_t submit_sm_t; -typedef struct submit_sm_resp_t submit_sm_resp_t; -typedef struct submit_multi_t submit_multi_t; -typedef struct submit_multi_resp_t submit_multi_resp_t; -typedef struct deliver_sm_t deliver_sm_t; -typedef struct deliver_sm_resp_t deliver_sm_resp_t; -typedef struct data_sm_t data_sm_t; -typedef struct data_sm_resp_t data_sm_resp_t; -typedef struct query_sm_t query_sm_t; -typedef struct query_sm_resp_t query_sm_resp_t; -typedef struct cancel_sm_t cancel_sm_t; -typedef struct cancel_sm_resp_t cancel_sm_resp_t; -typedef struct replace_sm_t replace_sm_t; -typedef struct replace_sm_resp_t replace_sm_resp_t; -typedef struct enquire_link_t enquire_link_t; -typedef struct alert_notification_t alert_notification_t; +typedef struct tlv_t tlv_t; +typedef struct dad_t dad_t; +typedef struct udad_t udad_t; +typedef struct bind_transmitter_t bind_transmitter_t; +typedef struct bind_transmitter_resp_t bind_transmitter_resp_t; +typedef struct bind_receiver_t bind_receiver_t; +typedef struct bind_receiver_resp_t bind_receiver_resp_t; +typedef struct bind_transceiver_t bind_transceiver_t; +typedef struct bind_transceiver_resp_t bind_transceiver_resp_t; +typedef struct outbind_t outbind_t; +typedef struct unbind_t unbind_t; +typedef struct unbind_resp_t unbind_resp_t; +typedef struct generic_nack_t generic_nack_t; +typedef struct submit_sm_t submit_sm_t; +typedef struct submit_sm_resp_t submit_sm_resp_t; +typedef struct submit_multi_t submit_multi_t; +typedef struct submit_multi_resp_t submit_multi_resp_t; +typedef struct deliver_sm_t deliver_sm_t; +typedef struct deliver_sm_resp_t deliver_sm_resp_t; +typedef struct data_sm_t data_sm_t; +typedef struct data_sm_resp_t data_sm_resp_t; +typedef struct query_sm_t query_sm_t; +typedef struct query_sm_resp_t query_sm_resp_t; +typedef struct cancel_sm_t cancel_sm_t; +typedef struct cancel_sm_resp_t cancel_sm_resp_t; +typedef struct replace_sm_t replace_sm_t; +typedef struct replace_sm_resp_t replace_sm_resp_t; +typedef struct enquire_link_t enquire_link_t; +typedef struct alert_notification_t alert_notification_t; /* TYPEDEFs structs ***********************************************************/ #define instancia 0 @@ -75,7 +75,7 @@ typedef struct alert_notification_t alert_notification_t; #define O_C_OCTET( inst, par, size ) uint8_t par[ size ]; #define C_OCTET( inst, par, size ) uint8_t par[ size ]; -#define OCTET8( inst, par, size ) uint8_t par[ size ]; +#define OCTET8( inst, par, size, lenval ) uint8_t par[ size ]; #define OCTET16( inst, par, size ) uint8_t par[ size ]; #define TLV( inst, par, do_tlv ) tlv_t *par; @@ -232,7 +232,7 @@ struct enquire_link_t { #include "def_frame/header.frame" }; -typedef struct enquire_link_resp_t enquire_link_resp_t; +typedef struct enquire_link_resp_t enquire_link_resp_t; struct enquire_link_resp_t { #include "def_frame/header.frame" }; diff --git a/src/smpp34_unpack.c b/src/smpp34_unpack.c index f498d01..749a037 100644 --- a/src/smpp34_unpack.c +++ b/src/smpp34_unpack.c @@ -143,8 +143,7 @@ smpp34_unpack(uint32_t type, void* tt, const uint8_t *ptrBuf, int ptrLen) };\ } -#define OCTET8( inst, par, size ){\ - lenval = *((inst par) - 1);\ +#define OCTET8( inst, par, size, lenval ){\ if( lenval > left ){\ PUTLOG("[leng %s:%d(%s)]", par, lenval,\ "Value length exceed buffer length");\ @@ -229,9 +228,7 @@ smpp34_unpack(uint32_t type, void* tt, const uint8_t *ptrBuf, int ptrLen) { /* Hace algunas Verificaciones **************************************/ uint32_t len_orig; - uint32_t l; memcpy(&len_orig, tt, sizeof(uint32_t)); - l = ntohl( len_orig ); if( len_orig != (aux - ini) ){ PUTLOG("[%s:(Error in PDU length %d!=%d)]",PDU,len_orig,(uint32_t)(aux-ini)); return( -1 ); diff --git a/test_pdu/bind_receiver_resp_test.c b/test_pdu/bind_receiver_resp_test.c index 610effd..e1817e8 100644 --- a/test_pdu/bind_receiver_resp_test.c +++ b/test_pdu/bind_receiver_resp_test.c @@ -52,7 +52,7 @@ main( int argc, char *argv[] ) b.command_id = BIND_RECEIVER_RESP; b.command_status = ESME_ROK; b.sequence_number = 1; - snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "1234567890123456"); + snprintf((char*)b.system_id, sizeof(b.system_id), "%s", "123456789012345"); tlv.tag = TLVID_sc_interface_version; tlv.length = sizeof(uint8_t); |