...
 
Commits (2)
......@@ -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
# 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
......@@ -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)
......
......@@ -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
......
#!/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
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
......
......@@ -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
......
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
......
......@@ -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)
......@@ -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 );
......@@ -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 );
......@@ -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 );
......@@ -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 );
# 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
......@@ -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++){
......
......@@ -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");\
......
......@@ -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");\
......
......@@ -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"
};
......
......@@ -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 );
......
......@@ -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);
......